interface CommandsActionProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Actions.CommandsActionProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#CommandsActionProps |
![]() | software.amazon.awscdk.services.codepipeline.actions.CommandsActionProps |
![]() | aws_cdk.aws_codepipeline_actions.CommandsActionProps |
![]() | aws-cdk-lib » aws_codepipeline_actions » CommandsActionProps |
Construction properties of the CommandsAction
.
Example
declare const sourceArtifact: codepipeline.Artifact;
declare const outputArtifact: codepipeline.Artifact;
const commandsAction = new codepipeline_actions.CommandsAction({
actionName: 'Commands',
commands: [
'export MY_OUTPUT=my-key',
],
input: sourceArtifact,
output: outputArtifact,
outputVariables: ['MY_OUTPUT', 'CODEBUILD_BUILD_ID'], // CODEBUILD_BUILD_ID is a variable defined by CodeBuild
});
// Deploy action
const deployAction = new codepipeline_actions.S3DeployAction({
actionName: 'DeployAction',
extract: true,
input: outputArtifact,
bucket: new s3.Bucket(this, 'DeployBucket'),
objectKey: commandsAction.variable('MY_OUTPUT'), // the variable emitted by the Commands action
});
Properties
Name | Type | Description |
---|---|---|
action | string | The physical, human-readable name of the Action. |
commands | string[] | Shell commands for the Commands action to run. |
input | Artifact | The source to use as input for this action. |
extra | Artifact [] | The list of additional input artifacts for this action. |
output? | Artifact | The output artifact for this action. |
output | string[] | The names of the variables in your environment that you want to export. |
role? | IRole | The Role in which context's this Action will be executing in. |
run | number | The runOrder property for this Action. |
variables | string | The name of the namespace to use for variables emitted by this action. |
actionName
Type:
string
The physical, human-readable name of the Action.
Note that Action names must be unique within a single Stage.
commands
Type:
string[]
Shell commands for the Commands action to run.
All formats are supported except multi-line formats.
The length of the commands array must be between 1 and 50.
input
Type:
Artifact
The source to use as input for this action.
extraInputs?
Type:
Artifact
[]
(optional, default: no extra inputs)
The list of additional input artifacts for this action.
output?
Type:
Artifact
(optional, default: no output artifact)
The output artifact for this action.
You can filter files that you want to export as the output artifact for the action. Example
new codepipeline.Artifact('CommandsArtifact', ['my-dir/**']);
outputVariables?
Type:
string[]
(optional, default: No output variables are exported)
The names of the variables in your environment that you want to export.
These variables can be referenced in other actions by using the variable
method
of this class.
role?
Type:
IRole
(optional, default: a new Role will be generated)
The Role in which context's this Action will be executing in.
The Pipeline's Role will assume this Role
(the required permissions for that will be granted automatically)
right before executing this Action.
This Action will be passed into your IAction.bind
method in the ActionBindOptions.role
property.
runOrder?
Type:
number
(optional, default: 1)
The runOrder property for this Action.
RunOrder determines the relative order in which multiple Actions in the same Stage execute.
variablesNamespace?
Type:
string
(optional, default: a name will be generated, based on the stage and action names,
if any of the action's variables were referenced - otherwise,
no namespace will be set)
The name of the namespace to use for variables emitted by this action.