AWS::EC2::Instance
Cost Risk: Medium

AWS::EC2::Instance

AWS::EC2::Instance#

Specifies an EC2 instance.

Description#

An instance is a virtual server in the AWS cloud. You can configure the instance with the compute, memory, storage, and networking resources that you need for your application.

Syntax#

JSON#

1
2
3
4
5
6
7
8
{
  "Type": "AWS::EC2::Instance",
  "Properties": {
    "ImageId": String,
    "InstanceType": String,
    "KeyName": String
  }
}

YAML#

1
2
3
4
5
Type: AWS::EC2::Instance
Properties:
  ImageId: String
  InstanceType: String
  KeyName: String

Properties#

PropertyTypeRequiredUpdateDescriptionConstraintsExample
ImageIdStringYesImmutableThe ID of the AMIPattern: ^ami-[0-9a-f]{8,17}$ami-0c55b159cbfafe1f0
InstanceTypeStringYesConditionalThe instance typeValues: t2.micro, t2.small, t2.medium…t2.micro
KeyNameStringNoImmutableThe name of the key pairmy-key-pair

Examples#

See Examples for CloudFormation templates.