my blog

Posted by test on 17 Oct, 2019

Test

Eco test

```

https://github.com/sjevs/cloudformation-s3-static-website-with-cloudfront-and-route-53

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. www.jevsejev.io # 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: '0.0.0.0/0' - IpProtocol: tcp FromPort: '443' ToPort: '443' CidrIp: '0.0.0.0/0' - IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: '0.0.0.0/0' Description: 'Allow access from Kega HQ.'

Outputs:

# 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](https://www.google.nl/url?sa=i&source=images&cd=&ved=2ahUKEwj-zr3N4KjlAhUFEVAKHePwB9AQjRx6BAgBEAQ&url=https%3A%2F%2Faws.amazon.com%2Fblogs%2Farchitecture%2Fcreate-dynamic-contact-forms-for-s3-static-websites-using-aws-lambda-amazon-api-gateway-and-amazon-ses%2F&psig=AOvVaw134-hvySJVrc6GguU_jsMw&ust=1571589317596429 "enter image title here")


   HAHA   

 Share on: Twitter / Facebook / Google+ / Email