Code Monkey home page Code Monkey logo

Comments (3)

martinhanzik avatar martinhanzik commented on June 4, 2024 1

No, I meant this https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/search?q=launch_template_version&unscoped_q=launch_template_version

from terraform-aws-ec2-autoscale-group.

aknysh avatar aknysh commented on June 4, 2024

@martinhanzik thanks!
Did you mean this https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/blob/master/main.tf#L99?

from terraform-aws-ec2-autoscale-group.

evgmoskalenko avatar evgmoskalenko commented on June 4, 2024

The module always deploys with the template version = 1. Even if launch_template has the latest version = 5

~ module.asg.aws_launch_template.default
      latest_version:                          "5" => "0"
      tag_specifications.0.tags.sourceCodeRef: "0ccb201" => "52e5bb1"

Terraform docs (With Latest Version Of Launch Template)

resource "aws_launch_template" "foobar" {
  name_prefix   = "foobar"
  image_id      = "ami-1a2b3c"
  instance_type = "t2.micro"
}

resource "aws_autoscaling_group" "bar" {
  availability_zones = ["us-east-1a"]
  desired_capacity   = 1
  max_size           = 1
  min_size           = 1

  launch_template {
    id      = "${aws_launch_template.foobar.id}"
    version = "$Latest"
  }
}

But in your module launch_template version is a reference to terraform resource - aws_launch_template.default.latest_version - https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/blob/master/main.tf#L99. It looks right but does not work and does not comply with the Terraform documentation.

I think we can make a switch and use either the launch_template_version variable ("$Latest" or "$Default") - https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/search?q=launch_template_version&unscoped_q=launch_template_version or use terraform resource reference such as aws_launch_template.default.latest_version

from terraform-aws-ec2-autoscale-group.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.