Skip to content
v2.275.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',
};

Properties ​

actionNamestringaction_namestractionNameStringActionNamestringActionName*stringrequired#
Name the action should get.
artifactsArtifactMapartifactsArtifactMapartifactsArtifactMapArtifactsArtifactMapArtifactsArtifactMaprequired#
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.

pipelineCodePipelinepipelineCodePipelinepipelineCodePipelinePipelineCodePipelinePipelineCodePipelinerequired#
The pipeline the action is being generated for.
runOrdernumberrun_orderint | floatrunOrderNumberRunOrderdoubleRunOrder*float64required#
RunOrder the action should get.
scopeConstructscopeConstructscopeConstructScopeConstructScopeConstructrequired#
Scope in which to create constructs.
stackOutputsMapStackOutputsMapstack_outputs_mapStackOutputsMapstackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMapStackOutputsMaprequired#
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.