Interface BuildEnvironmentVariable

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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:14.016Z") @Stability(Stable) public interface BuildEnvironmentVariable extends software.amazon.jsii.JsiiSerializable
Example:

 // later:
 PipelineProject project;
 Artifact sourceOutput = new Artifact();
 CodeBuildAction buildAction = CodeBuildAction.Builder.create()
         .actionName("Build1")
         .input(sourceOutput)
         .project(PipelineProject.Builder.create(this, "Project")
                 .buildSpec(BuildSpec.fromObject(Map.of(
                         "version", "0.2",
                         "env", Map.of(
                                 "exported-variables", List.of("MY_VAR")),
                         "phases", Map.of(
                                 "build", Map.of(
                                         "commands", "export MY_VAR=\"some value\"")))))
                 .build())
         .variablesNamespace("MyNamespace")
         .build();
 CodeBuildAction.Builder.create()
         .actionName("CodeBuild")
         .project(project)
         .input(sourceOutput)
         .environmentVariables(Map.of(
                 "MyVar", BuildEnvironmentVariable.builder()
                         .value(buildAction.variable("MY_VAR"))
                         .build()))
         .build();
 
  • Method Details

    • getValue

      @Stability(Stable) @NotNull Object getValue()
      The value of the environment variable.

      For plain-text variables (the default), this is the literal value of variable. For SSM parameter variables, pass the name of the parameter here (parameterName property of IParameter). For SecretsManager variables secrets, pass either the secret name (secretName property of ISecret) or the secret ARN (secretArn property of ISecret) here, along with optional SecretsManager qualifiers separated by ':', like the JSON key, or the version or stage (see https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.env.secrets-manager for details).

    • getType

      @Stability(Stable) @Nullable default BuildEnvironmentVariableType getType()
      The type of environment variable.

      Default: PlainText

    • builder

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