ConnectionSourceOptions

class aws_cdk.pipelines.ConnectionSourceOptions(*, connection_arn, code_build_clone_output=None, trigger_on_push=None)

Bases: object

Configuration options for CodeStar source.

Parameters:
  • connection_arn (str) – The ARN of the CodeStar Connection created in the AWS console that has permissions to access this GitHub or BitBucket repository.

  • code_build_clone_output (Optional[bool]) – 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. Default: false

  • trigger_on_push (Optional[bool]) – 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. Default: true

ExampleMetadata:

infused

Example:

pipeline = pipelines.CodePipeline(self, "Pipeline",
    synth=pipelines.ShellStep("Synth",
        input=pipelines.CodePipelineSource.connection("my-org/my-app", "main",
            connection_arn="arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"
        ),
        commands=["npm ci", "npm run build", "npx cdk synth"]
    ),

    # Turn this on because the pipeline uses Docker image assets
    docker_enabled_for_self_mutation=True
)

pipeline.add_wave("MyWave",
    post=[
        pipelines.CodeBuildStep("RunApproval",
            commands=["command-from-image"],
            build_environment=codebuild.BuildEnvironment(
                # The user of a Docker image asset in the pipeline requires turning on
                # 'dockerEnabledForSelfMutation'.
                build_image=codebuild.LinuxBuildImage.from_asset(self, "Image",
                    directory="./docker-image"
                )
            )
        )
    ]
)

Attributes

code_build_clone_output

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.

Default:

false

See:

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

connection_arn

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

See:

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"
trigger_on_push

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.

Default:

true

See:

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