https://github.com/dippynark/terraform-provider-awstag
A simple terraform provider for creating AWS tag resources
https://github.com/dippynark/terraform-provider-awstag
Last synced: over 1 year ago
JSON representation
A simple terraform provider for creating AWS tag resources
- Host: GitHub
- URL: https://github.com/dippynark/terraform-provider-awstag
- Owner: dippynark
- Created: 2018-01-30T15:02:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T16:19:45.000Z (over 8 years ago)
- Last Synced: 2025-01-23T12:11:35.305Z (over 1 year ago)
- Language: Go
- Size: 9.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform AWSTag Provider
This is a simple provider which adds an AWS EC2 tag resource. This resource allows us to do the following:
- Modify tags for EC2 resources created in an external Terraform environment
- Create tags with dynamic keys (tag keys currently have to be specified as static strings)
More details about the need for this resource can be found in [this](https://github.com/terraform-providers/terraform-provider-aws/issues/3143) issue.
## Example
```
provider "awstag" {
region = "eu-west-1"
}
provider "aws" {
region = "eu-west-1"
}
resource "aws_subnet" "example" {
vpc_id = "vpc-12345678"
cidr_block = "192.168.1.0/24"
lifecycle {
ignore_changes = ["tags"]
}
tags {
Name = "Example"
}
}
variable "tag_key" {
default = "my_tag_key"
}
variable "tag_value" {
default = "my_tag_value"
}
resource "awstag_ec2_tag" "my_tag" {
ec2_id = "${aws_subnet.example.id}"
key = "${var.tag_key}"
value = "${var.tag_value}"
}
```