CodePipelineProps Struct
Properties for a CodePipeline.
Example
declare const codePipeline: codepipeline.Pipeline;
const sourceArtifact = new codepipeline.Artifact('MySourceArtifact');
const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
codePipeline: codePipeline,
synth: new pipelines.ShellStep('Synth', {
input: pipelines.CodePipelineFileSet.fromArtifact(sourceArtifact),
commands: ['npm ci', 'npm run build', 'npx cdk synth'],
}),
});
Properties
artifactBucketoptionalIBucketartifact_bucketoptionalIBucketartifactBucketoptionalIBucketArtifactBucketoptionalIBucketArtifactBucketoptionalIBucket#Default: A new S3 bucket will be created.
assetPublishingCodeBuildDefaultsoptionalCodeBuildOptionsasset_publishing_code_build_defaultsoptionalCodeBuildOptionsassetPublishingCodeBuildDefaultsoptionalCodeBuildOptionsAssetPublishingCodeBuildDefaultsoptionalCodeBuildOptionsAssetPublishingCodeBuildDefaultsoptionalCodeBuildOptions#Default: Only codeBuildDefaults are applied
cdkAssetsCliVersionoptionalstringcdk_assets_cli_versionoptionalstrcdkAssetsCliVersionoptionalStringCdkAssetsCliVersionoptionalstringCdkAssetsCliVersionoptional*string#Default: Latest version
notes
If you want to lock the cdk-assets version used in the pipeline, by steps that are automatically generated for you, specify the version here.
We recommend you do not specify this value, as not specifying it always uses the latest CLI version which is backwards compatible with old versions.
cliVersionoptionalstringcli_versionoptionalstrcliVersionoptionalStringCliVersionoptionalstringCliVersionoptional*string#Default: Latest version
notes
If you want to lock the CDK CLI version used in the pipeline, by steps that are automatically generated for you, specify the version here.
We recommend you do not specify this value, as not specifying it always uses the latest CLI version which is backwards compatible with old versions.
If you do specify it, be aware that this version should always be equal to or higher than the version of the CDK framework used by the CDK app, when the CDK commands are run during your pipeline execution. When you change this version, the next time the SelfMutate step runs it will still be using the CLI of the the previous version that was in this property: it will only start using the new version after SelfMutate completes successfully. That means that if you want to update both framework and CLI version, you should update the CLI version first, commit, push and deploy, and only then update the framework version.
codeBuildDefaultsoptionalCodeBuildOptionscode_build_defaultsoptionalCodeBuildOptionscodeBuildDefaultsoptionalCodeBuildOptionsCodeBuildDefaultsoptionalCodeBuildOptionsCodeBuildDefaultsoptionalCodeBuildOptions#Default: All projects run non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0
codePipelineoptionalPipelinecode_pipelineoptionalPipelinecodePipelineoptionalPipelineCodePipelineoptionalPipelineCodePipelineoptionalPipeline#Default: a new underlying pipeline is created.
[disable-awslint:ref-via-interface]
crossAccountKeysoptionalbooleancross_account_keysoptionalboolcrossAccountKeysoptionalBooleanCrossAccountKeysoptionalboolCrossAccountKeysoptional*bool= false#notes
The artifact buckets have to be encrypted to support deploying CDK apps to another account, so if you want to do that or want to have your artifact buckets encrypted, be sure to set this value to true.
Be aware there is a cost associated with maintaining the KMS keys.
crossRegionReplicationBucketsoptional{ [key: string]: IBucket }cross_region_replication_bucketsoptionaltyping.Mapping[str, IBucket]crossRegionReplicationBucketsoptionalMap<String, IBucket>CrossRegionReplicationBucketsoptionalIDictionary<string, IBucket>CrossRegionReplicationBucketsoptional*map[string]IBucket#Default: no cross region replication buckets.
notes
For every Action that you specify targeting a different region than the Pipeline itself, if you don't provide an explicit Bucket for that region using this property, the construct will automatically create a Stack containing an S3 Bucket in that region. Passed directly through to the {@link cp.Pipeline}.
dockerCredentialsoptionalDockerCredential[]docker_credentialsoptionaltyping.List[DockerCredential]dockerCredentialsoptionalList<DockerCredential>DockerCredentialsoptionalDockerCredential[]DockerCredentialsoptional*[]DockerCredential= []#Specify any credentials necessary within the pipeline to build, synth, update, or publish assets.
dockerEnabledForSelfMutationoptionalbooleandocker_enabled_for_self_mutationoptionalbooldockerEnabledForSelfMutationoptionalBooleanDockerEnabledForSelfMutationoptionalboolDockerEnabledForSelfMutationoptional*bool= false#notes
Set this to true if the pipeline itself uses Docker container assets (for example, if you use LinuxBuildImage.fromAsset() as the build image of a CodeBuild step in the pipeline).
You do not need to set it if you build Docker image assets in the application Stages and Stacks that are deployed by this pipeline.
Configures privileged mode for the self-mutation CodeBuild action.
If you are about to turn this on in an already-deployed Pipeline, set the value to true first, commit and allow the pipeline to self-update, and only then use the Docker asset in the pipeline.
dockerEnabledForSynthoptionalbooleandocker_enabled_for_synthoptionalbooldockerEnabledForSynthoptionalBooleanDockerEnabledForSynthoptionalboolDockerEnabledForSynthoptional*bool= false#notes
Set this to true if you are using file assets that require "bundling" anywhere in your application (meaning an asset compilation step will be run with the tools provided by a Docker image), both for the Pipeline stack as well as the application stacks.
A common way to use bundling assets in your application is by using the aws-cdk-lib/aws-lambda-nodejs library.
Configures privileged mode for the synth CodeBuild action.
If you are about to turn this on in an already-deployed Pipeline, set the value to true first, commit and allow the pipeline to self-update, and only then use the bundled asset.
enableKeyRotationoptionalbooleanenable_key_rotationoptionalboolenableKeyRotationoptionalBooleanEnableKeyRotationoptionalboolEnableKeyRotationoptional*bool#Default: false (key rotation is disabled)
By default KMS key rotation is disabled, but will add additional costs when enabled.
executionModeoptionalExecutionModeexecution_modeoptionalExecutionModeexecutionModeoptionalExecutionModeExecutionModeoptionalExecutionModeExecutionModeoptionalExecutionMode= ExecutionMode.SUPERSEDED#QUEUED and PARALLEL require pipelineType: PipelineType.V2.
pipelineNameoptionalstringpipeline_nameoptionalstrpipelineNameoptionalStringPipelineNameoptionalstringPipelineNameoptional*string#Default: Automatically generated
pipelineTypeoptionalPipelineTypepipeline_typeoptionalPipelineTypepipelineTypeoptionalPipelineTypePipelineTypeoptionalPipelineTypePipelineTypeoptionalPipelineType#Default: PipelineType.V2 if the feature flag CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 is true, PipelineType.V1 otherwise
publishAssetsInParalleloptionalbooleanpublish_assets_in_paralleloptionalboolpublishAssetsInParalleloptionalBooleanPublishAssetsInParalleloptionalboolPublishAssetsInParalleloptional*bool= true#notes
If set to false, use one Project per type to publish all assets.
Publishing in parallel improves concurrency and may reduce publishing latency, but may also increase overall provisioning time of the CodeBuild projects.
Experiment and see what value works best for you.
reuseCrossRegionSupportStacksoptionalbooleanreuse_cross_region_support_stacksoptionalboolreuseCrossRegionSupportStacksoptionalBooleanReuseCrossRegionSupportStacksoptionalboolReuseCrossRegionSupportStacksoptional*bool#Default: true (Use the same support stack for all pipelines in App)
Default: A new role is created
selfMutationoptionalbooleanself_mutationoptionalboolselfMutationoptionalBooleanSelfMutationoptionalboolSelfMutationoptional*bool= true#notes
This needs to be set to true to allow the pipeline to reconfigure itself when assets or stages are being added to it, and true is the recommended setting.
You can temporarily set this to false while you are iterating on the pipeline itself and prefer to deploy changes using cdk deploy.
selfMutationCodeBuildDefaultsoptionalCodeBuildOptionsself_mutation_code_build_defaultsoptionalCodeBuildOptionsselfMutationCodeBuildDefaultsoptionalCodeBuildOptionsSelfMutationCodeBuildDefaultsoptionalCodeBuildOptionsSelfMutationCodeBuildDefaultsoptionalCodeBuildOptions#Default: Only codeBuildDefaults are applied
synthIFileSetProducersynthIFileSetProducersynthIFileSetProducerSynthIFileSetProducerSynthIFileSetProducerrequired#notes
The primary output of this step needs to be the cdk.out directory generated by the cdk synth command.
If you use a ShellStep here and you don't configure an output directory, the output directory will automatically be assumed to be cdk.out.
synthCodeBuildDefaultsoptionalCodeBuildOptionssynth_code_build_defaultsoptionalCodeBuildOptionssynthCodeBuildDefaultsoptionalCodeBuildOptionsSynthCodeBuildDefaultsoptionalCodeBuildOptionsSynthCodeBuildDefaultsoptionalCodeBuildOptions#Default: Only codeBuildDefaults are applied
useChangeSetsoptionalbooleanuse_change_setsoptionalbooluseChangeSetsoptionalBooleanUseChangeSetsoptionalboolUseChangeSetsoptional*bool= true#When enabled, creates a "Prepare" and "Execute" action for each stack. Disable to deploy the stack in one pipeline action.
usePipelineRoleForActionsoptionalbooleanuse_pipeline_role_for_actionsoptionalboolusePipelineRoleForActionsoptionalBooleanUsePipelineRoleForActionsoptionalboolUsePipelineRoleForActionsoptional*bool= false#