AWS::CodeBuild::Project EnvironmentVariable - AWS CloudFormation

AWS::CodeBuild::Project EnvironmentVariable

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.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Name" : String, "Type" : String, "Value" : String }

YAML

Name: String Type: String Value: String

Properties

Name

The name or key of the environment variable.

Required: Yes

Type: String

Minimum: 1

Update requires: No interruption

Type

The type of environment variable. Valid values include:

  • PARAMETER_STORE: An environment variable stored in Systems Manager Parameter Store. To learn how to specify a parameter store environment variable, 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. To learn how to specify a secrets manager environment variable, see env/secrets-manager in the AWS CodeBuild User Guide.

Required: No

Type: String

Allowed values: PARAMETER_STORE | PLAINTEXT | SECRETS_MANAGER

Update requires: No interruption

Value

The value of the environment variable.

Important

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.

Required: Yes

Type: String

Update requires: No interruption

Examples

JSON

{ "Project": { "Environment": { "EnvironmentVariables": [ { "Name": "MY_VAR_1", "Type": "PLAINTEXT", "Value": "VAR_1_VALUE" }, { "Name": "MY_VAR_2", "Type": "PLAINTEXT", "Value": "VAR_2_VALUE" } ] } } }

YAML

Project: Type: AWS::CodeBuild::Project Properties: Environment: EnvironmentVariables: - Name: MY_VAR_1 Type: PLAINTEXT Value: VAR_1_VALUE - Name: MY_VAR_2 Type: PLAINTEXT Value: VAR_2_VALUE