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 = '{{ region }}' 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 = '{{ 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.appconfig.environments (
ApplicationId,
Name,
region
)
SELECT
'{{ application_id }}',
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.appconfig.environments (
Description,
Monitors,
DeletionProtectionCheck,
ApplicationId,
Tags,
Name,
region
)
SELECT
'{{ description }}',
'{{ monitors }}',
'{{ deletion_protection_check }}',
'{{ application_id }}',
'{{ tags }}',
'{{ name }}',
'{{ 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: 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.appconfig.environments
WHERE
Identifier = '{{ application_id }}|{{ environment_id }}' 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
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