Skip to content

API Reference

Constructs

PDKPipeline

An extension to CodePipeline which configures sane defaults for a NX Monorepo codebase.

In addition to this, it also creates a CodeCommit repository with automated PR builds and approvals.

Initializers

import software.aws.pdk.pipeline.PDKPipeline;

PDKPipeline.Builder.create(Construct scope, java.lang.String id)
//  .artifactBucket(IBucket)
//  .assetPublishingCodeBuildDefaults(CodeBuildOptions)
//  .cliVersion(java.lang.String)
//  .codeBuildDefaults(CodeBuildOptions)
//  .codePipeline(Pipeline)
//  .crossAccountKeys(java.lang.Boolean)
//  .crossRegionReplicationBuckets(java.util.Map<java.lang.String, IBucket>)
//  .dockerCredentials(java.util.List<DockerCredential>)
//  .dockerEnabledForSelfMutation(java.lang.Boolean)
//  .dockerEnabledForSynth(java.lang.Boolean)
//  .enableKeyRotation(java.lang.Boolean)
//  .pipelineName(java.lang.String)
//  .publishAssetsInParallel(java.lang.Boolean)
//  .reuseCrossRegionSupportStacks(java.lang.Boolean)
//  .role(IRole)
//  .selfMutation(java.lang.Boolean)
//  .selfMutationCodeBuildDefaults(CodeBuildOptions)
//  .synth(IFileSetProducer)
//  .synthCodeBuildDefaults(CodeBuildOptions)
//  .useChangeSets(java.lang.Boolean)
    .primarySynthDirectory(java.lang.String)
    .repositoryName(java.lang.String)
//  .branchNamePrefixes(java.util.List<java.lang.String>)
//  .cdkCommand(java.lang.String)
//  .cdkSrcDir(java.lang.String)
//  .codeCommitRemovalPolicy(RemovalPolicy)
//  .defaultBranchName(java.lang.String)
//  .sonarCodeScannerConfig(SonarCodeScannerConfig)
//  .synthShellStepPartialProps(ShellStepProps)
    .build();
Name Type Description
scope software.constructs.Construct No description.
id java.lang.String No description.
artifactBucket software.amazon.awscdk.services.s3.IBucket An existing S3 Bucket to use for storing the pipeline's artifact.
assetPublishingCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the asset publishing CodeBuild projects.
cliVersion java.lang.String CDK CLI version to use in self-mutation and asset publishing steps.
codeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Customize the CodeBuild projects created for this pipeline.
codePipeline software.amazon.awscdk.services.codepipeline.Pipeline An existing Pipeline to be reused and built upon.
crossAccountKeys java.lang.Boolean Create KMS keys for the artifact buckets, allowing cross-account deployments.
crossRegionReplicationBuckets java.util.Map A map of region to S3 bucket name used for cross-region CodePipeline.
dockerCredentials java.util.List A list of credentials used to authenticate to Docker registries.
dockerEnabledForSelfMutation java.lang.Boolean Enable Docker for the self-mutate step.
dockerEnabledForSynth java.lang.Boolean Enable Docker for the 'synth' step.
enableKeyRotation java.lang.Boolean Enable KMS key rotation for the generated KMS keys.
pipelineName java.lang.String The name of the CodePipeline pipeline.
publishAssetsInParallel java.lang.Boolean Publish assets in multiple CodeBuild projects. If set to false, use one Project per type to publish all assets.
reuseCrossRegionSupportStacks java.lang.Boolean Reuse the same cross region support stack for all pipelines in the App.
role software.amazon.awscdk.services.iam.IRole The IAM role to be assumed by this Pipeline.
selfMutation java.lang.Boolean Whether the pipeline will update itself.
selfMutationCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the self mutation CodeBuild projects.
synth software.amazon.awscdk.pipelines.IFileSetProducer The build step that produces the CDK Cloud Assembly.
synthCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the synthesize CodeBuild projects.
useChangeSets java.lang.Boolean Deploy every stack by creating a change set and executing it.
primarySynthDirectory java.lang.String Output directory for cdk synthesized artifacts i.e: packages/infra/cdk.out.
repositoryName java.lang.String Name of the CodeCommit repository to create.
branchNamePrefixes java.util.List Branch name prefixes Any branches created matching this list of prefixes will create a new pipeline and stack.
cdkCommand java.lang.String CDK command.
cdkSrcDir java.lang.String The directory with cdk.json to run cdk synth from. Set this if you enabled feature branches and cdk.json is not located in the parent directory of primarySynthDirectory.
codeCommitRemovalPolicy software.amazon.awscdk.RemovalPolicy Possible values for a resource's Removal Policy The removal policy controls what happens to the resource if it stops being managed by CloudFormation.
defaultBranchName java.lang.String Branch to trigger the pipeline execution.
sonarCodeScannerConfig SonarCodeScannerConfig Configuration for enabling Sonarqube code scanning on a successful synth.
synthShellStepPartialProps software.amazon.awscdk.pipelines.ShellStepProps PDKPipeline by default assumes a NX Monorepo structure for it's codebase and uses sane defaults for the install and run commands.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

artifactBucketOptional
  • Type: software.amazon.awscdk.services.s3.IBucket
  • Default: A new S3 bucket will be created.

An existing S3 Bucket to use for storing the pipeline's artifact.


assetPublishingCodeBuildDefaultsOptional
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the asset publishing CodeBuild projects.


cliVersionOptional
  • Type: java.lang.String
  • Default: Latest version

CDK CLI version to use in self-mutation and asset publishing steps.

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.


codeBuildDefaultsOptional
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: All projects run non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0

Customize the CodeBuild projects created for this pipeline.


codePipelineOptional
  • Type: software.amazon.awscdk.services.codepipeline.Pipeline
  • Default: a new underlying pipeline is created.

An existing Pipeline to be reused and built upon.

[disable-awslint:ref-via-interface]


crossAccountKeysOptional
  • Type: java.lang.Boolean
  • Default: false

Create KMS keys for the artifact buckets, allowing cross-account deployments.

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
  • Type: java.util.Map
  • Default: no cross region replication buckets.

A map of region to S3 bucket name used for cross-region CodePipeline.

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 }.


dockerCredentialsOptional
  • Type: java.util.List
  • Default: []

A list of credentials used to authenticate to Docker registries.

Specify any credentials necessary within the pipeline to build, synth, update, or publish assets.


dockerEnabledForSelfMutationOptional
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the self-mutate step.

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.


dockerEnabledForSynthOptional
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the 'synth' step.

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.


enableKeyRotationOptional
  • Type: java.lang.Boolean
  • Default: false (key rotation is disabled)

Enable KMS key rotation for the generated KMS keys.

By default KMS key rotation is disabled, but will add additional costs when enabled.


pipelineNameOptional
  • Type: java.lang.String
  • Default: Automatically generated

The name of the CodePipeline pipeline.


publishAssetsInParallelOptional
  • Type: java.lang.Boolean
  • Default: true

Publish assets in multiple CodeBuild projects. 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.


reuseCrossRegionSupportStacksOptional
  • Type: java.lang.Boolean
  • Default: true (Use the same support stack for all pipelines in App)

Reuse the same cross region support stack for all pipelines in the App.


roleOptional
  • Type: software.amazon.awscdk.services.iam.IRole
  • Default: A new role is created

The IAM role to be assumed by this Pipeline.


selfMutationOptional
  • Type: java.lang.Boolean
  • Default: true

Whether the pipeline will update itself.

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.


selfMutationCodeBuildDefaultsOptional
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the self mutation CodeBuild projects.


synthOptional
  • Type: software.amazon.awscdk.pipelines.IFileSetProducer

The build step that produces the CDK Cloud Assembly.

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.


synthCodeBuildDefaultsOptional
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the synthesize CodeBuild projects.


useChangeSetsOptional
  • Type: java.lang.Boolean
  • Default: true

Deploy every stack by creating a change set and executing it.

When enabled, creates a "Prepare" and "Execute" action for each stack. Disable to deploy the stack in one pipeline action.


primarySynthDirectoryRequired
  • Type: java.lang.String

Output directory for cdk synthesized artifacts i.e: packages/infra/cdk.out.


repositoryNameRequired
  • Type: java.lang.String

Name of the CodeCommit repository to create.


branchNamePrefixesOptional
  • Type: java.util.List
  • Default: undefined

Branch name prefixes Any branches created matching this list of prefixes will create a new pipeline and stack.


Example

// Example automatically generated from non-compiling source. May contain errors.
// Disables feature branches (default)
// Disables feature branches (default)
PDKPipeline.Builder.create(this, "PDKPipeline")
        .repositoryName("my-repo")
        .branchNamePrefixes(List.of())
        .build();
cdkCommandOptional
  • Type: java.lang.String
  • Default: 'npx cdk'

CDK command.

Override the command used to call cdk for synth and deploy.


cdkSrcDirOptional
  • Type: java.lang.String
  • Default: The parent directory of primarySynthDirectory

The directory with cdk.json to run cdk synth from. Set this if you enabled feature branches and cdk.json is not located in the parent directory of primarySynthDirectory.


codeCommitRemovalPolicyOptional
  • Type: software.amazon.awscdk.RemovalPolicy

Possible values for a resource's Removal Policy The removal policy controls what happens to the resource if it stops being managed by CloudFormation.


defaultBranchNameOptional
  • Type: java.lang.String
  • Default: mainline

Branch to trigger the pipeline execution.


sonarCodeScannerConfigOptional

Configuration for enabling Sonarqube code scanning on a successful synth.


synthShellStepPartialPropsOptional
  • Type: software.amazon.awscdk.pipelines.ShellStepProps

PDKPipeline by default assumes a NX Monorepo structure for it's codebase and uses sane defaults for the install and run commands.

To override these defaults and/or provide additional inputs, specify env settings, etc you can provide a partial ShellStepProps.


Methods

Name Description
toString Returns a string representation of this construct.
addStage No description.
buildPipeline No description.
suppressCDKViolations No description.

toString
public java.lang.String toString()

Returns a string representation of this construct.

addStage
public StageDeployment addStage(Stage stage)
public StageDeployment addStage(Stage stage, AddStageOpts options)
stageRequired
  • Type: software.amazon.awscdk.Stage

optionsOptional
  • Type: software.amazon.awscdk.pipelines.AddStageOpts

buildPipeline
public void buildPipeline()
suppressCDKViolations
public void suppressCDKViolations()

Static Functions

Name Description
isConstruct Checks if x is a construct.
getBranchPrefix A helper function to create a branch prefix.
isDefaultBranch A helper function to determine if the current branch is the default branch.
normalizeBranchName A helper function to normalize the branch name with only alphanumeric characters and hypens ('-').

isConstruct
import software.aws.pdk.pipeline.PDKPipeline;

PDKPipeline.isConstruct(java.lang.Object x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: java.lang.Object

Any object.


getBranchPrefix
import software.aws.pdk.pipeline.PDKPipeline;

PDKPipeline.getBranchPrefix(),PDKPipeline.getBranchPrefix(IsDefaultBranchProps props)

A helper function to create a branch prefix.

The prefix is empty on the default branch.

propsOptional

? { defaultBranchName? Specify the default branch name without context. node? The current app to fetch defaultBranchName from context. }.


isDefaultBranch
import software.aws.pdk.pipeline.PDKPipeline;

PDKPipeline.isDefaultBranch(),PDKPipeline.isDefaultBranch(IsDefaultBranchProps props)

A helper function to determine if the current branch is the default branch.

If there is no BRANCH environment variable, then assume this is the default branch. Otherwise, check that BRANCH matches the default branch name.

The default branch name is determined in the following priority:

  1. defaultBranchName property
  2. defaultBranchName context
  3. PDKPipeline.defaultBranchName constant
propsOptional

? { defaultBranchName? Specify the default branch name without context. node? The current app to fetch defaultBranchName from context. }.


normalizeBranchName
import software.aws.pdk.pipeline.PDKPipeline;

PDKPipeline.normalizeBranchName(java.lang.String branchName)

A helper function to normalize the branch name with only alphanumeric characters and hypens ('-').

branchNameRequired
  • Type: java.lang.String

The name of the branch to normalize.


Properties

Name Type Description
node software.constructs.Node The tree node.
codePipeline software.amazon.awscdk.pipelines.CodePipeline No description.
codeRepository software.amazon.awscdk.services.codecommit.IRepository No description.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


codePipelineRequired
public CodePipeline getCodePipeline();
  • Type: software.amazon.awscdk.pipelines.CodePipeline

codeRepositoryRequired
public IRepository getCodeRepository();
  • Type: software.amazon.awscdk.services.codecommit.IRepository

Constants

Name Type Description
ALL_BRANCHES java.util.List No description.
defaultBranchName java.lang.String No description.

ALL_BRANCHESRequired
public java.util.List<java.lang.String> getAllBranches();
  • Type: java.util.List

defaultBranchNameRequired
public java.lang.String getDefaultBranchName();
  • Type: java.lang.String

SonarCodeScanner

Initializers

import software.aws.pdk.pipeline.SonarCodeScanner;

SonarCodeScanner.Builder.create(Construct scope, java.lang.String id)
    .sonarqubeAuthorizedGroup(java.lang.String)
    .sonarqubeDefaultProfileOrGateName(java.lang.String)
    .sonarqubeEndpoint(java.lang.String)
    .sonarqubeProjectName(java.lang.String)
//  .cdkOutDir(java.lang.String)
//  .cfnNagIgnorePath(java.lang.String)
//  .excludeGlobsForScan(java.util.List<java.lang.String>)
//  .includeGlobsForScan(java.util.List<java.lang.String>)
//  .preArchiveCommands(java.util.List<java.lang.String>)
//  .sonarqubeSpecificProfileOrGateName(java.lang.String)
//  .sonarqubeTags(java.util.List<java.lang.String>)
    .artifactBucketArn(java.lang.String)
    .synthBuildArn(java.lang.String)
//  .artifactBucketKeyArn(java.lang.String)
    .build();
Name Type Description
scope software.constructs.Construct No description.
id java.lang.String No description.
sonarqubeAuthorizedGroup java.lang.String Group name in Sonarqube with access to administer this project.
sonarqubeDefaultProfileOrGateName java.lang.String Default profile/gate name i.e: your org profile.
sonarqubeEndpoint java.lang.String endpoint of the sonarqube instance i.e: https://.
sonarqubeProjectName java.lang.String Name of the project to create in Sonarqube.
cdkOutDir java.lang.String directory containing the synthesized cdk resources.
cfnNagIgnorePath java.lang.String path to a file containing the cfn nag suppression rules.
excludeGlobsForScan java.util.List glob patterns to exclude from sonar scan.
includeGlobsForScan java.util.List glob patterns to include from sonar scan.
preArchiveCommands java.util.List Hook which allows custom commands to be executed before the process commences the archival process.
sonarqubeSpecificProfileOrGateName java.lang.String Specific profile/gate name i.e: language specific.
sonarqubeTags java.util.List Tags to associate with this project.
artifactBucketArn java.lang.String S3 bucket ARN containing the built artifacts from the synth build.
synthBuildArn java.lang.String ARN for the CodeBuild task responsible for executing the synth command.
artifactBucketKeyArn java.lang.String Artifact bucket key ARN used to encrypt the artifacts.

scopeRequired
  • Type: software.constructs.Construct

idRequired
  • Type: java.lang.String

sonarqubeAuthorizedGroupRequired
  • Type: java.lang.String

Group name in Sonarqube with access to administer this project.


sonarqubeDefaultProfileOrGateNameRequired
  • Type: java.lang.String

Default profile/gate name i.e: your org profile.

Note: These need to be set up in Sonarqube manually.


sonarqubeEndpointRequired
  • Type: java.lang.String

endpoint of the sonarqube instance i.e: https://.

Note: Ensure a trailing '/' is not included.


sonarqubeProjectNameRequired
  • Type: java.lang.String

Name of the project to create in Sonarqube.


cdkOutDirOptional
  • Type: java.lang.String

directory containing the synthesized cdk resources.


cfnNagIgnorePathOptional
  • Type: java.lang.String

path to a file containing the cfn nag suppression rules.


excludeGlobsForScanOptional
  • Type: java.util.List

glob patterns to exclude from sonar scan.


includeGlobsForScanOptional
  • Type: java.util.List

glob patterns to include from sonar scan.


preArchiveCommandsOptional
  • Type: java.util.List

Hook which allows custom commands to be executed before the process commences the archival process.


sonarqubeSpecificProfileOrGateNameOptional
  • Type: java.lang.String

Specific profile/gate name i.e: language specific.

Note: These need to be set up in Sonarqube manually.


sonarqubeTagsOptional
  • Type: java.util.List

Tags to associate with this project.


artifactBucketArnRequired
  • Type: java.lang.String

S3 bucket ARN containing the built artifacts from the synth build.


synthBuildArnRequired
  • Type: java.lang.String

ARN for the CodeBuild task responsible for executing the synth command.


artifactBucketKeyArnOptional
  • Type: java.lang.String

Artifact bucket key ARN used to encrypt the artifacts.


Methods

Name Description
toString Returns a string representation of this construct.

toString
public java.lang.String toString()

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import software.aws.pdk.pipeline.SonarCodeScanner;

SonarCodeScanner.isConstruct(java.lang.Object x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: java.lang.Object

Any object.


Properties

Name Type Description
node software.constructs.Node The tree node.

nodeRequired
public Node getNode();
  • Type: software.constructs.Node

The tree node.


Structs

CodePipelineProps

CodePipelineProps.

Initializer

import software.aws.pdk.pipeline.CodePipelineProps;

CodePipelineProps.builder()
//  .artifactBucket(IBucket)
//  .assetPublishingCodeBuildDefaults(CodeBuildOptions)
//  .cliVersion(java.lang.String)
//  .codeBuildDefaults(CodeBuildOptions)
//  .codePipeline(Pipeline)
//  .crossAccountKeys(java.lang.Boolean)
//  .crossRegionReplicationBuckets(java.util.Map<java.lang.String, IBucket>)
//  .dockerCredentials(java.util.List<DockerCredential>)
//  .dockerEnabledForSelfMutation(java.lang.Boolean)
//  .dockerEnabledForSynth(java.lang.Boolean)
//  .enableKeyRotation(java.lang.Boolean)
//  .pipelineName(java.lang.String)
//  .publishAssetsInParallel(java.lang.Boolean)
//  .reuseCrossRegionSupportStacks(java.lang.Boolean)
//  .role(IRole)
//  .selfMutation(java.lang.Boolean)
//  .selfMutationCodeBuildDefaults(CodeBuildOptions)
//  .synth(IFileSetProducer)
//  .synthCodeBuildDefaults(CodeBuildOptions)
//  .useChangeSets(java.lang.Boolean)
    .build();

Properties

Name Type Description
artifactBucket software.amazon.awscdk.services.s3.IBucket An existing S3 Bucket to use for storing the pipeline's artifact.
assetPublishingCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the asset publishing CodeBuild projects.
cliVersion java.lang.String CDK CLI version to use in self-mutation and asset publishing steps.
codeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Customize the CodeBuild projects created for this pipeline.
codePipeline software.amazon.awscdk.services.codepipeline.Pipeline An existing Pipeline to be reused and built upon.
crossAccountKeys java.lang.Boolean Create KMS keys for the artifact buckets, allowing cross-account deployments.
crossRegionReplicationBuckets java.util.Map A map of region to S3 bucket name used for cross-region CodePipeline.
dockerCredentials java.util.List A list of credentials used to authenticate to Docker registries.
dockerEnabledForSelfMutation java.lang.Boolean Enable Docker for the self-mutate step.
dockerEnabledForSynth java.lang.Boolean Enable Docker for the 'synth' step.
enableKeyRotation java.lang.Boolean Enable KMS key rotation for the generated KMS keys.
pipelineName java.lang.String The name of the CodePipeline pipeline.
publishAssetsInParallel java.lang.Boolean Publish assets in multiple CodeBuild projects. If set to false, use one Project per type to publish all assets.
reuseCrossRegionSupportStacks java.lang.Boolean Reuse the same cross region support stack for all pipelines in the App.
role software.amazon.awscdk.services.iam.IRole The IAM role to be assumed by this Pipeline.
selfMutation java.lang.Boolean Whether the pipeline will update itself.
selfMutationCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the self mutation CodeBuild projects.
synth software.amazon.awscdk.pipelines.IFileSetProducer The build step that produces the CDK Cloud Assembly.
synthCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the synthesize CodeBuild projects.
useChangeSets java.lang.Boolean Deploy every stack by creating a change set and executing it.

artifactBucketOptional
public IBucket getArtifactBucket();
  • Type: software.amazon.awscdk.services.s3.IBucket
  • Default: A new S3 bucket will be created.

An existing S3 Bucket to use for storing the pipeline's artifact.


assetPublishingCodeBuildDefaultsOptional
public CodeBuildOptions getAssetPublishingCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the asset publishing CodeBuild projects.


cliVersionOptional
public java.lang.String getCliVersion();
  • Type: java.lang.String
  • Default: Latest version

CDK CLI version to use in self-mutation and asset publishing steps.

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.


codeBuildDefaultsOptional
public CodeBuildOptions getCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: All projects run non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0

Customize the CodeBuild projects created for this pipeline.


codePipelineOptional
public Pipeline getCodePipeline();
  • Type: software.amazon.awscdk.services.codepipeline.Pipeline
  • Default: a new underlying pipeline is created.

An existing Pipeline to be reused and built upon.

[disable-awslint:ref-via-interface]


crossAccountKeysOptional
public java.lang.Boolean getCrossAccountKeys();
  • Type: java.lang.Boolean
  • Default: false

Create KMS keys for the artifact buckets, allowing cross-account deployments.

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
public java.util.Map<java.lang.String, IBucket> getCrossRegionReplicationBuckets();
  • Type: java.util.Map
  • Default: no cross region replication buckets.

A map of region to S3 bucket name used for cross-region CodePipeline.

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 }.


dockerCredentialsOptional
public java.util.List<DockerCredential> getDockerCredentials();
  • Type: java.util.List
  • Default: []

A list of credentials used to authenticate to Docker registries.

Specify any credentials necessary within the pipeline to build, synth, update, or publish assets.


dockerEnabledForSelfMutationOptional
public java.lang.Boolean getDockerEnabledForSelfMutation();
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the self-mutate step.

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.


dockerEnabledForSynthOptional
public java.lang.Boolean getDockerEnabledForSynth();
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the 'synth' step.

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.


enableKeyRotationOptional
public java.lang.Boolean getEnableKeyRotation();
  • Type: java.lang.Boolean
  • Default: false (key rotation is disabled)

Enable KMS key rotation for the generated KMS keys.

By default KMS key rotation is disabled, but will add additional costs when enabled.


pipelineNameOptional
public java.lang.String getPipelineName();
  • Type: java.lang.String
  • Default: Automatically generated

The name of the CodePipeline pipeline.


publishAssetsInParallelOptional
public java.lang.Boolean getPublishAssetsInParallel();
  • Type: java.lang.Boolean
  • Default: true

Publish assets in multiple CodeBuild projects. 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.


reuseCrossRegionSupportStacksOptional
public java.lang.Boolean getReuseCrossRegionSupportStacks();
  • Type: java.lang.Boolean
  • Default: true (Use the same support stack for all pipelines in App)

Reuse the same cross region support stack for all pipelines in the App.


roleOptional
public IRole getRole();
  • Type: software.amazon.awscdk.services.iam.IRole
  • Default: A new role is created

The IAM role to be assumed by this Pipeline.


selfMutationOptional
public java.lang.Boolean getSelfMutation();
  • Type: java.lang.Boolean
  • Default: true

Whether the pipeline will update itself.

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.


selfMutationCodeBuildDefaultsOptional
public CodeBuildOptions getSelfMutationCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the self mutation CodeBuild projects.


synthOptional
public IFileSetProducer getSynth();
  • Type: software.amazon.awscdk.pipelines.IFileSetProducer

The build step that produces the CDK Cloud Assembly.

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.


synthCodeBuildDefaultsOptional
public CodeBuildOptions getSynthCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the synthesize CodeBuild projects.


useChangeSetsOptional
public java.lang.Boolean getUseChangeSets();
  • Type: java.lang.Boolean
  • Default: true

Deploy every stack by creating a change set and executing it.

When enabled, creates a "Prepare" and "Execute" action for each stack. Disable to deploy the stack in one pipeline action.


IsDefaultBranchProps

Properties to help the isDefaultBranch function determine the default branch name.

Initializer

import software.aws.pdk.pipeline.IsDefaultBranchProps;

IsDefaultBranchProps.builder()
//  .defaultBranchName(java.lang.String)
//  .node(Node)
    .build();

Properties

Name Type Description
defaultBranchName java.lang.String Specify the default branch name without context.
node software.constructs.Node The current node to fetch defaultBranchName from context.

defaultBranchNameOptional
public java.lang.String getDefaultBranchName();
  • Type: java.lang.String

Specify the default branch name without context.


nodeOptional
public Node getNode();
  • Type: software.constructs.Node

The current node to fetch defaultBranchName from context.


PDKPipelineProps

Properties to configure the PDKPipeline.

Note: Due to limitations with JSII and generic support it should be noted that the synth, synthShellStepPartialProps.input and synthShellStepPartialProps.primaryOutputDirectory properties will be ignored if passed in to this construct.

synthShellStepPartialProps.commands is marked as a required field, however if you pass in [] the default commands of this construct will be retained.

Initializer

import software.aws.pdk.pipeline.PDKPipelineProps;

PDKPipelineProps.builder()
//  .artifactBucket(IBucket)
//  .assetPublishingCodeBuildDefaults(CodeBuildOptions)
//  .cliVersion(java.lang.String)
//  .codeBuildDefaults(CodeBuildOptions)
//  .codePipeline(Pipeline)
//  .crossAccountKeys(java.lang.Boolean)
//  .crossRegionReplicationBuckets(java.util.Map<java.lang.String, IBucket>)
//  .dockerCredentials(java.util.List<DockerCredential>)
//  .dockerEnabledForSelfMutation(java.lang.Boolean)
//  .dockerEnabledForSynth(java.lang.Boolean)
//  .enableKeyRotation(java.lang.Boolean)
//  .pipelineName(java.lang.String)
//  .publishAssetsInParallel(java.lang.Boolean)
//  .reuseCrossRegionSupportStacks(java.lang.Boolean)
//  .role(IRole)
//  .selfMutation(java.lang.Boolean)
//  .selfMutationCodeBuildDefaults(CodeBuildOptions)
//  .synth(IFileSetProducer)
//  .synthCodeBuildDefaults(CodeBuildOptions)
//  .useChangeSets(java.lang.Boolean)
    .primarySynthDirectory(java.lang.String)
    .repositoryName(java.lang.String)
//  .branchNamePrefixes(java.util.List<java.lang.String>)
//  .cdkCommand(java.lang.String)
//  .cdkSrcDir(java.lang.String)
//  .codeCommitRemovalPolicy(RemovalPolicy)
//  .defaultBranchName(java.lang.String)
//  .sonarCodeScannerConfig(SonarCodeScannerConfig)
//  .synthShellStepPartialProps(ShellStepProps)
    .build();

Properties

Name Type Description
artifactBucket software.amazon.awscdk.services.s3.IBucket An existing S3 Bucket to use for storing the pipeline's artifact.
assetPublishingCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the asset publishing CodeBuild projects.
cliVersion java.lang.String CDK CLI version to use in self-mutation and asset publishing steps.
codeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Customize the CodeBuild projects created for this pipeline.
codePipeline software.amazon.awscdk.services.codepipeline.Pipeline An existing Pipeline to be reused and built upon.
crossAccountKeys java.lang.Boolean Create KMS keys for the artifact buckets, allowing cross-account deployments.
crossRegionReplicationBuckets java.util.Map A map of region to S3 bucket name used for cross-region CodePipeline.
dockerCredentials java.util.List A list of credentials used to authenticate to Docker registries.
dockerEnabledForSelfMutation java.lang.Boolean Enable Docker for the self-mutate step.
dockerEnabledForSynth java.lang.Boolean Enable Docker for the 'synth' step.
enableKeyRotation java.lang.Boolean Enable KMS key rotation for the generated KMS keys.
pipelineName java.lang.String The name of the CodePipeline pipeline.
publishAssetsInParallel java.lang.Boolean Publish assets in multiple CodeBuild projects. If set to false, use one Project per type to publish all assets.
reuseCrossRegionSupportStacks java.lang.Boolean Reuse the same cross region support stack for all pipelines in the App.
role software.amazon.awscdk.services.iam.IRole The IAM role to be assumed by this Pipeline.
selfMutation java.lang.Boolean Whether the pipeline will update itself.
selfMutationCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the self mutation CodeBuild projects.
synth software.amazon.awscdk.pipelines.IFileSetProducer The build step that produces the CDK Cloud Assembly.
synthCodeBuildDefaults software.amazon.awscdk.pipelines.CodeBuildOptions Additional customizations to apply to the synthesize CodeBuild projects.
useChangeSets java.lang.Boolean Deploy every stack by creating a change set and executing it.
primarySynthDirectory java.lang.String Output directory for cdk synthesized artifacts i.e: packages/infra/cdk.out.
repositoryName java.lang.String Name of the CodeCommit repository to create.
branchNamePrefixes java.util.List Branch name prefixes Any branches created matching this list of prefixes will create a new pipeline and stack.
cdkCommand java.lang.String CDK command.
cdkSrcDir java.lang.String The directory with cdk.json to run cdk synth from. Set this if you enabled feature branches and cdk.json is not located in the parent directory of primarySynthDirectory.
codeCommitRemovalPolicy software.amazon.awscdk.RemovalPolicy Possible values for a resource's Removal Policy The removal policy controls what happens to the resource if it stops being managed by CloudFormation.
defaultBranchName java.lang.String Branch to trigger the pipeline execution.
sonarCodeScannerConfig SonarCodeScannerConfig Configuration for enabling Sonarqube code scanning on a successful synth.
synthShellStepPartialProps software.amazon.awscdk.pipelines.ShellStepProps PDKPipeline by default assumes a NX Monorepo structure for it's codebase and uses sane defaults for the install and run commands.

artifactBucketOptional
public IBucket getArtifactBucket();
  • Type: software.amazon.awscdk.services.s3.IBucket
  • Default: A new S3 bucket will be created.

An existing S3 Bucket to use for storing the pipeline's artifact.


assetPublishingCodeBuildDefaultsOptional
public CodeBuildOptions getAssetPublishingCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the asset publishing CodeBuild projects.


cliVersionOptional
public java.lang.String getCliVersion();
  • Type: java.lang.String
  • Default: Latest version

CDK CLI version to use in self-mutation and asset publishing steps.

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.


codeBuildDefaultsOptional
public CodeBuildOptions getCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: All projects run non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0

Customize the CodeBuild projects created for this pipeline.


codePipelineOptional
public Pipeline getCodePipeline();
  • Type: software.amazon.awscdk.services.codepipeline.Pipeline
  • Default: a new underlying pipeline is created.

An existing Pipeline to be reused and built upon.

[disable-awslint:ref-via-interface]


crossAccountKeysOptional
public java.lang.Boolean getCrossAccountKeys();
  • Type: java.lang.Boolean
  • Default: false

Create KMS keys for the artifact buckets, allowing cross-account deployments.

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
public java.util.Map<java.lang.String, IBucket> getCrossRegionReplicationBuckets();
  • Type: java.util.Map
  • Default: no cross region replication buckets.

A map of region to S3 bucket name used for cross-region CodePipeline.

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 }.


dockerCredentialsOptional
public java.util.List<DockerCredential> getDockerCredentials();
  • Type: java.util.List
  • Default: []

A list of credentials used to authenticate to Docker registries.

Specify any credentials necessary within the pipeline to build, synth, update, or publish assets.


dockerEnabledForSelfMutationOptional
public java.lang.Boolean getDockerEnabledForSelfMutation();
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the self-mutate step.

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.


dockerEnabledForSynthOptional
public java.lang.Boolean getDockerEnabledForSynth();
  • Type: java.lang.Boolean
  • Default: false

Enable Docker for the 'synth' step.

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.


enableKeyRotationOptional
public java.lang.Boolean getEnableKeyRotation();
  • Type: java.lang.Boolean
  • Default: false (key rotation is disabled)

Enable KMS key rotation for the generated KMS keys.

By default KMS key rotation is disabled, but will add additional costs when enabled.


pipelineNameOptional
public java.lang.String getPipelineName();
  • Type: java.lang.String
  • Default: Automatically generated

The name of the CodePipeline pipeline.


publishAssetsInParallelOptional
public java.lang.Boolean getPublishAssetsInParallel();
  • Type: java.lang.Boolean
  • Default: true

Publish assets in multiple CodeBuild projects. 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.


reuseCrossRegionSupportStacksOptional
public java.lang.Boolean getReuseCrossRegionSupportStacks();
  • Type: java.lang.Boolean
  • Default: true (Use the same support stack for all pipelines in App)

Reuse the same cross region support stack for all pipelines in the App.


roleOptional
public IRole getRole();
  • Type: software.amazon.awscdk.services.iam.IRole
  • Default: A new role is created

The IAM role to be assumed by this Pipeline.


selfMutationOptional
public java.lang.Boolean getSelfMutation();
  • Type: java.lang.Boolean
  • Default: true

Whether the pipeline will update itself.

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.


selfMutationCodeBuildDefaultsOptional
public CodeBuildOptions getSelfMutationCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the self mutation CodeBuild projects.


synthOptional
public IFileSetProducer getSynth();
  • Type: software.amazon.awscdk.pipelines.IFileSetProducer

The build step that produces the CDK Cloud Assembly.

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.


synthCodeBuildDefaultsOptional
public CodeBuildOptions getSynthCodeBuildDefaults();
  • Type: software.amazon.awscdk.pipelines.CodeBuildOptions
  • Default: Only codeBuildDefaults are applied

Additional customizations to apply to the synthesize CodeBuild projects.


useChangeSetsOptional
public java.lang.Boolean getUseChangeSets();
  • Type: java.lang.Boolean
  • Default: true

Deploy every stack by creating a change set and executing it.

When enabled, creates a "Prepare" and "Execute" action for each stack. Disable to deploy the stack in one pipeline action.


primarySynthDirectoryRequired
public java.lang.String getPrimarySynthDirectory();
  • Type: java.lang.String

Output directory for cdk synthesized artifacts i.e: packages/infra/cdk.out.


repositoryNameRequired
public java.lang.String getRepositoryName();
  • Type: java.lang.String

Name of the CodeCommit repository to create.


branchNamePrefixesOptional
public java.util.List<java.lang.String> getBranchNamePrefixes();
  • Type: java.util.List
  • Default: undefined

Branch name prefixes Any branches created matching this list of prefixes will create a new pipeline and stack.


Example

// Example automatically generated from non-compiling source. May contain errors.
// Disables feature branches (default)
// Disables feature branches (default)
PDKPipeline.Builder.create(this, "PDKPipeline")
        .repositoryName("my-repo")
        .branchNamePrefixes(List.of())
        .build();
cdkCommandOptional
public java.lang.String getCdkCommand();
  • Type: java.lang.String
  • Default: 'npx cdk'

CDK command.

Override the command used to call cdk for synth and deploy.


cdkSrcDirOptional
public java.lang.String getCdkSrcDir();
  • Type: java.lang.String
  • Default: The parent directory of primarySynthDirectory

The directory with cdk.json to run cdk synth from. Set this if you enabled feature branches and cdk.json is not located in the parent directory of primarySynthDirectory.


