aws-cdk-lib.pipelines.ConnectionSourceOptions

interface ConnectionSourceOptions

LanguageType name
.NETAmazon.CDK.Pipelines.ConnectionSourceOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#ConnectionSourceOptions
Javasoftware.amazon.awscdk.pipelines.ConnectionSourceOptions
Pythonaws_cdk.pipelines.ConnectionSourceOptions
TypeScript (source)aws-cdk-lib » pipelines » ConnectionSourceOptions

Configuration options for CodeStar source.

Example

const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
  synth: new pipelines.ShellStep('Synth', {
    input: pipelines.CodePipelineSource.connection('my-org/my-app', 'main', {
      connectionArn: 'arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41', // Created using the AWS console * });',
    }),
    commands: ['npm ci','npm run build','npx cdk synth'],
  }),

  // Turn this on because the pipeline uses Docker image assets
  dockerEnabledForSelfMutation: true,
});

pipeline.addWave('MyWave', {
  post: [
    new pipelines.CodeBuildStep('RunApproval', {
      commands: ['command-from-image'],
      buildEnvironment: {
        // The user of a Docker image asset in the pipeline requires turning on
        // 'dockerEnabledForSelfMutation'.
        buildImage: codebuild.LinuxBuildImage.fromAsset(this, 'Image', {
          directory: './docker-image',
        }),
      },
    }),
  ],
});

Properties

NameTypeDescription
connectionArnstringThe ARN of the CodeStar Connection created in the AWS console that has permissions to access this GitHub or BitBucket repository.
actionName?stringThe action name used for this source in the CodePipeline.
codeBuildCloneOutput?booleanIf this is set, the next CodeBuild job clones the repository (instead of CodePipeline downloading the files).
triggerOnPush?booleanControls automatically starting your pipeline when a new commit is made on the configured repository and branch.

connectionArn

Type: string

The ARN of the CodeStar Connection created in the AWS console that has permissions to access this GitHub or BitBucket repository.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/connections-create.html Example

'arn:aws:codestar-connections:us-east-1:123456789012:connection/12345678-abcd-12ab-34cdef5678gh'

actionName?

Type: string (optional, default: The repository string)

The action name used for this source in the CodePipeline.


codeBuildCloneOutput?

Type: boolean (optional, default: false)

If this is set, the next CodeBuild job clones the repository (instead of CodePipeline downloading the files).

This provides access to repository history, and retains symlinks (symlinks would otherwise be removed by CodePipeline).

Note: if this option is true, only CodeBuild jobs can use the output artifact.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config


triggerOnPush?

Type: boolean (optional, default: true)

Controls automatically starting your pipeline when a new commit is made on the configured repository and branch.

If unspecified, the default value is true, and the field does not display by default.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html