# AWS CodeConnections

AWS CodeConnections provides managed connections between AWS developer services and supported external Git repositories.

Cloud service · AWS. Updated 2026-11-12. Page: https://blowstack.com/tools/cloud-services-hub/aws-codeconnections

> AWS CodeConnections lets services such as AWS CodePipeline and AWS CodeBuild access repositories hosted by supported providers, including GitHub, GitLab, and Bitbucket Cloud. It manages the connection and authorization relationship, supports supported self-managed provider installations through host resources, and supplies repository synchronization capabilities for supported AWS workflows.

Practice exams covering AWS CodeConnections: [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [MLA-C02 (beta) AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate).

## 8 key features of AWS CodeConnections

1. **Managed repository connections**: Create reusable connection resources for supported Git providers instead of configuring separate repository credentials in every consuming workflow. AWS services reference the connection ARN to request authorized repository access.
2. **Provider-side authorization**: Connect AWS resources to provider installations or authorization flows with explicitly granted repository access. Complete the provider authorization step and confirm that the connection is available before enabling dependent workflows.
3. **CodePipeline source integration**: Use a connection-backed source action to retrieve repository content for a delivery pipeline. Configure repository, branch, output format, and supported trigger settings in CodePipeline rather than treating these as properties of the connection itself.
4. **CodeBuild source access**: Use supported CodeConnections integrations to authorize CodeBuild access to external source repositories. Grant the build service role the required connection permissions and configure build triggers separately where supported.
5. **Self-managed provider hosts**: Represent supported self-managed Git provider installations with host resources. Configure the network connectivity and certificate settings required for AWS to reach the installation.
6. **Repository synchronization resources**: Repository links and synchronization configurations connect repository content to supported AWS synchronization workflows. Use these resources for scenarios such as CloudFormation Git sync, where repository changes drive infrastructure updates.
7. **IAM-controlled administration and use**: Separate permissions to create or manage connections from permissions to use an existing connection. Scope consuming-service permissions to the required connection resources and follow the relevant integration's IAM requirements.
8. **Administrative audit visibility**: Use AWS CloudTrail to investigate supported CodeConnections API activity, including connection and host administration. Combine these records with consuming-service logs and provider audit information when diagnosing access changes.

## Where AWS CodeConnections is used

1. **External Git source for continuous delivery**: Connect a GitHub, GitLab, or Bitbucket Cloud repository to a supported CodePipeline source action. For example, start a build-and-deploy pipeline when changes arrive on the configured application branch.
2. **Build projects with managed repository authorization**: Authorize CodeBuild source access through a supported connection rather than distributing individual developer credentials. Use separate build roles and narrowly scoped provider repository permissions for different applications.
3. **Infrastructure changes driven by Git**: Use CloudFormation Git sync with a supported provider to manage stack deployment inputs and templates from a repository. Review infrastructure changes through pull requests before merging them into the branch watched by the synchronization configuration.
4. **Delivery from self-managed Git installations**: Connect a supported GitHub Enterprise Server or GitLab self-managed installation to compatible AWS delivery services. Establish the required host resource and network path before wiring the connection into production pipelines.
5. **Controlled repository onboarding**: Let platform administrators manage provider authorization while application teams receive permission to use approved connections. This separates repository integration administration from routine pipeline and build configuration.

## How AWS CodeConnections is priced

- **No additional CodeConnections service charge**: AWS CodeConnections has no additional charge for creating and using connections. Charges for the AWS services that consume those connections remain separate.
- **Associated service and infrastructure charges**: Budget for services such as CodePipeline, CodeBuild, artifact storage, and deployed resources according to their own pricing. Provider subscriptions and any chargeable networking components used to reach self-managed installations are also separate costs.

## Services AWS CodeConnections works with

A typical delivery architecture uses CodeConnections for repository authorization, CodePipeline for orchestration, and CodeBuild for compilation and testing. The pipeline source action references a connection ARN and selects the repository and branch. It can deliver a source artifact to downstream stages or, for supported configurations, provide full-clone information that CodeBuild uses to access Git history. The IAM roles involved must have the permissions required for their particular source mode.

For infrastructure workflows, CloudFormation Git sync uses a connection together with repository linking and synchronization configuration. Teams keep templates and deployment inputs in Git, review changes through pull requests, and let the configured synchronization workflow update the target stack. Connection authorization, synchronization permissions, and CloudFormation deployment permissions are distinct concerns that should be validated separately.

Self-managed provider architectures add host configuration and, where required, VPC connectivity. Diagnose network and certificate issues independently of repository permissions. Across these patterns, IAM limits administrative and runtime access, while CloudTrail provides administrative audit evidence. Combine AWS audit records with build logs, pipeline execution details, and provider audit events to troubleshoot failures across the integration boundary.

- **[AWS CodePipeline](https://blowstack.com/tools/cloud-services-hub/aws-codepipeline)**: CodePipeline uses CodeConnections through its connection-backed source action, whose action provider identifier retains the name CodeStarSourceConnection. For example, configure a GitHub repository and branch as the source, then pass the resulting source artifact to a build stage. Grant the pipeline service role permission to use the connection and configure supported event triggers in the pipeline.
- **[AWS CodeBuild](https://blowstack.com/tools/cloud-services-hub/aws-codebuild)**: CodeBuild supports CodeConnections-based source authorization for supported repository providers. For example, a build project can use an authorized GitLab connection to retrieve application source before running tests. When using CodePipeline's full-clone source output, the downstream CodeBuild role also needs the appropriate connection permissions to access the repository.
- **[AWS CloudFormation](https://blowstack.com/tools/cloud-services-hub/aws-cloudformation)**: CloudFormation Git sync uses CodeConnections to access supported repositories containing stack templates and deployment configuration. For example, merging an approved change to a watched branch can cause a stack update using repository-managed inputs. CloudFormation can also provision connection resources, but newly created connections generally require provider authorization before use.
- **[AWS CloudTrail](https://blowstack.com/tools/cloud-services-hub/aws-cloudtrail)**: CloudTrail records supported CodeConnections API activity for auditing and investigation. For example, inspect administrative events when a previously working repository integration fails after an authorization or configuration change. Correlate these events with pipeline execution details and provider-side audit records rather than expecting CloudTrail to contain complete Git operation logs.
- **[Amazon VPC](https://blowstack.com/tools/cloud-services-hub/amazon-vpc)**: Supported self-managed provider hosts can use VPC configuration to reach repository installations on private networks. For example, configure appropriate subnets and security groups for a privately reachable GitHub Enterprise Server host. Validate routing, DNS, TLS trust, and provider-specific connectivity requirements before enabling dependent source actions.
- **[Amazon CodeGuru](https://blowstack.com/tools/cloud-services-hub/amazon-codeguru)**: AWS CodeConnections connects supported third-party repositories to Amazon CodeGuru Reviewer so it can analyze source code and provide review recommendations.
- **[Amazon Q](https://blowstack.com/tools/cloud-services-hub/amazon-q)**: AWS CodeConnections gives Amazon Q Developer access to supported external repositories for code customizations. These customizations let Q Developer tailor suggestions to an organization's internal libraries and coding practices.
- **[Amazon SageMaker](https://blowstack.com/tools/cloud-services-hub/amazon-sagemaker)**: AWS CodeConnections connects external Git repositories to Amazon SageMaker workflows that support connections, including repository integration for MLOps projects.
- **[Amazon EventBridge](https://blowstack.com/tools/cloud-services-hub/amazon-eventbridge)**: AWS CodeConnections publishes Git sync status-change events to Amazon EventBridge. EventBridge rules can react to repository or resource synchronization failures, for example by routing an event to a notification or remediation workflow.
- **[AWS App Runner](https://blowstack.com/tools/cloud-services-hub/aws-app-runner)**: AWS CodeConnections authorizes AWS App Runner to access a source-code repository. App Runner can build and deploy an application from that repository and automatically deploy new commits when automatic deployments are enabled.
- **[AWS Identity and Access Management (IAM)](https://blowstack.com/tools/cloud-services-hub/aws-identity-and-access-management-(iam))**: AWS CodeConnections uses IAM policies to control who can create, manage, and use connections. Service roles can receive permission to use a particular connection ARN, allowing a pipeline to access its configured repository without giving users broader connection access.
- **[AWS PrivateLink](https://blowstack.com/tools/cloud-services-hub/aws-privatelink)**: AWS CodeConnections supports interface VPC endpoints through AWS PrivateLink, allowing supported API requests to reach the service privately without traversing the public internet.
- **[AWS Resource Access Manager (AWS RAM)](https://blowstack.com/tools/cloud-services-hub/aws-resource-access-manager-(aws-ram))**: AWS CodeConnections connections can be shared with other AWS accounts through AWS RAM. This lets authorized consumers use a centrally managed repository connection rather than establish separate connections in each account.
- **[AWS Service Catalog](https://blowstack.com/tools/cloud-services-hub/aws-service-catalog)**: AWS CodeConnections links AWS Service Catalog products to template files in external repositories. Service Catalog can synchronize changes from the configured repository and branch into new provisioning artifact versions.

## AWS CodeConnections exam questions

Real practice exam questions on AWS CodeConnections, with the correct answer and its explanation.

### Question 1 (MLA-C02 (beta))

**Question:**

An ML engineering team uses AWS CodePipeline to release inference application updates from a private GitHub repository. The source action uses an AWS CodeConnections connection whose status is AVAILABLE. The team creates a second pipeline for a new private repository in the same GitHub organization and reuses the connection. The new pipeline's source action fails because it cannot access the repository, but the original pipeline still succeeds. An engineer verifies that the new repository name and branch are correct and that the new pipeline's service role allows codeconnections:UseConnection on the connection ARN with no applicable denies. What should the engineer do to resolve the failure?

**Correct answer:** Update the GitHub App installation associated with the connection to grant access to the new repository, and then retry the pipeline.

**Explanation:** An AVAILABLE connection can still be restricted to selected repositories by its GitHub App installation. The working original pipeline and verified AWS permissions point to missing provider-side access for the new repository. Granting that installation access allows the existing connection to be reused.

### Question 2 (DOP-C02)

**Question:**

A company stores several applications in a GitHub monorepo. An AWS CodePipeline pipeline uses an authorized AWS CodeConnections connection to retrieve the repository. The company wants the pipeline to deploy its payments application to a release-validation environment whenever a push to any release/* branch changes at least one file under services/payments/ other than files under services/payments/docs/. Pushes to other branches, documentation-only changes, and pull-request events must not start the pipeline. Direct pushes and merge-generated pushes to release/* branches must both qualify. The company wants to use native pipeline trigger configuration without custom event-processing code.

Which configuration meets these requirements?

**Correct answer:** Use a V2 pipeline with a connection-backed source trigger containing one push filter object. In that object, include branches matching release/*, include file paths matching services/payments/**, and exclude file paths matching services/payments/docs/**. Do not configure pull-request filters.

**Explanation:** Within one push filter object, the branch and file-path conditions must both match. The file-path inclusion limits qualifying changes to the payments application, and the exclusion prevents documentation files from satisfying that condition. A mixed push that includes a non-documentation payments file still qualifies. The push trigger covers both direct pushes and pushes resulting from merges, without subscribing to pull-request events. These configurable connection-backed triggers require a V2 pipeline.

### Question 3 (DVA-C02)

**Question:**

A developer uses AWS CloudFormation to create an AWS CodePipeline pipeline for a private repository on GitHub.com. The pipeline has build, test, and deployment stages. Its source action references an AWS CodeConnections connection and is configured for the correct repository and main branch, with automatic change detection enabled. The pipeline service role has permission to use the connection. However, pushing a commit to main does not start the pipeline, and a manual execution fails at the source action. The connection status is PENDING. What should the developer do to enable commit-triggered pipeline executions?

**Correct answer:** Open the pending connection in the AWS console and complete GitHub App authorization for the repository. Verify that the connection becomes AVAILABLE.

**Explanation:** Connections created through CloudFormation initially remain PENDING until provider authorization is completed. Authorizing the GitHub App with access to the repository makes the connection available. With the existing source configuration and IAM permissions, repository pushes can then trigger the pipeline.

## Practice AWS CodeConnections in a full exam

Questions on AWS CodeConnections in each practice exam, with every answer option and an explanation for each:

- [MLA-C02 (beta)](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 2 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 2 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 2 questions

## What is AWS CodeConnections

AWS CodeConnections is the connection layer between supported Git providers and AWS services that consume repository content or repository events. Instead of placing a developer's personal access token directly into each delivery workflow, engineers create a connection, authorize access at the repository provider, and give an AWS service permission to use that connection. The connection is represented by an Amazon Resource Name, or ARN, which consuming services reference in their configuration.

The default quota is 250 connections per AWS account per AWS Region, and this quota can be increased.

A connection has both AWS-side configuration and provider-side authorization. Creating the AWS resource alone does not necessarily make it usable: connections created through an API or infrastructure-as-code workflow typically remain pending until an administrator completes the provider authorization process. For GitHub, this involves authorizing the appropriate GitHub App installation and repository access. Treat authorization completion and verification of the available connection status as explicit deployment prerequisites rather than assuming that successful resource creation means the integration is ready.

In a common delivery architecture, AWS CodePipeline uses a connection-backed source action to obtain a selected repository and branch. Repository events can initiate pipeline executions, while source action configuration determines how repository content is passed to downstream actions. AWS CodeBuild can also use supported connections for source access. Engineers should distinguish a connection's provider permissions from the AWS IAM permissions granted to the consuming service: both must allow the intended operation.

When specifying a resource in an IAM policy, the service prefix must match the resource's prefix: `codeconnections` or `codestar-connections`. Actions and resources under both prefixes remain available.

For supported self-managed providers, CodeConnections uses a host resource to represent the provider installation. Depending on the provider and deployment, host configuration can include VPC connectivity, security groups, subnets, and certificate information. Validate DNS resolution, network reachability, and provider-specific prerequisites before troubleshooting the pipeline itself. Support differs by provider, AWS Region, and consuming service, so a provider supported by CodeConnections is not automatically supported in every downstream workflow.

The maximum number of hosts per AWS account is 50; this quota is fixed and cannot be increased.

CodeConnections also supports repository links and synchronization configurations for supported Git synchronization scenarios. For example, AWS CloudFormation Git sync can monitor repository-managed deployment files and templates and use changes to update a stack. These resources describe the repository relationship and synchronization target; they are separate from the connection that supplies authorization.

Operationally, apply least-privilege IAM permissions to connection administration and use, restrict provider installations to necessary repositories, and record administrative API activity with AWS CloudTrail. When diagnosing failures, check connection status, provider installation permissions, repository and branch identifiers, consuming-service role permissions, and any host networking requirements. AWS CodeConnections was previously named AWS CodeStar Connections, so older resource names, ARNs, policy examples, and integration identifiers may retain the earlier terminology. Preserve the correct identifiers for existing resources rather than assuming a rename requires resource replacement.

## Learn AWS CodeConnections in lessons

2 short lessons on AWS CodeConnections in 2 certification courses.

- MLA-C02 (beta): AWS CodeConnections: authorizing repository access (Premium), https://app.blowstack.com/lessons/aws-codeconnections-authorizing-repository-access-mla-c02
- DOP-C02: AWS CodeConnections: authorized repository access for pipelines (Premium), https://app.blowstack.com/lessons/aws-codeconnections-authorized-repository-access-for-pipelines-dop-c02

## Concepts related to AWS CodeConnections

- [Gitflow](https://blowstack.com/tools/cloud-concepts-hub/gitflow): Gitflow is a Git branching workflow that separates ongoing development, release preparation, and production fixes using branches with defined roles.
- [Trunk-Based Development](https://blowstack.com/tools/cloud-concepts-hub/trunk-based-development): Trunk-Based Development is a version-control strategy in which developers integrate small changes frequently into a single shared main branch, using direct commits or short-lived branches.