codeCommitRemovalPolicyOptional
public RemovalPolicy getCodeCommitRemovalPolicy();
  • Type: software.amazon.awscdk.RemovalPolicy

Possible values for a resource's Removal Policy The removal policy controls what happens to the resource if it stops being managed by CloudFormation.


defaultBranchNameOptional
public java.lang.String getDefaultBranchName();
  • Type: java.lang.String
  • Default: mainline

Branch to trigger the pipeline execution.


sonarCodeScannerConfigOptional
public SonarCodeScannerConfig getSonarCodeScannerConfig();

Configuration for enabling Sonarqube code scanning on a successful synth.


synthShellStepPartialPropsOptional
public ShellStepProps getSynthShellStepPartialProps();
  • Type: software.amazon.awscdk.pipelines.ShellStepProps

PDKPipeline by default assumes a NX Monorepo structure for it's codebase and uses sane defaults for the install and run commands.

To override these defaults and/or provide additional inputs, specify env settings, etc you can provide a partial ShellStepProps.


SonarCodeScannerConfig

Initializer

import software.aws.pdk.pipeline.SonarCodeScannerConfig;

SonarCodeScannerConfig.builder()
    .sonarqubeAuthorizedGroup(java.lang.String)
    .sonarqubeDefaultProfileOrGateName(java.lang.String)
    .sonarqubeEndpoint(java.lang.String)
    .sonarqubeProjectName(java.lang.String)
//  .cdkOutDir(java.lang.String)
//  .cfnNagIgnorePath(java.lang.String)
//  .excludeGlobsForScan(java.util.List<java.lang.String>)
//  .includeGlobsForScan(java.util.List<java.lang.String>)
//  .preArchiveCommands(java.util.List<java.lang.String>)
//  .sonarqubeSpecificProfileOrGateName(java.lang.String)
//  .sonarqubeTags(java.util.List<java.lang.String>)
    .build();

Properties

Name Type Description
sonarqubeAuthorizedGroup java.lang.String Group name in Sonarqube with access to administer this project.
sonarqubeDefaultProfileOrGateName java.lang.String Default profile/gate name i.e: your org profile.
sonarqubeEndpoint java.lang.String endpoint of the sonarqube instance i.e: https://.
sonarqubeProjectName java.lang.String Name of the project to create in Sonarqube.
cdkOutDir java.lang.String directory containing the synthesized cdk resources.
cfnNagIgnorePath java.lang.String path to a file containing the cfn nag suppression rules.
excludeGlobsForScan java.util.List glob patterns to exclude from sonar scan.
includeGlobsForScan java.util.List glob patterns to include from sonar scan.
preArchiveCommands java.util.List Hook which allows custom commands to be executed before the process commences the archival process.
sonarqubeSpecificProfileOrGateName java.lang.String Specific profile/gate name i.e: language specific.
sonarqubeTags java.util.List Tags to associate with this project.

sonarqubeAuthorizedGroupRequired
public java.lang.String getSonarqubeAuthorizedGroup();
  • Type: java.lang.String

Group name in Sonarqube with access to administer this project.


sonarqubeDefaultProfileOrGateNameRequired
public java.lang.String getSonarqubeDefaultProfileOrGateName();
  • Type: java.lang.String

Default profile/gate name i.e: your org profile.

Note: These need to be set up in Sonarqube manually.


sonarqubeEndpointRequired
public java.lang.String getSonarqubeEndpoint();
  • Type: java.lang.String

endpoint of the sonarqube instance i.e: https://.

Note: Ensure a trailing '/' is not included.


sonarqubeProjectNameRequired
public java.lang.String getSonarqubeProjectName();
  • Type: java.lang.String

Name of the project to create in Sonarqube.


cdkOutDirOptional
public java.lang.String getCdkOutDir();
  • Type: java.lang.String

directory containing the synthesized cdk resources.


cfnNagIgnorePathOptional
public java.lang.String getCfnNagIgnorePath();
  • Type: java.lang.String

path to a file containing the cfn nag suppression rules.


