Closed yagnasivasai closed 4 years ago
AWSTemplateFormatVersion: 2010-09-09 Parameters: MyKeyName: Description: Select the key name from the list Type: AWS::EC2::KeyPair::KeyName Instancetypes: Type: String AllowedValues:
Resources: myEC2Instance: Type: AWS::EC2::Instance Properties: KeyName: !Ref MyKeyName ImageId: ami-0323c3dd2da7fb37d InstanceType: !Ref Instancetypes SecurityGroupIds:
IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: 0.0.0.0/0 VpcId: !Ref LocalVPC
LocalVPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/16 EnableDnsSupport: true
subnet1: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1a VpcId: !Ref LocalVPC CidrBlock: 10.0.1.0/24
subnet2: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1b VpcId: !Ref LocalVPC CidrBlock: 10.0.2.0/24
subnet3: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1c VpcId: !Ref LocalVPC CidrBlock: 10.0.3.0/24
routeTable: Type: AWS::EC2::RouteTable Properties: VpcId: Ref: LocalVPC
routeName: Type: AWS::EC2::Route Properties: RouteTableId: !Ref routeTable DestinationCidrBlock: 0.0.0.0/0 GatewayId: !Ref igwName routeTableAssocName: Type: AWS::EC2::SubnetRouteTableAssociation Properties: SubnetId: !Ref subnet1 RouteTableId: !Ref routeTable igwName: Type: AWS::EC2::InternetGateway Properties: Tags:
Check your image ami id It's changed depending on region
If issue is not resolved call +918008017131
AWSTemplateFormatVersion: 2010-09-09 Parameters: MyKeyName: Description: Select the key name from the list Type: AWS::EC2::KeyPair::KeyName Instancetypes: Type: String AllowedValues:
Resources: myEC2Instance: Type: AWS::EC2::Instance Properties: KeyName: !Ref MyKeyName
ImageId: ami-0323c3dd2da7fb37d InstanceType: !Ref Instancetypes SecurityGroupIds:
IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: 0.0.0.0/0 VpcId: !Ref LocalVPC
LocalVPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/16 EnableDnsSupport: true
subnet1: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1a VpcId: !Ref LocalVPC CidrBlock: 10.0.1.0/24
subnet2: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1b VpcId: !Ref LocalVPC CidrBlock: 10.0.2.0/24
subnet3: Type: AWS::EC2::Subnet Properties: AvailabilityZone: us-east-1c VpcId: !Ref LocalVPC CidrBlock: 10.0.3.0/24
routeTable: Type: AWS::EC2::RouteTable Properties: VpcId: Ref: LocalVPC
routeName: Type: AWS::EC2::Route Properties: RouteTableId: !Ref routeTable DestinationCidrBlock: 0.0.0.0/0 GatewayId: !Ref igwName routeTableAssocName: Type: AWS::EC2::SubnetRouteTableAssociation Properties: SubnetId: !Ref subnet1 RouteTableId: !Ref routeTable igwName: Type: AWS::EC2::InternetGateway Properties: Tags: