From cb4f436cb9fb02bc927c54da688adfae568e2ef7 Mon Sep 17 00:00:00 2001 From: Eric Stroczynski Date: Fri, 7 Jul 2017 13:56:33 -0700 Subject: [PATCH] installer/frontend/: apply 'extra tags' to autoscaling groups --- installer/frontend/__tests__/examples/aws-vpc.json | 7 +++++++ installer/frontend/__tests__/examples/aws.json | 7 +++++++ .../frontend/__tests__/examples/tectonic-aws-vpc.progress | 4 ++-- installer/frontend/cluster-config.js | 6 ++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/installer/frontend/__tests__/examples/aws-vpc.json b/installer/frontend/__tests__/examples/aws-vpc.json index de52be7931..b756fa9876 100644 --- a/installer/frontend/__tests__/examples/aws-vpc.json +++ b/installer/frontend/__tests__/examples/aws-vpc.json @@ -31,6 +31,13 @@ "tectonic_aws_extra_tags": { "test_tag": "testing" }, + "tectonic_autoscaling_group_extra_tags": [ + { + "key": "test_tag", + "value": "testing", + "propagate_at_launch": true + } + ], "tectonic_aws_master_ec2_type": "t2.large", "tectonic_aws_master_root_volume_size": 33, "tectonic_aws_master_root_volume_type": "gp2", diff --git a/installer/frontend/__tests__/examples/aws.json b/installer/frontend/__tests__/examples/aws.json index 9739d2c8d8..3243bd0805 100644 --- a/installer/frontend/__tests__/examples/aws.json +++ b/installer/frontend/__tests__/examples/aws.json @@ -14,6 +14,13 @@ "tectonic_aws_extra_tags": { "test_tag": "testing" }, + "tectonic_autoscaling_group_extra_tags": [ + { + "key": "test_tag", + "value": "testing", + "propagate_at_launch": true + } + ], "tectonic_aws_master_custom_subnets": { "us-west-1a": "10.0.0.0/19", "us-west-1c": "10.0.32.0/19" diff --git a/installer/frontend/__tests__/examples/tectonic-aws-vpc.progress b/installer/frontend/__tests__/examples/tectonic-aws-vpc.progress index 5fed08fa58..f496e225e1 100644 --- a/installer/frontend/__tests__/examples/tectonic-aws-vpc.progress +++ b/installer/frontend/__tests__/examples/tectonic-aws-vpc.progress @@ -1,7 +1,7 @@ { "clusterConfig": { "platformType": "aws-tf", - "aws_ssh": "some-ssh-key", + "aws_ssh": "some-ssh-key", "aws_etcds-numberOfInstances": 3, "aws_etcds-instanceType": "t2.large", "aws_etcds-storageSizeInGiB": 300, @@ -28,7 +28,7 @@ "extra": { "awsHostedZoneId": { "zoneToName": { - "asfd": "example.com" + "asfd": "example.com" } } }, diff --git a/installer/frontend/cluster-config.js b/installer/frontend/cluster-config.js index 74c39a00a9..d8d98fd17b 100644 --- a/installer/frontend/cluster-config.js +++ b/installer/frontend/cluster-config.js @@ -217,9 +217,11 @@ export const toAWS_TF = (cc, FORMS, opts={}) => { } const extraTags = {}; + const extraAutoScalingTags = []; _.each(cc[AWS_TAGS], ({key, value}) => { if(key && value) { extraTags[key] = value; + extraAutoScalingTags.push({key, value, propagate_at_launch: true}); } }); @@ -274,6 +276,10 @@ export const toAWS_TF = (cc, FORMS, opts={}) => { ret.variables.tectonic_aws_extra_tags = extraTags; } + if (_.size(extraAutoScalingTags) > 0) { + ret.variables.tectonic_autoscaling_group_extra_tags = extraAutoScalingTags; + } + if (cc[STS_ENABLED]) { ret.credentials.AWSSessionToken = cc[AWS_SESSION_TOKEN]; }