Button Claimed in us-west-2 account
geotrocities.com is my toy domain
-
Template - emailFromButron (typo - fix)
-
Placement 0 home
-
added attribute dest_email
-
can I get it to send the deviceId?
- aws iot1click-devices list-devices
- aws iot1click-devices get-device-methods --device-id G030PM047405B285
- aws iot1click-devices invoke-device-method --device-id G030PM047405B285 --device-method --device-method-parameters
- aws iot1click-projects list-projects
- aws iot1click-projects describe-project --project-name ButtonFun
- Created certificates for geotrociies.com and www.
- certificate needed to use my own fancy domain
- then point R53 at it
Automatically created a lambda function from the 1-click template. It kicks off an email via SES.
Modified the Lambda function so that it could see the dest_email attribute I added to the IoT template
The function already had that, just didn't read the parameter
- Lambda folder contains simple functions and tests
- CORS needed to be added to the lambda function's return because of the proxy integration
- in the case of proxy integration, api gateway siliently shrugs it off
- Function name: get_button_clicks
- Execution role (create new from policy templates): iot_read_lambda_role
- Policy template: Simple microservice permissions (there by default)
-
Create a new API: HTTP API (Beta)
-
Security: Open
-
API name: get_button_clicks-API
-
Deployment stage: default
-
CORS/detailed metrics: not checked
-
Using the blueprint microservice-http-endpoint-python
- get_button_clicks - return how many clicks have been received in total
- read dynamo and get a count
- the CORS lives here. But if it's broken, CORS doesn't get delivered. Probably (definitely) need to improve error handling.
- let's get email working from my account
- configured geotrocities.com with SES
- get a domain
- setup
- used DKIM which does some sort of authentication
- setup MAIL FROM using smtp.geotrocities.com
- in general AWS was able to do all the DNS and verifications automatically since it's hosted there
URL: widgets
- geotrocities.com - content
- www.geotrocities.com - HTTP redirect
- policy applied to bucket under s3/geotrocities.com-bucket-policy.json
- geotrocities. com -> bucket alias
- www.geotrocities.com -> bucket alias
- inbound-
-
Lambda logging enabled makes it easy to get a sample payload
-
Created button-fun-api logging group
- Table name: IoTButtonClicks
- Partition Key: buttonId (String)
going to see about using deviceId as partition key
Just created the certs for geotrocities and www.geotrocities.com - required for API Gateway
- create user pool to associate clicks
- Looking at using the new HTTPS API
https://1dbkv5mqkg.execute-api.us-west-2.amazonaws.com/get_button_clicks
- get_button_clicks
- get_button_clicks (Lambda)
- GET /get_button_clicks → get_button_clicks (Lambda)
- $default (Auto-deploy: enabled)
-
button-fun-api cloudwatch log group, CLF Format
-
allow CloudWatch Logging
- per https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html
- APIGatewayCloudWatchPushRole
- arn:aws:iam::247070336958:role/APIGatewayCloudWatchPushRole