Interface BuildEnvironmentVariable
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
BuildEnvironmentVariable.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:41.671Z")
@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();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBuildEnvironmentVariablestatic final classAn implementation forBuildEnvironmentVariable -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default BuildEnvironmentVariableTypegetType()The type of environment variable.getValue()The value of the environment variable.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
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 (
parameterNameproperty ofIParameter). For SecretsManager variables secrets, pass either the secret name (secretNameproperty ofISecret) or the secret ARN (secretArnproperty ofISecret) 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
The type of environment variable.Default: PlainText
-
builder
- Returns:
- a
BuildEnvironmentVariable.BuilderofBuildEnvironmentVariable
-