Version TF: 1.3.3
AWS provider v.: v4.36.0
when creating an route53_record alias for the S3 website configuration I get the following error. Seems to be a bug.
Error message
╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for module.main.module.lacta-2022.aws_route53_record.lacta_2022_bucket to include new
│ values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .alias: planned set element cty.ObjectVal(map[string]cty.Value{"evaluate_target_health":cty.False,
│ "name":cty.StringVal("s3-website.eu-central-1.amazonaws.com"), "zone_id":cty.StringVal("Z04888888TTT88A88TTT8")}) does not
│ correlate with any element in actual.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
The TF code:
resource "aws_s3_bucket" "lacta_2022_bucket" {
bucket = "lacta-2022.p.domain.de"
hosted_zone_id = data.aws_route53_zone.route53_zone.zone_id
}
data "aws_iam_policy_document" "lacta_2022_bucket_policy" {
statement {
sid = "AllowPublicRead"
effect = "Allow"
actions = [
"s3:GetObject"
]
principals {
identifiers = ["*"]
type = "AWS"
}
resources = [
"arn:aws:s3:::lacta-2022.p.domain.de",
"arn:aws:s3:::lacta-2022.p.domain.de/*"
]
}
}
resource "aws_s3_bucket_policy" "lacta_2022_bucket_policy" {
bucket = aws_s3_bucket.lacta_2022_bucket.id
policy = data.aws_iam_policy_document.lacta_2022_bucket_policy.json
}
resource "aws_s3_bucket_website_configuration" "clacta_2022_bucket_website" {
bucket = aws_s3_bucket.lacta_2022_bucket.bucket
index_document {
suffix = "index.html"
}
error_document {
key = "index.html"
}
}
resource "aws_s3_bucket_acl" "lacta_2022_bucket_acl" {
bucket = aws_s3_bucket.lacta_2022_bucket.id
acl = "public-read"
}
data "aws_route53_zone" "route53_zone" {
name = "p.domain.de."
}
resource "aws_route53_record" "lacta_2022_bucket" {
zone_id = data.aws_route53_zone.route53_zone.zone_id
name = "lacta-2022"
type = "A"
alias {
name = aws_s3_bucket_website_configuration.lacta_2022_bucket_website.website_domain
zone_id = aws_s3_bucket.lacta_2022_bucket.hosted_zone_id
evaluate_target_health = false
}
}
To reproduce it just
terraform init
terraform apply → yes
Has anyone had the same error?