Skip to main content

environments

Creates, updates, deletes, gets or lists an environments resource.

Overview

Nameenvironments
TypeResource
Idaws.elasticbeanstalk.environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
abortable_operation_in_progressbooleanIndicates if there is an in-progress environment configuration update or application version deployment that you can cancel. true: There is an update in progress. false: There are no updates currently in progress.
application_namestringThe name of the application associated with this environment.
cnamestringThe URL to the CNAME for this environment.
date_createdstringThe creation date for this environment.
date_updatedstringThe last modified date for this environment.
descriptionstringDescribes this environment.
endpoint_urlstringFor load-balanced, autoscaling environments, the URL to the LoadBalancer. For single-instance environments, the IP address of the instance.
environment_arnstringThe environment's Amazon Resource Name (ARN), which can be used in other API requests that require an ARN.
environment_idstringThe ID of this environment.
environment_linksstringA list of links to other environments in the same group.
environment_namestringThe name of this environment.
healthstringDescribes the health status of the environment. AWS Elastic Beanstalk indicates the failure levels for a running environment: Red: Indicates the environment is not responsive. Occurs when three or more consecutive failures occur for an environment. Yellow: Indicates that something is wrong. Occurs when two consecutive failures occur for an environment. Green: Indicates the environment is healthy and fully functional. Grey: Default health for a new environment. The environment is not fully launched and health checks have not started or health checks are suspended during an UpdateEnvironment or RestartEnvironment request. Default: Grey
health_statusstringReturns the health status of the application running in your environment. For more information, see Health Colors and Statuses.
operations_rolestringThe Amazon Resource Name (ARN) of the environment's operations role. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
platform_arnstringThe ARN of the platform version.
resourcesstringThe description of the AWS resources used by this environment.
solution_stack_namestringThe name of the SolutionStack deployed with this environment.
statusstringThe current operational status of the environment: Launching: Environment is in the process of initial deployment. Updating: Environment is in the process of updating its configuration settings or application version. Ready: Environment is available to have an action performed on it, such as update or terminate. Terminating: Environment is in the shut-down process. Terminated: Environment is not running.
template_namestringThe name of the configuration template used to originally launch this environment.
tierstringDescribes the current tier of this environment.
version_labelstringThe application version deployed in this environment.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_environmentsselectregionApplicationName, VersionLabel, EnvironmentIds, EnvironmentNames, IncludeDeleted, IncludedDeletedBackTo, MaxRecords, NextTokenReturns descriptions for existing environments.
create_environmentinsertApplicationName, regionEnvironmentName, GroupName, Description, CNAMEPrefix, Tier, Tags, VersionLabel, TemplateName, SolutionStackName, PlatformArn, OptionSettings, OptionsToRemove, OperationsRoleLaunches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.
associate_environment_operations_roleupdateEnvironmentName, OperationsRole, regionAdd or change the operations role used by an environment. After this call is made, Elastic Beanstalk uses the associated operations role for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
disassociate_environment_operations_roleupdateEnvironmentName, regionDisassociate the operations role from an environment. After this call is made, Elastic Beanstalk uses the caller's permissions for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
update_environmentupdateregionApplicationName, EnvironmentId, EnvironmentName, GroupName, Description, Tier, VersionLabel, TemplateName, SolutionStackName, PlatformArn, OptionSettings, OptionsToRemoveUpdates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment. Attempting to update both the release and configuration is not allowed and AWS Elastic Beanstalk returns an InvalidParameterCombination error. When updating the configuration settings to a new template or individual settings, a draft configuration is created and DescribeConfigurationSettings for this environment returns two setting descriptions with different DeploymentStatus values.
delete_environment_configurationdeleteApplicationName, EnvironmentName, regionDeletes the draft configuration associated with the running environment. Updating a running environment with any configuration changes creates a draft configuration set. You can get the draft configuration using DescribeConfigurationSettings while the update is in progress or if the update fails. The DeploymentStatus for the draft configuration indicates whether the deployment is in process or has failed. The draft configuration remains in existence until it is deleted with this action.
terminate_environmentdeleteregionEnvironmentId, EnvironmentName, TerminateResources, ForceTerminateTerminates the specified environment.
compose_environmentsexecregionApplicationName, GroupName, VersionLabelsCreate or update a group of environments that each run a separate component of a single application. Takes a list of version labels that specify application source bundles for each of the environments to create or update. The name of each environment and other required information must be included in the source bundles in an environment manifest named env.yaml. See Compose Environments for details.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ApplicationNamestringThe name of the application the environment is associated with.
EnvironmentNamestringThe name of the environment to delete the draft configuration from.
OperationsRolestringThe Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role.
regionstringAWS region (default: us-east-1)
ApplicationNamestringThe name of the application to which the specified source bundles belong.
CNAMEPrefixstringIf 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.
DescriptionstringIf this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.
EnvironmentIdstringThe ID of the environment to terminate. Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
EnvironmentIdsarrayIf specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.
EnvironmentNamestringThe name of the environment to terminate. Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
EnvironmentNamesarrayIf specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.
ForceTerminatebooleanTerminates the target environment even if another environment in the same group is dependent on it.
GroupNamestringThe name of the group to which the target environments belong. Specify a group name only if the environment name defined in each target environment's manifest ends with a + (plus) character. See Environment Manifest (env.yaml) for details.
IncludeDeletedbooleanIndicates whether to include deleted environments: true: Environments that have been deleted after IncludedDeletedBackTo are displayed. false: Do not include deleted environments.
IncludedDeletedBackTostring (date-time)If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed.
MaxRecordsintegerFor a paginated request. Specify a maximum number of environments to include in each response. If no MaxRecords is specified, all available environments are retrieved in a single response.
NextTokenstringFor a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved.
OperationsRolestringThe 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. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
OptionSettingsarrayIf specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.
OptionsToRemovearrayA list of custom user-defined configuration options to remove from the configuration set for this environment.
PlatformArnstringThe ARN of the platform, if used.
SolutionStackNamestringThis specifies the platform version that the environment will run after the environment is updated.
TagsarraySpecifies the tags applied to resources in the environment.
TemplateNamestringIf this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an InvalidParameterValue error.
TerminateResourcesbooleanIndicates whether the associated AWS resources should shut down when the environment is terminated: true: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated. false: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate. For more information, see the AWS Elastic Beanstalk User Guide. Default: true Valid Values: true | false
TierobjectThis specifies the tier to use to update the environment. Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns InvalidParameterValue error.
VersionLabelstringIf this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an InvalidParameterValue error.
VersionLabelsarrayA list of version labels, specifying one or more application source bundles that belong to the target application. Each source bundle must include an environment manifest that specifies the name of the environment and the name of the solution stack to use, and optionally can specify environment links to create.

