Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "AWSTemplateFormatVersion": "2010-09-09",
- "Description": "Create ubuntu 16.04 server from Amazon AMI ",
- "Parameters":
- {
- "SSHKeyName":
- {
- "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
- "Type": "AWS::EC2::KeyPair::KeyName",
- "Default": "salesfusion_wsfcva",
- "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
- },
- "EC2SubnetGroup":
- {
- "Type": "String",
- "Default": "subnet-af58efc1",
- "Description": "Subnet where you want EC2 to run"
- },
- "ImgId":
- {
- "Type": "String",
- "Default": "ami-d15a75c7",
- "Description": "Image id name to create EC2"
- },
- "InstanceType":
- {
- "Description": "EC2 instance type",
- "Type": "String",
- "Default": "c4.large",
- "AllowedValues": ["t1.micro", "t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "t2.2xlarge", "m1.small", "m1.medium", "m1.large", "m1.xlarge", "m2.xlarge", "m2.2xlarge", "m2.4xlarge", "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge", "m4.large", "m4.xlarge", "m4.2xlarge", "m4.4xlarge", "m4.10xlarge", "c1.medium", "c1.xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge", "g2.2xlarge", "g2.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge", "i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge", "d2.xlarge", "d2.2xlarge", "d2.4xlarge", "d2.8xlarge", "hi1.4xlarge", "hs1.8xlarge", "cr1.8xlarge", "cc2.8xlarge", "cg1.4xlarge"],
- "ConstraintDescription": "must be a valid EC2 instance type."
- },
- "VpcIds":
- {
- "Description": "Specify/Select only one VPC for Security group to be created under",
- "Type": "String",
- "Default": "vpc-f55ee99b"
- },
- "CidIp":
- {
- "Description": "The IP address range that can be used to SSH to the EC2 instances",
- "Type": "String",
- "MinLength": "9",
- "MaxLength": "18",
- "Default": "0.0.0.0/0",
- "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
- "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
- }
- },
- "Resources":
- {
- "EC2Instance":
- {
- "Type": "AWS::EC2::Instance",
- "Properties":
- {
- "InstanceType":
- {
- "Ref": "InstanceType"
- },
- "AvailabilityZone" : "us-east-1a",
- "KeyName":
- {
- "Ref": "SSHKeyName"
- },
- "ImageId":
- {
- "Ref": "ImgId"
- },
- "NetworkInterfaces": [
- {
- "AssociatePublicIpAddress": true,
- "DeviceIndex": "0",
- "DeleteOnTermination": false,
- "SubnetId":
- {
- "Ref": "EC2SubnetGroup"
- }
- }],
- "SecurityGroups" : [ "sg-9493d3f1", "sg-681b800d", "sg-1439e77b", "sg-67399f08" ],
- "Tags": [
- {
- "Key": "Name",
- "Value": "test"
- }]
- }
- }
- },
- "Outputs":
- {
- "InstanceId":
- {
- "Description": "InstanceId of the newly created EC2 instance",
- "Value":
- {
- "Ref": "EC2Instance"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement