Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bendrucker/terraform-aws-arn
Terraform module that accepts the components of an AWS ARN and outputs the string form
https://github.com/bendrucker/terraform-aws-arn
arn aws terraform terraform-module
Last synced: 3 months ago
JSON representation
Terraform module that accepts the components of an AWS ARN and outputs the string form
- Host: GitHub
- URL: https://github.com/bendrucker/terraform-aws-arn
- Owner: bendrucker
- License: mit
- Created: 2020-06-09T21:30:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T14:25:44.000Z (8 months ago)
- Last Synced: 2024-05-22T18:59:38.313Z (8 months ago)
- Topics: arn, aws, terraform, terraform-module
- Language: Go
- Homepage:
- Size: 1.01 MB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# terraform-aws-arn [![tests workflow status](https://github.com/bendrucker/terraform-aws-arn/workflows/tests/badge.svg?branch=master)](https://github.com/bendrucker/terraform-aws-arn/actions?query=workflow%3Atests) [![terraform module](https://img.shields.io/badge/terraform-module-623CE4)](https://registry.terraform.io/modules/bendrucker/arn/aws)
⚠️ **Deprecated:** Terraform 1.8+ users should use the AWS provider's [`arn_build`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/functions/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`](https://www.terraform.io/docs/providers/aws/d/arn.html). 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.
```tf
module "object" {
source = "bendrucker/arn/aws"service = "s3"
resource_id = "my-bucket/my-object"
}output "object_arn" {
value = module.object.arn
}
```## Testing
```sh
go test -v ./...
```## License
MIT © [Ben Drucker](http://bendrucker.me)