SELECT examples

Returns descriptions for existing environments.

SELECT
abortable_operation_in_progress,
application_name,
cname,
date_created,
date_updated,
description,
endpoint_url,
environment_arn,
environment_id,
environment_links,
environment_name,
health,
health_status,
operations_role,
platform_arn,
resources,
solution_stack_name,
status,
template_name,
tier,
version_label
FROM aws.elasticbeanstalk.environments
WHERE region = '{{ region }}' -- required
AND ApplicationName = '{{ ApplicationName }}'
AND VersionLabel = '{{ VersionLabel }}'
AND EnvironmentIds = '{{ EnvironmentIds }}'
AND EnvironmentNames = '{{ EnvironmentNames }}'
AND IncludeDeleted = '{{ IncludeDeleted }}'
AND IncludedDeletedBackTo = '{{ IncludedDeletedBackTo }}'
AND MaxRecords = '{{ MaxRecords }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.

INSERT INTO aws.elasticbeanstalk.environments (
ApplicationName,
region,
EnvironmentName,
GroupName,
Description,
CNAMEPrefix,
Tier,
Tags,
VersionLabel,
TemplateName,
SolutionStackName,
PlatformArn,
OptionSettings,
OptionsToRemove,
OperationsRole
)
SELECT
'{{ ApplicationName }}',
'{{ region }}',
'{{ EnvironmentName }}',
'{{ GroupName }}',
'{{ Description }}',
'{{ CNAMEPrefix }}',
'{{ Tier }}',
'{{ Tags }}',
'{{ VersionLabel }}',
'{{ TemplateName }}',
'{{ SolutionStackName }}',
'{{ PlatformArn }}',
'{{ OptionSettings }}',
'{{ OptionsToRemove }}',
'{{ OperationsRole }}'
RETURNING
abortable_operation_in_progress,
application_name,
cname,
date_created,
date_updated,
description,
endpoint_url,
environment_arn,
environment_id,
environment_links,
environment_name,
health,
health_status,
operations_role,
platform_arn,
resources,
solution_stack_name,
status,
template_name,
tier,
version_label
;

UPDATE examples

Add or change the operations role used by an environment. After this call is made, Elastic Beanstalk uses the associated operations role for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.

UPDATE aws.elasticbeanstalk.environments
SET
-- No updatable properties
WHERE
EnvironmentName = '{{ EnvironmentName }}' --required
AND OperationsRole = '{{ OperationsRole }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes the draft configuration associated with the running environment. Updating a running environment with any configuration changes creates a draft configuration set. You can get the draft configuration using DescribeConfigurationSettings while the update is in progress or if the update fails. The DeploymentStatus for the draft configuration indicates whether the deployment is in process or has failed. The draft configuration remains in existence until it is deleted with this action.

DELETE FROM aws.elasticbeanstalk.environments
WHERE ApplicationName = '{{ ApplicationName }}' --required
AND EnvironmentName = '{{ EnvironmentName }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Create or update a group of environments that each run a separate component of a single application. Takes a list of version labels that specify application source bundles for each of the environments to create or update. The name of each environment and other required information must be included in the source bundles in an environment manifest named env.yaml. See Compose Environments for details.

EXEC aws.elasticbeanstalk.environments.compose_environments
@region='{{ region }}' --required,
@ApplicationName='{{ ApplicationName }}',
@GroupName='{{ GroupName }}',
@VersionLabels='{{ VersionLabels }}'
;