environments
Creates, updates, deletes, gets or lists an environments resource.
Overview
| Name | environments |
| Type | Resource |
| Id | aws.elasticbeanstalk.environments |
Fields
The following fields are returned by SELECT queries:
- describe_environments
| Name | Datatype | Description |
|---|---|---|
abortable_operation_in_progress | boolean | Indicates 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_name | string | The name of the application associated with this environment. |
cname | string | The URL to the CNAME for this environment. |
date_created | string | The creation date for this environment. |
date_updated | string | The last modified date for this environment. |
description | string | Describes this environment. |
endpoint_url | string | For load-balanced, autoscaling environments, the URL to the LoadBalancer. For single-instance environments, the IP address of the instance. |
environment_arn | string | The environment's Amazon Resource Name (ARN), which can be used in other API requests that require an ARN. |
environment_id | string | The ID of this environment. |
environment_links | string | A list of links to other environments in the same group. |
environment_name | string | The name of this environment. |
health | string | Describes 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_status | string | Returns the health status of the application running in your environment. For more information, see Health Colors and Statuses. |
operations_role | string | The Amazon Resource Name (ARN) of the environment's operations role. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide. |
platform_arn | string | The ARN of the platform version. |
resources | string | The description of the AWS resources used by this environment. |
solution_stack_name | string | The name of the SolutionStack deployed with this environment. |
status | string | The 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_name | string | The name of the configuration template used to originally launch this environment. |
tier | string | Describes the current tier of this environment. |
version_label | string | The application version deployed in this environment. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_environments | select | region | ApplicationName, VersionLabel, EnvironmentIds, EnvironmentNames, IncludeDeleted, IncludedDeletedBackTo, MaxRecords, NextToken | Returns descriptions for existing environments. |
create_environment | insert | ApplicationName, region | EnvironmentName, GroupName, Description, CNAMEPrefix, Tier, Tags, VersionLabel, TemplateName, SolutionStackName, PlatformArn, OptionSettings, OptionsToRemove, OperationsRole | Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration. |
associate_environment_operations_role | update | EnvironmentName, OperationsRole, region | 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. | |
disassociate_environment_operations_role | update | EnvironmentName, region | Disassociate 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_environment | update | region | ApplicationName, EnvironmentId, EnvironmentName, GroupName, Description, Tier, VersionLabel, TemplateName, SolutionStackName, PlatformArn, OptionSettings, OptionsToRemove | Updates 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_configuration | delete | ApplicationName, EnvironmentName, region | 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. | |
terminate_environment | delete | region | EnvironmentId, EnvironmentName, TerminateResources, ForceTerminate | Terminates the specified environment. |
compose_environments | exec | region | ApplicationName, GroupName, VersionLabels | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
ApplicationName | string | The name of the application the environment is associated with. |
EnvironmentName | string | The name of the environment to delete the draft configuration from. |
OperationsRole | string | The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. |
region | string | AWS region (default: us-east-1) |
ApplicationName | string | The name of the application to which the specified source bundles belong. |
CNAMEPrefix | 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. |
Description | string | If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment. |
EnvironmentId | string | The 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. |
EnvironmentIds | array | If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs. |
EnvironmentName | string | The 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. |
EnvironmentNames | array | If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names. |
ForceTerminate | boolean | Terminates the target environment even if another environment in the same group is dependent on it. |
GroupName | string | The 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. |
IncludeDeleted | boolean | Indicates whether to include deleted environments: true: Environments that have been deleted after IncludedDeletedBackTo are displayed. false: Do not include deleted environments. |
IncludedDeletedBackTo | string (date-time) | If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed. |
MaxRecords | integer | For 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. |
NextToken | string | For 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. |
OperationsRole | string | 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. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide. |
OptionSettings | array | If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value. |
OptionsToRemove | array | A list of custom user-defined configuration options to remove from the configuration set for this environment. |
PlatformArn | string | The ARN of the platform, if used. |
SolutionStackName | string | This specifies the platform version that the environment will run after the environment is updated. |
Tags | array | Specifies the tags applied to resources in the environment. |
TemplateName | string | If 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. |
TerminateResources | boolean | Indicates 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 |
Tier | object | This 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. |
VersionLabel | string | If 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. |
VersionLabels | array | A 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
- describe_environments
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
- create_environment
- Manifest
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
;
# Description fields are for documentation purposes
- name: environments
props:
- name: ApplicationName
value: "{{ ApplicationName }}"
description: Required parameter for the environments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the environments resource.
- name: EnvironmentName
value: "{{ EnvironmentName }}"
description: 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 the specified name already exists in the region, Elastic Beanstalk returns an InvalidParameterValue error. 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.
description: 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 the specified name already exists in the region, Elastic Beanstalk returns an InvalidParameterValue error. 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.
- name: GroupName
value: "{{ GroupName }}"
description: The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name parameter. See Environment Manifest (env.yaml) for details.
description: The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name parameter. See Environment Manifest (env.yaml) for details.
- name: Description
value: "{{ Description }}"
description: Your description for this environment.
description: Your description for this environment.
- name: CNAMEPrefix
value: "{{ CNAMEPrefix }}"
description: 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: 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.
- name: Tier
value: "{{ Tier }}"
description: 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.
description: 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.
- name: Tags
value: "{{ Tags }}"
description: Specifies the tags applied to resources in the environment.
description: Specifies the tags applied to resources in the environment.
- name: VersionLabel
value: "{{ VersionLabel }}"
description: The name of the application version to deploy. Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.
description: The name of the application version to deploy. Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.
- name: TemplateName
value: "{{ TemplateName }}"
description: The name of the Elastic Beanstalk configuration template to use with the environment. If you specify TemplateName, then don't specify SolutionStackName.
description: The name of the Elastic Beanstalk configuration template to use with the environment. If you specify TemplateName, then don't specify SolutionStackName.
- name: SolutionStackName
value: "{{ SolutionStackName }}"
description: 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. If you specify SolutionStackName, don't specify PlatformArn or TemplateName.
description: 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. If you specify SolutionStackName, don't specify PlatformArn or TemplateName.
- name: PlatformArn
value: "{{ PlatformArn }}"
description: 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. If you specify PlatformArn, don't specify SolutionStackName.
description: 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. If you specify PlatformArn, don't specify SolutionStackName.
- name: OptionSettings
value: "{{ OptionSettings }}"
description: If specified, AWS Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template.
description: If specified, AWS Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template.
- name: OptionsToRemove
value: "{{ OptionsToRemove }}"
description: A list of custom user-defined configuration options to remove from the configuration set for this new environment.
description: A list of custom user-defined configuration options to remove from the configuration set for this new environment.
- name: OperationsRole
value: "{{ OperationsRole }}"
description: 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. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
description: 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. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
UPDATE examples
- associate_environment_operations_role
- disassociate_environment_operations_role
- update_environment
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;
Disassociate 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 aws.elasticbeanstalk.environments
SET
-- No updatable properties
WHERE
EnvironmentName = '{{ EnvironmentName }}' --required
AND region = '{{ region }}' --required;
Updates 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.
UPDATE aws.elasticbeanstalk.environments
SET
-- No updatable properties
WHERE
region = '{{ region }}' --required
AND ApplicationName = '{{ ApplicationName}}'
AND EnvironmentId = '{{ EnvironmentId}}'
AND EnvironmentName = '{{ EnvironmentName}}'
AND GroupName = '{{ GroupName}}'
AND Description = '{{ Description}}'
AND Tier = '{{ Tier}}'
AND VersionLabel = '{{ VersionLabel}}'
AND TemplateName = '{{ TemplateName}}'
AND SolutionStackName = '{{ SolutionStackName}}'
AND PlatformArn = '{{ PlatformArn}}'
AND OptionSettings = '{{ OptionSettings}}'
AND OptionsToRemove = '{{ OptionsToRemove}}'
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;
DELETE examples
- delete_environment_configuration
- terminate_environment
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
;
Terminates the specified environment.
DELETE FROM aws.elasticbeanstalk.environments
WHERE region = '{{ region }}' --required
AND EnvironmentId = '{{ EnvironmentId }}'
AND EnvironmentName = '{{ EnvironmentName }}'
AND TerminateResources = '{{ TerminateResources }}'
AND ForceTerminate = '{{ ForceTerminate }}'
;
Lifecycle Methods
- compose_environments
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 }}'
;