Skip to content

Conversation

@nanasingh
Copy link

Description

This PR updates all references to the deprecated data.aws_region.current.name attribute to use data.aws_region.current.region instead, ensuring compatibility with AWS provider v6.0 and later versions.

Motivation

The AWS provider v6 deprecated the name attribute of the aws_region data source in favor of region. Using the deprecated attribute generates warnings during terraform validate:

Warning: Deprecated attribute
The attribute "name" is deprecated. Refer to the provider documentation for details.

Changes

  • Updated 8 occurrences in data.tf where data.aws_region.current.name was used in IAM policy document ARN constructions
  • All instances replaced with data.aws_region.current.region

Testing

  • Modified code has been validated for syntax correctness
  • The change is backwards compatible as both attributes return the same value (e.g., "us-east-1")

References

Checklist

  • Code follows the project's style guidelines
  • Changes are backwards compatible
  • Documentation does not need updates (internal data source reference)

This change updates all references to the deprecated `data.aws_region.current.name`
attribute to use `data.aws_region.current.region` instead, as required for AWS
provider v6.0+ compatibility.

The AWS provider v6 deprecated the `name` attribute in favor of `region` for the
aws_region data source. This change ensures compatibility with current and future
AWS provider versions.

Changes:
- Updated 8 occurrences in data.tf where data.aws_region.current.name was used
  in IAM policy document ARN constructions

Fixes warnings:
```
Warning: Deprecated attribute
The attribute "name" is deprecated. Refer to the provider documentation for details.
```

References:
- AWS Provider v6 Upgrade Guide: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-6-upgrade#data-source-aws_region
@nanasingh nanasingh requested a review from a team as a code owner October 21, 2025 19:12
Copy link
Collaborator

@vara-bonthu vara-bonthu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be breaking functionality for the users who are using the old provider.

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.

2 participants