Skip to content

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
@mm-chia
Copy link
Author

mm-chia commented Jun 25, 2025

Hello,
Since there's another PR open for the same issue, should I close this one?

@antonbabenko
Copy link
Member

This issue has been resolved in version 5.0.0 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants