SimpleSynthAction

class aws_cdk.pipelines.SimpleSynthAction(*, synth_command, build_command=None, build_commands=None, install_command=None, install_commands=None, test_commands=None, cloud_assembly_artifact, source_artifact, action_name=None, additional_artifacts=None, copy_environment_variables=None, environment=None, environment_variables=None, project_name=None, role_policy_statements=None, subdirectory=None, subnet_selection=None, vpc=None)

Bases: object

(experimental) A standard synth with a generated buildspec.

Stability

experimental

Parameters
  • synth_command (str) – (experimental) The synth command.

  • build_command (Optional[str]) – (deprecated) The build command. If your programming language requires a compilation step, put the compilation command here. Default: - No build required

  • build_commands (Optional[Sequence[str]]) – (experimental) The build commands. If your programming language requires a compilation step, put the compilation command here. Default: - No build required

  • install_command (Optional[str]) – (deprecated) The install command. If not provided by the build image or another dependency management tool, at least install the CDK CLI here using npm install -g aws-cdk. Default: - No install required

  • install_commands (Optional[Sequence[str]]) – (experimental) Install commands. If not provided by the build image or another dependency management tool, at least install the CDK CLI here using npm install -g aws-cdk. Default: - No install required

  • test_commands (Optional[Sequence[str]]) – (experimental) Test commands. These commands are run after the build commands but before the synth command. Default: - No test commands

  • cloud_assembly_artifact (Artifact) – (experimental) The artifact where the CloudAssembly should be emitted.

  • source_artifact (Artifact) – (experimental) The source artifact of the CodePipeline.

  • action_name (Optional[str]) – (experimental) Name of the build action. Default: ‘Synth’

  • additional_artifacts (Optional[Sequence[AdditionalArtifact]]) – (experimental) Produce additional output artifacts after the build based on the given directories. Can be used to produce additional artifacts during the build step, separate from the cloud assembly, which can be used further on in the pipeline. Directories are evaluated with respect to subdirectory. Default: - No additional artifacts generated

  • copy_environment_variables (Optional[Sequence[str]]) – (experimental) Environment variables to copy over from parent env. These are environment variables that are being used by the build. Default: - No environment variables copied

  • environment (Optional[BuildEnvironment]) – (experimental) Build environment to use for CodeBuild job. Default: BuildEnvironment.LinuxBuildImage.STANDARD_4_0

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

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

  • role_policy_statements (Optional[Sequence[PolicyStatement]]) – (experimental) Policy statements to add to role used during the synth. Can be used to add acces to a CodeArtifact repository etc. Default: - No policy statements added to CodeBuild Project Role

  • subdirectory (Optional[str]) – (experimental) Directory inside the source where package.json and cdk.json are located. Default: - Repository root

  • subnet_selection (Optional[SubnetSelection]) – (experimental) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

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

Stability

experimental

Methods

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

(experimental) Exists to implement IAction.

Parameters
Stability

experimental

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)

(experimental) 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 (Optional[EventPattern]) – 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

experimental

Return type

Rule

Attributes

action_properties

(experimental) Exists to implement IAction.

Stability

experimental

Return type

ActionProperties

grant_principal

(experimental) The CodeBuild Project’s principal.

Stability

experimental

Return type

IPrincipal

project

(experimental) Project generated to run the synth command.

Stability

experimental

Return type

IProject

Static Methods

classmethod standard_npm_synth(*, build_command=None, install_command=None, synth_command=None, cloud_assembly_artifact, source_artifact, action_name=None, additional_artifacts=None, copy_environment_variables=None, environment=None, environment_variables=None, project_name=None, role_policy_statements=None, subdirectory=None, subnet_selection=None, vpc=None)

(experimental) Create a standard NPM synth action.

Uses npm ci to install dependencies and npx cdk synth to synthesize.

If you need a build step, add buildCommand: 'npm run build'.

