Skip to content

Commit

Permalink
cloudfront script and config files
Browse files Browse the repository at this point in the history
  • Loading branch information
justinstander committed Oct 9, 2024
1 parent f64e335 commit 970fb8c
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/cloudfront.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

function distribution_create() {
aws cloudfront create-distribution --distribution-config file://config/cloudfront/aws-cloudfront-distribution-config.json
}

"$@"
269 changes: 269 additions & 0 deletions bin/config/cloudfront/aws-cloudfront-distribution-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
{
"ETag": "EJ6LDRXLT5NEK",
"DistributionConfig": {
"CallerReference": "408f8e39-c3ff-43b7-8007-ab30fa3b6ef6",
"Aliases": {
"Quantity": 1,
"Items": [
"haasandmilan.com"
]
},
"DefaultRootObject": "index.html",
"Origins": {
"Quantity": 1,
"Items": [
{
"Id": "aws-haasandmilan-com.s3.us-east-1.amazonaws.com",
"DomainName": "aws-haasandmilan-com.s3.us-east-1.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"S3OriginConfig": {
"OriginAccessIdentity": ""
},
"ConnectionAttempts": 3,
"ConnectionTimeout": 10,
"OriginShield": {
"Enabled": false
},
"OriginAccessControlId": "E14LHHTL5TEBOG"
}
]
},
"OriginGroups": {
"Quantity": 0
},
"DefaultCacheBehavior": {
"TargetOriginId": "aws-haasandmilan-com.s3.us-east-1.amazonaws.com",
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TrustedKeyGroups": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "redirect-to-https",
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"Compress": true,
"LambdaFunctionAssociations": {
"Quantity": 0
},
"FunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": "",
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"ResponseHeadersPolicyId": "67f7725c-6f97-4210-82d7-5512b31e9d03"
},
"CacheBehaviors": {
"Quantity": 2,
"Items": [
{
"PathPattern": "/*.php",
"TargetOriginId": "aws-haasandmilan-com.s3.us-east-1.amazonaws.com",
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TrustedKeyGroups": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "redirect-to-https",
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"Compress": true,
"LambdaFunctionAssociations": {
"Quantity": 1,
"Items": [
{
"LambdaFunctionARN": "arn:aws:lambda:us-east-1:639518990921:function:viewer-requests:5",
"EventType": "viewer-request",
"IncludeBody": true
}
]
},
"FunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": "",
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"ResponseHeadersPolicyId": "67f7725c-6f97-4210-82d7-5512b31e9d03"
},
{
"PathPattern": "/*.env*",
"TargetOriginId": "aws-haasandmilan-com.s3.us-east-1.amazonaws.com",
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TrustedKeyGroups": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "redirect-to-https",
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"Compress": true,
"LambdaFunctionAssociations": {
"Quantity": 1,
"Items": [
{
"LambdaFunctionARN": "arn:aws:lambda:us-east-1:639518990921:function:viewer-requests:5",
"EventType": "viewer-request",
"IncludeBody": false
}
]
},
"FunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": "",
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"ResponseHeadersPolicyId": "67f7725c-6f97-4210-82d7-5512b31e9d03"
}
]
},
"CustomErrorResponses": {
"Quantity": 11,
"Items": [
{
"ErrorCode": 400,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 403,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 404,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 405,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 414,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 416,
"ResponsePagePath": "/404.html",
"ResponseCode": "404",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 500,
"ResponsePagePath": "/503.html",
"ResponseCode": "503",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 501,
"ResponsePagePath": "/503.html",
"ResponseCode": "503",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 502,
"ResponsePagePath": "/503.html",
"ResponseCode": "503",
"ErrorCachingMinTTL": 10
},
{
"ErrorCode": 503,
"ResponsePagePath": "/503.html",
"ResponseCode": "503",
"ErrorCachingMinTTL": 60
},
{
"ErrorCode": 504,
"ResponsePagePath": "/503.html",
"ResponseCode": "503",
"ErrorCachingMinTTL": 10
}
]
},
"Comment": "haasandmilan.com",
"Logging": {
"Enabled": true,
"IncludeCookies": true,
"Bucket": "aws-haasandmilan-com-cloudfront-logs.s3.amazonaws.com",
"Prefix": ""
},
"PriceClass": "PriceClass_100",
"Enabled": true,
"ViewerCertificate": {
"CloudFrontDefaultCertificate": false,
"ACMCertificateArn": "arn:aws:acm:us-east-1:639518990921:certificate/2ab337bd-6f59-4b66-84d6-7412718f90f9",
"SSLSupportMethod": "sni-only",
"MinimumProtocolVersion": "TLSv1.2_2021",
"Certificate": "arn:aws:acm:us-east-1:639518990921:certificate/2ab337bd-6f59-4b66-84d6-7412718f90f9",
"CertificateSource": "acm"
},
"Restrictions": {
"GeoRestriction": {
"RestrictionType": "none",
"Quantity": 0
}
},
"WebACLId": "",
"HttpVersion": "http2",
"IsIPV6Enabled": true,
"ContinuousDeploymentPolicyId": "",
"Staging": false
}
}

0 comments on commit 970fb8c

Please sign in to comment.