hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.82k stars 9.17k forks source link

error listing tags for CodeDeploy application #19493

Closed artem-tomyuk closed 3 years ago

artem-tomyuk commented 3 years ago

Hi, after upgrade aws provider to version 3.42.0 getting error while executing terraform plan:

Error: error listing tags for CodeDeploy application: AccessDeniedException: User: arn:aws:iam:::user/terraform is not authorized to perform: codedeploy:ListTagsForResource on resource: arn:aws:codedeploy:eu-central-1::application:hppProd

Debug Output

In trace log i have found warnings:

https://gist.github.com/artem-tomyuk/c9b64745efc1120110a572ce0bf23bc1

Expected Behavior

terraform plan executed without error

Actual Behavior

terraform plan executed with error

Steps to Reproduce

  1. upgrade aws provider to 3.42.0
  2. run "terraform plan -out=plan -parallelism=150 -compact-warnings"
artem-tomyuk commented 3 years ago

From GIST you can find that resourceArn in body-request is malformed: {"ResourceArn":"arn:aws:codedeploy:eu-central-1::application:hppProd"} It seems that there is missing accountId in ResourceArn.

artem-tomyuk commented 3 years ago

so, it seems that things are getting broken from release v3.37.0, since on v3.36.0 there is no such error, also in 3.37 a lot of enhancements was introduced to codeDeploy https://github.com/hashicorp/terraform-provider-aws/releases/tag/v3.37.0

artem-tomyuk commented 3 years ago

ok, so, the problem occurred because of setting in provider block: skip_requesting_account_id = true. https://registry.terraform.io/providers/hashicorp/aws/latest/docs#skip_requesting_account_id

github-actions[bot] commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.