Skip to content

Instantly share code, notes, and snippets.

@LMtx
Last active May 5, 2025 04:59
Show Gist options
  • Save LMtx/a5988a846744b902fa93fdd1dde650a7 to your computer and use it in GitHub Desktop.
Save LMtx/a5988a846744b902fa93fdd1dde650a7 to your computer and use it in GitHub Desktop.
Amazon Q global context for IoT projects.

General

Ensure code maintainability and extendability. Do not hardcode configuration into source code; use a dedicated config.ini file. Design solutions secure by default.

Costs

Take into account the AWS costs and optimize them. Analyze AWS infrastructure, data ingest, and data egress costs.

CDK

When creating an AWS CDK app, use Python and a dedicated virtual environment. Define stacks in separate files stored in the 'stacks' directory.

Lambda

Use the latest supported version of Python and ARM for Lambda functions. Do not embed Lambda source code into CDK Stack or Construct; put it into a separate file. Create dedicated CloudWatch LogGroups for every Lambda with a default retention of one year and ensure that Lambda's logger uses that LogGroup. Add a log-level environment variable to Lambdas to enable changing the log's verbosity.

API

Enable proxy when integrating API Gateway with Lambda; add resource("{proxy+}") and capture any method.

Security

Use OWASP Top 10 security guidelines during design and implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment