From fb2d42884150a93ab5ea6034d997abc4800b3a72 Mon Sep 17 00:00:00 2001 From: x p k Date: Sat, 27 Jun 2020 00:09:13 +0800 Subject: [PATCH] NEW: cloudformation --- cloudformation/acrolinx-cftemplate.yaml | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 cloudformation/acrolinx-cftemplate.yaml diff --git a/cloudformation/acrolinx-cftemplate.yaml b/cloudformation/acrolinx-cftemplate.yaml new file mode 100644 index 0000000..2ca0898 --- /dev/null +++ b/cloudformation/acrolinx-cftemplate.yaml @@ -0,0 +1,71 @@ +Description: >- + Cloud Formation template for Acrolinx instance. +Parameters: + InputInstanceType: + Description: EC2 Instance Type + Default: t3a.medium + Type: String + InputSubdomain: + Description: Subdomain of acrolinx instance + Type: String + Default: rstest + InputTimezone: + Description: Timezone of instance + Type: String + Default: UTC + +Resources: + InstanceSubnet: + Type: AWS::EC2::Subnet + Properties: + VpcId: "vpc-7155ca14" + CidrBlock: "10.2.253.0/28" + + Ec2Instance: + Type: AWS::EC2::Instance + Properties: + KeyName: ACROLINX-OREGON + InstanceType: !Ref InputInstanceType + ImageId: ami-0a8d75344fec6c412 + SubnetId: !Ref InstanceSubnet + SecurityGroupIds: ["sg-0c8c5cf4dca2147ee","sg-d444e4b2","sg-0b93187b","sg-859d16f5"] + Tags: + - Key: "Name" + Value: !Join ['', [!Ref 'InputSubdomain', ".acrolinx.cloud"]] + - Key: "TZ" + Value: !Ref InputTimezone + UserData: + 'Fn::Base64': !Sub | + #!/bin/bash -ex + yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm + systemctl enable amazon-ssm-agent + + Ec2EIP: + Type: AWS::EC2::EIP + Properties: + Domain: vpc + InstanceId: !Ref Ec2Instance + + PublicDnsRecord: + Type: AWS::Route53::RecordSet + Properties: + HostedZoneName: "acrolinx.cloud." + Comment: DNS name for my instance. + Name: !Join ['', [!Ref 'InputSubdomain', ".acrolinx.cloud"]] + Type: A + TTL: '900' + ResourceRecords: + - !Ref Ec2EIP + + OriginDnsRecord: + Type: AWS::Route53::RecordSet + Properties: + HostedZoneName: "acrolinx.cloud." + Comment: DNS name for my instance. + Name: !Join ['origin-', [!Ref 'InputSubdomain', ".acrolinx.cloud"]] + Type: A + TTL: '900' + ResourceRecords: + - !Ref Ec2EIP + +