Launch an instance from a launch template

Launch an instance from a launch template

Launch an instance from a launch template#

Specifies an EC2 instance.

If an Elastic IP address is attached to your instance, AWS CloudFormation reattaches the Elastic IP address after it updates the instance. For more information about updating stacks, see AWS CloudFormation Stacks Updates.

architecture-beta
    service left_disk(disk)[Disk]
    service top_disk(disk)[Disk]
    service bottom_disk(disk)[Disk]
    service top_gateway(internet)[Gateway]
    service bottom_gateway(internet)[Gateway]
    junction junctionCenter
    junction junctionRight

    left_disk:R -- L:junctionCenter
    top_disk:B -- T:junctionCenter
    bottom_disk:T -- B:junctionCenter
    junctionCenter:R -- L:junctionRight
    top_gateway:B -- T:junctionRight
    bottom_gateway:T -- B:junctionRight
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
   "MyEC2Instance" : {
      "Type" : "AWS::EC2::Instance",
      "Properties" : {
         "ImageId" : "ami-79fd7eee",
         "KeyName" : "testkey",
         "BlockDeviceMappings" : [
            {
               "DeviceName" : "/dev/sdm",
               "Ebs" : {
               "VolumeType" : "io1",
               "Iops" : "200",
               "DeleteOnTermination" : "false",
               "VolumeSize" : "20"
               }
            }, 
            {
               "DeviceName" : "/dev/sdk",
               "NoDevice" : {}
            }
         ]
      }
   }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  MyEC2Instance: 
    Type: AWS::EC2::Instance
    Properties: 
      ImageId: "ami-79fd7eee"
      KeyName: "testkey"
      BlockDeviceMappings: 
      - DeviceName: "/dev/sdm"
        Ebs: 
          VolumeType: "io1"
          Iops: "200"
          DeleteOnTermination: "false"
          VolumeSize: "20"
      - DeviceName: "/dev/sdk"
        NoDevice: {}

Can deploy it using the example:

1
2
curl .... > path
aws s3 cp ... > path

Can deploy it using the example

1
2
aws cloudformation deploy --stack-name .. --template path
rain deploy