CfnEnvironment

class aws_cdk.aws_elasticbeanstalk.CfnEnvironment(scope, id, *, application_name, cname_prefix=None, description=None, environment_name=None, operations_role=None, option_settings=None, platform_arn=None, solution_stack_name=None, tags=None, template_name=None, tier=None, version_label=None)

Bases: CfnResource

A CloudFormation AWS::ElasticBeanstalk::Environment.

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.

CloudformationResource

AWS::ElasticBeanstalk::Environment

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticbeanstalk as elasticbeanstalk

cfn_environment = elasticbeanstalk.CfnEnvironment(self, "MyCfnEnvironment",
    application_name="applicationName",

    # the properties below are optional
    cname_prefix="cnamePrefix",
    description="description",
    environment_name="environmentName",
    operations_role="operationsRole",
    option_settings=[elasticbeanstalk.CfnEnvironment.OptionSettingProperty(
        namespace="namespace",
        option_name="optionName",

        # the properties below are optional
        resource_name="resourceName",
        value="value"
    )],
    platform_arn="platformArn",
    solution_stack_name="solutionStackName",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    template_name="templateName",
    tier=elasticbeanstalk.CfnEnvironment.TierProperty(
        name="name",
        type="type",
        version="version"
    ),
    version_label="versionLabel"
)

Create a new AWS::ElasticBeanstalk::Environment.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • application_name (str) – The name of the application that is associated with this environment.

  • cname_prefix (Optional[str]) – 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.

  • description (Optional[str]) – Your description for this environment.

  • environment_name (Optional[str]) – 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 . .. epigraph:: 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.

  • operations_role (Optional[str]) –

    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.

  • option_settings (Union[IResolvable, Sequence[Union[IResolvable, OptionSettingProperty, Dict[str, Any]]], None]) – 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 . If you remove any options during a stack update, the removed options retain their current values.

  • platform_arn (Optional[str]) – The Amazon Resource Name (ARN) of the custom platform to use with the environment. For more information, see Custom Platforms in the AWS Elastic Beanstalk Developer Guide . .. epigraph:: If you specify PlatformArn , don’t specify SolutionStackName .

  • solution_stack_name (Optional[str]) – 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 in the AWS Elastic Beanstalk Platforms guide. .. epigraph:: If you specify SolutionStackName , don’t specify PlatformArn or TemplateName .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Specifies the tags applied to resources in the environment.

  • template_name (Optional[str]) – The name of the Elastic Beanstalk configuration template to use with the environment. .. epigraph:: If you specify TemplateName , then don’t specify SolutionStackName .

  • tier (Union[IResolvable, TierProperty, Dict[str, Any], None]) – 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.

  • version_label (Optional[str]) – The name of the application version to deploy. Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::ElasticBeanstalk::Environment'
application_name

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-applicationname

Return type

str

attr_endpoint_url

For load-balanced, autoscaling environments, the URL to the load balancer. For single-instance environments, the IP address of the instance.

Example load balancer URL:

Example instance IP address:

192.0.2.0

CloudformationAttribute

EndpointURL

Return type

str

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

cname_prefix

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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-cnameprefix

Return type

Optional[str]

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

description

Your description for this environment.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-description

Return type

Optional[str]

environment_name

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 . .. epigraph:

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.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-name

Return type

