aws-cdk-lib.pipelines.ProduceActionOptions

interface ProduceActionOptions

LanguageType name
.NETAmazon.CDK.Pipelines.ProduceActionOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#ProduceActionOptions
Javasoftware.amazon.awscdk.pipelines.ProduceActionOptions
Pythonaws_cdk.pipelines.ProduceActionOptions
TypeScript (source)aws-cdk-lib » pipelines » ProduceActionOptions

Options for the CodePipelineActionFactory.produce() method.

Example

// 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 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,
      environmentVariables: {
        environmentVariablesKey: {
          value: value,

          // the properties below are optional
          type: codebuild.BuildEnvironmentVariableType.PLAINTEXT,
        },
      },
      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

NameTypeDescription
actionNamestringName the action should get.
artifactsArtifactMapHelper object to translate FileSets to CodePipeline Artifacts.
pipelineCodePipelineThe pipeline the action is being generated for.
runOrdernumberRunOrder the action should get.
scopeConstructScope in which to create constructs.
stackOutputsMapStackOutputsMapHelper object to produce variables exported from stack deployments.
beforeSelfMutation?booleanWhether or not this action is inserted before self mutation.
codeBuildDefaults?CodeBuildOptionsIf this action factory creates a CodeBuild step, default options to inherit.
fallbackArtifact?ArtifactAn input artifact that CodeBuild projects that don't actually need an input artifact can use.
variablesNamespace?stringIf this step is producing outputs, the variables namespace assigned to it.

actionName

Type: string

Name the action should get.


artifacts

Type: ArtifactMap

Helper object to translate FileSets to CodePipeline Artifacts.


pipeline

Type: CodePipeline

The pipeline the action is being generated for.


runOrder

Type: number

RunOrder the action should get.


scope

Type: Construct

Scope in which to create constructs.


stackOutputsMap

Type: 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.


beforeSelfMutation?

Type: boolean (optional, default: 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).


codeBuildDefaults?

Type: CodeBuildOptions (optional, default: No CodeBuild project defaults)

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


fallbackArtifact?

Type: Artifact (optional, default: A fallback artifact does not exist)

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.


variablesNamespace?

Type: string (optional, default: Step doesn't produce any outputs)

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

Pass this on to the Action you are creating.