Interface VariableProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
VariableProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:04.443Z") @Stability(Stable) public interface VariableProps extends software.amazon.jsii.JsiiSerializable
Properties of pipeline-level variable.

Example:

 S3SourceAction sourceAction;
 Artifact sourceOutput;
 Bucket deployBucket;
 // Pipeline-level variable
 Variable variable = Variable.Builder.create()
         .variableName("bucket-var")
         .description("description")
         .defaultValue("sample")
         .build();
 Pipeline.Builder.create(this, "Pipeline")
         .pipelineType(PipelineType.V2)
         .variables(List.of(variable))
         .stages(List.of(StageProps.builder()
                 .stageName("Source")
                 .actions(List.of(sourceAction))
                 .build(), StageProps.builder()
                 .stageName("Deploy")
                 .actions(List.of(
                     S3DeployAction.Builder.create()
                             .actionName("DeployAction")
                             // can reference the variables
                             .objectKey(String.format("%s.txt", variable.reference()))
                             .input(sourceOutput)
                             .bucket(deployBucket)
                             .build()))
                 .build()))
         .build();
 
  • Method Details

    • getVariableName

      @Stability(Stable) @NotNull String getVariableName()
      The name of a pipeline-level variable.
    • getDefaultValue

      @Stability(Stable) @Nullable default String getDefaultValue()
      The default value of a pipeline-level variable.

      Default: - No default value.

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      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.

      Default: - No description.

    • builder

      @Stability(Stable) static VariableProps.Builder builder()
      Returns:
      a VariableProps.Builder of VariableProps