diff --git a/terraform/aws/keypair/main.tf b/terraform/aws/keypair/main.tf index d7199807..8be3f01b 100644 --- a/terraform/aws/keypair/main.tf +++ b/terraform/aws/keypair/main.tf @@ -6,6 +6,9 @@ variable "public_key_filename" { default = "~/.ssh/id_rsa_aws.pub" } resource "aws_key_pair" "default" { key_name = "${var.short_name}" public_key = "${file(var.public_key_filename)}" + tags = { + yor_trace = "da357308-e844-46cf-8442-49497d82385d" + } } # output variables diff --git a/terraform/aws/private-cloud/bastion-server.tf b/terraform/aws/private-cloud/bastion-server.tf index 7fe98f44..297011e7 100644 --- a/terraform/aws/private-cloud/bastion-server.tf +++ b/terraform/aws/private-cloud/bastion-server.tf @@ -23,18 +23,19 @@ resource "template_file" "bastion_cloud_init" { } resource "aws_instance" "bastion" { - instance_type = "${var.bastion_instance_type}" - ami = "${module.bastion_ami.ami_id}" + instance_type = "${var.bastion_instance_type}" + ami = "${module.bastion_ami.ami_id}" # Just put the bastion in the first public subnet - subnet_id = "${element(split(",", module.vpc.public_subnets), 0)}" + subnet_id = "${element(split(",", module.vpc.public_subnets), 0)}" # @todo - this allows bastion connection on any port which is not ideal but was like this previously. security_groups = ["${module.sg-default.security_group_id}", "${aws_security_group.bastion.id}"] key_name = "${module.aws-keypair.keypair_name}" source_dest_check = false user_data = "${template_file.bastion_cloud_init.rendered}" tags = { - Name = "apollo-mesos-bastion" - role = "bastion" + Name = "apollo-mesos-bastion" + role = "bastion" + yor_trace = "9606a32f-bbd4-4449-8f42-fbd3503bfefd" } connection { user = "core" @@ -66,4 +67,7 @@ resource "aws_instance" "bastion" { resource "aws_eip" "bastion" { instance = "${aws_instance.bastion.id}" vpc = true + tags = { + yor_trace = "d0914d70-3d7a-48a7-8175-912f1b27c7d7" + } } diff --git a/terraform/aws/private-cloud/mesos-agents.tf b/terraform/aws/private-cloud/mesos-agents.tf index 46c3cb83..a721b6a0 100644 --- a/terraform/aws/private-cloud/mesos-agents.tf +++ b/terraform/aws/private-cloud/mesos-agents.tf @@ -30,13 +30,14 @@ resource "aws_instance" "mesos-agent" { key_name = "${module.aws-keypair.keypair_name}" source_dest_check = false # @todo - fix this as this only allows 3 agents maximum (due to splittingo on the count variable) - subnet_id = "${element(split(",", module.vpc.private_subnets), count.index)}" - security_groups = ["${module.sg-default.security_group_id}"] - depends_on = ["aws_instance.bastion", "aws_instance.mesos-master"] - user_data = "${template_file.master_cloud_init.rendered}" + subnet_id = "${element(split(",", module.vpc.private_subnets), count.index)}" + security_groups = ["${module.sg-default.security_group_id}"] + depends_on = ["aws_instance.bastion", "aws_instance.mesos-master"] + user_data = "${template_file.master_cloud_init.rendered}" tags = { - Name = "apollo-mesos-agent-${count.index}" - role = "mesos_agents" + Name = "apollo-mesos-agent-${count.index}" + role = "mesos_agents" + yor_trace = "2e009ac2-8d94-41d1-bfd5-1ea3531c2911" } connection { user = "core" diff --git a/terraform/aws/private-cloud/mesos-masters.tf b/terraform/aws/private-cloud/mesos-masters.tf index 65dba00a..90cd20d5 100644 --- a/terraform/aws/private-cloud/mesos-masters.tf +++ b/terraform/aws/private-cloud/mesos-masters.tf @@ -31,8 +31,9 @@ resource "aws_instance" "mesos-master" { depends_on = ["aws_instance.bastion"] user_data = "${template_file.master_cloud_init.rendered}" tags = { - Name = "apollo-mesos-master-${count.index}" - role = "mesos_masters" + Name = "apollo-mesos-master-${count.index}" + role = "mesos_masters" + yor_trace = "7e7a3e78-ac49-4e96-8334-9c3c6b216660" } connection { user = "core" diff --git a/terraform/aws/private-cloud/security_groups.tf b/terraform/aws/private-cloud/security_groups.tf index d30d0488..791d7793 100644 --- a/terraform/aws/private-cloud/security_groups.tf +++ b/terraform/aws/private-cloud/security_groups.tf @@ -52,4 +52,7 @@ resource "aws_security_group" "bastion" { tags { Name = "bastion-apollo-sg" } + tags = { + yor_trace = "cf1d82f1-4772-4b6a-b5bb-16a8f33b5157" + } } diff --git a/terraform/aws/private-cloud/vpc/main.tf b/terraform/aws/private-cloud/vpc/main.tf index 47bf1f64..04bcff0e 100644 --- a/terraform/aws/private-cloud/vpc/main.tf +++ b/terraform/aws/private-cloud/vpc/main.tf @@ -1,16 +1,16 @@ -variable "name" { } -variable "cidr" { } +variable "name" {} +variable "cidr" {} variable "public_subnets" { default = "" } variable "private_subnets" { default = "" } -variable "bastion_instance_id" { } -variable "azs" { } +variable "bastion_instance_id" {} +variable "azs" {} variable "enable_dns_hostnames" { description = "should be true if you want to use private DNS within the VPC" - default = false + default = false } variable "enable_dns_support" { description = "should be true if you want to use private DNS within the VPC" - default = false + default = false } # resources @@ -21,21 +21,30 @@ resource "aws_vpc" "mod" { tags { Name = "${var.name}" } + tags = { + yor_trace = "97db6332-f675-423f-9f28-895332aaaac0" + } } resource "aws_internet_gateway" "mod" { vpc_id = "${aws_vpc.mod.id}" + tags = { + yor_trace = "2b913cf2-4a82-422c-9c10-7b89b85f54d8" + } } resource "aws_route_table" "public" { vpc_id = "${aws_vpc.mod.id}" route { - cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.mod.id}" + cidr_block = "0.0.0.0/0" + gateway_id = "${aws_internet_gateway.mod.id}" } tags { Name = "${var.name}-public" } + tags = { + yor_trace = "598b8c63-05a7-4c78-a8e7-2a100e03efce" + } } resource "aws_route_table" "private" { @@ -47,6 +56,9 @@ resource "aws_route_table" "private" { tags { Name = "${var.name}-private" } + tags = { + yor_trace = "9ca9dcc2-05c2-430f-8770-9721576e6d29" + } } resource "aws_subnet" "private" { @@ -57,6 +69,9 @@ resource "aws_subnet" "private" { tags { Name = "${var.name}-private" } + tags = { + yor_trace = "8f8da41a-8e3d-4a93-bc03-423f724ad49d" + } } resource "aws_subnet" "public" { @@ -69,6 +84,9 @@ resource "aws_subnet" "public" { } map_public_ip_on_launch = true + tags = { + yor_trace = "fb8ada78-3a4f-4832-afe3-ab0012f38a4b" + } } resource "aws_route_table_association" "private" { diff --git a/terraform/aws/public-cloud/mesos-agents.tf b/terraform/aws/public-cloud/mesos-agents.tf index 82f1bf78..5098db4c 100644 --- a/terraform/aws/public-cloud/mesos-agents.tf +++ b/terraform/aws/public-cloud/mesos-agents.tf @@ -31,8 +31,9 @@ resource "aws_instance" "mesos-agent" { depends_on = ["aws_instance.mesos-master"] user_data = "${template_file.agent_cloud_init.rendered}" tags = { - Name = "apollo-mesos-agent-${count.index}" - role = "mesos_agents" + Name = "apollo-mesos-agent-${count.index}" + role = "mesos_agents" + yor_trace = "174efd1b-6b80-44f2-b8fd-910f211a0e3c" } ebs_block_device { device_name = "/dev/xvdb" diff --git a/terraform/aws/public-cloud/mesos-masters.tf b/terraform/aws/public-cloud/mesos-masters.tf index a41d99ba..0c557040 100644 --- a/terraform/aws/public-cloud/mesos-masters.tf +++ b/terraform/aws/public-cloud/mesos-masters.tf @@ -30,7 +30,8 @@ resource "aws_instance" "mesos-master" { security_groups = ["${module.sg-default.security_group_id}"] user_data = "${template_file.master_cloud_init.rendered}" tags = { - Name = "apollo-mesos-master-${count.index}" - role = "mesos_masters" + Name = "apollo-mesos-master-${count.index}" + role = "mesos_masters" + yor_trace = "9088c15c-a2fb-4831-bef2-31b6363dcfdb" } } diff --git a/terraform/aws/sg-all-traffic/main.tf b/terraform/aws/sg-all-traffic/main.tf index d31e6762..6fa0ead4 100644 --- a/terraform/aws/sg-all-traffic/main.tf +++ b/terraform/aws/sg-all-traffic/main.tf @@ -34,6 +34,9 @@ resource "aws_security_group" "default" { tags { Name = "apollo-default-sg" } + tags = { + yor_trace = "6b4a3dda-0b87-46c9-84bf-9e9428e4480e" + } } # output variables diff --git a/terraform/gce/mesos-agent.tf b/terraform/gce/mesos-agent.tf index 2cf07039..e7d48db5 100644 --- a/terraform/gce/mesos-agent.tf +++ b/terraform/gce/mesos-agent.tf @@ -6,24 +6,27 @@ resource "atlas_artifact" "mesos-agent" { } resource "google_compute_instance" "mesos-agent" { - count = "${var.agents}" - name = "apollo-mesos-agent-${count.index}" - machine_type = "${var.instance_type.agent}" - zone = "${var.zone}" - tags = ["mesos-agent","http","https","ssh"] + count = "${var.agents}" + name = "apollo-mesos-agent-${count.index}" + machine_type = "${var.instance_type.agent}" + zone = "${var.zone}" + tags = ["mesos-agent", "http", "https", "ssh"] - disk { - image = "${atlas_artifact.mesos-agent.id}" - } - - metadata { - role = "mesos_agents" - } + disk { + image = "${atlas_artifact.mesos-agent.id}" + } - network_interface { - network = "default" - access_config { - // Ephemeral IP - } - } + metadata { + role = "mesos_agents" + } + + network_interface { + network = "default" + access_config { + // Ephemeral IP + } + } + labels = { + yor_trace = "88562c80-c854-4c62-b824-567a90dda89e" + } } diff --git a/terraform/gce/mesos-master.tf b/terraform/gce/mesos-master.tf index b5a232f0..3e939e69 100644 --- a/terraform/gce/mesos-master.tf +++ b/terraform/gce/mesos-master.tf @@ -7,46 +7,49 @@ resource "atlas_artifact" "mesos-master" { } resource "google_compute_instance" "mesos-master" { - count = "${var.masters}" - name = "apollo-mesos-master-${count.index}" - machine_type = "${var.instance_type.master}" - zone = "${var.zone}" - tags = ["mesos-master"] - - disk { - image = "${atlas_artifact.mesos-master.id}" - } - - # declare metadata for configuration of the node - metadata { - role = "mesos_masters" + count = "${var.masters}" + name = "apollo-mesos-master-${count.index}" + machine_type = "${var.instance_type.master}" + zone = "${var.zone}" + tags = ["mesos-master"] + + disk { + image = "${atlas_artifact.mesos-master.id}" + } + + # declare metadata for configuration of the node + metadata { + role = "mesos_masters" + } + + network_interface { + network = "default" + access_config { + // Ephemeral IP } - - network_interface { - network = "default" - access_config { - // Ephemeral IP - } - } + } + labels = { + yor_trace = "c592b38f-a0e8-42d7-ab4a-55fbe2ef6393" + } } resource "google_compute_firewall" "default" { - name = "default-allow-all" - network = "default" + name = "default-allow-all" + network = "default" - allow { - protocol = "icmp" - } + allow { + protocol = "icmp" + } - allow { - protocol = "tcp" - ports = ["1-65535"] - } + allow { + protocol = "tcp" + ports = ["1-65535"] + } - allow { - protocol = "udp" - ports = ["1-65535"] - } + allow { + protocol = "udp" + ports = ["1-65535"] + } - source_ranges = ["0.0.0.0/0"] + source_ranges = ["0.0.0.0/0"] }