interface VariableProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.VariableProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#VariableProps |
![]() | software.amazon.awscdk.services.codepipeline.VariableProps |
![]() | aws_cdk.aws_codepipeline.VariableProps |
![]() | aws-cdk-lib » aws_codepipeline » VariableProps |
Properties of pipeline-level variable.
Example
declare const sourceAction: codepipeline_actions.S3SourceAction;
declare const sourceOutput: codepipeline.Artifact;
declare const deployBucket: s3.Bucket;
// Pipeline-level variable
const variable = new codepipeline.Variable({
variableName: 'bucket-var',
description: 'description',
defaultValue: 'sample',
});
new codepipeline.Pipeline(this, 'Pipeline', {
pipelineType: codepipeline.PipelineType.V2,
variables: [variable],
stages: [
{
stageName: 'Source',
actions: [sourceAction],
},
{
stageName: 'Deploy',
actions: [
new codepipeline_actions.S3DeployAction({
actionName: 'DeployAction',
// can reference the variables
objectKey: `${variable.reference()}.txt`,
input: sourceOutput,
bucket: deployBucket,
}),
],
},
],
});
Properties
Name | Type | Description |
---|---|---|
variable | string | The name of a pipeline-level variable. |
default | string | The default value of a pipeline-level variable. |
description? | string | The description of a pipeline-level variable. |
variableName
Type:
string
The name of a pipeline-level variable.
defaultValue?
Type:
string
(optional, default: No default value.)
The default value of a pipeline-level variable.
description?
Type:
string
(optional, default: No description.)
The description of a pipeline-level variable.
It's used to add additional context about the variable, and not being used at time when pipeline executes.