Skip to content

aws_region.current.name attribute is deprecated in version 6 of the AWS provider #361

@thelo-gaultier

Description

@thelo-gaultier

Describe the Bug

The name attribute which is relied on has been deprecated in favor of the region one. ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region ). This creates warning i the version 6+ of the AWS provider.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are
needed.
╷
│ Warning: Deprecated attribute
│ 
│   on .terraform/modules/stuff_cdn/main.tf line 100, in locals:
│  100:   origin_shield_region = local.enabled ? lookup(local.origin_shield_region_fallback_map, data.aws_region.current[0].name, data.aws_region.current[0].name) : "this string is never used"
│ 
│ The attribute "name" is deprecated. Refer to the provider documentation for details.
│ 
│ (and 3 more similar warnings elsewhere)
╵

Expected Behavior

No warning are presented when the plan is proposed

Steps to Reproduce

Use this module with the version 6 of the AWS provider

Screenshots

No response

Environment

  • Terraform version 1.6.6

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions