Cloud service · AWS · Updated

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

In short

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.

Cloud Services Hub →

8 key features of AWS CodeConnections

01
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.

02
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.

03
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.

04
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.

05
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.

06
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.

07
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.

08
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. 01
    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. 02
    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. 03
    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. 04
    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. 05
    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 CodePipelineAWS 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 CodeBuildAWS 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 CloudFormationAWS 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 CloudTrailAWS 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 VPCAmazon 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 CodeGuruAmazon CodeGuru

AWS CodeConnections connects supported third-party repositories to Amazon CodeGuru Reviewer so it can analyze source code and provide review recommendations.

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 SageMakerAmazon SageMaker

AWS CodeConnections connects external Git repositories to Amazon SageMaker workflows that support connections, including repository integration for MLOps projects.

Amazon EventBridgeAmazon 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 RunnerAWS 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 CodeConnections exam questions

Real practice exam questions on AWS CodeConnections, with the correct answer and its explanation. Answer them with every option in the exam simulator.

MLA-C02 (beta)

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?

Show answerCORRECT ANSWER

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

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.

DOP-C02

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?

Show answerCORRECT 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.

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.

DVA-C02

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?

Show answerCORRECT ANSWER

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

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:

Start a free practice exam

What is AWS CodeConnections

2 min read

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.

Open the lessons

Concepts related to AWS CodeConnections

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.