Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Tags Issue #555

Open
chenhuazhen opened this issue Nov 17, 2017 · 2 comments
Open

AWS Tags Issue #555

chenhuazhen opened this issue Nov 17, 2017 · 2 comments

Comments

@chenhuazhen
Copy link

chenhuazhen commented Nov 17, 2017

Run the following

aws_subnet "CSS-BETA-DMZ-Subnet-B" do
  vpc "VPC1"
  cidr_block "10.140.16.0/24"
  aws_tags :chef_type => "ABCDEFG"
end

Got the following error:

[2017-11-17T15:03:28-05:00] FATAL: Aws::EC2::Errors::InvalidParameterValue: aws_subnet[CSS-BETA-DMZ-Subnet-B] (subnet-9
b6a5dfe) (fan-provisioning::css-prod-subnet line 4) had an error: Aws::EC2::Errors::InvalidParameterValue: Value ( aws:
cloudformation:logical-id ) for parameter key is invalid. Tag keys starting with 'aws:' are reserved for internal use
@btm
Copy link
Contributor

btm commented Nov 22, 2017

@chenhuazhen what version of chef-provisioning-aws are you using? Is it a version that comes in a ChefDK package? If so, what version of ChefDK are you using?

@r4hulgupta
Copy link

I think I have seen this error when you try to work on AWS CloudFormation created resources. Since you just specified :chef_type => "ABCDEFG" it would go and try to delete the rest of the tags, including the ones created by CloudFormation (tag key format is aws:cloudformation:...). But you cannot delete those tags as those are managed by AWS and they won't let you delete those tags. That's where the tagger fails with this mentioned error.

One solution will be to ignore aws managed tags and will probably work with the below change:

Just need to add few more lines to delete keys starting with aws below this line:
https://github.com/chef/chef-provisioning-aws/blob/44f819583848bcd381401b498f92ca2c4ad27c1e/lib/chef/provisioning/aws_driver/aws_tagger.rb#L34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants