environments
Creates, updates, deletes or gets an environment resource or lists environments in a region
Overview
| Name | environments |
| Type | Resource |
| Description | Definition of AWS::DataZone::Environment Resource Type |
| Id | awscc.datazone.environments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
aws_account_id | string | The AWS account in which the Amazon DataZone environment is created. |
aws_account_region | string | The AWS region in which the Amazon DataZone environment is created. |
environment_account_identifier | string | The AWS account in which the Amazon DataZone environment is created. |
environment_account_region | string | The AWS region in which the Amazon DataZone environment is created. |
created_at | string | The timestamp of when the environment was created. |
created_by | string | The Amazon DataZone user who created the environment. |
description | string | The description of the Amazon DataZone environment. |
domain_id | string | The identifier of the Amazon DataZone domain in which the environment is created. |
domain_identifier | string | The identifier of the Amazon DataZone domain in which the environment would be created. |
environment_blueprint_id | string | The ID of the blueprint with which the Amazon DataZone environment was created. |
environment_profile_id | string | The ID of the environment profile with which the Amazon DataZone environment was created. |
environment_profile_identifier | string | The ID of the environment profile with which the Amazon DataZone environment would be created. |
glossary_terms | array | The glossary terms that can be used in the Amazon DataZone environment. |
environment_role_arn | string | Environment role arn for custom aws environment permissions |
id | string | The ID of the Amazon DataZone environment. |
name | string | The name of the environment. |
project_id | string | The ID of the Amazon DataZone project in which the environment is created. |
project_identifier | string | The ID of the Amazon DataZone project in which the environment would be created. |
provider | string | The provider of the Amazon DataZone environment. |
status | string | The status of the Amazon DataZone environment. |
updated_at | string | The timestamp of when the environment was updated. |
user_parameters | array | The user parameters of the Amazon DataZone environment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
domain_id | string | The identifier of the Amazon DataZone domain in which the environment is created. |
id | string | The ID of the Amazon DataZone environment. |
region | string | AWS region. |
For more information, see AWS::DataZone::Environment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | environments | INSERT | Name, ProjectIdentifier, DomainIdentifier, 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,
aws_account_id,
aws_account_region,
environment_account_identifier,
environment_account_region,
created_at,
created_by,
description,
domain_id,
domain_identifier,
environment_blueprint_id,
environment_profile_id,
environment_profile_identifier,
glossary_terms,
environment_role_arn,
id,
name,
project_id,
project_identifier,
provider,
status,
updated_at,
user_parameters
FROM awscc.datazone.environments
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_id }}|{{ id }}';
Lists all environments in a region.
SELECT
region,
domain_id,
id
FROM awscc.datazone.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.datazone.environments (
DomainIdentifier,
Name,
ProjectIdentifier,
region
)
SELECT
'{{ domain_identifier }}',
'{{ name }}',
'{{ project_identifier }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.datazone.environments (
EnvironmentAccountIdentifier,
EnvironmentAccountRegion,
Description,
DomainIdentifier,
EnvironmentProfileIdentifier,
GlossaryTerms,
EnvironmentRoleArn,
Name,
ProjectIdentifier,
UserParameters,
region
)
SELECT
'{{ environment_account_identifier }}',
'{{ environment_account_region }}',
'{{ description }}',
'{{ domain_identifier }}',
'{{ environment_profile_identifier }}',
'{{ glossary_terms }}',
'{{ environment_role_arn }}',
'{{ name }}',
'{{ project_identifier }}',
'{{ user_parameters }}',
'{{ 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: environment_account_identifier
value: '{{ environment_account_identifier }}'
- name: environment_account_region
value: '{{ environment_account_region }}'
- name: description
value: '{{ description }}'
- name: domain_identifier
value: '{{ domain_identifier }}'
- name: environment_profile_identifier
value: '{{ environment_profile_identifier }}'
- name: glossary_terms
value:
- '{{ glossary_terms[0] }}'
- name: environment_role_arn
value: '{{ environment_role_arn }}'
- name: name
value: '{{ name }}'
- name: project_identifier
value: '{{ project_identifier }}'
- name: user_parameters
value:
- name: '{{ name }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a environment resource, using stack-deploy.
/*+ update */
UPDATE awscc.datazone.environments
SET PatchDocument = string('{{ {
"Description": description,
"GlossaryTerms": glossary_terms,
"EnvironmentRoleArn": environment_role_arn,
"Name": name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_id }}|{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.datazone.environments
WHERE
Identifier = '{{ domain_id }}|{{ 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:
- Create
- Read
- Update
- Delete
- List
datazone:CreateEnvironment,
datazone:GetEnvironment,
datazone:DeleteEnvironment,
datazone:AssociateEnvironmentRole,
iam:PassRole
datazone:GetEnvironment
datazone:UpdateEnvironment,
datazone:GetEnvironment,
datazone:DeleteEnvironment,
datazone:AssociateEnvironmentRole,
datazone:DisassociateEnvironmentRole,
iam:PassRole
datazone:DeleteEnvironment,
datazone:GetEnvironment
datazone:ListEnvironments