Code Monkey home page Code Monkey logo

packer-aws-ecs-optimized-ami's Introduction

ECS optimized AMI

This package will create an Optimized ECS image which includes the following components:

  1. Latest security updates
  2. SSM agent
  3. AWS inspector agent
  4. Encrypted EBS store (optional)
  5. Customize the EBS volume size (optional)

1. Usage

1.1 Setup AWS credentials

The package relies on an aws profile from your ~/.aws/credentials file.
Export the desired profile:

export AWS_PROFILE='your profile name from the ~/.aws/credentials file'

1.2 Setup AMI requirements

Update the variables.json file with the correct values for your environment

Variable Description Default Value
instance_type The instance type t2.micro
aws_region Specify the AWS region ""
aws_vpc_id Specify a VPC ID ""
public_subnet_id Specify a public subnet ID ""
xvda_volume_size The root volume size 8
xvdcz_volume_size The data volume size 22
encrypted Encrypt the data volume "false"
ami_name The AMI name "allcloud-amzn-ecs-{{isotime}}"

1.3 Validate your template

packer validate -var-file=variables.json packer.json

Varify you get the output:

$ packer validate -var-file=variables.json packer.json
$ Template validated successfully.

1.4 Create AMI

packer build -var-file=variables.json packer.json

Login to your AWS account and locate your AMI.

1.5 Next steps

Update your ECS cluster with the new AMI and perform rolling update

IMPORTANT: Verifty that the ECS instance role includes the SSM agent and AWS inspector policies for it to work properly.

  • SSM agent policy: AmazonEC2RoleforSSM

packer-aws-ecs-optimized-ami's People

Stargazers

 avatar

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.