diff --git a/README.md b/README.md index 7843f4eb..5dacb0c4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,24 @@ -# Chimp +# +![Chimp by Xolv.io](./images/chimp.png?raw=true) +# -## Your Quality Faster Companion - -Please go to http://chimpjs.com for documentation +# IMPORTANT ANNOUNCEMENT - July 22nd, 2018 + +The Chimp that you know and love is now being split into two separate projects, both of which are intended to help you deliver higher quality faster. + +The first is [*Chimpy*](https://github.com/TheBrainFamily/chimpy). This project will continue evolving and supporting the current thinking behind Chimp 1.x. + +The second is [*Chimp 2.0*](https://github.com/xolvio/chimp). This project will be built from scratch based on the learnings made while using Chimp 1.x in the field. + +For more details about this decision, [please see the full announcement here.](https://medium.com/@sam_hatoum/the-future-of-chimp-js-e911f8e9aaa6) + +## Chimp 2.0 +Chimp 2.0 is likely to be a [Yeoman](http://yeoman.io/) for quality. The intention is to have Chimp be your companion that you can call on to help you create high quality code that is optimized for changes + +## Quality Faster +Please checkout the new [Quality Faster](https://www.qualityfaster.com) guide where you can learn how to build quality in to your application across the full stack. + +Anyone that purchased The Meteor Testing Manual will get this guide for free. [See here for the announcement](https://www.qualityfaster.com/landing/meteor-testing.html). + +## Community +**Slack:** Please join our Slack [xolv.io/community](http://community.xolv.io) #chimp channel, where you can chat, find help and help others. (it might take a minute for the free Now.sh serverless function to start up!) diff --git a/documentation/package.json b/documentation/package.json index 36525475..1824f480 100644 --- a/documentation/package.json +++ b/documentation/package.json @@ -7,7 +7,8 @@ "start": "docusaurus start", "build": "docusaurus build", "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy", + "deploy": "sh ./scripts/deployToS3.sh s3://www.chimpjs.com && yarn run invalidate", + "invalidate": "aws cloudfront create-invalidation --distribution-id $XOLVIO_WEBSITE_DISTRIBUTION_ID --paths \"/*\"", "serve": "docusaurus serve" }, "dependencies": { diff --git a/documentation/scripts/deployToS3.sh b/documentation/scripts/deployToS3.sh new file mode 100644 index 00000000..6b8103d2 --- /dev/null +++ b/documentation/scripts/deployToS3.sh @@ -0,0 +1,11 @@ +echo "Cleaning the bucket $1" + +aws s3 rm $1 --recursive + +#echo "Syncing gzipped files to bucket $1" +#aws s3 sync ./build/ $1 \ +#--include "*" --acl public-read --cache-control max-age=31556926,public --content-encoding gzip \ +#--delete \ + +echo "Syncing non-gzipped files to bucket $1" +aws s3 sync ./build/ $1 --acl public-read --cache-control max-age=31556926,public diff --git a/documentation/serverless/.serverless/cloudformation-template-create-stack.json b/documentation/serverless/.serverless/cloudformation-template-create-stack.json new file mode 100644 index 00000000..aadbe3b2 --- /dev/null +++ b/documentation/serverless/.serverless/cloudformation-template-create-stack.json @@ -0,0 +1,67 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "ServerlessDeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + } + }, + "ServerlessDeploymentBucketPolicy": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "ServerlessDeploymentBucket" + }, + "/*" + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": { + "Ref": "ServerlessDeploymentBucket" + } + } + } +} \ No newline at end of file diff --git a/documentation/serverless/.serverless/cloudformation-template-update-stack.json b/documentation/serverless/.serverless/cloudformation-template-update-stack.json new file mode 100644 index 00000000..64b42995 --- /dev/null +++ b/documentation/serverless/.serverless/cloudformation-template-update-stack.json @@ -0,0 +1,315 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "ServerlessDeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + } + }, + "ServerlessDeploymentBucketPolicy": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "ServerlessDeploymentBucket" + }, + "/*" + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "DomainZone": { + "Type": "AWS::Route53::HostedZone", + "Properties": { + "Name": "chimpjs.com", + "HostedZoneConfig": { + "Comment": "Created on August 19 2020 to codify DNS" + } + } + }, + "Certificate": { + "Type": "AWS::CertificateManager::Certificate", + "Properties": { + "DomainName": "*.chimpjs.com", + "SubjectAlternativeNames": [ + "chimpjs.com", + "*.chimpjs.com" + ], + "DomainValidationOptions": [ + { + "DomainName": "chimpjs.com", + "ValidationDomain": "chimpjs.com" + } + ] + } + }, + "WebsiteBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "www.chimpjs.com", + "AccessControl": "Private", + "WebsiteConfiguration": { + "IndexDocument": "index.html", + "ErrorDocument": "error.html" + } + } + }, + "WebsiteDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "www.chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "WebsiteOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "DefaultRootObject": "index.html", + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "WebsiteOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "WebsiteBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ], + "CustomErrorResponses": [ + { + "ErrorCode": "403", + "ErrorCachingMinTTL": 1, + "ResponseCode": 403, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "404", + "ErrorCachingMinTTL": 1, + "ResponseCode": 404, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "500", + "ErrorCachingMinTTL": 1, + "ResponseCode": 500, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "502", + "ErrorCachingMinTTL": 1, + "ResponseCode": 502, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "503", + "ErrorCachingMinTTL": 1, + "ResponseCode": 503, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "504", + "ErrorCachingMinTTL": 1, + "ResponseCode": 504, + "ResponsePagePath": "/index.html" + } + ] + } + } + }, + "WebsiteDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "www.chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "WebsiteDistribution", + "DomainName" + ] + } + } + }, + { + "Name": "www.chimpjs.com.", + "Type": "TXT", + "ResourceRecords": [ + "\"google-site-verification=TwPZPfFdTvgtB94eKQtEAbWWU7_S59xKF8WU8WtwkMQ\"" + ], + "TTL": "300" + } + ] + } + }, + "RedirectBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "chimpjs.com", + "AccessControl": "PublicRead", + "WebsiteConfiguration": { + "RedirectAllRequestsTo": { + "HostName": "www.chimpjs.com", + "Protocol": "https" + } + } + } + }, + "RedirectDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "RedirectOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "RedirectOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "RedirectBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ] + } + } + }, + "RedirectDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "RedirectDistribution", + "DomainName" + ] + } + } + } + ] + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": { + "Ref": "ServerlessDeploymentBucket" + } + } + } +} \ No newline at end of file diff --git a/documentation/serverless/.serverless/serverless-state.json b/documentation/serverless/.serverless/serverless-state.json new file mode 100644 index 00000000..5866fc37 --- /dev/null +++ b/documentation/serverless/.serverless/serverless-state.json @@ -0,0 +1,695 @@ +{ + "service": { + "service": "www-chimpjs-com", + "serviceObject": { + "name": "www-chimpjs-com" + }, + "provider": { + "stage": "prod", + "variableSyntax": "\\${([^{}]+?)}", + "runtime": "nodejs10.x", + "name": "aws", + "region": "us-east-1", + "versionFunctions": true, + "compiledCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "ServerlessDeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + } + }, + "ServerlessDeploymentBucketPolicy": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "ServerlessDeploymentBucket" + }, + "/*" + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + }, + "DomainZone": { + "Type": "AWS::Route53::HostedZone", + "Properties": { + "Name": "chimpjs.com", + "HostedZoneConfig": { + "Comment": "Created on August 19 2020 to codify DNS" + } + } + }, + "Certificate": { + "Type": "AWS::CertificateManager::Certificate", + "Properties": { + "DomainName": "*.chimpjs.com", + "SubjectAlternativeNames": [ + "chimpjs.com", + "*.chimpjs.com" + ], + "DomainValidationOptions": [ + { + "DomainName": "chimpjs.com", + "ValidationDomain": "chimpjs.com" + } + ] + } + }, + "WebsiteBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "www.chimpjs.com", + "AccessControl": "Private", + "WebsiteConfiguration": { + "IndexDocument": "index.html", + "ErrorDocument": "error.html" + } + } + }, + "WebsiteDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "www.chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "WebsiteOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "DefaultRootObject": "index.html", + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "WebsiteOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "WebsiteBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ], + "CustomErrorResponses": [ + { + "ErrorCode": "403", + "ErrorCachingMinTTL": 1, + "ResponseCode": 403, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "404", + "ErrorCachingMinTTL": 1, + "ResponseCode": 404, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "500", + "ErrorCachingMinTTL": 1, + "ResponseCode": 500, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "502", + "ErrorCachingMinTTL": 1, + "ResponseCode": 502, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "503", + "ErrorCachingMinTTL": 1, + "ResponseCode": 503, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "504", + "ErrorCachingMinTTL": 1, + "ResponseCode": 504, + "ResponsePagePath": "/index.html" + } + ] + } + } + }, + "WebsiteDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "www.chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "WebsiteDistribution", + "DomainName" + ] + } + } + }, + { + "Name": "www.chimpjs.com.", + "Type": "TXT", + "ResourceRecords": [ + "\"google-site-verification=TwPZPfFdTvgtB94eKQtEAbWWU7_S59xKF8WU8WtwkMQ\"" + ], + "TTL": "300" + } + ] + } + }, + "RedirectBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "chimpjs.com", + "AccessControl": "PublicRead", + "WebsiteConfiguration": { + "RedirectAllRequestsTo": { + "HostName": "www.chimpjs.com", + "Protocol": "https" + } + } + } + }, + "RedirectDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "RedirectOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "RedirectOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "RedirectBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ] + } + } + }, + "RedirectDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "RedirectDistribution", + "DomainName" + ] + } + } + } + ] + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": { + "Ref": "ServerlessDeploymentBucket" + } + } + } + }, + "coreCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "ServerlessDeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + } + }, + "ServerlessDeploymentBucketPolicy": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Effect": "Deny", + "Principal": "*", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Ref": "ServerlessDeploymentBucket" + }, + "/*" + ] + ] + } + ], + "Condition": { + "Bool": { + "aws:SecureTransport": false + } + } + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": { + "Ref": "ServerlessDeploymentBucket" + } + } + } + } + }, + "custom": { + "subdomain": "www", + "name": "chimpjs", + "tld": "com", + "domain": "chimpjs.com", + "url": "www.chimpjs.com", + "prefix": "www-chimpjs-com", + "region": "us-east-1", + "stage": "prod" + }, + "pluginsData": {}, + "functions": {}, + "resources": { + "Resources": { + "DomainZone": { + "Type": "AWS::Route53::HostedZone", + "Properties": { + "Name": "chimpjs.com", + "HostedZoneConfig": { + "Comment": "Created on August 19 2020 to codify DNS" + } + } + }, + "Certificate": { + "Type": "AWS::CertificateManager::Certificate", + "Properties": { + "DomainName": "*.chimpjs.com", + "SubjectAlternativeNames": [ + "chimpjs.com", + "*.chimpjs.com" + ], + "DomainValidationOptions": [ + { + "DomainName": "chimpjs.com", + "ValidationDomain": "chimpjs.com" + } + ] + } + }, + "WebsiteBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "www.chimpjs.com", + "AccessControl": "Private", + "WebsiteConfiguration": { + "IndexDocument": "index.html", + "ErrorDocument": "error.html" + } + } + }, + "WebsiteDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "www.chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "WebsiteOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "DefaultRootObject": "index.html", + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "WebsiteOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "WebsiteBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ], + "CustomErrorResponses": [ + { + "ErrorCode": "403", + "ErrorCachingMinTTL": 1, + "ResponseCode": 403, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "404", + "ErrorCachingMinTTL": 1, + "ResponseCode": 404, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "500", + "ErrorCachingMinTTL": 1, + "ResponseCode": 500, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "502", + "ErrorCachingMinTTL": 1, + "ResponseCode": 502, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "503", + "ErrorCachingMinTTL": 1, + "ResponseCode": 503, + "ResponsePagePath": "/index.html" + }, + { + "ErrorCode": "504", + "ErrorCachingMinTTL": 1, + "ResponseCode": 504, + "ResponsePagePath": "/index.html" + } + ] + } + } + }, + "WebsiteDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "www.chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "WebsiteDistribution", + "DomainName" + ] + } + } + }, + { + "Name": "www.chimpjs.com.", + "Type": "TXT", + "ResourceRecords": [ + "\"google-site-verification=TwPZPfFdTvgtB94eKQtEAbWWU7_S59xKF8WU8WtwkMQ\"" + ], + "TTL": "300" + } + ] + } + }, + "RedirectBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "chimpjs.com", + "AccessControl": "PublicRead", + "WebsiteConfiguration": { + "RedirectAllRequestsTo": { + "HostName": "www.chimpjs.com", + "Protocol": "https" + } + } + } + }, + "RedirectDistribution": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "Aliases": [ + "chimpjs.com" + ], + "DefaultCacheBehavior": { + "TargetOriginId": "RedirectOriginBucket", + "ViewerProtocolPolicy": "redirect-to-https", + "Compress": true, + "ForwardedValues": { + "QueryString": false, + "Cookies": { + "Forward": "none" + } + } + }, + "Enabled": true, + "HttpVersion": "http2", + "ViewerCertificate": { + "AcmCertificateArn": { + "Ref": "Certificate" + }, + "SslSupportMethod": "sni-only" + }, + "Origins": [ + { + "Id": "RedirectOriginBucket", + "DomainName": { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Fn::GetAtt": [ + "RedirectBucket", + "WebsiteURL" + ] + } + ] + } + ] + }, + "CustomOriginConfig": { + "OriginProtocolPolicy": "http-only" + } + } + ] + } + } + }, + "RedirectDNSRecords": { + "Type": "AWS::Route53::RecordSetGroup", + "Properties": { + "HostedZoneId": { + "Ref": "DomainZone" + }, + "RecordSets": [ + { + "Name": "chimpjs.com.", + "Type": "A", + "AliasTarget": { + "HostedZoneId": "Z2FDTNDATAQYW2", + "DNSName": { + "Fn::GetAtt": [ + "RedirectDistribution", + "DomainName" + ] + } + } + } + ] + } + } + }, + "Outputs": {} + }, + "configValidationMode": "warn", + "serviceFilename": "serverless.yml", + "layers": {}, + "initialServerlessConfig": { + "custom": { + "$ref": "$[\"service\"][\"custom\"]" + }, + "service": { + "$ref": "$[\"service\"][\"serviceObject\"]" + }, + "provider": { + "$ref": "$[\"service\"][\"provider\"]" + }, + "resources": { + "$ref": "$[\"service\"][\"resources\"]" + }, + "functions": { + "$ref": "$[\"service\"][\"functions\"]" + }, + "package": { + "artifactDirectoryName": "serverless/www-chimpjs-com/prod/1597853126636-2020-08-19T16:05:26.636Z" + }, + "layers": { + "$ref": "$[\"service\"][\"layers\"]" + }, + "configValidationMode": "warn" + }, + "isDashboardMonitoringPreconfigured": false + }, + "package": { + "artifactDirectoryName": "serverless/www-chimpjs-com/prod/1597853126636-2020-08-19T16:05:26.636Z", + "artifact": "" + } +} \ No newline at end of file diff --git a/documentation/serverless/serverless.yml b/documentation/serverless/serverless.yml new file mode 100644 index 00000000..f131909e --- /dev/null +++ b/documentation/serverless/serverless.yml @@ -0,0 +1,173 @@ +custom: + subdomain: "www" + name: "chimpjs" + tld: "com" + domain: "${self:custom.name}.${self:custom.tld}" + url: "${self:custom.subdomain}.${self:custom.domain}" + prefix: "${self:custom.subdomain}-${self:custom.name}-${self:custom.tld}" + region: "us-east-1" + stage: "prod" + +service: + name: ${self:custom.prefix} + +provider: + runtime: nodejs10.x + name: aws + region: "${self:custom.region}" + stage: "${self:custom.stage}" + +resources: + Resources: + DomainZone: + Type: "AWS::Route53::HostedZone" + Properties: + Name: "${self:custom.domain}" + HostedZoneConfig: + Comment: "Created on August 19 2020 to codify DNS" + + ## SSL CERT + Certificate: + Type: "AWS::CertificateManager::Certificate" + Properties: + DomainName: "*.${self:custom.domain}" + SubjectAlternativeNames: + - "${self:custom.domain}" + - "*.${self:custom.domain}" + DomainValidationOptions: + - DomainName: "${self:custom.domain}" + ValidationDomain: "${self:custom.domain}" + + # WEBSITE, CDN, HTTP > HTTPS REDIRECT, DNS RECORD + WebsiteBucket: + Type: "AWS::S3::Bucket" + Properties: + BucketName: "${self:custom.url}" + AccessControl: Private + WebsiteConfiguration: + IndexDocument: index.html + ErrorDocument: error.html + WebsiteDistribution: + Type: "AWS::CloudFront::Distribution" + Properties: + DistributionConfig: + Aliases: + - "${self:custom.url}" + DefaultCacheBehavior: + TargetOriginId: WebsiteOriginBucket + ViewerProtocolPolicy: redirect-to-https + Compress: true + ForwardedValues: + QueryString: false + Cookies: + Forward: none + DefaultRootObject: index.html + Enabled: true + HttpVersion: http2 + ViewerCertificate: + AcmCertificateArn: + Ref: Certificate + SslSupportMethod: "sni-only" + Origins: + - Id: WebsiteOriginBucket + DomainName: + !Select [2, !Split ["/", !GetAtt [WebsiteBucket, WebsiteURL]]] + CustomOriginConfig: + OriginProtocolPolicy: "http-only" + CustomErrorResponses: + - ErrorCode: "403" + ErrorCachingMinTTL: 1 + ResponseCode: 403 + ResponsePagePath: "/index.html" + - ErrorCode: "404" + ErrorCachingMinTTL: 1 + ResponseCode: 404 + ResponsePagePath: "/index.html" + - ErrorCode: "500" + ErrorCachingMinTTL: 1 + ResponseCode: 500 + ResponsePagePath: "/index.html" + - ErrorCode: "502" + ErrorCachingMinTTL: 1 + ResponseCode: 502 + ResponsePagePath: "/index.html" + - ErrorCode: "503" + ErrorCachingMinTTL: 1 + ResponseCode: 503 + ResponsePagePath: "/index.html" + - ErrorCode: "504" + ErrorCachingMinTTL: 1 + ResponseCode: 504 + ResponsePagePath: "/index.html" + WebsiteDNSRecords: + Type: AWS::Route53::RecordSetGroup + Properties: + HostedZoneId: + Ref: DomainZone + RecordSets: + - Name: "${self:custom.url}." + Type: A + AliasTarget: + HostedZoneId: Z2FDTNDATAQYW2 + DNSName: + Fn::GetAtt: [WebsiteDistribution, DomainName] + - Name: "${self:custom.url}." + Type: TXT + ResourceRecords: + - '"google-site-verification=TwPZPfFdTvgtB94eKQtEAbWWU7_S59xKF8WU8WtwkMQ"' + TTL: "300" + # NAKED DOMAIN REDIRECT + RedirectBucket: + Type: "AWS::S3::Bucket" + Properties: + BucketName: "${self:custom.domain }" + AccessControl: PublicRead + WebsiteConfiguration: + RedirectAllRequestsTo: + HostName: "${self:custom.url}" + Protocol: "https" + RedirectDistribution: + Type: "AWS::CloudFront::Distribution" + Properties: + DistributionConfig: + Aliases: + - "${self:custom.domain}" + DefaultCacheBehavior: + TargetOriginId: RedirectOriginBucket + ViewerProtocolPolicy: redirect-to-https + Compress: true + ForwardedValues: + QueryString: false + Cookies: + Forward: none + Enabled: true + HttpVersion: http2 + ViewerCertificate: + AcmCertificateArn: + Ref: Certificate + SslSupportMethod: "sni-only" + Origins: + - Id: RedirectOriginBucket + DomainName: + "Fn::Select": + [ + 2, + "Fn::Split": + ["/", "Fn::GetAtt": ["RedirectBucket", "WebsiteURL"]], + ] + CustomOriginConfig: + OriginProtocolPolicy: "http-only" + # TODO ENABLE THIS WHEN READY TO GO LIVE + RedirectDNSRecords: + Type: AWS::Route53::RecordSetGroup + Properties: + HostedZoneId: + Ref: DomainZone + RecordSets: + - Name: "${self:custom.domain}." + Type: A + AliasTarget: + HostedZoneId: Z2FDTNDATAQYW2 + DNSName: + Fn::GetAtt: [RedirectDistribution, DomainName] + diff --git a/images/chimp.png b/images/chimp.png new file mode 100644 index 00000000..e20a5394 Binary files /dev/null and b/images/chimp.png differ