Skip to content

aws.s3.get_bucket_logging

Example SQL Queries

SELECT * FROM
aws.s3.get_bucket_logging
WHERE
"bucket" = 'VALUE';

Description

This operation is not supported by directory buckets.

Returns the logging status of a bucket and the permissions users have to view and modify that status.

Table Definition

Column NameColumn Data Type
bucket Required Input Column

The bucket name for which to get the logging information.

VARCHAR
expected_bucket_owner Input Column

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

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.

logging_enabled

Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the Amazon S3 API Reference.

STRUCT(
"target_bucket" VARCHAR,
"target_grants" STRUCT(
"grantee" STRUCT(
"display_name" VARCHAR,
"email_address" VARCHAR,
"id" VARCHAR,
"type" VARCHAR,
"uri" VARCHAR
),
"permission" VARCHAR
)[],
"target_prefix" VARCHAR,
"target_object_key_format" STRUCT(
"simple_prefix" BOOLEAN,
"partitioned_prefix" STRUCT(
"partition_date_source" VARCHAR
)
)
)
Show child fields
logging_enabled.target_bucket

Specifies the bucket where you want Amazon S3 to store server access logs. You can have your logs delivered to any bucket that you own, including the same bucket that is being logged. You can also configure multiple buckets to deliver their logs to the same target bucket. In this case, you should choose a different TargetPrefix for each source bucket so that the delivered log files can be distinguished by key.

logging_enabled.target_grants[]
Show child fields
logging_enabled.target_grants[].grantee

Container for the person being granted permissions.

Show child fields
logging_enabled.target_grants[].grantee.display_name

Screen name of the grantee.

logging_enabled.target_grants[].grantee.email_address

Email address of the grantee.

Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:

  • US East (N. Virginia)

  • US West (N. California)

  • US West (Oregon)

  • Asia Pacific (Singapore)

  • Asia Pacific (Sydney)

  • Asia Pacific (Tokyo)

  • Europe (Ireland)

  • South America (São Paulo)

For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference.

logging_enabled.target_grants[].grantee.id

The canonical user ID of the grantee.

logging_enabled.target_grants[].grantee.type

Type of grantee

logging_enabled.target_grants[].grantee.uri

URI of the grantee group.

logging_enabled.target_grants[].permission

Logging permissions assigned to the grantee for the bucket.

logging_enabled.target_object_key_format

Amazon S3 key format for log objects.

Show child fields
logging_enabled.target_object_key_format.partitioned_prefix

Partitioned S3 key for log objects.

Show child fields
logging_enabled.target_object_key_format.partitioned_prefix.partition_date_source

Specifies the partition date source for the partitioned prefix. PartitionDateSource can be EventTime or DeliveryTime.

For DeliveryTime, the time in the log file names corresponds to the delivery time for the log files.

For EventTime, The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key.

logging_enabled.target_object_key_format.simple_prefix

To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}.

logging_enabled.target_prefix

A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.