ShellScriptActionProps

class aws_cdk.pipelines.ShellScriptActionProps(*, action_name, commands, additional_artifacts=None, bash_options=None, environment=None, environment_variables=None, role_policy_statements=None, run_order=None, security_groups=None, subnet_selection=None, use_outputs=None, vpc=None)

Bases: object

(deprecated) Properties for ShellScriptAction.

Parameters:
  • action_name (str) – (deprecated) Name of the validation action in the pipeline.

  • commands (Sequence[str]) – (deprecated) Commands to run.

  • additional_artifacts (Optional[Sequence[Artifact]]) – (deprecated) Additional artifacts to use as input for the CodeBuild project. You can use these files to load more complex test sets into the shellscript build environment. The files artifact given here will be unpacked into the current working directory, the other ones will be unpacked into directories which are available through the environment variables $CODEBUILD_SRC_DIR_. The CodeBuild job must have at least one input artifact, so you must provide either at least one additional artifact here or one stack output using useOutput. Default: - No additional artifacts

  • bash_options (Optional[str]) – (deprecated) Bash options to set at the start of the script. Default: ‘-eu’ (errexit and nounset)

  • environment (Union[BuildEnvironment, Dict[str, Any], None]) – (deprecated) The CodeBuild environment where scripts are executed. Default: LinuxBuildImage.STANDARD_5_0

  • environment_variables (Optional[Mapping[str, Union[BuildEnvironmentVariable, Dict[str, Any]]]]) – (deprecated) Environment variables to send into build. Default: - No additional environment variables

  • role_policy_statements (Optional[Sequence[PolicyStatement]]) – (deprecated) Additional policy statements to add to the execution role. Default: - No policy statements

  • run_order (Union[int, float, None]) – (deprecated) RunOrder for this action. Use this to sequence the shell script after the deployments. The default value is 100 so you don’t have to supply the value if you just want to run this after the application stacks have been deployed, and you don’t have more than 100 stacks. Default: 100

  • security_groups (Optional[Sequence[ISecurityGroup]]) – (deprecated) Which security group to associate with the script’s project network interfaces. If no security group is identified, one will be created automatically. Only used if ‘vpc’ is supplied. Default: - Security group will be automatically created.

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

  • use_outputs (Optional[Mapping[str, StackOutput]]) – (deprecated) Stack outputs to make available as environment variables. Default: - No outputs used

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

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.aws_s3 as s3
import aws_cdk.pipelines as pipelines

# artifact: codepipeline.Artifact
# bucket: s3.Bucket
# build_image: codebuild.IBuildImage
# policy_statement: iam.PolicyStatement
# security_group: ec2.SecurityGroup
# stack_output: pipelines.StackOutput
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# value: Any
# vpc: ec2.Vpc

shell_script_action_props = pipelines.ShellScriptActionProps(
    action_name="actionName",
    commands=["commands"],

    # the properties below are optional
    additional_artifacts=[artifact],
    bash_options="bashOptions",
    environment=codebuild.BuildEnvironment(
        build_image=build_image,
        certificate=codebuild.BuildEnvironmentCertificate(
            bucket=bucket,
            object_key="objectKey"
        ),
        compute_type=codebuild.ComputeType.SMALL,
        environment_variables={
            "environment_variables_key": codebuild.BuildEnvironmentVariable(
                value=value,

                # the properties below are optional
                type=codebuild.BuildEnvironmentVariableType.PLAINTEXT
            )
        },
        privileged=False
    ),
    environment_variables={
        "environment_variables_key": codebuild.BuildEnvironmentVariable(
            value=value,

            # the properties below are optional
            type=codebuild.BuildEnvironmentVariableType.PLAINTEXT
        )
    },
    role_policy_statements=[policy_statement],
    run_order=123,
    security_groups=[security_group],
    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
    ),
    use_outputs={
        "use_outputs_key": stack_output
    },
    vpc=vpc
)

Attributes

action_name

(deprecated) Name of the validation action in the pipeline.

Stability:

deprecated

additional_artifacts

(deprecated) Additional artifacts to use as input for the CodeBuild project.

You can use these files to load more complex test sets into the shellscript build environment.

The files artifact given here will be unpacked into the current working directory, the other ones will be unpacked into directories which are available through the environment variables $CODEBUILD_SRC_DIR_.

The CodeBuild job must have at least one input artifact, so you must provide either at least one additional artifact here or one stack output using useOutput.

Default:
  • No additional artifacts

Stability:

deprecated

bash_options

(deprecated) Bash options to set at the start of the script.

Default:

‘-eu’ (errexit and nounset)

Stability:

deprecated

commands

(deprecated) Commands to run.

Stability:

deprecated

environment

(deprecated) The CodeBuild environment where scripts are executed.

Default:

LinuxBuildImage.STANDARD_5_0

Stability:

deprecated

environment_variables

(deprecated) Environment variables to send into build.

Default:
  • No additional environment variables

Stability:

deprecated

role_policy_statements

(deprecated) Additional policy statements to add to the execution role.

Default:
  • No policy statements

Stability:

deprecated

run_order

(deprecated) RunOrder for this action.

Use this to sequence the shell script after the deployments.

The default value is 100 so you don’t have to supply the value if you just want to run this after the application stacks have been deployed, and you don’t have more than 100 stacks.

Default:

100

Stability:

deprecated

security_groups

(deprecated) Which security group to associate with the script’s project network interfaces.

If no security group is identified, one will be created automatically.

Only used if ‘vpc’ is supplied.

Default:
  • Security group will be automatically created.

Stability:

deprecated

subnet_selection

(deprecated) Which subnets to use.

Only used if ‘vpc’ is supplied.

Default:
  • All private subnets.

Stability:

deprecated

use_outputs

(deprecated) Stack outputs to make available as environment variables.

Default:
  • No outputs used

Stability:

deprecated

vpc

(deprecated) The VPC where to execute the specified script.

Default:
  • No VPC

Stability:

deprecated