Terraform Version
v1.13.0
Affected Resource(s)
Terraform Configuration Files
resource "akamai_appsec_rule" "example_rule" {
config_id = 98672
security_policy_id = "2_251403" -> The issue happens because the policy ID contains an underscore
rule_id = 3000403
rule_action = "alert"
}
Debug Output / Error Message
module.security.akamai_appsec_rule.example_rule: Refreshing state... [id=98672:3000403:2_251403]
╷
│ Error: strconv.Atoi: parsing "2_251403": invalid syntax
│
╵
Expected Behavior
The provider should treat security_policy_id as a string, accepting alphanumeric values or values containing underscores (e.g., 2_251403, hmgo_283918), which are standard formats for Security Policy IDs in Akamai.
Other resources like akamai_appsec_ip_geo or akamai_appsec_waf_protection handle these IDs correctly, but akamai_appsec_rule seems to force an Integer conversion.
Actual Behavior
The execution fails during terraform plan or terraform import. The error strconv.Atoi: parsing "2_251403": invalid syntax indicates that the provider code is attempting to convert the string ID into an integer using Go's strconv.Atoi function, which fails due to the non-numeric character (_).
Steps to Reproduce
- Configure an akamai_appsec_rule resource.
- Set the security_policy_id to a valid Akamai Policy ID that contains an underscore (e.g., 2_251403).
- Run terraform plan.
Terraform Version
v1.13.0
Affected Resource(s)
Terraform Configuration Files
Debug Output / Error Message
Expected Behavior
The provider should treat security_policy_id as a string, accepting alphanumeric values or values containing underscores (e.g., 2_251403, hmgo_283918), which are standard formats for Security Policy IDs in Akamai.
Other resources like akamai_appsec_ip_geo or akamai_appsec_waf_protection handle these IDs correctly, but akamai_appsec_rule seems to force an Integer conversion.
Actual Behavior
The execution fails during terraform plan or terraform import. The error strconv.Atoi: parsing "2_251403": invalid syntax indicates that the provider code is attempting to convert the string ID into an integer using Go's strconv.Atoi function, which fails due to the non-numeric character (_).
Steps to Reproduce