You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data source for the ELB doesn't work with newer regions:
For AWS Regions opened since Jakarta (ap-southeast-3) in December 2021, AWS documents that a service principal name should be used instead of an AWS account ID in any relevant IAM policy.
Set the following in the provider block for aws provider:
region = "il-central-1"
Execute the base example to spin up the S3 bucket with ELB
The error would be like this:
│ Error: Unknown region ("il-central-1")
│
│ with module.s3_bucket.data.aws_elb_service_account.default[0],
│ on .terraform/modules/s3_bucket/main.tf line 18, in data "aws_elb_service_account" "default":
│ 18: data "aws_elb_service_account" "default" {
Screenshots
No response
Environment
OS: Linux
Terraform version: 1.9.7
Terraform AWS provider: 5.52.0
terraform version output:
Terraform v1.9.7
on linux_amd64
Describe the Bug
The data source for the ELB doesn't work with newer regions:
For AWS Regions opened since Jakarta (ap-southeast-3) in December 2021, AWS documents that a service principal name should be used instead of an AWS account ID in any relevant IAM policy.
Reference:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elb_service_account
Expected Behavior
Region accepted and policy attached
Steps to Reproduce
Set the following in the provider block for aws provider:
region = "il-central-1"
Execute the base example to spin up the S3 bucket with ELB
The error would be like this:
│ Error: Unknown region ("il-central-1")
│
│ with module.s3_bucket.data.aws_elb_service_account.default[0],
│ on .terraform/modules/s3_bucket/main.tf line 18, in data "aws_elb_service_account" "default":
│ 18: data "aws_elb_service_account" "default" {
Screenshots
No response
Environment
terraform version output:
Terraform v1.9.7
on linux_amd64
Additional Context
Seems like we need to adjust the conditions to support an updated policy:
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy
Open question: how could we detect new (August 2022 or later) regions programmatically?
Possible solution (from other repository) - check the aws_iam_policy_document data block:
https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/blob/master/main.tf
The text was updated successfully, but these errors were encountered: