projects
Creates, updates, deletes or gets a project resource or lists projects in a region
Overview
| Name | projects |
| Type | Resource |
| Description | Resource schema for AWS::IoTSiteWise::Project |
| Id | awscc.iotsitewise.projects |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
portal_id | string | The ID of the portal in which to create the project. |
project_id | string | The ID of the project. |
project_name | string | A friendly name for the project. |
project_description | string | A description for the project. |
project_arn | string | The ARN of the project. |
asset_ids | array | The IDs of the assets to be associated to the project. |
tags | array | A list of key-value pairs that contain metadata for the project. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
project_id | string | The ID of the project. |
region | string | AWS region. |
For more information, see AWS::IoTSiteWise::Project.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | projects | INSERT | PortalId, ProjectName, region |
delete_resource | projects | DELETE | Identifier, region |
update_resource | projects | UPDATE | Identifier, PatchDocument, region |
list_resources | projects_list_only | SELECT | region |
get_resource | projects | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual project.
SELECT
region,
portal_id,
project_id,
project_name,
project_description,
project_arn,
asset_ids,
tags
FROM awscc.iotsitewise.projects
WHERE
region = '{{ region }}' AND
Identifier = '{{ project_id }}';
Lists all projects in a region.
SELECT
region,
project_id
FROM awscc.iotsitewise.projects_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new project resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iotsitewise.projects (
PortalId,
ProjectName,
region
)
SELECT
'{{ portal_id }}',
'{{ project_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.iotsitewise.projects (
PortalId,
ProjectName,
ProjectDescription,
AssetIds,
Tags,
region
)
SELECT
'{{ portal_id }}',
'{{ project_name }}',
'{{ project_description }}',
'{{ asset_ids }}',
'{{ tags }}',
'{{ 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: project
props:
- name: portal_id
value: '{{ portal_id }}'
- name: project_name
value: '{{ project_name }}'
- name: project_description
value: '{{ project_description }}'
- name: asset_ids
value:
- '{{ asset_ids[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a project resource, using stack-deploy.
/*+ update */
UPDATE awscc.iotsitewise.projects
SET PatchDocument = string('{{ {
"ProjectName": project_name,
"ProjectDescription": project_description,
"AssetIds": asset_ids,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ project_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.iotsitewise.projects
WHERE
Identifier = '{{ project_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 projects resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iotsitewise:CreateProject,
iotsitewise:DescribeProject,
iotsitewise:ListProjectAssets,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:BatchAssociateProjectAssets
iotsitewise:DescribeProject,
iotsitewise:ListTagsForResource,
iotsitewise:ListProjectAssets
iotsitewise:DescribeProject,
iotsitewise:UpdateProject,
iotsitewise:BatchAssociateProjectAssets,
iotsitewise:BatchDisAssociateProjectAssets,
iotsitewise:ListProjectAssets,
iotsitewise:TagResource,
iotsitewise:UntagResource,
iotsitewise:ListTagsForResource
iotsitewise:DescribeProject,
iotsitewise:DeleteProject
iotsitewise:ListPortals,
iotsitewise:ListProjects,
iotsitewise:ListTagsForResource