-
Notifications
You must be signed in to change notification settings - Fork 121
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
awscc_wafv2_ip_set - API error ValidationException #999
Comments
The resource generator disables synthetic ids due to the terraform-provider-awscc/internal/provider/generators/shared/generator.go Lines 153 to 155 in 6b432d1
terraform-provider-awscc/internal/provider/generators/shared/codegen/emitter.go Lines 91 to 102 in 6b432d1
Overriding this manually in the generated resource to test "works", but that's certainly not the intended way :) I'm not across the details of #156 and #125 and why we would (or not) want to do this. I suspect generation for these resources should not have been enabled, as they don't work as-is.
|
Running my own test via Cloud Control API, here is what I found:
Notice how the Identifier contains several strings merged with "|" |
likely upstream issue |
Community Note
Terraform CLI and Terraform AWS Cloud Control Provider Version
Affected Resource(s)
Terraform v1.4.6 & v1.5.0 - both experience the same issue
on darwin_arm64
Terraform Configuration Files
Example 1
`resource awscc_wafv2_ip_set "this" {
name = "example"
description = "Example IP Set"
addresses = ["10.1.1.0/32", "10.2.1.0/32"]
ip_address_version = "IPV4"
scope = "REGIONAL"
}`
Example 2
`resource awscc_wafv2_ip_set "this" {
addresses = ["10.1.1.0/32", "10.2.1.0/32"]
ip_address_version = "IPV4"
scope = "CLOUDFRONT"
}`
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
awscc_wafv2_ip_set.this will be created
]
}
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
awscc_wafv2_ip_set.this: Creating...
awscc_wafv2_ip_set.this: Creation complete after 8s [id=d728ee28-5d84-4cb9-9147-ba3d4478feed]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Actual Behavior
The resource has successfully provision. However, if Terraform Plan or Terraform Destroy command is used, Terraform failed to fetch the existing resource as it failed at Identifier is not valid for identifier /properties/Name, /properties/Id, /properties/Scope
Steps to Reproduce
awscc_wafv2_ip_set % terraform plan
awscc_wafv2_ip_set.this: Refreshing state... [id=d728ee28-5d84-4cb9-9147-ba3d4478feed]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: AWS SDK Go Service Operation Unsuccessful
│
│ with awscc_wafv2_ip_set.this,
│ on wafv2_ip_set.tf line 14, in resource "awscc_wafv2_ip_set" "this":
│ 14: resource awscc_wafv2_ip_set "this" {
│
│ Calling Cloud Control API service GetResource operation returned: operation error CloudControl: GetResource, https response error StatusCode: 400, RequestID: cd8b48e1-5782-45ea-96b6-b59406daa0f0, api error
│ ValidationException: Identifier d728ee28-5d84-4cb9-9147-ba3d4478feed is not valid for identifier [/properties/Name, /properties/Id, /properties/Scope]
╵
terraform apply
Important Factoids
References
TFState file
{
"version": 4,
"terraform_version": "1.5.0",
"serial": 1,
"lineage": "140cf1bf-b2cb-3656-397f-0174637cf8d2",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "awscc_wafv2_ip_set",
"name": "this",
"provider": "provider["registry.terraform.io/hashicorp/awscc"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"addresses": [
"10.1.1.0/32",
"10.2.1.0/32"
],
"arn": "arn:aws:wafv2:us-east-1:**********:regional/ipset/0RbRyadLqMXBaUxuZUGsjvBVa-jkZfpEcqdscc/d728ee28-5d84-4cb9-9147-ba3d4478feed",
"description": "",
"id": "d728ee28-5d84-4cb9-9147-ba3d4478feed",
"ip_address_version": "IPV4",
"name": "0RbRyadLqMXBaUxuZUGsjvBVa-jkZfpEcqdscc",
"scope": "REGIONAL",
"tags": null
},
"sensitive_attributes": []
}
]
}
],
"check_results": null
}
The text was updated successfully, but these errors were encountered: