AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::CodeCommit::Repository

CfnRepository

Creates a new, empty repository. > AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal. [Learn more"](https://docs.aws.amazon.com/devops/how-to-migrate-your-aws-codecommit-repository-to-another-git-provider)

Import

import { CfnRepository } from 'aws-cdk-lib/aws-codecommit';

Or use the module namespace:

import * as codecommit from 'aws-cdk-lib/aws-codecommit';
// codecommit.CfnRepository

Properties

Configuration passed to the constructor as CfnRepositoryProps.

repositoryNameRequired
string

The name of the new repository to be created. > The repository name must be unique across the calling AWS account . Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see [Quotas](https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) in the *AWS CodeCommit User Guide* . The suffix .git is prohibited.

codeOptional
IResolvable | CodeProperty

Information about code to be committed to a repository after it is created in an AWS CloudFormation stack. Information about code is only used in resource creation. Updates to a stack will not reflect changes made to code properties after initial resource creation. > You can only use this property to add code when creating a repository with a CloudFormation template at creation time. This property cannot be used for updating code to an existing repository.

kmsKeyIdOptional
string

The ID of the AWS Key Management Service encryption key used to encrypt and decrypt the repository. > The input can be the full ARN, the key ID, or the key alias. For more information, see [Finding the key ID and key ARN](https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html) .

repositoryDescriptionOptional
string

A comment or description about the new repository. > The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.

tagsOptional
CfnTag[]

One or more tag key-value pairs to use when tagging this repository.

triggersOptional
IResolvable | IResolvable | RepositoryTriggerProperty[]

The JSON block of configuration information for each trigger.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-codecommit
CFN TypeAWS::CodeCommit::Repository
Properties6

Related Constructs

External Links