environments
Creates, updates, deletes or gets an environment
resource or lists environments
in a region
Overview
Name | environments |
Type | Resource |
Description | Resource Type definition for AWS::ElasticBeanstalk::Environment |
Id | aws.elasticbeanstalk.environments |
Fields
Name | Datatype | Description |
---|---|---|
platform_arn | string | The Amazon Resource Name (ARN) of the custom platform to use with the environment. |
application_name | string | The name of the application that is associated with this environment. |
description | string | Your description for this environment. |
environment_name | string | A unique name for the environment. |
operations_role | string | The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. |
tier | object | 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 | string | The name of the application version to deploy. |
endpoint_url | string | |
option_settings | array | Key-value pairs defining configuration options for this environment, such as the instance type. |
template_name | string | The name of the Elastic Beanstalk configuration template to use with the environment. |
solution_stack_name | string | The name of an Elastic Beanstalk solution stack (platform version) to use with the environment. |
cname_prefix | 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. |
tags | array | Specifies the tags applied to resources in the environment. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ApplicationName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.elasticbeanstalk.environments (
ApplicationName,
region
)
SELECT
'{{ ApplicationName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.elasticbeanstalk.environments (
PlatformArn,
ApplicationName,
Description,
EnvironmentName,
OperationsRole,
Tier,
VersionLabel,
OptionSettings,
TemplateName,
SolutionStackName,
CNAMEPrefix,
Tags,
region
)
SELECT
'{{ PlatformArn }}',
'{{ ApplicationName }}',
'{{ Description }}',
'{{ EnvironmentName }}',
'{{ OperationsRole }}',
'{{ Tier }}',
'{{ VersionLabel }}',
'{{ OptionSettings }}',
'{{ TemplateName }}',
'{{ SolutionStackName }}',
'{{ CNAMEPrefix }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: environment
props:
- name: PlatformArn
value: '{{ PlatformArn }}'
- name: ApplicationName
value: '{{ ApplicationName }}'
- name: Description
value: '{{ Description }}'
- name: EnvironmentName
value: '{{ EnvironmentName }}'
- name: OperationsRole
value: '{{ OperationsRole }}'
- name: Tier
value:
Type: '{{ Type }}'
Version: '{{ Version }}'
Name: '{{ Name }}'
- name: VersionLabel
value: '{{ VersionLabel }}'
- name: OptionSettings
value:
- ResourceName: '{{ ResourceName }}'
Value: '{{ Value }}'
Namespace: '{{ Namespace }}'
OptionName: '{{ OptionName }}'
- name: TemplateName
value: '{{ TemplateName }}'
- name: SolutionStackName
value: '{{ SolutionStackName }}'
- name: CNAMEPrefix
value: '{{ CNAMEPrefix }}'
- name: Tags
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
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