PublishAssetsAction

class aws_cdk.pipelines.PublishAssetsAction(scope, id, *, action_name, asset_type, cloud_assembly_input, build_spec=None, cdk_cli_version=None, create_buildspec_file=None, dependable=None, pre_install_commands=None, project_name=None, role=None, subnet_selection=None, vpc=None)

Bases: Construct

(deprecated) 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.

Deprecated:

This class is part of the old API. Use the API based on the CodePipeline class instead

Stability:

deprecated

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.core as cdk
import aws_cdk.pipelines as pipelines

# artifact: codepipeline.Artifact
# build_spec: codebuild.BuildSpec
# dependable: cdk.IDependable
# role: iam.Role
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc: ec2.Vpc

publish_assets_action = pipelines.PublishAssetsAction(self, "MyPublishAssetsAction",
    action_name="actionName",
    asset_type=pipelines.AssetType.FILE,
    cloud_assembly_input=artifact,

    # the properties below are optional
    build_spec=build_spec,
    cdk_cli_version="cdkCliVersion",
    create_buildspec_file=False,
    dependable=dependable,
    pre_install_commands=["preInstallCommands"],
    project_name="projectName",
    role=role,
    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
    ),
    vpc=vpc
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • action_name (str) – (deprecated) Name of publishing action.

  • asset_type (AssetType) – (deprecated) AssetType we’re publishing.

  • cloud_assembly_input (Artifact) – (deprecated) The CodePipeline artifact that holds the Cloud Assembly.

  • build_spec (Optional[BuildSpec]) – (deprecated) Custom BuildSpec that is merged with generated one. Default: - none

  • cdk_cli_version (Optional[str]) – (deprecated) Version of CDK CLI to ‘npm install’. Default: - Latest version

  • create_buildspec_file (Optional[bool]) – (deprecated) 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 Default: false

  • dependable (Optional[IDependable]) – (deprecated) Any Dependable construct that the CodeBuild project needs to take a dependency on. Default: - none

  • pre_install_commands (Optional[Sequence[str]]) – (deprecated) Additional commands to run before installing cdk-assert Use this to setup proxies or npm mirrors. Default: -

  • project_name (Optional[str]) – (deprecated) Name of the CodeBuild project. Default: - Automatically generated

  • role (Optional[IRole]) – (deprecated) Role to use for CodePipeline and CodeBuild to build and publish the assets. Default: - Automatically generated

  • subnet_selection (Union[SubnetSelection, Dict[str, Any], None]) – (deprecated) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

  • vpc (Optional[IVpc]) – (deprecated) The VPC where to execute the PublishAssetsAction. Default: - No VPC

Stability:

deprecated

Methods

add_publish_command(relative_manifest_path, asset_selector)

(deprecated) Add a single publishing command.

Manifest path should be relative to the root Cloud Assembly.

Parameters:
  • relative_manifest_path (str) –

  • asset_selector (str) –

Stability:

deprecated

Return type:

None

bind(scope, stage, *, bucket, role)

(deprecated) Exists to implement IAction.

Parameters:
Stability:

deprecated

Return type:

ActionConfig

on_state_change(name, target=None, *, description=None, enabled=None, event_bus=None, event_pattern=None, rule_name=None, schedule=None, targets=None)

(deprecated) Exists to implement IAction.

Parameters:
  • name (str) –

  • target (Optional[IRuleTarget]) –

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description.

  • enabled (Optional[bool]) – Indicates whether the rule is enabled. Default: true

  • event_bus (Optional[IEventBus]) – The event bus to associate with this rule. Default: - The default event bus.

  • event_pattern (Union[EventPattern, Dict[str, Any], None]) – Describes which events EventBridge routes to the specified target. These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide. Default: - None.

  • rule_name (Optional[str]) – A name for the rule. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.

  • schedule (Optional[Schedule]) – The schedule or rate (frequency) that determines when EventBridge runs the rule. For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide. Default: - None.

  • targets (Optional[Sequence[IRuleTarget]]) – Targets to invoke when this rule matches an event. Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]). Default: - No targets.

Stability:

deprecated

Return type:

Rule

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

action_properties

(deprecated) Exists to implement IAction.

Stability:

deprecated

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool