class PublishAssetsAction (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Pipelines.PublishAssetsAction |
Java | software.amazon.awscdk.pipelines.PublishAssetsAction |
Python | aws_cdk.pipelines.PublishAssetsAction |
TypeScript (source) | @aws-cdk/pipelines » PublishAssetsAction |
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Implements
IConstruct, IConstruct, IDependable, IAction
Action to publish an asset in the pipeline.
Creates a CodeBuild project which will use the CDK CLI to prepare and publish the asset.
You do not need to instantiate this action -- it will automatically be added by the pipeline when you add stacks that use assets.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import * as pipelines from '@aws-cdk/pipelines';
declare const artifact: codepipeline.Artifact;
declare const buildSpec: codebuild.BuildSpec;
declare const dependable: cdk.IDependable;
declare const role: iam.Role;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const publishAssetsAction = new pipelines.PublishAssetsAction(this, 'MyPublishAssetsAction', {
actionName: 'actionName',
assetType: pipelines.AssetType.FILE,
cloudAssemblyInput: artifact,
// the properties below are optional
buildSpec: buildSpec,
cdkCliVersion: 'cdkCliVersion',
createBuildspecFile: false,
dependable: dependable,
preInstallCommands: ['preInstallCommands'],
projectName: 'projectName',
role: role,
subnetSelection: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnetName: 'subnetName',
subnets: [subnet],
subnetType: ec2.SubnetType.ISOLATED,
},
vpc: vpc,
});
Initializer
new PublishAssetsAction(scope: Construct, id: string, props: PublishAssetsActionProps)
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Parameters
- scope
Construct - id
string - props
PublishAssets Action Props
Construct Props
| Name | Type | Description |
|---|---|---|
| action | string | Name of publishing action. |
| asset | Asset | AssetType we're publishing. |
| cloud | Artifact | The CodePipeline artifact that holds the Cloud Assembly. |
| build | Build | Custom BuildSpec that is merged with generated one. |
| cdk | string | Version of CDK CLI to 'npm install'. |
| create | boolean | Use a file buildspec written to the cloud assembly instead of an inline buildspec. |
| dependable? | IDependable | Any Dependable construct that the CodeBuild project needs to take a dependency on. |
| pre | string[] | Additional commands to run before installing cdk-assert Use this to setup proxies or npm mirrors. |
| project | string | Name of the CodeBuild project. |
| role? | IRole | Role to use for CodePipeline and CodeBuild to build and publish the assets. |
| subnet | Subnet | Which subnets to use. |
| vpc? | IVpc | The VPC where to execute the PublishAssetsAction. |
actionName
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
string
Name of publishing action.
assetType
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Asset
AssetType we're publishing.
cloudAssemblyInput
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Artifact
The CodePipeline artifact that holds the Cloud Assembly.
buildSpec?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Build
(optional, default: none)
Custom BuildSpec that is merged with generated one.
cdkCliVersion?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
string
(optional, default: Latest version)
Version of CDK CLI to 'npm install'.
createBuildspecFile?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
boolean
(optional, default: false)
Use a file buildspec written to the cloud assembly instead of an inline buildspec.
This prevents size limitation errors as inline specs have a max length of 25600 characters
dependable?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
IDependable
(optional, default: none)
Any Dependable construct that the CodeBuild project needs to take a dependency on.
preInstallCommands?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
string[]
(optional, default: -)
Additional commands to run before installing cdk-assert Use this to setup proxies or npm mirrors.
projectName?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
string
(optional, default: Automatically generated)
Name of the CodeBuild project.
role?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
IRole
(optional, default: Automatically generated)
Role to use for CodePipeline and CodeBuild to build and publish the assets.
subnetSelection?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Subnet
(optional, default: All private subnets.)
Which subnets to use.
Only used if 'vpc' is supplied.
vpc?
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
IVpc
(optional, default: No VPC)
The VPC where to execute the PublishAssetsAction.
Properties
| Name | Type | Description |
|---|---|---|
| action | Action | Exists to implement IAction. |
| node | Construct | The construct tree node associated with this construct. |
actionProperties
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Action
Exists to implement IAction.
node
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Type:
Construct
The construct tree node associated with this construct.
Methods
| Name | Description |
|---|---|
| add | Add a single publishing command. |
| bind(scope, stage, options) | Exists to implement IAction. |
| on | Exists to implement IAction. |
| to | Returns a string representation of this construct. |
addPublishCommand(relativeManifestPath, assetSelector)
public addPublishCommand(relativeManifestPath: string, assetSelector: string): void
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Parameters
- relativeManifestPath
string - assetSelector
string
Add a single publishing command.
Manifest path should be relative to the root Cloud Assembly.
bind(scope, stage, options)
public bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Parameters
- scope
Construct - stage
IStage - options
ActionBind Options
Returns
Exists to implement IAction.
onStateChange(name, target?, options?)
public onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Parameters
- name
string - target
IRuleTarget - options
RuleProps
Returns
Exists to implement IAction.
toString()
public toString(): string
⚠️ Deprecated: This class is part of the old API. Use the API based on the CodePipeline class instead
Returns
string
Returns a string representation of this construct.

.NET
Java
Python
TypeScript (