Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted JSON templates to YAML templates
- Loading branch information
1 parent
8c3ba29
commit 83dc3ff
Showing
6 changed files
with
136 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello world!</h1> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: Creates an Amazon Route 53 hosted zone | ||
Parameters: | ||
DomainName: | ||
Type: String | ||
Description: The DNS name of an Amazon Route 53 hosted zone e.g. jevsejev.io | ||
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-) | ||
ConstraintDescription: must be a valid DNS zone name. | ||
Resources: | ||
DNS: | ||
Type: AWS::Route53::HostedZone | ||
Properties: | ||
HostedZoneConfig: | ||
Comment: !Join ['', ['Hosted zone for ', !Ref 'DomainName']] | ||
Name: !Ref 'DomainName' | ||
HostedZoneTags: | ||
- Key: Application | ||
Value: Blog |
153 changes: 0 additions & 153 deletions
153
s3-static-website-with-cloudfront-and-route-53.template
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
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: | ||
DomainName: | ||
Type: String | ||
Description: The DNS name of an existing Amazon Route 53 hosted zone e.g. jevsejev.io | ||
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-) | ||
ConstraintDescription: must be a valid DNS zone name. | ||
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. | ||
Mappings: | ||
RegionMap: | ||
us-east-1: | ||
S3HostedZoneId: Z3AQBSTGFYJSTF | ||
S3WebsiteEndpoint: s3-website-us-east-1.amazonaws.com | ||
us-west-1: | ||
S3HostedZoneId: Z2F56UZL2M1ACD | ||
S3WebsiteEndpoint: s3-website-us-west-1.amazonaws.com | ||
us-west-2: | ||
S3HostedZoneId: Z3BJ6K6RIION7M | ||
S3WebsiteEndpoint: s3-website-us-west-2.amazonaws.com | ||
eu-west-1: | ||
S3HostedZoneId: Z1BKCTXD74EZPE | ||
S3WebsiteEndpoint: s3-website-eu-west-1.amazonaws.com | ||
ap-southeast-1: | ||
S3HostedZoneId: Z3O0J2DXBE1FTB | ||
S3WebsiteEndpoint: s3-website-ap-southeast-1.amazonaws.com | ||
ap-southeast-2: | ||
S3HostedZoneId: Z1WCIGYICN2BYD | ||
S3WebsiteEndpoint: s3-website-ap-southeast-2.amazonaws.com | ||
ap-northeast-1: | ||
S3HostedZoneId: Z2M4EHUR26P7ZW | ||
S3WebsiteEndpoint: s3-website-ap-northeast-1.amazonaws.com | ||
sa-east-1: | ||
S3HostedZoneId: Z31GFT0UA1I2HV | ||
S3WebsiteEndpoint: s3-website-sa-east-1.amazonaws.com | ||
Resources: | ||
WebsiteBucket: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
BucketName: !Ref 'FullDomainName' | ||
AccessControl: PublicRead | ||
WebsiteConfiguration: | ||
IndexDocument: index.html | ||
ErrorDocument: 404.html | ||
DeletionPolicy: Retain | ||
WebsiteBucketPolicy: | ||
Type: AWS::S3::BucketPolicy | ||
Properties: | ||
Bucket: !Ref 'WebsiteBucket' | ||
PolicyDocument: | ||
Statement: | ||
- Sid: PublicReadForGetBucketObjects | ||
Effect: Allow | ||
Principal: '*' | ||
Action: s3:GetObject | ||
Resource: !Join ['', ['arn:aws:s3:::', !Ref 'WebsiteBucket', /*]] | ||
WebsiteCloudfront: | ||
Type: AWS::CloudFront::Distribution | ||
DependsOn: | ||
- WebsiteBucket | ||
Properties: | ||
DistributionConfig: | ||
Comment: Cloudfront Distribution pointing to S3 bucket | ||
Origins: | ||
- DomainName: !Join [., [!Ref 'FullDomainName', !FindInMap [RegionMap, !Ref 'AWS::Region', | ||
S3WebsiteEndpoint]]] | ||
Id: S3Origin | ||
CustomOriginConfig: | ||
HTTPPort: '80' | ||
HTTPSPort: '443' | ||
OriginProtocolPolicy: http-only | ||
Enabled: 'true' | ||
DefaultRootObject: index.html | ||
Aliases: | ||
- !Ref 'FullDomainName' | ||
DefaultCacheBehavior: | ||
AllowedMethods: | ||
- GET | ||
- HEAD | ||
Compress: 'true' | ||
TargetOriginId: S3Origin | ||
ForwardedValues: | ||
QueryString: 'true' | ||
Cookies: | ||
Forward: none | ||
ViewerProtocolPolicy: allow-all | ||
PriceClass: PriceClass_200 | ||
ViewerCertificate: | ||
CloudFrontDefaultCertificate: 'true' | ||
WebsiteDNSName: | ||
Type: AWS::Route53::RecordSetGroup | ||
Properties: | ||
HostedZoneName: !Join ['', [!Ref 'DomainName', .]] | ||
RecordSets: | ||
- Name: !Ref 'FullDomainName' | ||
Type: A | ||
AliasTarget: | ||
HostedZoneId: Z2FDTNDATAQYW2 | ||
DNSName: !GetAtt [WebsiteCloudfront, DomainName] | ||
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 |