aws-cdk-lib.aws_codebuild.CfnProject.EnvironmentVariableProperty

interface EnvironmentVariableProperty

LanguageType name
.NETAmazon.CDK.AWS.CodeBuild.CfnProject.EnvironmentVariableProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#CfnProject_EnvironmentVariableProperty
Javasoftware.amazon.awscdk.services.codebuild.CfnProject.EnvironmentVariableProperty
Pythonaws_cdk.aws_codebuild.CfnProject.EnvironmentVariableProperty
TypeScript aws-cdk-lib » aws_codebuild » CfnProject » EnvironmentVariableProperty

EnvironmentVariable is a property of the AWS CodeBuild Project Environment property type that specifies the name and value of an environment variable for an AWS CodeBuild project environment. When you use the environment to run a build, these variables are available for your builds to use. EnvironmentVariable contains a list of EnvironmentVariable property types.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
const environmentVariableProperty: codebuild.CfnProject.EnvironmentVariableProperty = {
  name: 'name',
  value: 'value',

  // the properties below are optional
  type: 'type',
};

Properties

NameTypeDescription
namestringThe name or key of the environment variable.
valuestringThe value of the environment variable.
type?stringThe type of environment variable. Valid values include:.

name

Type: string

The name or key of the environment variable.


value

Type: string

The value of the environment variable.

We strongly discourage the use of PLAINTEXT environment variables to store sensitive values, especially AWS secret key IDs and secret access keys. PLAINTEXT environment variables can be displayed in plain text using the AWS CodeBuild console and the AWS CLI . For sensitive values, we recommend you use an environment variable of type PARAMETER_STORE or SECRETS_MANAGER .


type?

Type: string (optional)

The type of environment variable. Valid values include:.

  • PARAMETER_STORE : An environment variable stored in Systems Manager Parameter Store. For environment variables of this type, specify the name of the parameter as the value of the EnvironmentVariable. The parameter value will be substituted for the name at runtime. You can also define Parameter Store environment variables in the buildspec. To learn how to do so, see env/parameter-store in the AWS CodeBuild User Guide .
  • PLAINTEXT : An environment variable in plain text format. This is the default value.
  • SECRETS_MANAGER : An environment variable stored in AWS Secrets Manager . For environment variables of this type, specify the name of the secret as the value of the EnvironmentVariable. The secret value will be substituted for the name at runtime. You can also define AWS Secrets Manager environment variables in the buildspec. To learn how to do so, see env/secrets-manager in the AWS CodeBuild User Guide .