UPD: various changes

This commit is contained in:
xpk 2020-06-27 16:02:31 +08:00
parent ccb418c4be
commit c131ed84f0

View File

@ -13,29 +13,33 @@ Parameters:
Description: Timezone of instance Description: Timezone of instance
Type: String Type: String
Default: UTC Default: UTC
Mappings: Mappings:
RegionMap: RegionMap:
us-west-1: us-west-2:
VpcId: vpc-7155ca14 VpcId: vpc-7155ca14
ImageId: ami-0a8d75344fec6c412 ImageId: ami-0a8d75344fec6c412
SshKey: AROLINX-OREGON SshKey: ACROLINX-OREGON
SecGroups: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"] SecGroups: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"]
eu-east-1: Subnet: "10.2.254.0/28"
VpcId: eu-west-1:
ImageId: VpcId: vpc-55a5a930
SshKey: AROLINX-IRELAND ImageId: ami-0385d2ff9f9c3706d
SecGroups: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"] SshKey: ACROLINX-IRELAND
SecGroups: ["sg-07ffa804cbff134ed","sg-5217ce2e","sg-620ad31e","sg-aa0ed7d6"]
Subnet: "10.1.254.0/28"
Resources: Resources:
InstanceSubnet: InstanceSubnet:
Type: AWS::EC2::Subnet Type: AWS::EC2::Subnet
Properties: Properties:
VpcId: !FindInMap [RegionMap, !Ref "AWS::Region", VpcId] VpcId: !FindInMap [RegionMap, !Ref "AWS::Region", VpcId]
CidrBlock: "10.2.253.0/28" CidrBlock: !FindInMap [RegionMap, !Ref "AWS::Region", Subnet]
Ec2Instance: Ec2Instance:
Type: AWS::EC2::Instance Type: AWS::EC2::Instance
Properties: Properties:
IamInstanceProfile: AmazonSSMRoleForInstancesQuickSetup
KeyName: !FindInMap [RegionMap, !Ref "AWS::Region", SshKey] KeyName: !FindInMap [RegionMap, !Ref "AWS::Region", SshKey]
InstanceType: !Ref InputInstanceType InstanceType: !Ref InputInstanceType
ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", ImageId] ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", ImageId]
@ -48,9 +52,9 @@ Resources:
Value: !Ref InputTimezone Value: !Ref InputTimezone
UserData: UserData:
'Fn::Base64': !Sub | 'Fn::Base64': !Sub |
#!/bin/bash -ex #!/bin/bash -ex
yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
systemctl enable amazon-ssm-agent systemctl enable amazon-ssm-agent
Ec2EIP: Ec2EIP:
Type: AWS::EC2::EIP Type: AWS::EC2::EIP
@ -74,10 +78,8 @@ Resources:
Properties: Properties:
HostedZoneName: "acrolinx.cloud." HostedZoneName: "acrolinx.cloud."
Comment: DNS name for my instance. Comment: DNS name for my instance.
Name: !Join ['origin-', [!Ref 'InputSubdomain', ".acrolinx.cloud"]] Name: !Join ['', ['origin-', !Ref 'InputSubdomain', ".acrolinx.cloud"]]
Type: A Type: A
TTL: '900' TTL: '900'
ResourceRecords: ResourceRecords:
- !Ref Ec2EIP - !Ref Ec2EIP