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

Upgrade Terraform AWS provider to 5.0 #220

Open
nikki-t opened this issue Aug 13, 2024 · 0 comments
Open

Upgrade Terraform AWS provider to 5.0 #220

nikki-t opened this issue Aug 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nikki-t
Copy link
Collaborator

nikki-t commented Aug 13, 2024

We should upgrade AWS provider to take advantage of new features and recent updates. When attempting to upgrade the provider previously, I ran into the following errors:

╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for aws_iam_role.hydrocron_lambda_track_ingest_role
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .inline_policy: planned set element
│ cty.ObjectVal(map[string]cty.Value{"name":cty.StringVal("HydrocronSSMRead"),
│ "policy":cty.StringVal("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"ssm:DescribeParameters\",\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ssm:us-west-2:***:parameter/service/hydrocron/*\"},{\"Action\":[\"ssm:GetParametersByPath\",\"ssm:GetParameters\",\"ssm:GetParameter\"],\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ssm:us-west-2:***:parameter/service/hydrocron/*\"}]}")})
│ does not correlate with any element in actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for aws_iam_role.hydrocron-lambda-execution-role to
│ include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .inline_policy: planned set element
│ cty.ObjectVal(map[string]cty.Value{"name":cty.StringVal("HydrocronLambdaVPC"),
│ "policy":cty.StringVal("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"ec2:CreateNetworkInterface\",\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ec2:us-west-2:***:*/*\"},{\"Action\":\"ec2:DeleteNetworkInterface\",\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ec2:us-west-2:***:*/*\"},{\"Action\":\"ec2:DescribeNetworkInterfaces\",\"Effect\":\"Allow\",\"Resource\":\"*\"}]}")})
│ does not correlate with any element in actual.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for aws_iam_role.hydrocron-lambda-execution-role to
│ include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .inline_policy: planned set element
│ cty.ObjectVal(map[string]cty.Value{"name":cty.StringVal("HydrocronSSMRead"),
│ "policy":cty.StringVal("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"ssm:DescribeParameters\",\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ssm:us-west-2:***:parameter/service/hydrocron/*\"},{\"Action\":[\"ssm:GetParametersByPath\",\"ssm:GetParameters\",\"ssm:GetParameter\"],\"Effect\":\"Allow\",\"Resource\":\"arn:aws:ssm:us-west-2:***:parameter/service/hydrocron/*\"}]}")})
│ does not correlate with any element in actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Which seems to indicate an issue with using * in the ARN of a resource defined in an inline policy. This does seem to be fixed when using aws_iam_policy. So we should also revisit how we define and use IAM policies in roles when doing the upgrade.

@nikki-t nikki-t added the enhancement New feature or request label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant