Skip to content

aws.macie2.get_usage_statistics

Example SQL Queries

SELECT * FROM
aws.macie2.get_usage_statistics;

Description

Retrieves (queries) quotas and aggregated usage data for one or more accounts.

Table Definition

Column NameColumn Data Type
filter_by Input Column

An array of objects, one for each condition to use to filter the query results. If you specify more than one condition, Amazon Macie uses an AND operator to join the conditions.

STRUCT(
"comparator" VARCHAR,
"key" VARCHAR,
"values" VARCHAR[]
)[]
Show child fields
filter_by[]
Show child fields
filter_by[].comparator

The operator to use in the condition. If the value for the key property is accountId, this value must be CONTAINS. If the value for the key property is any other supported field, this value can be EQ, GT, GTE, LT, LTE, or NE.

filter_by[].key

The field to use in the condition.

filter_by[].values[]
sort_by Input Column

The criteria to use to sort the query results.

STRUCT(
"key" VARCHAR,
"order_by" VARCHAR
)
Show child fields
sort_by.key

The field to sort the results by.

sort_by.order_by

The sort order to apply to the results, based on the value for the field specified by the key property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.

time_range Input Column

The inclusive time period that the usage data applies to. Possible values are: MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for the preceding 30 days.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
records

An array of objects that contains the results of the query. Each object contains the data for an account that matches the filter criteria specified in the request.

STRUCT(
"account_id" VARCHAR,
"automated_discovery_free_trial_start_date" TIMESTAMP_S,
"free_trial_start_date" TIMESTAMP_S,
"usage" STRUCT(
"currency" VARCHAR,
"estimated_cost" VARCHAR,
"service_limit" STRUCT(
"is_service_limited" BOOLEAN,
"unit" VARCHAR,
"value" BIGINT
),
"type" VARCHAR
)[]
)[]
Show child fields
records[]
Show child fields
records[].account_id

The unique identifier for the Amazon Web Services account that the data applies to.

records[].automated_discovery_free_trial_start_date

The date and time, in UTC and extended ISO 8601 format, when the free trial of automated sensitive data discovery started for the account. This value is null if automated sensitive data discovery hasn't been enabled for the account.

records[].free_trial_start_date

The date and time, in UTC and extended ISO 8601 format, when the Amazon Macie free trial started for the account.

records[].usage[]
Show child fields
records[].usage[].currency

The type of currency that the value for the metric (estimatedCost) is reported in.

records[].usage[].estimated_cost

The estimated value for the metric.

records[].usage[].service_limit

The current value for the quota that corresponds to the metric specified by the type field.

Show child fields
records[].usage[].service_limit.is_service_limited

Specifies whether the account has met the quota that corresponds to the metric specified by the UsageByAccount.type field in the response.

records[].usage[].service_limit.unit

The unit of measurement for the value specified by the value field.

records[].usage[].service_limit.value

The value for the metric specified by the UsageByAccount.type field in the response.

records[].usage[].type

The name of the metric. Possible values are: AUTOMATED_OBJECT_MONITORING, to monitor S3 objects for automated sensitive data discovery; AUTOMATED_SENSITIVE_DATA_DISCOVERY, to analyze S3 objects for automated sensitive data discovery; DATA_INVENTORY_EVALUATION, to monitor S3 buckets; and, SENSITIVE_DATA_DISCOVERY, to run classification jobs.