Closed jackywong-amazon closed 1 year ago
This does "work" in the provider, although the experience is not the best. The awscc_apigateway_stage
resource does not have an arn
property (it is not part of the schema of this resource, and not returned by CloudControl APIs). You have to create this ARN manually.
resource "awscc_wafv2_web_acl_association" "example" {
resource_arn = "arn:aws:apigateway:ap-southeast-2::/restapis/${awscc_apigateway_stage.example.rest_api_id}/stages/${awscc_apigateway_stage.example.stage_name}"
web_acl_arn = aws_wafv2_web_acl.example.arn
}
Thanks for providing the workaround and i believe it would work.
do we know whyawscc_apigateway_stage
resource doesn't have that schema? I mean what's the purpose or advantage not to contain the arn based on the design etc. Would it be aiming faster migration to awscc ? I don't know just be curious.
Select AWS resources may return non-ARN ID properties and the underlying API implementation details is beyond the scope of the awscc provider. I am going to close this issue, feel free to re-open if the problem persisted
Community Note
Terraform CLI and Terraform AWS Cloud Control Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
This bug report example: wafv2 web acl association with awscc_apigateway_stage does not work because awscc_apigateway_stage does not have arn.
Other example I have tested: wafv2 web acl association with aws_api_gateway_stage work because aws_api_gateway_stage does have arn
Debug Output
Panic Output
awscc_wafv2_web_acl_association.example: Creating... ╷ │ Error: AWS SDK Go Service Operation Incomplete │ │ with awscc_wafv2_web_acl_association.example, │ on wafv2_web_acl_assoication.tf line 82, in resource "awscc_wafv2_web_acl_association" "example": │ 82: resource "awscc_wafv2_web_acl_association" "example" { │ │ Waiting for Cloud Control API service CreateResource operation completion returned: waiter state transitioned │ to FAILED. StatusMessage: Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other │ information separated by colons or slashes., field: RESOURCE_ARN, parameter: cusryjficj|example_stage │ (Service: Wafv2, Status Code: 400, Request ID: 143144e2-8526-4488-b636-998fe4577b4d). ErrorCode: │ InvalidRequest ╵
Expected Behavior
able to create the wafv2 association
Actual Behavior
throw an error because api gateway stage doesn't even have arn.
Steps to Reproduce
terraform apply
Important Factoids
References
0000
state file for awscc_apigateway_stage
state file for aws_api_gateway_stage