Skip to content

Conversation

@AndrewGearhart
Copy link

This pull request introduces environment-aware resource naming and configuration across the project to support multi-environment deployments (e.g., dev, prod) and improve AWS resource management. The changes standardize how stack names, S3 buckets, ECS clusters, Lambda functions, Step Functions, dashboards, and Secrets Manager secrets are named and accessed, using context variables or environment variables. Documentation and code are updated to reflect these conventions, and resource policies are adjusted to ensure correct permissions.

Environment-aware resource naming and configuration:

  • All AWS resources (S3 buckets, ECS clusters, Lambda functions, Step Functions, CloudWatch dashboards) now use names based on <stackBase>-<env> and include account/region where needed for uniqueness. This is set via CDK context or environment variables. (app.py, README.md) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • Lambda functions and ECS tasks receive STACK_BASE and ENV as environment variables for runtime awareness. (app.py) [1] [2] [3]

Secrets Manager and permissions:

  • Secrets Manager secret names are updated to use the environment-aware pattern (/<stackBase>/<env>/client_credentials), and resource policies for Lambda and ECS roles are updated to match. (app.py, README.md, docker_autotag/autotag.py, lambda/accessibility_checker_before_remidiation/main.py, lambda/accessability_checker_after_remidiation/main.py) [1] [2] [3] [4] [5] [6] [7]

Documentation updates:

  • The README.md is expanded with clear instructions and examples for environment-aware deployment, stack/resource naming, and credential management. (README.md) [1] [2] [3] [4]

Container and runtime environment handling:

  • Dockerfiles for Python and JavaScript containers are updated to remove hardcoded AWS region; region is now set by the task execution environment. S3 client initialization in JavaScript uses environment variables for region. (docker_autotag/Dockerfile, javascript_docker/Dockerfile, javascript_docker/alt-text.js) [1] [2] [3]

CloudWatch and Step Functions:

  • CloudWatch dashboard and Step Functions log group/state machine names are now environment-aware, using the new naming conventions. (app.py) [1] [2]

These changes make the project much easier to deploy and manage across multiple environments, reduce risk of resource naming collisions, and improve security by scoping secrets and permissions appropriately.

Closes #9

… the project

- Updated README.md to include environment and naming guidelines for multi-environment deployments.
- Modified app.py to support environment-specific naming for resources and tags.
- Adjusted Dockerfiles to remove hardcoded AWS region and rely on task execution environment.
- Refactored secret retrieval in autotag.py and main.py files to use dynamic naming based on environment variables.
- Updated JavaScript files to utilize environment variables for AWS region configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Environment-Aware Configuration and Naming Conventions for Multi-Environment Deployments

1 participant