-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cdk): Add multi-environment deployment support #778
base: v2
Are you sure you want to change the base?
Conversation
- Create separate parameter models for each entry point using Zod - Define BaseParametersSchema for common parameters across all entry points - Implement specific parameter schemas for bedrock-chat, api-publish, and bedrock-custom-bot - Add type-safe parameter retrieval functions for each entry point - Simplify parameter handling in entry point files - Ensure proper default values and validation for all parameters
Add ability to specify environment name when getting Bedrock chat parameters. When envName is provided, parameters are fetched from bedrockChatParams map. If envName is undefined, 'default' is used. If 'default' is not found in the map, CDK context values are used. For non-default environments, an error is thrown if not found in the map.
…per experience - Use z.input for input types to allow optional parameters with defaults - Use z.infer for output types to ensure all properties are required - Remove unnecessary .optional() calls from properties with defaults - Update parameter.ts to use the new input type - Ensure getBedrockChatParameters returns fully resolved parameters This change allows users to pass empty objects to bedrockChatParams while maintaining strong typing for the returned parameters from get*Parameters functions.
…loyments - Rename parameter getter functions to better reflect their purpose (get* -> resolve*) - Add explicit App type for better type safety - Improve handling of array parameters with proper null checks - Add default value for publishedApiAllowedOrigins - Add unit tests for parameter resolution functions
…support Move envName and envPrefix to BaseParameterSchema and add functionality to retrieve parameters from environment variables. This allows handling context parameters from tryGetContext and environment variables using the same mechanism. - Add getEnvVar helper function to parameter-models.ts - Extend BedrockCustomBotParametersSchema with required parameters - Update resolveBedrockCustomBotParameters to retrieve parameters from environment variables - Similarly update resolveApiPublishParameters - Modify bin/bedrock-custom-bot.ts and bin/api-publish.ts to use the new parameter handling - Simplify debug logging and standardize to JSON format - Update function comments to clarify that values are retrieved from environment variables
Memoenv_name / env_prefix
|
@statefb Thank you for your review! Fixed them. |
Close #720
Adds support for deploying multiple environments (dev, test, prod, etc.) within the same AWS account. It introduces a type-safe parameter management system using Zod and enables environment-specific resource naming.
Key Features
CDKEnvironment
for identificationImplementation Details
Notes
CDKEnvironment
tagBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.