diff --git a/README.md b/README.md index 2aafb9c..179eccd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This project creates an API Gateway which serves a public REST API and a public All resources are deployed in a single CloudFormation stack, which can be created or deleted via single commands. +Optionally, a custom domain name can be configured as the gateway URL. + ## Static Website @@ -32,6 +34,8 @@ Run ```source setup.sh``` Add extra website files with: ```aws s3 cp s3://${WEB_BUCKET_NAME}/``` +Website paths map to simulated S3 folders by putting slashes in ``````. For example, uploading a file named "a/b/c.html" will make it accessible at ```{GATEWAY_URL}/{stage}/static/a/b/c.html```. + ## To Delete All Resources @@ -40,11 +44,11 @@ Run ```/stack.sh $STACK_NAME delete $WEB_BUCKET_NAME``` This will also delete the S3 bucket contents. -## Optional: Use a Custom Domain Name +## Optional: Using a Custom Domain Name ### Certificate setup: manual process -1. Sign in to the AWS Certificate Manager console **and set the region to us-east-1**. +1. Sign in to the AWS Certificate Manager console **and set the region to us-east-1** (mandatory region). 2. Choose "Request a certificate". 3. Enter the custom domain name for the API in "Domain name". 4. Choose "Review, request and confirm". diff --git a/setup.sh b/setup.sh index 024c646..1dea9b9 100755 --- a/setup.sh +++ b/setup.sh @@ -3,13 +3,13 @@ # Run this script to deploy the project on AWS export AWS_REGION=eu-west-3 -export STACK_NAME=webtest2 +export STACK_NAME=webtest1 export STAGE_NAME=v1 # Optional: custom domain settings. # Must then update the custom DNS records with the new cloudfront URL. -export USE_CUSTOM_DOMAIN=false +export USE_CUSTOM_DOMAIN=true export DOMAIN_NAME=mtest.dev export DOMAIN_CERT_ARN="define this" diff --git a/template.yml b/template.yml index 8035188..d66a64d 100644 --- a/template.yml +++ b/template.yml @@ -167,7 +167,7 @@ Resources: Type: AWS::ApiGateway::Resource Properties: ParentId: !Ref apiStaticPath - PathPart: '{object}' + PathPart: '{object+}' RestApiId: !GetAtt apiGateway.RestApiId apiStaticGET: