Skip to content

Commit

Permalink
Merge pull request #192 from erzetpe/feature/python-cli
Browse files Browse the repository at this point in the history
Create auto scaling groups with tags and integration with epiphany flow
  • Loading branch information
toszo authored Mar 29, 2019
2 parents 77c05bb + 7b25d35 commit 811cadf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#####################################################

provider "aws" {
access_key = "{{ specification.cloud.service_principal.key }}"
secret_key = "{{ specification.cloud.service_principal.secret }}"
access_key = "{{ specification.cloud.credentials.key }}"
secret_key = "{{ specification.cloud.credentials.secret }}"
region = "{{ specification.cloud.region }}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@


resource "aws_autoscaling_group" "{{ specification.name }}" {
availability_zones = [{% for availability_zone in specification.availability_zones %} "{{ availability_zone }}" {% if not loop.last %}, {% endif %} {% endfor %}]
# todo: check availability zones in VPC
#availability_zones = [{% for availability_zone in specification.availability_zones %} "{{ availability_zone }}" {% if not loop.last %}, {% endif %} {% endfor %}]
name = "{{ specification.name }}"
max_size = "{{ specification.count }}"
min_size = "{{ specification.count }}"
Expand All @@ -25,8 +26,19 @@ resource "aws_autoscaling_group" "{{ specification.name }}" {
]

tag {
key = "Name"
value = "{{ specification.name }}"
key = "Name"
value = "{{ specification.name }}"
propagate_at_launch = "true"
}

{%- for tag in specification.tags %}
tag {
{%- for tag_key, tag_value in tag.items() %}
key = "{{ tag_key }}"
value = "{% if tag_value is defined and tag_value|length %}{{ tag_value }}{% else %}-{% endif %}"
{%- endfor %}
propagate_at_launch = "true"
}
{%- endfor %}

}
4 changes: 4 additions & 0 deletions core/src/epicli/cli/static/terraform_templates_aws/vpc.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ resource "aws_vpc" "{{ specification.name }}" {
instance_tenancy = "default"
enable_dns_support = "true"
enable_dns_hostnames = "true"

tags {
Name = "{{ specification.name }}"
}
}

0 comments on commit 811cadf

Please sign in to comment.