mitigation_actions
Creates, updates, deletes or gets a mitigation_action resource or lists mitigation_actions in a region
Overview
| Name | mitigation_actions |
| Type | Resource |
| Description | Mitigation actions can be used to take actions to mitigate issues that were found in an Audit finding or Detect violation. |
| Id | awscc.iot.mitigation_actions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
action_name | string | A unique identifier for the mitigation action. |
role_arn | string | |
tags | array | An array of key-value pairs to apply to this resource. |
action_params | object | The set of parameters for this mitigation action. You can specify only one type of parameter (in other words, you can apply only one action for each defined mitigation action). |
mitigation_action_arn | string | |
mitigation_action_id | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
action_name | string | A unique identifier for the mitigation action. |
region | string | AWS region. |
For more information, see AWS::IoT::MitigationAction.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | mitigation_actions | INSERT | RoleArn, ActionParams, region |
delete_resource | mitigation_actions | DELETE | Identifier, region |
update_resource | mitigation_actions | UPDATE | Identifier, PatchDocument, region |
list_resources | mitigation_actions_list_only | SELECT | region |
get_resource | mitigation_actions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual mitigation_action.
SELECT
region,
action_name,
role_arn,
tags,
action_params,
mitigation_action_arn,
mitigation_action_id
FROM awscc.iot.mitigation_actions
WHERE
region = '{{ region }}' AND
Identifier = '{{ action_name }}';
Lists all mitigation_actions in a region.
SELECT
region,
action_name
FROM awscc.iot.mitigation_actions_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new mitigation_action resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.mitigation_actions (
RoleArn,
ActionParams,
region
)
SELECT
'{{ role_arn }}',
'{{ action_params }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.iot.mitigation_actions (
ActionName,
RoleArn,
Tags,
ActionParams,
region
)
SELECT
'{{ action_name }}',
'{{ role_arn }}',
'{{ tags }}',
'{{ action_params }}',
'{{ 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: mitigation_action
props:
- name: action_name
value: '{{ action_name }}'
- name: role_arn
value: '{{ role_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: action_params
value:
add_things_to_thing_group_params:
override_dynamic_groups: '{{ override_dynamic_groups }}'
thing_group_names:
- '{{ thing_group_names[0] }}'
enable_io_tlogging_params:
log_level: '{{ log_level }}'
role_arn_for_logging: '{{ role_arn_for_logging }}'
publish_finding_to_sns_params:
topic_arn: '{{ topic_arn }}'
replace_default_policy_version_params:
template_name: '{{ template_name }}'
update_ca_certificate_params:
action: '{{ action }}'
update_device_certificate_params:
action: '{{ action }}'
UPDATE example
Use the following StackQL query and manifest file to update a mitigation_action resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.mitigation_actions
SET PatchDocument = string('{{ {
"RoleArn": role_arn,
"Tags": tags,
"ActionParams": action_params
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ action_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.iot.mitigation_actions
WHERE
Identifier = '{{ action_name }}' 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 mitigation_actions resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iot:CreateMitigationAction,
iot:DescribeMitigationAction,
iot:TagResource,
iam:PassRole
iot:DescribeMitigationAction,
iot:ListTagsForResource
iot:UpdateMitigationAction,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource,
iam:PassRole
iot:DescribeMitigationAction,
iot:DeleteMitigationAction
iot:ListMitigationActions