Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Terraform module that accepts the components of an AWS ARN and outputs the string form

License

Notifications You must be signed in to change notification settings

bendrucker/terraform-aws-arn

Repository files navigation

terraform-aws-arn tests workflow status terraform module

⚠️ Deprecated: Terraform 1.8+ users should use the AWS provider's arn_build function.


Terraform module that accepts the components of an AWS ARN and outputs the string form.

This module provides the inverse to data.aws_arn. Where possible, prefer refererring to an ARN directly (as an attribute of a resource or data source) rather than constructing it.

Use this module to construct:

  • ARNs for resources that do not yet exist but will be created in the future
  • ARNs with wildcard segments (for use in IAM policies)

Usage

Only the service and resource_id variables are required, since all ARNs include them. Variables partition (default: "aws"), account_id (default: ""), and region (default: "") are optional.

module "object" {
  source = "bendrucker/arn/aws"

  service     = "s3"
  resource_id = "my-bucket/my-object"
}

output "object_arn" {
  value = module.object.arn
}

Testing

go test -v ./...

License

MIT © Ben Drucker

About

Terraform module that accepts the components of an AWS ARN and outputs the string form

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published