Skip to content
v2.277.0

CodeConfig Struct ​

Represents the structure to pass into the underlying CfnRepository class.

Example ​

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 codeConfig: codecommit.CodeConfig = {
  code: {
    s3: {
      bucket: 'bucket',
      key: 'key',

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

    // the properties below are optional
    branchName: 'branchName',
  },
};
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_config = codecommit.CodeConfig(
    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"
    )
)
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.*;

CodeConfig codeConfig = CodeConfig.builder()
        .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())
        .build();
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 codeConfig = new CodeConfig {
    Code = new CodeProperty {
        S3 = new S3Property {
            Bucket = "bucket",
            Key = "key",

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

        // the properties below are optional
        BranchName = "branchName"
    }
};
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"

codeConfig := &CodeConfig{
	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"),
	},
}

Properties ​

represents the underlying code structure.