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 = 'us-east-1' AND
Identifier = '{{ action_name }}';
Lists all mitigation_actions in a region.
SELECT
region,
action_name
FROM awscc.iot.mitigation_actions_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.iot.mitigation_actions (
ActionName,
RoleArn,
Tags,
ActionParams,
region
)
SELECT
'{{ action_name }}',
'{{ role_arn }}',
'{{ tags }}',
'{{ action_params }}',
'{{ region }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.mitigation_actions
WHERE
Identifier = '{{ action_name }}' AND
region = 'us-east-1';
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