Conversation
…larity and functionality - Updated variable definitions in `variables.tf` to enhance validation and structure. - Modified request handler, agent runner, and response handler configurations in example deployments to support new packaging options (S3Zip and ECR). - Improved validation logic for request and response handlers to ensure proper configuration when using S3 or ECR. - Cleaned up formatting and comments for better readability across multiple files.
…tion configuration
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the AWS deployment modules and examples to support external build artifacts (S3 ZIPs and/or pre-built ECR images) so terraform apply can be run without performing local builds, and refreshes related documentation and example deployment scripts accordingly.
Changes:
- Add support in the serverless module for
S3Zipdeployments via an explicit{ bucket, key }reference and forImagedeployments via an explicitecr_image_uri, plus shared S3 source-bucket handling. - Add support in the containerized module for using an external
ecr_image_uriand skipping the local Docker build step. - Update AWS example READMEs, Terraform examples, and deploy scripts to reflect external-artifact workflows.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/aws-serverless/scalable-openai/README.md | Documents external S3 ZIP + ECR image packaging for the scalable serverless example. |
| examples/aws-serverless/scalable-openai/deploy/variables.tf | Adds tfvars inputs for S3 ZIP artifacts and agent-runner ECR image URI. |
| examples/aws-serverless/scalable-openai/deploy/terraform.tfvars | Provides example values for external S3/ECR artifact inputs. |
| examples/aws-serverless/scalable-openai/deploy/main.tf | Switches scalable example to S3Zip for handlers and Image via external ECR URI for agent runner. |
| examples/aws-serverless/scalable-openai/deploy/deploy.sh | Builds/zips handlers, uploads to S3, builds/pushes agent runner image to ECR, then runs Terraform. |
| examples/aws-containerized/openai-dynamodb/README.md | Documents external ECR image deployment flow for the ECS example. |
| examples/aws-containerized/openai-dynamodb/deploy/variables.tf | Adds ecr_image_uri input for the ECS example. |
| examples/aws-containerized/openai-dynamodb/deploy/terraform.tfvars | Provides example value for the external ECR image URI. |
| examples/aws-containerized/openai-dynamodb/deploy/main.tf | Wires ecr_image_uri into the containerized module and removes local package_path usage. |
| examples/aws-containerized/openai-dynamodb/deploy/deploy.sh | Builds the app package, builds/pushes an image to ECR, then runs Terraform. |
| examples/api/multimodal/dynamodb/deploy/main.tf | Formatting-only changes to the Terraform module block. |
| ak-deployment/ak-aws/serverless/variables.tf | Extends handler config objects with lambda_package_s3 and ecr_image_uri plus validations. |
| ak-deployment/ak-aws/serverless/state.tf | Implements shared S3 source bucket + external artifact wiring and updated module plumbing. |
| ak-deployment/ak-aws/serverless/README.md | Documents external artifact usage and updates variable documentation tables. |
| ak-deployment/ak-aws/serverless/modules/response-handler/variables.tf | Adds source key/version + s3_existing_package inputs for signing/external ZIP usage. |
| ak-deployment/ak-aws/serverless/modules/response-handler/main.tf | Updates signing job inputs and S3 ZIP wiring to accept external artifacts. |
| ak-deployment/ak-aws/serverless/modules/request-handler/variables.tf | Adds source key/version + s3_existing_package inputs for signing/external ZIP usage. |
| ak-deployment/ak-aws/serverless/modules/request-handler/main.tf | Updates signing job inputs and S3 ZIP wiring to accept external artifacts. |
| ak-deployment/ak-aws/serverless/modules/agent-runner/variables.tf | Adds source key/version + s3_existing_package inputs for signing/external ZIP usage. |
| ak-deployment/ak-aws/serverless/modules/agent-runner/main.tf | Updates signing job inputs and S3 ZIP wiring to accept external artifacts. |
| ak-deployment/ak-aws/containerized/variables.tf | Adds ecr_image_uri and makes package_path conditional. |
| ak-deployment/ak-aws/containerized/state.tf | Skips local image build when external ecr_image_uri is provided; resolves effective image URI. |
| ak-deployment/ak-aws/containerized/README.md | Documents external ECR image usage and updates variable table. |
| ak-deployment/ak-aws/containerized/ecs.tf | Switches ECS task image reference to resolved local.ecr_image_uri. |
| ak-deployment/ak-aws/common/modules/lambda-package/outputs.tf | Exposes S3 bucket/key/version outputs for uploaded Lambda packages. |
| .github/integration-test-config.yaml | Minor comment change in the weekly matrix configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
379
to
+383
| validation { | ||
| condition = !var.queue_mode || try(var.response_handler.package_path, null) != null | ||
| error_message = "response_handler.package_path must be set when queue_mode is true." | ||
| condition = (!var.queue_mode || var.response_handler.package_type != "S3Zip" || try(var.response_handler.package_path, null) != null || try(var.response_handler.lambda_package_s3, null) != null) | ||
| error_message = "response_handler: when queue_mode is true and package_type is S3Zip, at least one of package_path or lambda_package_s3 must be set." | ||
| } | ||
| validation { |
| } | ||
|
|
||
| module "response_handler_docker_image" { | ||
| count = var.queue_mode && var.response_handler.package_type == "Image" ? 1 : 0 |
Comment on lines
+448
to
+450
| source_bucket = local.shared_source_bucket | ||
| source_key = try(module.request_handler_source_package[0].s3_key, null) | ||
| source_version_id = try(module.request_handler_source_package[0].s3_object_version, null) |
Comment on lines
+5
to
+15
| request_handler_lambda_package_s3 = { | ||
| bucket = "lambda-s3-packages-329597159169-ap-southeast-2-an" | ||
| key = "dist_request_handler.zip" | ||
| } | ||
|
|
||
| response_handler_lambda_package_s3 = { | ||
| bucket = "lambda-s3-packages-329597159169-ap-southeast-2-an" | ||
| key = "dist_response_handler.zip" | ||
| } | ||
|
|
||
| agent_runner_ecr_image_uri = "329597159169.dkr.ecr.ap-southeast-2.amazonaws.com/agent-runner-ext:latest" |
| env_alias = "dev" | ||
| module_name = "examples" No newline at end of file | ||
| module_name = "examples" | ||
| ecr_image_uri = "329597159169.dkr.ecr.ap-southeast-2.amazonaws.com/openai-dynamodb-ext:latest" No newline at end of file |
Comment on lines
2
to
+6
| set -e # exit if any command in this script fails | ||
| S3_BUCKET=lambda-s3-packages-329597159169-ap-southeast-2-an | ||
| upload_to_s3() { | ||
| aws s3 cp $1 s3://${2}/ | ||
| } |
|
|
||
| push_to_ecr() { | ||
| AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | ||
| AWS_REGION="ap-southeast-2" |
| deploy_dir: deploy | ||
|
|
||
| # Memory options | ||
| # # Memory options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Related Issues
Fixes #
Relates to #
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes