Skip to content

Commit

Permalink
Make static path have a greedy object
Browse files Browse the repository at this point in the history
  • Loading branch information
e-mit committed Jun 15, 2024
1 parent eedbbd0 commit ef8f4d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -32,6 +34,8 @@ Run ```source setup.sh```
Add extra website files with:
```aws s3 cp <local file name> s3://${WEB_BUCKET_NAME}/<public file name>```

Website paths map to simulated S3 folders by putting slashes in ```<public file name>```. 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

Expand All @@ -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".
Expand Down
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Resources:
Type: AWS::ApiGateway::Resource
Properties:
ParentId: !Ref apiStaticPath
PathPart: '{object}'
PathPart: '{object+}'
RestApiId: !GetAtt apiGateway.RestApiId

apiStaticGET:
Expand Down

0 comments on commit ef8f4d3

Please sign in to comment.