Trivial Sites that will be used to test various deployment approaches
- Go to S3 service
- Create bucket (make sure to enable public access)
- Configure Bucket
- Properties → Static website hosting → edit → enable
- Use all the defaults
- For this example
- The default (index document) page is
index.html
- The error document is
error.html
...though I don’t think we’ll use it
- The default (index document) page is
- Permissions → Edit bucket policy
- Paste in example, swapping in your own bucket name (leaving the trailing
/*
, to indicate this applies to everything in that bucket)
- Paste in example, swapping in your own bucket name (leaving the trailing
- Objects → Upload → index.html
- Use defaults for upload
- index.html is just a simple hello world written in html
- Properties → Static website hosting → edit → enable
- Go back to properties → Static website hosting
- Follow the link to see the contents of
index.html
being displayed
- Follow the link to see the contents of
- Create Lambda Function
- Open Lambda service (he has this option directly in cloud9, but it’s either a plugin, or there has been a GUI change since he filmed
- Create Function:
- Select Function name
- Select runtime (eg: python)
- Configure Lambda Function
- Function overview → +Add Trigger
- For this example, select API, which is used for http and RESTful APIs
- Select REST
- For this example, select API, which is used for http and RESTful APIs
- Security: Select Open, so that no additional configuration is required yet
- Function overview → +Add Trigger
- Create content for the function (see lambda_function.py)
- Test Lambda Function:
- Create Test Event
- Provide input keys and values (
{“key”: “value”}
), or just use open braces{}
for now
- Provide input keys and values (
- Deploy
- Test:
- Make sure to
deploy
before testing - You should see
- Make sure to
- Create Test Event
- View content:
- Select the API Gateway trigger that you created above
- Go to details, and follow the link to
API endpoint
- You should seen the content returned from your function call