environments
Creates, updates, deletes, gets or lists an environments resource.
Overview
| Name | environments |
| Type | Resource |
| Id | aws.appconfig.environments |
Fields
The following fields are returned by SELECT queries:
- get_environment
- list_environments
| Name | Datatype | Description |
|---|---|---|
application_id | string | The application ID. (pattern: <code>[a-z0-9]{4,7}</code>) |
description | string | The description of the environment. |
id | string | The environment ID. (pattern: <code>[a-z0-9]{4,7}</code>) |
monitors | array | Amazon CloudWatch alarms monitored during the deployment. |
name | string | The name of the environment. |
state | string | The state of the environment. An environment can be in one of the following states: READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, or ROLLED_BACK (READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, ROLLED_BACK, REVERTED) |
| Name | Datatype | Description |
|---|---|---|
application_id | string | The application ID. (pattern: <code>[a-z0-9]{4,7}</code>) |
description | string | The description of the environment. |
id | string | The environment ID. (pattern: <code>[a-z0-9]{4,7}</code>) |
monitors | array | Amazon CloudWatch alarms monitored during the deployment. |
name | string | The name of the environment. |
state | string | The state of the environment. An environment can be in one of the following states: READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, or ROLLED_BACK (READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, ROLLED_BACK, REVERTED) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_environment | select | application_id, environment_id, region | Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a Production environment or in an EU_Region environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration. | |
list_environments | select | application_id, region | max_results, next_token | Lists the environments for an application. |
create_environment | insert | application_id, region | Creates an environment. For each application, you define one or more environments. An environment is a deployment group of AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application subcomponents such as the Web, Mobile and Back-end components for your application. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration. | |
update_environment | update | application_id, environment_id, region | Updates an environment. | |
delete_environment | delete | environment_id, application_id, region | x-amzn-deletion-protection-check | Deletes an environment. To prevent users from unintentionally deleting actively-used environments, enable deletion protection. |
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 |
|---|---|---|
application_id | string | The application ID that includes the environment that you want to delete. |
environment_id | string | The ID of the environment that you want to delete. |
region | string | AWS region (default: us-east-1) |
max_results | integer | The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results. |
next_token | string | A token to start the list. Use this token to get the next set of results. |
x-amzn-deletion-protection-check | string | A parameter to configure deletion protection. Deletion protection prevents a user from deleting an environment if your application called either GetLatestConfiguration or in the environment during the specified interval. This parameter supports the following values: BYPASS: Instructs AppConfig to bypass the deletion protection check and delete a configuration profile even if deletion protection would have otherwise prevented it. APPLY: Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. APPLY also forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks. ACCOUNT_DEFAULT: The default setting, which instructs AppConfig to implement the deletion protection value specified in the UpdateAccountSettings API. |
SELECT examples
- get_environment
- list_environments
Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a Production environment or in an EU_Region environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.
SELECT
application_id,
description,
id,
monitors,
name,
state
FROM aws.appconfig.environments
WHERE application_id = '{{ application_id }}' -- required
AND environment_id = '{{ environment_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the environments for an application.
SELECT
application_id,
description,
id,
monitors,
name,
state
FROM aws.appconfig.environments
WHERE application_id = '{{ application_id }}' -- required
AND region = '{{ region }}' -- required
AND max_results = '{{ max_results }}'
AND next_token = '{{ next_token }}'
;
INSERT examples
- create_environment
- Manifest
Creates an environment. For each application, you define one or more environments. An environment is a deployment group of AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application subcomponents such as the Web, Mobile and Back-end components for your application. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration.
INSERT INTO aws.appconfig.environments (
Name,
Description,
Monitors,
Tags,
application_id,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Monitors }}',
'{{ Tags }}',
'{{ application_id }}',
'{{ region }}'
RETURNING
application_id,
description,
id,
monitors,
name,
state
;
# Description fields are for documentation purposes
- name: environments
props:
- name: application_id
value: "{{ application_id }}"
description: Required parameter for the environments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the environments resource.
- name: Name
value: "{{ Name }}"
- name: Description
value: "{{ Description }}"
- name: Monitors
value:
- AlarmArn: "{{ AlarmArn }}"
AlarmRoleArn: "{{ AlarmRoleArn }}"
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_environment
Updates an environment.
UPDATE aws.appconfig.environments
SET
Name = '{{ Name }}',
Description = '{{ Description }}',
Monitors = '{{ Monitors }}'
WHERE
application_id = '{{ application_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND region = '{{ region }}' --required
RETURNING
application_id,
description,
id,
monitors,
name,
state;
DELETE examples
- delete_environment
Deletes an environment. To prevent users from unintentionally deleting actively-used environments, enable deletion protection.
DELETE FROM aws.appconfig.environments
WHERE environment_id = '{{ environment_id }}' --required
AND application_id = '{{ application_id }}' --required
AND region = '{{ region }}' --required
AND `x-amzn-deletion-protection-check` = '{{ x-amzn-deletion-protection-check }}'
;