Questions tagged [launch-template]

23 questions
0
votes
1 answer

Terraform - cannot launch AWS EC2 instance with Launch Template

My EC2 instance resource code resource "aws_instance" "my-sample-webapp-ec2" { availability_zone = var.availability_zone subnet_id = var.subnet_id key_name =…
ha9u63a7
  • 6,233
  • 16
  • 73
  • 108
0
votes
0 answers

Github actions - variables

I am new to GitHub action and I am trying to pull a variable from a file but I cannot get it to work. Could anyone help, please? Also I want my default version always to be the latest. You can set that to update in terraform but I can't find the AWS…
Ydrab
  • 21
  • 1
  • 5
0
votes
2 answers

using variables in aws launch template userdata (terraform)

I am currently creating a launch template using terraform aws_launch_template resource. I need to pass in user data and i do so using user_data =filebase64("file_path/file_name.sh"). I need to have variables inside my userdata file (file_name.sh).…
0
votes
1 answer

Run custom shell script as soon as an EKS or ASG instance is launched in AWS

I would like to perform domain join on any servers provisioned in my AWS environment. For ASG and EKS, can launch template be used to run custom scripts as soon as new nodes are launched?
0
votes
1 answer

IAM permission to retrieve LaunchTemplate's LatestVersionNumber attribute in AWS::AutoScaling::AutoScalingGroup

While developing a CloudFormation template, I am following the principle of least privilege. So I am providing CloudFormation a role to assume, and which has the minimal set of privileges. The template contains an AWS::AutoScaling::AutoScalingGroup…
maslick
  • 2,903
  • 3
  • 28
  • 50
0
votes
1 answer

Launch Template reference latest AMI built by codepipeline

I have codepipeline that creates an AMI and I have created separate Cloudformation stack to create Launch template that uses the AMI. Currently the Launch Template Cloudformation has the AMI imageID hard-coded like this LaunchTemplate: Type:…
-1
votes
0 answers

Issue while propagating Launch Template changes to AWS by Terraform - No changes detected by Terraform

I made changes to lifecycle block from true to false for create_before_destroy parameter in below code and did a terraform plan. It did not detect a change. Am I doing something wrong ? Shouldn't it create a new launch template version ? resource…
-1
votes
1 answer

How best for EC2 Image Builder in one account to update Launch Templates on other accounts?

I have one AWS "infra" account that runs Image Builder to make nightly AMIs. These AMIs are shared with three other environment accounts (dev/stage/prod). These three accounts use the AMI in a Launch Template that backs an Auto Scaling group set to…
1
2