UPD: added mapping

This commit is contained in:
xpk 2020-06-27 15:10:06 +08:00
parent fb2d428841
commit ccb418c4be

View File

@ -13,22 +13,34 @@ Parameters:
Description: Timezone of instance Description: Timezone of instance
Type: String Type: String
Default: UTC Default: UTC
Mappings:
RegionMap:
us-west-1:
VpcId: vpc-7155ca14
ImageId: ami-0a8d75344fec6c412
SshKey: AROLINX-OREGON
SecGroups: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"]
eu-east-1:
VpcId:
ImageId:
SshKey: AROLINX-IRELAND
SecGroups: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"]
Resources: Resources:
InstanceSubnet: InstanceSubnet:
Type: AWS::EC2::Subnet Type: AWS::EC2::Subnet
Properties: Properties:
VpcId: "vpc-7155ca14" VpcId: !FindInMap [RegionMap, !Ref "AWS::Region", VpcId]
CidrBlock: "10.2.253.0/28" CidrBlock: "10.2.253.0/28"
Ec2Instance: Ec2Instance:
Type: AWS::EC2::Instance Type: AWS::EC2::Instance
Properties: Properties:
KeyName: ACROLINX-OREGON KeyName: !FindInMap [RegionMap, !Ref "AWS::Region", SshKey]
InstanceType: !Ref InputInstanceType InstanceType: !Ref InputInstanceType
ImageId: ami-0a8d75344fec6c412 ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", ImageId]
SubnetId: !Ref InstanceSubnet SubnetId: !Ref InstanceSubnet
SecurityGroupIds: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"] SecurityGroupIds: !FindInMap [RegionMap, !Ref "AWS::Region", SecGroups]
Tags: Tags:
- Key: "Name" - Key: "Name"
Value: !Join ['', [!Ref 'InputSubdomain', ".acrolinx.cloud"]] Value: !Join ['', [!Ref 'InputSubdomain', ".acrolinx.cloud"]]