Skip to content
v2.278.0

ProduceActionOptions Struct ​

Options for the CodePipelineActionFactory.produce() method.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';
import { pipelines } from 'aws-cdk-lib';
import * as constructs from 'constructs';

declare const artifact: codepipeline.Artifact;
declare const artifactMap: pipelines.ArtifactMap;
declare const bucket: s3.Bucket;
declare const buildImage: codebuild.IBuildImage;
declare const buildSpec: codebuild.BuildSpec;
declare const cache: codebuild.Cache;
declare const codePipeline: pipelines.CodePipeline;
declare const construct: constructs.Construct;
declare const fileSystemLocation: codebuild.IFileSystemLocation;
declare const fleet: codebuild.Fleet;
declare const logGroup: logs.LogGroup;
declare const policyStatement: iam.PolicyStatement;
declare const securityGroup: ec2.SecurityGroup;
declare const stackOutputsMap: pipelines.StackOutputsMap;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const value: any;
declare const vpc: ec2.Vpc;
const produceActionOptions: pipelines.ProduceActionOptions = {
  actionName: 'actionName',
  artifacts: artifactMap,
  pipeline: codePipeline,
  runOrder: 123,
  scope: construct,
  stackOutputsMap: stackOutputsMap,

  // the properties below are optional
  beforeSelfMutation: false,
  codeBuildDefaults: {
    buildEnvironment: {
      buildImage: buildImage,
      certificate: {
        bucket: bucket,
        objectKey: 'objectKey',
      },
      computeType: codebuild.ComputeType.SMALL,
      dockerServer: {
        computeType: codebuild.DockerServerComputeType.SMALL,

        // the properties below are optional
        securityGroups: [securityGroup],
      },
      environmentVariables: {
        environmentVariablesKey: {
          value: value,

          // the properties below are optional
          type: codebuild.BuildEnvironmentVariableType.PLAINTEXT,
        },
      },
      fleet: fleet,
      hostKernel: codebuild.HostKernel.LINUX_KERNEL_4,
      privileged: false,
    },
    cache: cache,
    fileSystemLocations: [fileSystemLocation],
    logging: {
      cloudWatch: {
        enabled: false,
        logGroup: logGroup,
        prefix: 'prefix',
      },
      s3: {
        bucket: bucket,

        // the properties below are optional
        enabled: false,
        encrypted: false,
        prefix: 'prefix',
      },
    },
    partialBuildSpec: buildSpec,
    rolePolicy: [policyStatement],
    securityGroups: [securityGroup],
    subnetSelection: {
      availabilityZones: ['availabilityZones'],
      onePerAz: false,
      subnetFilters: [subnetFilter],
      subnetGroupName: 'subnetGroupName',
      subnets: [subnet],
      subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
    },
    timeout: cdk.Duration.minutes(30),
    vpc: vpc,
  },
  fallbackArtifact: artifact,
  variablesNamespace: 'variablesNamespace',
};
python
# 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,
            docker_server=codebuild.DockerServerOptions(
                compute_type=codebuild.DockerServerComputeType.SMALL,

                # the properties below are optional
                security_groups=[security_group]
            ),
            environment_variables={
                "environment_variables_key": codebuild.BuildEnvironmentVariable(
                    value=value,

                    # the properties below are optional
                    type=codebuild.BuildEnvironmentVariableType.PLAINTEXT
                )
            },
            fleet=fleet,
            host_kernel=codebuild.HostKernel.LINUX_KERNEL_4,
            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"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.codebuild.*;
import software.amazon.awscdk.services.codepipeline.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.logs.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.pipelines.*;
import software.constructs.*;

Artifact artifact;
ArtifactMap artifactMap;
Bucket bucket;
IBuildImage buildImage;
BuildSpec buildSpec;
Cache cache;
CodePipeline codePipeline;
Construct construct;
IFileSystemLocation fileSystemLocation;
Fleet fleet;
LogGroup logGroup;
PolicyStatement policyStatement;
SecurityGroup securityGroup;
StackOutputsMap stackOutputsMap;
Subnet subnet;
SubnetFilter subnetFilter;
Object value;
Vpc vpc;

