# CfnRepositoryProps

Properties for defining a `CfnRepository`.

Used as props by: [CfnRepository](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.CfnRepository.html)

- Source: Generated at build time
- Type last changed: v2.117.0 · 27 Dec 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codecommit as codecommit } from 'aws-cdk-lib';
const cfnRepositoryProps: codecommit.CfnRepositoryProps = {
  repositoryName: 'repositoryName',

  // the properties below are optional
  code: {
    s3: {
      bucket: 'bucket',
      key: 'key',

      // the properties below are optional
      objectVersion: 'objectVersion',
    },

    // the properties below are optional
    branchName: 'branchName',
  },
  kmsKeyId: 'kmsKeyId',
  repositoryDescription: 'repositoryDescription',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  triggers: [{
    destinationArn: 'destinationArn',
    events: ['events'],
    name: 'name',

    // the properties below are optional
    branches: ['branches'],
    customData: 'customData',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codecommit as codecommit

cfn_repository_props = codecommit.CfnRepositoryProps(
    repository_name="repositoryName",

    # the properties below are optional
    code=codecommit.CfnRepository.CodeProperty(
        s3=codecommit.CfnRepository.S3Property(
            bucket="bucket",
            key="key",

            # the properties below are optional
            object_version="objectVersion"
        ),

        # the properties below are optional
        branch_name="branchName"
    ),
    kms_key_id="kmsKeyId",
    repository_description="repositoryDescription",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    triggers=[codecommit.CfnRepository.RepositoryTriggerProperty(
        destination_arn="destinationArn",
        events=["events"],
        name="name",

        # the properties below are optional
        branches=["branches"],
        custom_data="customData"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codecommit.*;

CfnRepositoryProps cfnRepositoryProps = CfnRepositoryProps.builder()
        .repositoryName("repositoryName")

        // the properties below are optional
        .code(CodeProperty.builder()
                .s3(S3Property.builder()
                        .bucket("bucket")
                        .key("key")

                        // the properties below are optional
                        .objectVersion("objectVersion")
                        .build())

                // the properties below are optional
                .branchName("branchName")
                .build())
        .kmsKeyId("kmsKeyId")
        .repositoryDescription("repositoryDescription")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .triggers(List.of(RepositoryTriggerProperty.builder()
                .destinationArn("destinationArn")
                .events(List.of("events"))
                .name("name")

                // the properties below are optional
                .branches(List.of("branches"))
                .customData("customData")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeCommit;

var cfnRepositoryProps = new CfnRepositoryProps {
    RepositoryName = "repositoryName",

    // the properties below are optional
    Code = new CodeProperty {
        S3 = new S3Property {
            Bucket = "bucket",
            Key = "key",

            // the properties below are optional
            ObjectVersion = "objectVersion"
        },

        // the properties below are optional
        BranchName = "branchName"
    },
    KmsKeyId = "kmsKeyId",
    RepositoryDescription = "repositoryDescription",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Triggers = new [] { new RepositoryTriggerProperty {
        DestinationArn = "destinationArn",
        Events = new [] { "events" },
        Name = "name",

        // the properties below are optional
        Branches = new [] { "branches" },
        CustomData = "customData"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnRepositoryProps := &CfnRepositoryProps{
	RepositoryName: jsii.String("repositoryName"),

	// the properties below are optional
	Code: &CodeProperty{
		S3: &S3Property{
			Bucket: jsii.String("bucket"),
			Key: jsii.String("key"),

			// the properties below are optional
			ObjectVersion: jsii.String("objectVersion"),
		},

		// the properties below are optional
		BranchName: jsii.String("branchName"),
	},
	KmsKeyId: jsii.String("kmsKeyId"),
	RepositoryDescription: jsii.String("repositoryDescription"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Triggers: []interface{}{
		&RepositoryTriggerProperty{
			DestinationArn: jsii.String("destinationArn"),
			Events: []*string{
				jsii.String("events"),
			},
			Name: jsii.String("name"),

			// the properties below are optional
			Branches: []*string{
				jsii.String("branches"),
			},
			CustomData: jsii.String("customData"),
		},
	},
}
```

## Properties

- `code`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnRepository.CodeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.CfnRepository.CodeProperty.html) — 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.

- `kmsKeyId`: 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) .

- `repositoryDescription`: 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.

- `repositoryName`: string (required) — 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.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — One or more tag key-value pairs to use when tagging this repository.

- `triggers`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnRepository.RepositoryTriggerProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.CfnRepository.RepositoryTriggerProperty.html)[] — The JSON block of configuration information for each trigger.
