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 | awscc.elasticbeanstalk.environments |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
environment_name | string | A unique name for the environment. |
region | string | AWS region. |
For more information, see AWS::ElasticBeanstalk::Environment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | environments | INSERT | ApplicationName, region |
delete_resource | environments | DELETE | Identifier, region |
update_resource | environments | UPDATE | Identifier, PatchDocument, region |
list_resources | environments_list_only | SELECT | region |
get_resource | environments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.elasticbeanstalk.environments
WHERE
region = '{{ region }}' AND
Identifier = '{{ environment_name }}';
Lists all environments in a region.
SELECT
region,
environment_name
FROM awscc.elasticbeanstalk.environments_list_only
WHERE
region = '{{ region }}';
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 awscc.elasticbeanstalk.environments (
ApplicationName,
region
)
SELECT
'{{ application_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.elasticbeanstalk.environments (
PlatformArn,
ApplicationName,
Description,
EnvironmentName,
OperationsRole,
Tier,
VersionLabel,
OptionSettings,
TemplateName,
SolutionStackName,
CNAMEPrefix,
Tags,
region
)
SELECT
'{{ platform_arn }}',
'{{ application_name }}',
'{{ description }}',
'{{ environment_name }}',
'{{ operations_role }}',
'{{ tier }}',
'{{ version_label }}',
'{{ option_settings }}',
'{{ template_name }}',
'{{ solution_stack_name }}',
'{{ cname_prefix }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: environment
props:
- name: platform_arn
value: '{{ platform_arn }}'
- name: application_name
value: '{{ application_name }}'
- name: description
value: '{{ description }}'
- name: environment_name
value: '{{ environment_name }}'
- name: operations_role
value: '{{ operations_role }}'
- name: tier
value:
type: '{{ type }}'
version: '{{ version }}'
name: '{{ name }}'
- name: version_label
value: '{{ version_label }}'
- name: option_settings
value:
- resource_name: '{{ resource_name }}'
value: '{{ value }}'
namespace: '{{ namespace }}'
option_name: '{{ option_name }}'
- name: template_name
value: '{{ template_name }}'
- name: solution_stack_name
value: '{{ solution_stack_name }}'
- name: cname_prefix
value: '{{ cname_prefix }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a environment resource, using stack-deploy.
/*+ update */
UPDATE awscc.elasticbeanstalk.environments
SET PatchDocument = string('{{ {
"PlatformArn": platform_arn,
"Description": description,
"OperationsRole": operations_role,
"VersionLabel": version_label,
"OptionSettings": option_settings,
"TemplateName": template_name,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ environment_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.elasticbeanstalk.environments
WHERE
Identifier = '{{ environment_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the environments resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:DescribeConfigurationSettings,
elasticbeanstalk:ListTagsForResource
elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:CreateEnvironment,
elasticbeanstalk:AddTags,
elasticbeanstalk:ListTagsForResource,
iam:PassRole
elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:UpdateEnvironment,
elasticbeanstalk:AssociateEnvironmentOperationsRole,
elasticbeanstalk:DisassociateEnvironmentOperationsRole,
elasticbeanstalk:AddTags,
elasticbeanstalk:ListTagsForResource,
elasticbeanstalk:RemoveTags,
s3:GetBucketLocation,
s3:GetBucketPolicy,
s3:ListBucket,
s3:PutBucketPolicy,
iam:PassRole
elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:ListTagsForResource
elasticbeanstalk:DescribeEnvironments,
elasticbeanstalk:TerminateEnvironment