ProduceActionOptions produceActionOptions = ProduceActionOptions.builder()
        .actionName("actionName")
        .artifacts(artifactMap)
        .pipeline(codePipeline)
        .runOrder(123)
        .scope(construct)
        .stackOutputsMap(stackOutputsMap)

        // the properties below are optional
        .beforeSelfMutation(false)
        .codeBuildDefaults(CodeBuildOptions.builder()
                .buildEnvironment(BuildEnvironment.builder()
                        .buildImage(buildImage)
                        .certificate(BuildEnvironmentCertificate.builder()
                                .bucket(bucket)
                                .objectKey("objectKey")
                                .build())
                        .computeType(ComputeType.SMALL)
                        .dockerServer(DockerServerOptions.builder()
                                .computeType(DockerServerComputeType.SMALL)

                                // the properties below are optional
                                .securityGroups(List.of(securityGroup))
                                .build())
                        .environmentVariables(Map.of(
                                "environmentVariablesKey", BuildEnvironmentVariable.builder()
                                        .value(value)

                                        // the properties below are optional
                                        .type(BuildEnvironmentVariableType.PLAINTEXT)
                                        .build()))
                        .fleet(fleet)
                        .hostKernel(HostKernel.LINUX_KERNEL_4)
                        .privileged(false)
                        .build())
                .cache(cache)
                .fileSystemLocations(List.of(fileSystemLocation))
                .logging(LoggingOptions.builder()
                        .cloudWatch(CloudWatchLoggingOptions.builder()
                                .enabled(false)
                                .logGroup(logGroup)
                                .prefix("prefix")
                                .build())
                        .s3(S3LoggingOptions.builder()
                                .bucket(bucket)

                                // the properties below are optional
                                .enabled(false)
                                .encrypted(false)
                                .prefix("prefix")
                                .build())
                        .build())
                .partialBuildSpec(buildSpec)
                .rolePolicy(List.of(policyStatement))
                .securityGroups(List.of(securityGroup))
                .subnetSelection(SubnetSelection.builder()
                        .availabilityZones(List.of("availabilityZones"))
                        .onePerAz(false)
                        .subnetFilters(List.of(subnetFilter))
                        .subnetGroupName("subnetGroupName")
                        .subnets(List.of(subnet))
                        .subnetType(SubnetType.PRIVATE_ISOLATED)
                        .build())
                .timeout(Duration.minutes(30))
                .vpc(vpc)
                .build())
        .fallbackArtifact(artifact)
        .variablesNamespace("variablesNamespace")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.CodePipeline;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Logs;
using Amazon.CDK.AWS.S3;
using Amazon.CDK.Pipelines;
using Constructs;

