Skip to content

Instantly share code, notes, and snippets.

@zarlant
zarlant / aws_tagging_example.tf
Last active July 27, 2017 23:06
An easy way to apply tags to resources with them all defined in one place, yet still have specific tags on any given resource.
resource "aws_vpc" "my_vpc" {
cidr_block = "172.16.0.0/16"
tags = "${merge(map("Name", "${var.team_name}-vpc"), "${var.tags_map}")}"
}
resource "aws_subnet" "my_subnet" {
vpc_id = "${aws_vpc.my_vpc.id}"
cidr_block = "172.16.10.0/24"
availability_zone = "us-west-2a"
tags = "${merge(map("Name", "${var.team_name}-subnet"), "${var.tags_map}")}"

Keybase proof

I hereby claim:

  • I am zarlant on github.
  • I am zarlant (https://keybase.io/zarlant) on keybase.
  • I have a public key whose fingerprint is ED1F 04EE 87C7 1623 EB2F C197 575A FF09 ECFB 1EA7

To claim this, I am signing this object: