[SEO Subhead]
This Guidance demonstrates how to aggregate public, open-source code repositories into a central location to customize Amazon Q Developer. It provides a blueprint to create a new repository that is preconfigured with source code and a workflow to deploy into an AWS account. Each repository is checked for open-source providers (such as GitHub) for a new release. If a new release is available, a subsequent task is launched within a customer-managed virtual private cloud (VPC). It uses an image of the repository, downloads, and extracts the release archive into a storage bucket. The task updates the repository and a notification is sent. An Amazon Q customization can be trained using the repository archives, allowing developers to use AI-generated code suited to their coding language and style.
Please note: [Disclaimer]
Architecture Diagram

[Architecture diagram description]
Step 1
Initialize a new project in Amazon CodeCatalyst with this blueprint to create a new Git repository. It is preconfigured with the source code and a workflow to deploy to an AWS account environment.
Step 2
All changes in the Git repository invoke a workflow which builds and deploys all infrastructure-as-code (IaC) related to the architecture, using an AWS Cloud Development Kit (AWS CDK), which includes a command line interface (CLI) tool for working with your AWS CDK apps and stacks.
Step 3
An AWS Lambda trigger function examines which repositories should be included in the archival process, and updates metadata in the Amazon DynamoDB repository table.
Step 4
An Amazon EventBridge rule invokes an AWS Step Functions state machine to process on a regular interval.
Step 5
A Lambda function scans the repository table in DynamoDB for enabled repositories, and starts a parallel process for each repository using a Map state.
Step 6
For each repository in the Map state, a Lambda function checks open-source providers (such as GitHub) for a new release. If a new release is available, a subsequent AWS Fargate task is launched within a customer-managed virtual private cloud (VPC).
It uses an image from Amazon Elastic Container Registry (Amazon ECR), downloads, and extracts the release archive in an Amazon Simple Storage Service (Amazon S3) bucket. The task updates the repository table in DynamoDB. A message is also published to an Amazon Simple Notification Service (Amazon SNS) topic.
Step 7
An Amazon Q Developer customization can be trained using the repository archives in Amazon S3, allowing developers to use AI-generated code suited to their coding language and style.
Well-Architected Pillars

The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
The goal of operational excellence is to get new features and bug fixes into your hands quickly and reliably. EventBridge, Step Functions, Amazon SNS, and Lambda do this by helping you automate the process of downloading or extracting repository releases when available, and alerting you when a new version of an Amazon Q customization can be trained. An EventBridge rule and a Step Functions workflow automatically check for new repository versions on a schedule, whereas the Lambda functions synchronize repository metadata. Finally, messages are published to an Amazon SNS topic for operational notifications.
-
Security
AWS Identity and Access Management (IAM) is used to define roles and permission policies for resources deployed in this solution, and Amazon S3 is configured with policies to restrict access to outside entities. Roles and policies defined within IAM and Amazon S3 are critical for implementing least-privilege access, and limiting access to only what is needed.
-
Reliability
Step Functions has features like automated retries, error handling, and fault tolerance for minimizing failures. It also can help limit re-processing that can degrade performance. These capabilities minimize the likelihood and impact of disruptions, enhancing the overall resiliency of workflow orchestration.
-
Performance Efficiency
The Map state feature in Step Functions allows you to process steps concurrently instead of sequentially, significantly increasing throughput and performance for workloads that can be done in parallel. This enables faster processing time by doing multiple tasks at once, and as the list of repositories scales, the time it takes to process all repositories remains static.
-
Cost Optimization
By using Fargate and Lambda to complete on-demand tasks, you can achieve significant cost efficiencies compared to self-managed Amazon Elastic Compute Cloud (Amazon EC2) deployments that accrue costs when idle. Fargate enables a serverless model with auto-scaling to reduce over-provisioning and minimize idle resources. With Lambda, you only pay for compute time when your functions execute. No need to provision and pay for Amazon EC2 instances that may be underutilized. With these serverless options, you can save significantly compared to traditional servers or virtual machines.
-
Sustainability
Both Fargate and Lambda are serverless, auto-scaling services that right-size usage to workload needs. This eliminates over-provisioning and idle resources, which reduces energy usage. The serverless auto-scaling nature, ephemeral infrastructure, and managed provider sustainability efforts of Lambda and Fargate help you to reduce waste, maximize utilization, and minimize the overall environmental footprint of your workloads.
Implementation Resources

The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
Related Content

[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.