Parameters
  • build_command (Optional[str]) – (experimental) The build command. By default, we assume NPM projects are either written in JavaScript or are using ts-node, so don’t need a build command. Otherwise, put the build command here, for example npm run build. Default: - No build required

  • install_command (Optional[str]) – (experimental) The install command. Default: ‘npm ci’

  • synth_command (Optional[str]) – (experimental) The synth command. Default: ‘npx cdk synth’

  • cloud_assembly_artifact (Artifact) – (experimental) The artifact where the CloudAssembly should be emitted.

  • source_artifact (Artifact) – (experimental) The source artifact of the CodePipeline.

  • action_name (Optional[str]) – (experimental) Name of the build action. Default: ‘Synth’

  • additional_artifacts (Optional[Sequence[AdditionalArtifact]]) – (experimental) Produce additional output artifacts after the build based on the given directories. Can be used to produce additional artifacts during the build step, separate from the cloud assembly, which can be used further on in the pipeline. Directories are evaluated with respect to subdirectory. Default: - No additional artifacts generated

  • copy_environment_variables (Optional[Sequence[str]]) – (experimental) Environment variables to copy over from parent env. These are environment variables that are being used by the build. Default: - No environment variables copied

  • environment (Optional[BuildEnvironment]) – (experimental) Build environment to use for CodeBuild job. Default: BuildEnvironment.LinuxBuildImage.STANDARD_4_0

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

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

  • role_policy_statements (Optional[Sequence[PolicyStatement]]) – (experimental) Policy statements to add to role used during the synth. Can be used to add acces to a CodeArtifact repository etc. Default: - No policy statements added to CodeBuild Project Role

  • subdirectory (Optional[str]) – (experimental) Directory inside the source where package.json and cdk.json are located. Default: - Repository root

  • subnet_selection (Optional[SubnetSelection]) – (experimental) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

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

Stability

experimental

Return type

SimpleSynthAction

classmethod standard_yarn_synth(*, build_command=None, install_command=None, synth_command=None, cloud_assembly_artifact, source_artifact, action_name=None, additional_artifacts=None, copy_environment_variables=None, environment=None, environment_variables=None, project_name=None, role_policy_statements=None, subdirectory=None, subnet_selection=None, vpc=None)

(experimental) Create a standard Yarn synth action.

Uses yarn install --frozen-lockfile to install dependencies and npx cdk synth to synthesize.

If you need a build step, add buildCommand: 'yarn build'.

Parameters
  • build_command (Optional[str]) – (experimental) The build command. By default, we assume NPM projects are either written in JavaScript or are using ts-node, so don’t need a build command. Otherwise, put the build command here, for example npm run build. Default: - No build required

  • install_command (Optional[str]) – (experimental) The install command. Default: ‘yarn install –frozen-lockfile’

  • synth_command (Optional[str]) – (experimental) The synth command. Default: ‘npx cdk synth’

  • cloud_assembly_artifact (Artifact) – (experimental) The artifact where the CloudAssembly should be emitted.

  • source_artifact (Artifact) – (experimental) The source artifact of the CodePipeline.

  • action_name (Optional[str]) – (experimental) Name of the build action. Default: ‘Synth’

  • additional_artifacts (Optional[Sequence[AdditionalArtifact]]) – (experimental) Produce additional output artifacts after the build based on the given directories. Can be used to produce additional artifacts during the build step, separate from the cloud assembly, which can be used further on in the pipeline. Directories are evaluated with respect to subdirectory. Default: - No additional artifacts generated

  • copy_environment_variables (Optional[Sequence[str]]) – (experimental) Environment variables to copy over from parent env. These are environment variables that are being used by the build. Default: - No environment variables copied

  • environment (Optional[BuildEnvironment]) – (experimental) Build environment to use for CodeBuild job. Default: BuildEnvironment.LinuxBuildImage.STANDARD_4_0

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

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

  • role_policy_statements (Optional[Sequence[PolicyStatement]]) – (experimental) Policy statements to add to role used during the synth. Can be used to add acces to a CodeArtifact repository etc. Default: - No policy statements added to CodeBuild Project Role

  • subdirectory (Optional[str]) – (experimental) Directory inside the source where package.json and cdk.json are located. Default: - Repository root

  • subnet_selection (Optional[SubnetSelection]) – (experimental) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

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

Stability

experimental

Return type

SimpleSynthAction