domain_units
Creates, updates, deletes or gets a domain_unit resource or lists domain_units in a region
Overview
| Name | domain_units |
| Type | Resource |
| Description | A domain unit enables you to easily organize your assets and other domain entities under specific business units and teams. |
| Id | awscc.datazone.domain_units |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
domain_identifier | string | The ID of the domain where you want to create a domain unit. |
description | string | The description of the domain unit. |
name | string | The name of the domain unit. |
parent_domain_unit_identifier | string | The ID of the parent domain unit. |
created_at | string | The timestamp at which the domain unit was created. |
domain_id | string | The ID of the domain where the domain unit was created. |
id | string | The ID of the domain unit. |
parent_domain_unit_id | string | The ID of the parent domain unit. |
identifier | string | The identifier of the domain unit that you want to get. |
last_updated_at | string | The timestamp at which the domain unit was last updated. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
domain_id | string | The ID of the domain where the domain unit was created. |
id | string | The ID of the domain unit. |
region | string | AWS region. |
For more information, see AWS::DataZone::DomainUnit.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | domain_units | INSERT | DomainIdentifier, Name, ParentDomainUnitIdentifier, region |
delete_resource | domain_units | DELETE | Identifier, region |
update_resource | domain_units | UPDATE | Identifier, PatchDocument, region |
list_resources | domain_units_list_only | SELECT | region |
get_resource | domain_units | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual domain_unit.
SELECT
region,
domain_identifier,
description,
name,
parent_domain_unit_identifier,
created_at,
domain_id,
id,
parent_domain_unit_id,
identifier,
last_updated_at
FROM awscc.datazone.domain_units
WHERE
region = 'us-east-1' AND
Identifier = '{{ domain_id }}|{{ id }}';
Lists all domain_units in a region.
SELECT
region,
domain_id,
id
FROM awscc.datazone.domain_units_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new domain_unit resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.datazone.domain_units (
DomainIdentifier,
Name,
ParentDomainUnitIdentifier,
region
)
SELECT
'{{ domain_identifier }}',
'{{ name }}',
'{{ parent_domain_unit_identifier }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.datazone.domain_units (
DomainIdentifier,
Description,
Name,
ParentDomainUnitIdentifier,
region
)
SELECT
'{{ domain_identifier }}',
'{{ description }}',
'{{ name }}',
'{{ parent_domain_unit_identifier }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: domain_unit
props:
- name: domain_identifier
value: '{{ domain_identifier }}'
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: parent_domain_unit_identifier
value: '{{ parent_domain_unit_identifier }}'
UPDATE example
Use the following StackQL query and manifest file to update a domain_unit resource, using stack-deploy.
/*+ update */
UPDATE awscc.datazone.domain_units
SET PatchDocument = string('{{ {
"Description": description,
"Name": name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_id }}|{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.datazone.domain_units
WHERE
Identifier = '{{ domain_id }}|{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the domain_units resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
datazone:CreateDomainUnit,
datazone:GetDomainUnit
datazone:GetDomainUnit
datazone:UpdateDomainUnit,
datazone:GetDomainUnit
datazone:DeleteDomainUnit,
datazone:GetDomainUnit
datazone:ListDomainUnitsForParent