AWS CloudFormation
User Guide (Version )

AWS::CodeCommit::Repository

Creates a new, empty repository.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CodeCommit::Repository", "Properties" : { "Code" : Code, "RepositoryDescription" : String, "RepositoryName" : String, "Triggers" : [ RepositoryTrigger, ... ] } }

YAML

Type: AWS::CodeCommit::Repository Properties: Code: Code RepositoryDescription: String RepositoryName: String Triggers: - RepositoryTrigger

Properties

Code

Information about code to be committed to a repository after it is created in an AWS CloudFormation stack.

Required: No

Type: Code

Update requires: No interruption

RepositoryDescription

A comment or description about the new repository.

Note

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 web page could 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 web page.

Required: No

Type: String

Maximum: 1000

Update requires: No interruption

RepositoryName

The name of the new repository to be created.

Note

The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide. The suffix ".git" is prohibited.

Required: Yes

Type: String

Minimum: 1

Maximum: 100

Pattern: [\w\.-]+

Update requires: No interruption

Triggers

The JSON block of configuration information for each trigger.

Required: No

Type: List of RepositoryTrigger

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the repository ID.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (ARN) of the repository.

CloneUrlHttp

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the URL to use for cloning the repository over HTTPS.

CloneUrlSsh

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the URL to use for cloning the repository over SSH.

Name

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the repository's name.

Examples

Example

The following example creates a CodeCommit repository with a trigger for all events in the Master branch.

JSON

{ "MyRepo": { "Type": "AWS: : CodeCommit: : Repository", "Properties": { "RepositoryName": "MyRepoName", "RepositoryDescription": "a description", "Triggers": [ { "Name": "MasterTrigger", "CustomData": "Project ID 12345", "DestinationArn": { "Ref": "SNSarn" }, "Branches": [ "Master" ], "Events": [ "all" ] } ] } } }

YAML

MyRepo: Type: AWS::CodeCommit::Repository Properties: RepositoryName: MyRepoName RepositoryDescription: a description Triggers: - Name: MasterTrigger CustomData: Project ID 12345 DestinationArn: Ref: SNSarn Branches: - Master Events: - all