Skip to main content

security_profiles

Creates, updates, deletes or gets a security_profile resource or lists security_profiles in a region

Overview

Namesecurity_profiles
TypeResource
DescriptionA security profile defines a set of expected behaviors for devices in your account.
Idawscc.iot.security_profiles

Fields

NameDatatypeDescription
security_profile_namestringA unique identifier for the security profile.
security_profile_descriptionstringA description of the security profile.
behaviorsarraySpecifies the behaviors that, when violated by a device (thing), cause an alert.
alert_targetsobjectSpecifies the destinations to which alerts are sent.
additional_metrics_to_retain_v2arrayA list of metrics whose data is retained (stored). By default, data is retained for any metric used in the profile's behaviors, but it is also retained for any metric specified here.
metrics_export_configobjectA structure containing the mqtt topic for metrics export.
tagsarrayMetadata that can be used to manage the security profile.
target_arnsarrayA set of target ARNs that the security profile is attached to.
security_profile_arnstringThe ARN (Amazon resource name) of the created security profile.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcesecurity_profilesINSERT, region
delete_resourcesecurity_profilesDELETEIdentifier, region
update_resourcesecurity_profilesUPDATEIdentifier, PatchDocument, region
list_resourcessecurity_profiles_list_onlySELECTregion
get_resourcesecurity_profilesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual security_profile.

SELECT
region,
security_profile_name,
security_profile_description,
behaviors,
alert_targets,
additional_metrics_to_retain_v2,
metrics_export_config,
tags,
target_arns,
security_profile_arn
FROM awscc.iot.security_profiles
WHERE
region = '{{ region }}' AND
Identifier = '{{ security_profile_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iot.security_profiles (
,
region
)
SELECT
'{{ }}',
'{{ 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 security_profile resource, using stack-deploy.

/*+ update */
UPDATE awscc.iot.security_profiles
SET PatchDocument = string('{{ {
"SecurityProfileDescription": security_profile_description,
"Behaviors": behaviors,
"AlertTargets": alert_targets,
"AdditionalMetricsToRetainV2": additional_metrics_to_retain_v2,
"MetricsExportConfig": metrics_export_config,
"Tags": tags,
"TargetArns": target_arns
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ security_profile_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iot.security_profiles
WHERE
Identifier = '{{ security_profile_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 security_profiles resource, the following permissions are required:

iot:CreateSecurityProfile,
iot:AttachSecurityProfile,
iot:DescribeSecurityProfile,
iot:TagResource,
iam:PassRole