Skip to main content

mitigation_actions

Creates, updates, deletes or gets a mitigation_action resource or lists mitigation_actions in a region

Overview

Namemitigation_actions
TypeResource
DescriptionMitigation actions can be used to take actions to mitigate issues that were found in an Audit finding or Detect violation.
Idawscc.iot.mitigation_actions

Fields

NameDatatypeDescription
action_namestringA unique identifier for the mitigation action.
role_arnstring
tagsarrayAn array of key-value pairs to apply to this resource.
action_paramsobjectThe 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_arnstring
mitigation_action_idstring
regionstringAWS region.

For more information, see AWS::IoT::MitigationAction.

Methods

NameResourceAccessible byRequired Params
create_resourcemitigation_actionsINSERTRoleArn, ActionParams, region
delete_resourcemitigation_actionsDELETEIdentifier, region
update_resourcemitigation_actionsUPDATEIdentifier, PatchDocument, region
list_resourcesmitigation_actions_list_onlySELECTregion
get_resourcemitigation_actionsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new mitigation_action resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

iot:CreateMitigationAction,
iot:DescribeMitigationAction,
iot:TagResource,
iam:PassRole