Skip to content

bug: Deprecated attribute warning due to aws_region.current.name usage in cloudtrail ARN #178

@eakin7

Description

@eakin7

Hi,

We are seeing a persistent Terraform deprecation warning originating from this module, even when using the latest released version.

Terraform emits the following warning during plan:

│```
Warning: Deprecated attribute

│ on .terraform/modules/aws_cloudtrails.lacework/main.tf line 36, in locals:
│ 36: cloudtrail_arn = var.consolidated_trail && var.use_existing_cloudtrail && var.cross_account_cloudtrail_arn != null ? var.cross_account_cloudtrail_arn : "arn:aws:cloudtrail:$data.aws_region.current.name:$data.aws_caller_identity.current.account_id:trail/$var.cloudtrail_name"

│ The attribute "name" is deprecated. Refer to the provider documentation for
│ details.

This appears to be caused by the use of: data.aws_region.current.name inside the module when constructing the CloudTrail ARN.

This is a problem for us because:

- We are consumers of this module and cannot modify or suppress this warning downstream
- The warning persists even when explicitly pinning the module version to v2.11.0
- Terraform plans succeed, but the warning appears consistently across environments

Expected behavior:
The module should avoid using deprecated Terraform attributes internally so that consumers do not receive warnings they cannot control.

Module source reference:
https://github.com/lacework/terraform-aws-cloudtrail/blob/main/main.tf#L36

Example consumer usage for context:
https://github.com/ApplauseAQI/infrastructure/pull/563

Environment:

- Terraform CLI: latest (via Github Actions)
- Module: lacework/cloudtrail/aws v2.11.0

Please let us know if there is a recommended workaround or if this needs to be addressed within the module itself.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions