Open wellsiau-aws opened 9 months ago
CCAPI raw output as comparison below, notice that the DomainName
includes extra .
at the end : example.com.
aws cloudcontrol get-resource --type-name AWS::Route53Resolver::ResolverRule --identifier rslvr-rr-2995758e0ca74e719 | jq -r ".ResourceDescription.Properties" | jq "."
{
"ResolverEndpointId": "rslvr-out-3483213a88fd40db8",
"DomainName": "example.com.",
"RuleType": "FORWARD",
"ResolverRuleId": "rslvr-rr-2995758e0ca74e719",
"Arn": "arn:aws:route53resolver:us-east-1:204034886740:resolver-rule/rslvr-rr-2995758e0ca74e719",
"Tags": [
{
"Value": "Engineering",
"Key": "LineOfBusiness"
}
],
"TargetIps": [
{
"Ip": "192.0.2.6",
"Port": "53"
},
{
"Ip": "192.0.2.99",
"Port": "53"
}
],
"Name": "MyRule"
}
Another problem, the target_ips
attribute also detected unnecessary changes because the ipv_6
was stored in the Terraform state as null
Terraform state output (redacted):
{
"version": 4,
"terraform_version": "1.4.2",
. . .
"resources": [
{
"mode": "managed",
"type": "awscc_route53resolver_resolver_rule",
. . .
"instances": [
{
"schema_version": 1,
"attributes": {
. . .
"target_ips": [
{
"ip": "192.0.2.6",
"ipv_6": null,
"port": "53"
},
{
"ip": "192.0.2.99",
"ipv_6": null,
"port": "53"
}
]
},
. . .
}
@wellsiau-aws R53Resolver silently appends the trailing dot to input domain names. Your HCL configuration will store "example.com" in state, but read calls (CCAPI/R53Resolver API) return "example.com." (trailing dot). This is visible in your sample plan.
Using domain_name = "example.com."
in your configuration leads to a no-op plan.
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.
Expected Behavior
terraform plan
should return no-resource changesActual Behavior
terraform plan
detects thatdomain_name
changed despite there are no modification.Steps to Reproduce
terraform apply
terraform plan