Artifact artifact;
ArtifactMap artifactMap;
Bucket bucket;
IBuildImage buildImage;
BuildSpec buildSpec;
Cache cache;
CodePipeline codePipeline;
Construct construct;
IFileSystemLocation fileSystemLocation;
Fleet fleet;
LogGroup logGroup;
PolicyStatement policyStatement;
SecurityGroup securityGroup;
StackOutputsMap stackOutputsMap;
Subnet subnet;
SubnetFilter subnetFilter;
var value;
Vpc vpc;
var produceActionOptions = new ProduceActionOptions {
    ActionName = "actionName",
    Artifacts = artifactMap,
    Pipeline = codePipeline,
    RunOrder = 123,
    Scope = construct,
    StackOutputsMap = stackOutputsMap,

    // the properties below are optional
    BeforeSelfMutation = false,
    CodeBuildDefaults = new CodeBuildOptions {
        BuildEnvironment = new BuildEnvironment {
            BuildImage = buildImage,
            Certificate = new BuildEnvironmentCertificate {
                Bucket = bucket,
                ObjectKey = "objectKey"
            },
            ComputeType = ComputeType.SMALL,
            DockerServer = new DockerServerOptions {
                ComputeType = DockerServerComputeType.SMALL,

                // the properties below are optional
                SecurityGroups = new [] { securityGroup }
            },
            EnvironmentVariables = new Dictionary<string, BuildEnvironmentVariable> {
                { "environmentVariablesKey", new BuildEnvironmentVariable {
                    Value = value,

                    // the properties below are optional
                    Type = BuildEnvironmentVariableType.PLAINTEXT
                } }
            },
            Fleet = fleet,
            HostKernel = HostKernel.LINUX_KERNEL_4,
            Privileged = false
        },
        Cache = cache,
        FileSystemLocations = new [] { fileSystemLocation },
        Logging = new LoggingOptions {
            CloudWatch = new CloudWatchLoggingOptions {
                Enabled = false,
                LogGroup = logGroup,
                Prefix = "prefix"
            },
            S3 = new S3LoggingOptions {
                Bucket = bucket,

                // the properties below are optional
                Enabled = false,
                Encrypted = false,
                Prefix = "prefix"
            }
        },
        PartialBuildSpec = buildSpec,
        RolePolicy = new [] { policyStatement },
        SecurityGroups = new [] { securityGroup },
        SubnetSelection = new SubnetSelection {
            AvailabilityZones = new [] { "availabilityZones" },
            OnePerAz = false,
            SubnetFilters = new [] { subnetFilter },
            SubnetGroupName = "subnetGroupName",
            Subnets = new [] { subnet },
            SubnetType = SubnetType.PRIVATE_ISOLATED
        },
        Timeout = Duration.Minutes(30),
        Vpc = vpc
    },
    FallbackArtifact = artifact,
    VariablesNamespace = "variablesNamespace"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import constructs "github.com/aws/constructs-go/constructs"

var artifact Artifact
var artifactMap ArtifactMap
var bucket Bucket
var buildImage IBuildImage
var buildSpec BuildSpec
var cache Cache
var codePipeline CodePipeline
var construct Construct
var fileSystemLocation IFileSystemLocation
var fleet Fleet
var logGroup LogGroup
var policyStatement PolicyStatement
var securityGroup SecurityGroup
var stackOutputsMap StackOutputsMap
var subnet Subnet
var subnetFilter SubnetFilter
var value interface{}
var vpc Vpc

produceActionOptions := &ProduceActionOptions{
	ActionName: jsii.String("actionName"),
	Artifacts: artifactMap,
	Pipeline: codePipeline,
	RunOrder: jsii.Number(123),
	Scope: construct,
	StackOutputsMap: stackOutputsMap,

	// the properties below are optional
	BeforeSelfMutation: jsii.Boolean(false),
	CodeBuildDefaults: &CodeBuildOptions{
		BuildEnvironment: &BuildEnvironment{
			BuildImage: buildImage,
			Certificate: &BuildEnvironmentCertificate{
				Bucket: bucket,
				ObjectKey: jsii.String("objectKey"),
			},
			ComputeType: awscdk.Aws_codebuild.ComputeType_SMALL,
			DockerServer: &DockerServerOptions{
				ComputeType: awscdk.*Aws_codebuild.DockerServerComputeType_SMALL,

				// the properties below are optional
				SecurityGroups: []ISecurityGroup{
					securityGroup,
				},
			},
			EnvironmentVariables: map[string]BuildEnvironmentVariable{
				"environmentVariablesKey": &BuildEnvironmentVariable{
					"value": value,

					// the properties below are optional
					"type": awscdk.*Aws_codebuild.BuildEnvironmentVariableType_PLAINTEXT,
				},
			},
			Fleet: fleet,
			HostKernel: awscdk.*Aws_codebuild.HostKernel_LINUX_KERNEL_4,
			Privileged: jsii.Boolean(false),
		},
		Cache: cache,
		FileSystemLocations: []IFileSystemLocation{
			fileSystemLocation,
		},
		Logging: &LoggingOptions{
			CloudWatch: &CloudWatchLoggingOptions{
				Enabled: jsii.Boolean(false),
				LogGroup: logGroup,
				Prefix: jsii.String("prefix"),
			},
			S3: &S3LoggingOptions{
				Bucket: bucket,

				// the properties below are optional
				Enabled: jsii.Boolean(false),
				Encrypted: jsii.Boolean(false),
				Prefix: jsii.String("prefix"),
			},
		},
		PartialBuildSpec: buildSpec,
		RolePolicy: []PolicyStatement{
			policyStatement,
		},
		SecurityGroups: []ISecurityGroup{
			securityGroup,
		},
		SubnetSelection: &SubnetSelection{
			AvailabilityZones: []*string{
				jsii.String("availabilityZones"),
			},
			OnePerAz: jsii.Boolean(false),
			SubnetFilters: []SubnetFilter{
				subnetFilter,
			},
			SubnetGroupName: jsii.String("subnetGroupName"),
			Subnets: []ISubnet{
				subnet,
			},
			SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
		},
		Timeout: cdk.Duration_Minutes(jsii.Number(30)),
		Vpc: vpc,
	},
	FallbackArtifact: artifact,
	VariablesNamespace: jsii.String("variablesNamespace"),
}

Properties ​

actionNamestringaction_namestractionNameStringActionNamestringActionName*string required #
Name the action should get.
artifactsArtifactMapartifactsArtifactMapartifactsArtifactMapArtifactsArtifactMapArtifactsArtifactMap required #
Helper object to translate FileSets to CodePipeline Artifacts.
beforeSelfMutationoptionalbooleanbefore_self_mutationoptionalboolbeforeSelfMutationoptionalBooleanBeforeSelfMutationoptionalboolBeforeSelfMutationoptional*bool = false #
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).

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

Default: No CodeBuild project defaults

fallbackArtifactoptionalArtifactfallback_artifactoptionalArtifactfallbackArtifactoptionalArtifactFallbackArtifactoptionalArtifactFallbackArtifactoptionalArtifact #
An input artifact that CodeBuild projects that don't actually need an input artifact can use.

Default: A fallback artifact does not exist

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.

pipelineCodePipelinepipelineCodePipelinepipelineCodePipelinePipelineCodePipelinePipelineCodePipeline required #
The pipeline the action is being generated for.
runOrdernumberrun_orderint | floatrunOrderNumberRunOrderdoubleRunOrder*float64 required #
RunOrder the action should get.
scopeConstructscopeConstructscopeConstructScopeConstructScopeConstruct required #
Scope in which to create constructs.
stackOutputsMapStackOutputsMapstack_outputs_mapStackOutputsMapstackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMap required #
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.

variablesNamespaceoptionalstringvariables_namespaceoptionalstrvariablesNamespaceoptionalStringVariablesNamespaceoptionalstringVariablesNamespaceoptional*string #
If this step is producing outputs, the variables namespace assigned to it.

Default: Step doesn't produce any outputs

Pass this on to the Action you are creating.