AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ElasticBeanstalk::Environment

CfnEnvironment

Specify an AWS Elastic Beanstalk environment by using the AWS::ElasticBeanstalk::Environment resource in an AWS CloudFormation template. The AWS::ElasticBeanstalk::Environment resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk environment.

Import

import { CfnEnvironment } from 'aws-cdk-lib/aws-elasticbeanstalk';

Or use the module namespace:

import * as elasticbeanstalk from 'aws-cdk-lib/aws-elasticbeanstalk';
// elasticbeanstalk.CfnEnvironment

Properties

Configuration passed to the constructor as CfnEnvironmentProps.

applicationNameRequired
string | IApplicationRef

The name of the application that is associated with this environment.

cnamePrefixOptional
string

If specified, the environment attempts to use this value as the prefix for the CNAME in your Elastic Beanstalk environment URL. If not specified, the CNAME is generated automatically by appending a random alphanumeric string to the environment name.

descriptionOptional
string

Your description for this environment.

environmentNameOptional
string

A unique name for the environment. Constraint: Must be from 4 to 40 characters in length. The name can contain only letters, numbers, and hyphens. It can't start or end with a hyphen. This name must be unique within a region in your account. If you don't specify the `CNAMEPrefix` parameter, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application. If you don't specify an environment name, AWS CloudFormation generates a unique physical ID and uses that ID for the environment name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

operationsRoleOptional
string

> The operations role feature of AWS Elastic Beanstalk is in beta release and is subject to change. The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. If specified, Elastic Beanstalk uses the operations role for permissions to downstream services during this call and during subsequent calls acting on this environment. To specify an operations role, you must have the `iam:PassRole` permission for the role.

optionSettingsOptional
IResolvable | IResolvable | OptionSettingProperty[]

Key-value pairs defining configuration options for this environment, such as the instance type. These options override the values that are defined in the solution stack or the [configuration template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-beanstalk-configurationtemplate.html) . If you remove any options during a stack update, the removed options retain their current values.

platformArnOptional
string

The Amazon Resource Name (ARN) of the custom platform to use with the environment. For more information, see [Custom Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html) in the *AWS Elastic Beanstalk Developer Guide* . > If you specify `PlatformArn` , don't specify `SolutionStackName` .

solutionStackNameOptional
string

The name of an Elastic Beanstalk solution stack (platform version) to use with the environment. If specified, Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack. For a list of current solution stacks, see [Elastic Beanstalk Supported Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html) in the *AWS Elastic Beanstalk Platforms* guide. > If you specify `SolutionStackName` , don't specify `PlatformArn` or `TemplateName` .

tagsOptional
CfnTag[]

Specifies the tags applied to resources in the environment.

templateNameOptional
string | IConfigurationTemplateRef

The name of the Elastic Beanstalk configuration template to use with the environment. > If you specify `TemplateName` , then don't specify `SolutionStackName` .

tierOptional
IResolvable | TierProperty

Specifies the tier to use in creating this environment. The environment tier that you choose determines whether Elastic Beanstalk provisions resources to support a web application that handles HTTP(S) requests or a web application that handles background-processing tasks.

versionLabelOptional
string

The name of the application version to deploy. Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-elasticbeanstalk
CFN TypeAWS::ElasticBeanstalk::Environment
Properties12

External Links