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::AppConfig::Environment |
| Id | awscc.appconfig.environments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
environment_id | string | The environment ID. |
description | string | A description of the environment. |
monitors | array | Amazon CloudWatch alarms to monitor during the deployment process. |
deletion_protection_check | string | On resource deletion this controls whether the Deletion Protection check should be applied, bypassed, or (the default) whether the behavior should be controlled by the account-level Deletion Protection setting. See https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html |
application_id | string | The application ID. |
tags | array | Metadata to assign to the environment. Tags help organize and categorize your AWS AppConfig resources. Each tag consists of a key and an optional value, both of which you define. |
name | string | A name for the environment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
environment_id | string | The environment ID. |
application_id | string | The application ID. |
region | string | AWS region. |
For more information, see AWS::AppConfig::Environment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | environments | INSERT | Name, ApplicationId, 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,
environment_id,
description,
monitors,
deletion_protection_check,
application_id,
tags,
name
FROM awscc.appconfig.environments
WHERE
region = 'us-east-1' AND
Identifier = '{{ application_id }}|{{ environment_id }}';
Lists all environments in a region.
SELECT
region,
application_id,
environment_id
FROM awscc.appconfig.environments_list_only
WHERE
region = 'us-east-1';
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.appconfig.environments (
ApplicationId,
Name,
region
)
SELECT
'{{ application_id }}',
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.appconfig.environments (
Description,
Monitors,
DeletionProtectionCheck,
ApplicationId,
Tags,
Name,
region
)
SELECT
'{{ description }}',
'{{ monitors }}',
'{{ deletion_protection_check }}',
'{{ application_id }}',
'{{ tags }}',
'{{ name }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: environment
props:
- name: description
value: '{{ description }}'
- name: monitors
value:
- alarm_arn: '{{ alarm_arn }}'
alarm_role_arn: '{{ alarm_role_arn }}'
- name: deletion_protection_check
value: '{{ deletion_protection_check }}'
- name: application_id
value: '{{ application_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: name
value: '{{ name }}'
UPDATE example
Use the following StackQL query and manifest file to update a environment resource, using stack-deploy.
/*+ update */
UPDATE awscc.appconfig.environments
SET PatchDocument = string('{{ {
"Description": description,
"Monitors": monitors,
"DeletionProtectionCheck": deletion_protection_check,
"Tags": tags,
"Name": name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ application_id }}|{{ environment_id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.appconfig.environments
WHERE
Identifier = '{{ application_id }}|{{ environment_id }}' AND
region = 'us-east-1';
Permissions
To operate on the environments resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
appconfig:GetEnvironment,
appconfig:ListTagsForResource
appconfig:CreateEnvironment,
appconfig:GetEnvironment,
appconfig:ListTagsForResource,
appconfig:TagResource,
iam:PassRole
appconfig:UpdateEnvironment,
appconfig:TagResource,
appconfig:UntagResource,
iam:PassRole
appconfig:ListEnvironments
appconfig:GetEnvironment,
appconfig:DeleteEnvironment