I'm making this guide with the assumption that the user has only entry-level familiarity with AWS to make it accessible. This guide also assumes you have a Route53 Domain and vaild certificate available
To use this template install AWS cli and SAM cli, it's important that you have both.
You can get help Cloudformation and SAM
To test your API using SAM local:
- Run this code in your terminal or command prompt:
sam local start-api
- Use curl or some other tool to test your API's inputs and outputs:
curl subdomain.domain.com/lambdafunction
To deploy your template to AWS properly:
- Edit the template to suit your needs.
- Create a bucket that you're happy to store code artefacts in.
- Change the bracketed values with what's specified.
- Run this code in your terminal or command prompt:
aws cloudformation package --template-file template.yaml --s3-bucket (name of artefact bucket) --output-template-file output.yaml --parameter-overrides DomainName=(domain name) Certificate=(certificate ARN) aws cloudformation deploy --template-file output.yaml --s3-bucket (Same bucket as above) --stack-name (name of stack) --capabilities CAPABILITY_IAM
- Check Cloudformation to ensure that your stack was successfully created.
- Have fun with AWS!