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.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
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
Terraform Configuration Files
bcm_data_export.zip
Steps to Reproduce
data_export_bucket_name
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None