Skip to content

Support adding custom resource tags to Secrets created by VPN Connection for Preshared Keys when using SecretsManager #45601

@mkielar

Description

@mkielar

What new functionality are you requesting?

  • Resource:
    • Either: Enhancement to aws_vpn_connection to allow custom tags / propagate default tags from the provider.
    • Or: New resource: aws_secretsmanger_tag to allow adding custom tags to existing resources.

Description

I'm deploying VPC Connections with aws_vpc_connection resource, and preshared_key_storage set to secretsmanager. This implicitly creates secrets in SecretsManager. Since these connections are parts of different use-cases, I'd like to track them in Cost Explorer together with other resources for given use case. Adding custom tags would also simplify identification, since the names of these implicitly-provisioned secrets are rather cryptic (they only contain the id of the vpn resource).

Potential Terraform Configuration

I believe a separate resource would be the most generic option:

resource "aws_secretsmanger_tag" "vpn_preshared_key_tag" {
  resource_arn = aws_vpn_connection.my_amazing_app_on_prem_vpn.preshared_key_arn
  key          = "x-app-name"
  value        = "my-amazing-app"
}

Otherwise:

resource "aws_vpn_connection" "my_amazing_app_on_prem_vpn" {
  # ...

  preshared_key_storage = "SecretsManager"

  # Only when using SecretsManager:
  preshared_key_storage_tags = {            
    "x-app-name" = "my-amazing-app"
  }

  # Default tags defined on the provider should be applied implicitly by the resource.
}

References

#42797

Would you like to implement the enhancement?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequests to existing resources that expand the functionality or scope.service/vpnsiteIssues and PRs that pertain to the vpnsite service.tagsPertains to resource tagging.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions