Skip to content

feat: Add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings #333

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mm-chia
Copy link

@mm-chia mm-chia commented Jun 23, 2025

Description

Add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings

Motivation and Context

Adding support for newest AWS provider

Breaking Changes

Yes, the data source aws_region is replacing the name property with region.
This will only work with AWS provider >= 6.0.0

How Has This Been Tested?

I used the following code to validate the module changes:

locals {
  s3_tf_state_bucket_name = "chose-your-own-bucket-name"
}

module "terraform_state" {
  source  = "github.com/mm-chia/terraform-aws-s3-bucket.git?ref=aws_provider_6.0.0"

  bucket = local.s3_tf_state_bucket_name

  block_public_acls                     = true
  ignore_public_acls                    = true
  block_public_policy                   = true
  restrict_public_buckets               = true
  attach_deny_insecure_transport_policy = true
  attach_require_latest_tls_policy      = true

  versioning = {
    enabled = true
  }
}

I ran:

  • terraform init
  • terraform plan
    And checked that there are no more warnings related to deprecated aws_region data source.
    These are the warnings that may show up, if not making the changes I made in main.tf:
│ Warning: Deprecated attribute
│
│   on .terraform/modules/terraform_state/main.tf line 888, in data "aws_iam_policy_document" "waf_log_delivery":
│  888:       values   = ["arn:aws:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.id}:*"]
│
│ The attribute "name" is deprecated. Refer to the provider documentation for details.

Also, I ran pre-commit run -a and checked that all validations are green.

@mm-chia mm-chia changed the title feat!: add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings Add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings Jun 23, 2025
@mm-chia mm-chia changed the title Add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings feat!: add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings Jun 23, 2025
@mm-chia mm-chia changed the title feat!: add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings feat: add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings Jun 23, 2025
@mm-chia mm-chia changed the title feat: add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings feat: Add support for AWS provider 6.0.0 with resolving deprecated aws_region warnings Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant