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.16k forks source link

[Bug]: Depends_on BCM Data Export Service-linked role not working properly for aws_bcmdataexports_export resource #39855

Open nuginy opened 1 week ago

nuginy commented 1 week ago

Terraform Core Version

1.9.3

AWS Provider Version

5.72.1

Affected Resource(s)

aws_bcmdataexports_export aws_iam_service_linked_role

Expected Behavior

The aws_bcmdataexports_export Cost Optimization Recommendation should be deployed after creating BCM Data Export service-linked role.

Actual Behavior

The BCM Service-Linked role is created and the creation of the aws_bcmdataexports_export starts immediately after the Service-Linked role creation and fails because at that moment the Service-Linked role isn't available yet and Data Export can not reach Cost Optimization Recommendation table. If we add the time_sleep resource between these two resources, everything works as we expected.

Relevant Error/Panic Output Snippet

Error: creating AWS BCM Data Exports Export: operation error BCM Data Exports: CreateExport, https response error StatusCode: 400, RequestID: 54ad67c0-d68e-4c6a-888a-1b20a1bc5b78, ValidationException: This account is unable to create an export against this Table.
│
│   with module.vertice_aws_data_export[0].aws_bcmdataexports_export.vertice_cor_report,
│   on modules/vertice-aws-data-export/main.tf line 22, in resource "aws_bcmdataexports_export" "vertice_cor_report":
│   22: resource "aws_bcmdataexports_export" "vertice_cor_report" {
│
│ operation error BCM Data Exports: CreateExport, https response error StatusCode: 400, RequestID: 54ad67c0-d68e-4c6a-888a-1b20a1bc5b78, ValidationException: This account is unable to create an export against this Table.

Terraform Configuration Files

bcm_data_export.zip

Steps to Reproduce

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 week ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue