Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1314 from estroz/autoscaling-group-tags
Browse files Browse the repository at this point in the history
Apply 'extra tags' to autoscaling groups
  • Loading branch information
estroz authored Jul 7, 2017
2 parents d684cca + cb4f436 commit b018c80
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions installer/frontend/__tests__/examples/aws-vpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions installer/frontend/__tests__/examples/aws.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -28,7 +28,7 @@
"extra": {
"awsHostedZoneId": {
"zoneToName": {
"asfd": "example.com"
"asfd": "example.com"
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions installer/frontend/cluster-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
});

Expand Down Expand Up @@ -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];
}
Expand Down

0 comments on commit b018c80

Please sign in to comment.