ProduceActionOptions

class aws_cdk.pipelines.ProduceActionOptions(*, action_name, artifacts, pipeline, run_order, scope, stack_outputs_map, before_self_mutation=None, code_build_defaults=None, fallback_artifact=None, variables_namespace=None)

Bases: object

Options for the CodePipelineActionFactory.produce() method.

Parameters:
  • action_name (str) – Name the action should get.

  • artifacts (ArtifactMap) – Helper object to translate FileSets to CodePipeline Artifacts.

  • pipeline (CodePipeline) – The pipeline the action is being generated for.

  • run_order (Union[int, float]) – RunOrder the action should get.

  • scope (Construct) – Scope in which to create constructs.

  • stack_outputs_map (StackOutputsMap) – Helper object to produce variables exported from stack deployments. If your step references outputs from a stack deployment, use this to map the output references to Codepipeline variable names. Note - Codepipeline variables can only be referenced in action configurations.

  • before_self_mutation (Optional[bool]) – Whether or not this action is inserted before self mutation. If it is, the action should take care to reflect some part of its own definition in the pipeline action definition, to trigger a restart after self-mutation (if necessary). Default: false

  • code_build_defaults (Union[CodeBuildOptions, Dict[str, Any], None]) – If this action factory creates a CodeBuild step, default options to inherit. Default: - No CodeBuild project defaults

  • fallback_artifact (Optional[Artifact]) – An input artifact that CodeBuild projects that don’t actually need an input artifact can use. CodeBuild Projects MUST have an input artifact in order to be added to the Pipeline. If the Project doesn’t actually care about its input (it can be anything), it can use the Artifact passed here. Default: - A fallback artifact does not exist

  • variables_namespace (Optional[str]) – If this step is producing outputs, the variables namespace assigned to it. Pass this on to the Action you are creating. Default: - Step doesn’t produce any outputs

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_codebuild as codebuild
from aws_cdk import aws_codepipeline as codepipeline
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam
from aws_cdk import aws_logs as logs
from aws_cdk import aws_s3 as s3
from aws_cdk import pipelines
import constructs as constructs

# artifact: codepipeline.Artifact
# artifact_map: pipelines.ArtifactMap
# bucket: s3.Bucket
# build_image: codebuild.IBuildImage
# build_spec: codebuild.BuildSpec
# cache: codebuild.Cache
# code_pipeline: pipelines.CodePipeline
# construct: constructs.Construct
# file_system_location: codebuild.IFileSystemLocation
# fleet: codebuild.Fleet
# log_group: logs.LogGroup
# policy_statement: iam.PolicyStatement
# security_group: ec2.SecurityGroup
# stack_outputs_map: pipelines.StackOutputsMap
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# value: Any
# vpc: ec2.Vpc

produce_action_options = pipelines.ProduceActionOptions(
    action_name="actionName",
    artifacts=artifact_map,
    pipeline=code_pipeline,
    run_order=123,
    scope=construct,
    stack_outputs_map=stack_outputs_map,

    # the properties below are optional
    before_self_mutation=False,
    code_build_defaults=pipelines.CodeBuildOptions(
        build_environment=codebuild.BuildEnvironment(
            build_image=build_image,
            certificate=codebuild.BuildEnvironmentCertificate(
                bucket=bucket,
                object_key="objectKey"
            ),
            compute_type=codebuild.ComputeType.SMALL,
            environment_variables={
                "environment_variables_key": codebuild.BuildEnvironmentVariable(
                    value=value,

                    # the properties below are optional
                    type=codebuild.BuildEnvironmentVariableType.PLAINTEXT
                )
            },
            fleet=fleet,
            privileged=False
        ),
        cache=cache,
        file_system_locations=[file_system_location],
        logging=codebuild.LoggingOptions(
            cloud_watch=codebuild.CloudWatchLoggingOptions(
                enabled=False,
                log_group=log_group,
                prefix="prefix"
            ),
            s3=codebuild.S3LoggingOptions(
                bucket=bucket,

                # the properties below are optional
                enabled=False,
                encrypted=False,
                prefix="prefix"
            )
        ),
        partial_build_spec=build_spec,
        role_policy=[policy_statement],
        security_groups=[security_group],
        subnet_selection=ec2.SubnetSelection(
            availability_zones=["availabilityZones"],
            one_per_az=False,
            subnet_filters=[subnet_filter],
            subnet_group_name="subnetGroupName",
            subnets=[subnet],
            subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
        ),
        timeout=cdk.Duration.minutes(30),
        vpc=vpc
    ),
    fallback_artifact=artifact,
    variables_namespace="variablesNamespace"
)

Attributes

action_name

Name the action should get.

artifacts

Helper object to translate FileSets to CodePipeline Artifacts.

before_self_mutation

Whether or not this action is inserted before self mutation.

If it is, the action should take care to reflect some part of its own definition in the pipeline action definition, to trigger a restart after self-mutation (if necessary).

Default:

false

code_build_defaults

If this action factory creates a CodeBuild step, default options to inherit.

Default:
  • No CodeBuild project defaults

fallback_artifact

An input artifact that CodeBuild projects that don’t actually need an input artifact can use.

CodeBuild Projects MUST have an input artifact in order to be added to the Pipeline. If the Project doesn’t actually care about its input (it can be anything), it can use the Artifact passed here.

Default:
  • A fallback artifact does not exist

pipeline

The pipeline the action is being generated for.

run_order

RunOrder the action should get.

scope

Scope in which to create constructs.

stack_outputs_map

Helper object to produce variables exported from stack deployments.

If your step references outputs from a stack deployment, use this to map the output references to Codepipeline variable names.

Note - Codepipeline variables can only be referenced in action configurations.

variables_namespace

If this step is producing outputs, the variables namespace assigned to it.

Pass this on to the Action you are creating.

Default:
  • Step doesn’t produce any outputs