In this final setup phase you will seed the required initial configuration into DynamoDB and run smoke tests to validate the deployment end-to-end.
The Lambda function reads its HMAC signing secret and loader secret from the app_config DynamoDB table. You must insert these before the platform is usable.
Replace APP_CONFIG_TABLE with your actual table name (from the CloudFormation output or using the pattern code-protector-aws-prod-app-config).
aws dynamodb put-item \
--table-name APP_CONFIG_TABLE \
--item '{
"key": {"S": "hmac_secret"},
"value": {"S": "REPLACE_WITH_A_STRONG_RANDOM_SECRET_MIN_32_CHARS"}
}'
Generate a strong secret:
openssl rand -hex 32
aws dynamodb put-item \
--table-name APP_CONFIG_TABLE \
--item '{
"key": {"S": "loader_secret"},
"value": {"S": "REPLACE_WITH_A_DIFFERENT_STRONG_RANDOM_SECRET"}
}'
Verify both items are stored:
aws dynamodb scan \
--table-name APP_CONFIG_TABLE \
--query "Items[*].key.S"
Expected output: ["hmac_secret", "loader_secret"]
Open your CloudFront domain in a browser and navigate to /register:
https://CLOUDFRONT_DOMAIN/register
Create an account using your email and a strong password. This first account will be promoted to admin in the next step.
Retrieve the user ID from the users table:
aws dynamodb query \
--table-name code-protector-aws-prod-users \
--index-name EmailIndex \
--key-condition-expression "email = :email" \
--expression-attribute-values '{":email": {"S": "YOUR_EMAIL@example.com"}}' \
--query "Items[0].id.S"
Then set the role attribute to admin:
aws dynamodb update-item \
--table-name code-protector-aws-prod-users \
--key '{"id": {"S": "USER_ID_FROM_ABOVE"}}' \
--update-expression "SET #r = :admin" \
--expression-attribute-names '{"#r": "role"}' \
--expression-attribute-values '{":admin": {"S": "admin"}}'
https://CLOUDFRONT_DOMAIN/login with your admin account./dashboard.Test that the loader execute endpoint responds correctly to an invalid request (it should return a 400 or 401 error — not a 500):
curl -X GET "https://CLOUDFRONT_DOMAIN/api/v5/execute?id=test&license=test&hwid=test×tamp=0&nonce=test&signature=invalid"
Expected: A JSON error response (e.g. {"error":"Invalid signature"}) — not an unhandled exception.
Use a WebSocket client (e.g. wscat) to verify the WebSocket endpoint accepts connections:
npm install -g wscat
wscat -c "WSS_ENDPOINT"
Expected: Connection established (press Ctrl+C to close).
In the AWS Console, navigate to CloudWatch → Alarms. You should see three alarms:
code-protector-aws-prod-api-errors — GREEN (OK)code-protector-aws-prod-api-throttles — GREEN (OK)code-protector-aws-prod-api-duration-p95 — GREEN (OK)Also check CloudWatch → Dashboards → code-protector-aws-prod-ops for the operational dashboard.
At the end of this phase you have:
hmac_secret and loader_secret into the app_config tableThe GuardScript platform is now fully deployed and operational.
Proceed to Cleanup when you are done.