Skip to content

Ak-128#304

Open
yl-nuwan wants to merge 11 commits into
developfrom
AK-128
Open

Ak-128#304
yl-nuwan wants to merge 11 commits into
developfrom
AK-128

Conversation

@yl-nuwan
Copy link
Copy Markdown
Contributor

@yl-nuwan yl-nuwan commented Jun 3, 2026

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update
  • CI/CD update
  • Other (please describe):

Related Issues

Fixes #
Relates to #

Changes Made

Testing

  • Unit tests pass locally
  • Integration tests pass locally
  • Manual testing completed
  • New tests added for changes

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

yl-nuwan added 11 commits June 2, 2026 17:34
…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.
@yl-nuwan yl-nuwan requested review from amithad and lakindu-yl June 3, 2026 07:47
@yl-nuwan yl-nuwan self-assigned this Jun 3, 2026
@yl-nuwan yl-nuwan marked this pull request as ready for review June 5, 2026 07:37
@amithad amithad requested a review from Copilot June 5, 2026 11:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 S3Zip deployments via an explicit { bucket, key } reference and for Image deployments via an explicit ecr_image_uri, plus shared S3 source-bucket handling.
  • Add support in the containerized module for using an external ecr_image_uri and 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
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.

2 participants