excludeGlobsForScanOptional
public java.util.List<java.lang.String> getExcludeGlobsForScan();
  • Type: java.util.List

glob patterns to exclude from sonar scan.


includeGlobsForScanOptional
public java.util.List<java.lang.String> getIncludeGlobsForScan();
  • Type: java.util.List

glob patterns to include from sonar scan.


preArchiveCommandsOptional
public java.util.List<java.lang.String> getPreArchiveCommands();
  • Type: java.util.List

Hook which allows custom commands to be executed before the process commences the archival process.


sonarqubeSpecificProfileOrGateNameOptional
public java.lang.String getSonarqubeSpecificProfileOrGateName();
  • Type: java.lang.String

Specific profile/gate name i.e: language specific.

Note: These need to be set up in Sonarqube manually.


sonarqubeTagsOptional
public java.util.List<java.lang.String> getSonarqubeTags();
  • Type: java.util.List

Tags to associate with this project.


SonarCodeScannerProps

SonarCodeScanners properties.

Initializer

import software.aws.pdk.pipeline.SonarCodeScannerProps;

SonarCodeScannerProps.builder()
    .sonarqubeAuthorizedGroup(java.lang.String)
    .sonarqubeDefaultProfileOrGateName(java.lang.String)
    .sonarqubeEndpoint(java.lang.String)
    .sonarqubeProjectName(java.lang.String)
//  .cdkOutDir(java.lang.String)
//  .cfnNagIgnorePath(java.lang.String)
//  .excludeGlobsForScan(java.util.List<java.lang.String>)
//  .includeGlobsForScan(java.util.List<java.lang.String>)
//  .preArchiveCommands(java.util.List<java.lang.String>)
//  .sonarqubeSpecificProfileOrGateName(java.lang.String)
//  .sonarqubeTags(java.util.List<java.lang.String>)
    .artifactBucketArn(java.lang.String)
    .synthBuildArn(java.lang.String)
//  .artifactBucketKeyArn(java.lang.String)
    .build();

Properties

Name Type Description
sonarqubeAuthorizedGroup java.lang.String Group name in Sonarqube with access to administer this project.
sonarqubeDefaultProfileOrGateName java.lang.String Default profile/gate name i.e: your org profile.
sonarqubeEndpoint java.lang.String endpoint of the sonarqube instance i.e: https://.
sonarqubeProjectName java.lang.String Name of the project to create in Sonarqube.
cdkOutDir java.lang.String directory containing the synthesized cdk resources.
cfnNagIgnorePath java.lang.String path to a file containing the cfn nag suppression rules.
excludeGlobsForScan java.util.List glob patterns to exclude from sonar scan.
includeGlobsForScan java.util.List glob patterns to include from sonar scan.
preArchiveCommands java.util.List Hook which allows custom commands to be executed before the process commences the archival process.
sonarqubeSpecificProfileOrGateName java.lang.String Specific profile/gate name i.e: language specific.
sonarqubeTags java.util.List Tags to associate with this project.
artifactBucketArn java.lang.String S3 bucket ARN containing the built artifacts from the synth build.
synthBuildArn java.lang.String ARN for the CodeBuild task responsible for executing the synth command.
artifactBucketKeyArn java.lang.String Artifact bucket key ARN used to encrypt the artifacts.

sonarqubeAuthorizedGroupRequired
public java.lang.String getSonarqubeAuthorizedGroup();
  • Type: java.lang.String

Group name in Sonarqube with access to administer this project.


sonarqubeDefaultProfileOrGateNameRequired
public java.lang.String getSonarqubeDefaultProfileOrGateName();
  • Type: java.lang.String

Default profile/gate name i.e: your org profile.

Note: These need to be set up in Sonarqube manually.


sonarqubeEndpointRequired
public java.lang.String getSonarqubeEndpoint();
  • Type: java.lang.String

endpoint of the sonarqube instance i.e: https://.

Note: Ensure a trailing '/' is not included.


sonarqubeProjectNameRequired
public java.lang.String getSonarqubeProjectName();
  • Type: java.lang.String

Name of the project to create in Sonarqube.


cdkOutDirOptional
public java.lang.String getCdkOutDir();
  • Type: java.lang.String

directory containing the synthesized cdk resources.


cfnNagIgnorePathOptional
public java.lang.String getCfnNagIgnorePath();
  • Type: java.lang.String

path to a file containing the cfn nag suppression rules.


excludeGlobsForScanOptional
public java.util.List<java.lang.String> getExcludeGlobsForScan();
  • Type: java.util.List

glob patterns to exclude from sonar scan.


includeGlobsForScanOptional
public java.util.List<java.lang.String> getIncludeGlobsForScan();
  • Type: java.util.List

glob patterns to include from sonar scan.


preArchiveCommandsOptional
public java.util.List<java.lang.String> getPreArchiveCommands();
  • Type: java.util.List

Hook which allows custom commands to be executed before the process commences the archival process.


sonarqubeSpecificProfileOrGateNameOptional
public java.lang.String getSonarqubeSpecificProfileOrGateName();
  • Type: java.lang.String

Specific profile/gate name i.e: language specific.

Note: These need to be set up in Sonarqube manually.


sonarqubeTagsOptional
public java.util.List<java.lang.String> getSonarqubeTags();
  • Type: java.util.List

Tags to associate with this project.


artifactBucketArnRequired
public java.lang.String getArtifactBucketArn();
  • Type: java.lang.String

S3 bucket ARN containing the built artifacts from the synth build.


synthBuildArnRequired
public java.lang.String getSynthBuildArn();
  • Type: java.lang.String

ARN for the CodeBuild task responsible for executing the synth command.


artifactBucketKeyArnOptional
public java.lang.String getArtifactBucketKeyArn();
  • Type: java.lang.String

Artifact bucket key ARN used to encrypt the artifacts.



Last update: 2024-05-08