Skip to main content

sessions

Creates, updates, deletes or gets a session resource or lists sessions in a region

Overview

Namesessions
TypeResource
DescriptionThe AWS::Macie::Session resource specifies a new Amazon Macie session. A session is an object that represents the Amazon Macie service. A session is required for Amazon Macie to become operational.
Idawscc.macie.sessions

Fields

NameDatatypeDescription
aws_account_idstringAWS account ID of customer
statusstringA enumeration value that specifies the status of the Macie Session.
finding_publishing_frequencystringA enumeration value that specifies how frequently finding updates are published.
service_rolestringService role used by Macie
automated_discovery_statusstringThe status of automated sensitive data discovery for the Macie session.
regionstringAWS region.

For more information, see AWS::Macie::Session.

Methods

NameResourceAccessible byRequired Params
create_resourcesessionsINSERTregion
delete_resourcesessionsDELETEIdentifier, region
update_resourcesessionsUPDATEIdentifier, PatchDocument, region
list_resourcessessions_list_onlySELECTregion
get_resourcesessionsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual session.

SELECT
region,
aws_account_id,
status,
finding_publishing_frequency,
service_role,
automated_discovery_status
FROM awscc.macie.sessions
WHERE
region = '{{ region }}' AND
Identifier = '{{ aws_account_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.macie.sessions (
Status,
FindingPublishingFrequency,
region
)
SELECT
'{{ status }}',
'{{ finding_publishing_frequency }}',
'{{ 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 session resource, using stack-deploy.

/*+ update */
UPDATE awscc.macie.sessions
SET PatchDocument = string('{{ {
"Status": status,
"FindingPublishingFrequency": finding_publishing_frequency
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ aws_account_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

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

macie2:GetMacieSession,
macie2:EnableMacie,
macie2:ListAutomatedDiscoveryAccounts