Optional[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

operations_role

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.

link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-operations-role

Return type

Optional[str]

option_settings

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 . If you remove any options during a stack update, the removed options retain their current values.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-optionsettings

Return type

Union[IResolvable, List[Union[IResolvable, OptionSettingProperty]], None]

platform_arn

The Amazon Resource Name (ARN) of the custom platform to use with the environment.

For more information, see Custom Platforms in the AWS Elastic Beanstalk Developer Guide . .. epigraph:

If you specify ``PlatformArn`` , don't specify ``SolutionStackName`` .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-platformarn

Return type

Optional[str]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

solution_stack_name

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 in the AWS Elastic Beanstalk Platforms guide. .. epigraph:

If you specify ``SolutionStackName`` , don't specify ``PlatformArn`` or ``TemplateName`` .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-solutionstackname

Return type

Optional[str]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

tags

Specifies the tags applied to resources in the environment.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-elasticbeanstalk-environment-tags

Return type

TagManager

template_name

The name of the Elastic Beanstalk configuration template to use with the environment.

If you specify TemplateName , then don’t specify SolutionStackName .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-templatename

Return type

Optional[str]

tier

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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-tier

Return type

Union[IResolvable, TierProperty, None]

version_label

The name of the application version to deploy.

Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-versionlabel

Return type

Optional[str]

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

OptionSettingProperty

class CfnEnvironment.OptionSettingProperty(*, namespace, option_name, resource_name=None, value=None)

Bases: object

Use the OptionSetting property type to specify an option for an AWS Elastic Beanstalk environment when defining an AWS::ElasticBeanstalk::Environment resource in an AWS CloudFormation template.

The OptionSetting property type specifies an option for an AWS Elastic Beanstalk environment.

The OptionSettings property of the AWS::ElasticBeanstalk::Environment resource contains a list of OptionSetting property types.

For a list of possible namespaces and option values, see Option Values in the AWS Elastic Beanstalk Developer Guide .

Parameters
  • namespace (str) – A unique namespace that identifies the option’s associated AWS resource.

  • option_name (str) – The name of the configuration option.

  • resource_name (Optional[str]) – A unique resource name for the option setting. Use it for a time–based scaling configuration option.

  • value (Optional[str]) – The current value for the configuration option.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-option-settings.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticbeanstalk as elasticbeanstalk

option_setting_property = elasticbeanstalk.CfnEnvironment.OptionSettingProperty(
    namespace="namespace",
    option_name="optionName",

    # the properties below are optional
    resource_name="resourceName",
    value="value"
)

Attributes

namespace

A unique namespace that identifies the option’s associated AWS resource.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-option-settings.html#cfn-beanstalk-optionsettings-namespace

Return type

str

option_name

The name of the configuration option.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-option-settings.html#cfn-beanstalk-optionsettings-optionname

Return type

str

resource_name

A unique resource name for the option setting.

Use it for a time–based scaling configuration option.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-option-settings.html#cfn-elasticbeanstalk-environment-optionsetting-resourcename

Return type

Optional[str]

value

The current value for the configuration option.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-option-settings.html#cfn-beanstalk-optionsettings-value

Return type

Optional[str]

TierProperty

class CfnEnvironment.TierProperty(*, name=None, type=None, version=None)

Bases: object

Use the Tier property type to specify the environment tier for an AWS Elastic Beanstalk environment when defining an AWS::ElasticBeanstalk::Environment resource in an AWS CloudFormation template.

Describes the environment tier for an AWS::ElasticBeanstalk::Environment resource. For more information, see Environment Tiers in the AWS Elastic Beanstalk Developer Guide .

Parameters
  • name (Optional[str]) – The name of this environment tier. Valid values: - For Web server tierWebServer - For Worker tierWorker

  • type (Optional[str]) – The type of this environment tier. Valid values: - For Web server tierStandard - For Worker tierSQS/HTTP

  • version (Optional[str]) – The version of this environment tier. When you don’t set a value to it, Elastic Beanstalk uses the latest compatible worker tier version. .. epigraph:: This member is deprecated. Any specific version that you set may become out of date. We recommend leaving it unspecified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment-tier.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticbeanstalk as elasticbeanstalk

tier_property = elasticbeanstalk.CfnEnvironment.TierProperty(
    name="name",
    type="type",
    version="version"
)

Attributes

name

The name of this environment tier.

Valid values:

  • For Web server tierWebServer

  • For Worker tierWorker

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment-tier.html#cfn-beanstalk-env-tier-name

Return type

Optional[str]

type

The type of this environment tier.

Valid values:

  • For Web server tierStandard

  • For Worker tierSQS/HTTP

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment-tier.html#cfn-beanstalk-env-tier-type

Return type

Optional[str]

version

The version of this environment tier.

When you don’t set a value to it, Elastic Beanstalk uses the latest compatible worker tier version. .. epigraph:

This member is deprecated. Any specific version that you set may become out of date. We recommend leaving it unspecified.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment-tier.html#cfn-beanstalk-env-tier-version

Return type

Optional[str]