my blog

Posted by test on 17 Oct, 2019


Eco test


AWSTemplateFormatVersion: '2010-09-09' Description: Creates an S3 bucket configured for hosting a static website, and a Route 53 DNS record pointing to the bucket Parameters: KeyPair: ConstraintDescription: Must be the name of an existing EC2 KeyPair. Description: Name of an existing EC2 KeyPair to enable SSH access to the instances. Key not available? Go to EC2 > Network & Security > Key Pairs Type: AWS::EC2::KeyPair::KeyName WebServerInstanceType: AllowedValues: - t3a.micro - t3a.small - t3a.medium ConstraintDescription: Choose an instance type. Default: t3a.micro Description: Web Server node instance type. Default is c5.xlarge (4 vCPU, 8GB). Type: String
# FullDomainName: # Type: String # Description: The full domain name e.g. # AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-) # ConstraintDescription: must be a valid DNS zone name. # AcmCertificateArn: # Type: String # Description: the Amazon Resource Name (ARN) of an AWS Certificate Manager (ACM) certificate. # AllowedPattern: "arn:aws:acm:.*" Resources: WebServerScalingGroup1: Type: 'AWS::AutoScaling::AutoScalingGroup' Properties: LaunchConfigurationName: !Ref LaunchConfig MinSize: '1' MaxSize: '1' # HealthCheckGracePeriod: 300 # HealthCheckType: 'EC2' AvailabilityZones: ['eu-west-1a', 'eu-west-1b']
LaunchConfig: Type: 'AWS::AutoScaling::LaunchConfiguration' Properties: ImageId: 'ami-02498d1ddb8cc6a86' SecurityGroups: - !Ref WebServerSecurityGroup InstanceType: !Ref WebServerInstanceType KeyName: !Ref KeyPair BlockDeviceMappings: - DeviceName: "/dev/xvda" Ebs: VolumeSize: 8 VolumeType: gp2 UserData: Fn::Base64: !Sub | #!/bin/bash sudo apt update && sudo apt upgrade -y sudo apt install apache2 -y

WebServerSecurityGroup: Type: 'AWS::EC2::SecurityGroup' Properties: GroupName: !Sub LAMP WebServer SG GroupDescription: Allow world traffic for 80/443 and restricted access to development and monitoring ports. SecurityGroupIngress: - IpProtocol: tcp FromPort: '80' ToPort: '80' CidrIp: '' - IpProtocol: tcp FromPort: '443' ToPort: '443' CidrIp: '' - IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: '' Description: 'Allow access from Kega HQ.'


# BucketName: # Value: !Ref 'WebsiteBucket' # Description: Name of S3 bucket to hold website content # CloudfrontEndpoint: # Value: !GetAtt [WebsiteCloudfront, DomainName] # Description: Endpoint for Cloudfront distribution # FullDomain: # Value: !Ref 'FullDomainName' # Description: Full DomainName ```

![enter image description here]( "enter image title here")


 Share on: Twitter / Facebook / Google+ / Email