Interface VariableProps

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:58.911Z") @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