Skip to main content

comments

Creates, updates, deletes, gets or lists a comments resource.

Overview

Namecomments
TypeResource
Idaws.security_ir.comments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
bodystring
comment_idstring (pattern: <code>\d{6}</code>)
created_datestring (date-time)
creatorstring (pattern: <code>.((^AWS Responder)|(^\d{12}$)|(^arn:([^:]aws[^:]):(?:(?:iam)::\d{12}:(?:user|role|group|root)(?:(?:/[^/]+)+)?|(?:sts)::\d{12}:assumed-role/[^/]+/[^/]+)$)|(^security-ir.amazonaws.com)).</code>)
last_updated_bystring (pattern: <code>.((^AWS Responder)|(^\d{12}$)|(^arn:([^:]aws[^:]):(?:(?:iam)::\d{12}:(?:user|role|group|root)(?:(?:/[^/]+)+)?|(?:sts)::\d{12}:assumed-role/[^/]+/[^/]+)$)|(^security-ir.amazonaws.com)).</code>)
last_updated_datestring (date-time)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_commentsselectcase_id, regionReturns comments for a designated case.
create_case_commentinsertcase_id, region, bodyAdds a comment to an existing case.
update_case_commentupdatecase_id, comment_id, region, bodyUpdates an existing case comment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
case_idstringRequired element for UpdateCaseComment to identify the case ID containing the comment to be updated.
comment_idstringRequired element for UpdateCaseComment to identify the case ID to be updated.
regionstringAWS region (default: us-east-1)

SELECT examples

Returns comments for a designated case.

SELECT
body,
comment_id,
created_date,
creator,
last_updated_by,
last_updated_date
FROM aws.security_ir.comments
WHERE case_id = '{{ case_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Adds a comment to an existing case.

INSERT INTO aws.security_ir.comments (
clientToken,
body,
case_id,
region
)
SELECT
'{{ clientToken }}',
'{{ body }}' /* required */,
'{{ case_id }}',
'{{ region }}'
RETURNING
comment_id
;

UPDATE examples

Updates an existing case comment.

UPDATE aws.security_ir.comments
SET
body = '{{ body }}'
WHERE
case_id = '{{ case_id }}' --required
AND comment_id = '{{ comment_id }}' --required
AND region = '{{ region }}' --required
AND body = '{{ body }}' --required
RETURNING
body,
comment_id;