ProduceActionOptions

class aws_cdk.pipelines.ProduceActionOptions(*, action_name, artifacts, pipeline, run_order, scope, 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.

  • 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.aws_codebuild as codebuild
import aws_cdk.aws_codepipeline as codepipeline
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_iam as iam
import aws_cdk.aws_s3 as s3
import aws_cdk.core as cdk
import aws_cdk.pipelines as pipelines
import constructs as constructs

# artifact: codepipeline.Artifact
# artifact_map: pipelines.ArtifactMap
# bucket: s3.Bucket
# build_image: codebuild.IBuildImage
# build_spec: codebuild.BuildSpec
# code_pipeline: pipelines.CodePipeline
# construct: constructs.Construct
# policy_statement: iam.PolicyStatement
# security_group: ec2.SecurityGroup
# 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,

    # 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
                )
            },
            privileged=False
        ),
        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",
            subnet_name="subnetName",
            subnets=[subnet],
            subnet_type=ec2.SubnetType.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.

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