Class Variable
Pipeline-Level variable.
Inheritance
System.Object
Variable
Namespace: Amazon.CDK.AWS.CodePipeline
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Variable : DeputyBase
Syntax (vb)
Public Class Variable
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
S3SourceAction sourceAction;
Artifact sourceOutput;
Bucket deployBucket;
// Pipeline-level variable
var variable = new Variable(new VariableProps {
VariableName = "bucket-var",
Description = "description",
DefaultValue = "sample"
});
new Pipeline(this, "Pipeline", new PipelineProps {
PipelineType = PipelineType.V2,
Variables = new [] { variable },
Stages = new [] { new StageProps {
StageName = "Source",
Actions = new [] { sourceAction }
}, new StageProps {
StageName = "Deploy",
Actions = new [] {
new S3DeployAction(new S3DeployActionProps {
ActionName = "DeployAction",
// can reference the variables
ObjectKey = $"{variable.reference()}.txt",
Input = sourceOutput,
Bucket = deployBucket
}) }
} }
});
Synopsis
Constructors
Variable(IVariableProps) | |
Variable(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Variable(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
VariableName | The name of a pipeline-level variable. |
Methods
Reference() | Reference the variable name at Pipeline actions. |
Constructors
Variable(IVariableProps)
Variable(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Variable(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Variable(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Variable(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
VariableName
The name of a pipeline-level variable.
public virtual string VariableName { get; }
Property Value
System.String
Methods
Reference()
Reference the variable name at Pipeline actions.
public virtual string Reference()
Returns
System.String
The variable name in a format that can be referenced at Pipeline actions