# CodeProperty

Information about code to be committed.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 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 codeProperty: codecommit.CfnRepository.CodeProperty = {
  s3: {
    bucket: 'bucket',
    key: 'key',

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

  // the properties below are optional
  branchName: 'branchName',
};
```

Python:

```python
# 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

code_property = 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"
)
```

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.*;

CodeProperty codeProperty = 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();
```

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 codeProperty = new CodeProperty {
    S3 = new S3Property {
        Bucket = "bucket",
        Key = "key",

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

    // the properties below are optional
    BranchName = "branchName"
};
```

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"

codeProperty := &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"),
}
```

## Properties

- `branchName`: string — Optional.

  Specifies a branch name to be used as the default branch when importing code into a repository on initial creation. If this property is not set, the name *main* will be used for the default branch for the repository. Changes to this property are ignored after initial resource creation. We recommend using this parameter to set the name to *main* to align with the default behavior of CodeCommit unless another name is needed.

- `s3`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnRepository.S3Property](/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.CfnRepository.S3Property.html) (required) — Information about the Amazon S3 bucket that contains a ZIP file of code to be committed to the repository.

  Changes to this property are ignored after initial resource creation.
