Skip to main content

environments

Creates, updates, deletes or gets an environment resource or lists environments in a region

Overview

Nameenvironments
TypeResource
DescriptionResource Type definition for AWS::ElasticBeanstalk::Environment
Idaws.elasticbeanstalk.environments

Fields

NameDatatypeDescription
platform_arnstringThe Amazon Resource Name (ARN) of the custom platform to use with the environment.
application_namestringThe name of the application that is associated with this environment.
descriptionstringYour description for this environment.
environment_namestringA unique name for the environment.
operations_rolestringThe Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role.
tierobjectSpecifies 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_labelstringThe name of the application version to deploy.
endpoint_urlstring
option_settingsarrayKey-value pairs defining configuration options for this environment, such as the instance type.
template_namestringThe name of the Elastic Beanstalk configuration template to use with the environment.
solution_stack_namestringThe name of an Elastic Beanstalk solution stack (platform version) to use with the environment.
cname_prefixstringIf 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.
tagsarraySpecifies the tags applied to resources in the environment.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTApplicationName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all environments in a region.

SELECT
region,
platform_arn,
application_name,
description,
environment_name,
operations_role,
tier,
version_label,
endpoint_url,
option_settings,
template_name,
solution_stack_name,
cname_prefix,
tags
FROM aws.elasticbeanstalk.environments
WHERE region = 'us-east-1';

Gets all properties from an individual environment.

SELECT
region,
platform_arn,
application_name,
description,
environment_name,
operations_role,
tier,
version_label,
endpoint_url,
option_settings,
template_name,
solution_stack_name,
cname_prefix,
tags
FROM aws.elasticbeanstalk.environments
WHERE region = 'us-east-1' AND data__Identifier = '<EnvironmentName>';

INSERT example

Use the following StackQL query and manifest file to create a new environment resource, using stack-deploy.

/*+ create */
INSERT INTO aws.elasticbeanstalk.environments (
ApplicationName,
region
)
SELECT
'{{ ApplicationName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.elasticbeanstalk.environments
WHERE data__Identifier = '<EnvironmentName>'
AND region = 'us-east-1';

Permissions

To operate on the environments resource, the following permissions are required:

Read

elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:DescribeConfigurationSettings,
elasticbeanstalk:ListTagsForResource

Create

elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:CreateEnvironment,
iam:PassRole

Update

elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:UpdateEnvironment,
elasticbeanstalk:UpdateTagsForResource,
elasticbeanstalk:AssociateEnvironmentOperationsRole,
elasticbeanstalk:DisassociateEnvironmentOperationsRole,
iam:PassRole

List

elasticbeanstalk:DescribeEnvironments

Delete

elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:TerminateEnvironment