Get a detailed overview of this resourceList the top 5 use cases for this resourceBuild a program using aws.s3.BucketLoggingV2Repository[AWS Classic pulumi/pulumi-aws](https://github.com/pulumi/pulumi-aws)LicenseApache-2.0NotesThis Pulumi package is based on the [`aws` Terraform Provider](https://github.com/hashicorp/terraform-provider-aws).

1. [Packages](/content/registry/index.html)
2. [Packages](/content/registry/packages/index.html)
3. [AWS](/content/registry/packages/aws/index.html)
4. [API Docs](/content/registry/packages/aws/api-docs/index.html)
5. [s3](/content/registry/packages/aws/api-docs/s3/index.html)
6. [BucketLoggingV2](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/index.html)

AWS v7.32.0, May 29 26

AWS v7.32.0, May 29 26

Viewing docs for AWS v7.32.0

published on Friday, May 29, 2026 by Pulumi

[Schema (JSON)](/content/registry/packages/aws/schema.json)

[pulumi/pulumi-aws](https://github.com/pulumi/pulumi-aws)

v7.32.0 (7.x, latest)v6.83.1 (6.x)v5.43.0 (5.x)

# aws.s3.BucketLoggingV2 [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#aws-s3-bucketloggingv2/index.html)

Explore with Neo

[Explain this resource](https://app.pulumi.com/neo?prompt=Explain+the+resource+aws.s3.BucketLoggingV2.+Provide+a+detailed+overview+of+its+purpose%2C+architecture%2C+and+typical+responsibilities.&prefer_signup=true) [Show real-world scenarios](https://app.pulumi.com/neo?prompt=List+the+top+five+real-world+scenarios+where+aws.s3.BucketLoggingV2+delivers+the+most+value.+Describe+why+it+is+useful+for+each.&prefer_signup=true) [Provision a new instance](https://app.pulumi.com/neo?prompt=Generate+a+Pulumi+program+that+provisions+aws.s3.BucketLoggingV2.+Include+any+required+configuration+and+showcase+best+practices.&prefer_signup=true)

Viewing docs for AWS v7.32.0

published on Friday, May 29, 2026 by Pulumi

[Schema (JSON)](/content/registry/packages/aws/schema.json)

[pulumi/pulumi-aws](https://github.com/pulumi/pulumi-aws)

v7.32.0 (7.x, latest)v6.83.1 (6.x)v5.43.0 (5.x)

## On this page

## On this page

- [Example Usage](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#example-usage/index.html)
- [Grant permission by using bucket policy](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grant-permission-by-using-bucket-policy/index.html)
- [Grant permission by using bucket ACL](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grant-permission-by-using-bucket-acl/index.html)
- [Create BucketLoggingV2 Resource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#create/index.html)
- [Constructor syntax](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#constructor-syntax/index.html)
- [BucketLoggingV2 Resource Properties](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#properties/index.html)
- [Inputs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)
- [Outputs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#outputs/index.html)
- [Look up Existing BucketLoggingV2 Resource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#look-up/index.html)
- [Supporting Types](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#supporting-types/index.html)
- [Import](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#import/index.html)
- [Identity Schema](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#identity-schema/index.html)
- [Package Details](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#package-details/index.html)

* * *

Related Resources

[s3.BucketV2](/content/registry/packages/aws/api-docs/s3/bucketv2/index.html)

- Copy Page

- [Request a Change](https://github.com/pulumi/registry/issues/new?body=File:%20[themes%2fdefault%2fcontent/%2fregistry%2fpackages%2faws%2fapi-docs%2fs3%2fbucketloggingv2](https%3a%2f%2fwww.pulumi.com%2fregistry%2fpackages%2faws%2fapi-docs%2fs3%2fbucketloggingv2%2f))

[Scroll to top](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/# "Scroll to top"/index.html)

Deprecated: aws.s3/bucketloggingv2.BucketLoggingV2 has been deprecated in favor of aws.s3/bucketlogging.BucketLogging

Provides an S3 bucket (server access) logging resource. For more information, see [Logging requests using server access logging](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html)
in the AWS S3 User Guide.

> **Note:** Amazon S3 supports server access logging, AWS CloudTrail, or a combination of both. Refer to the [Logging options for Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/logging-with-S3.html)
> to decide which method meets your requirements.

> This resource cannot be used with S3 directory buckets.

## Example Usage [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#example-usage/index.html)

### Grant permission by using bucket policy [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#grant-permission-by-using-bucket-policy/index.html)

- TypeScript
- Python
- Go
- C#
- Java
- YAML
- HCL PREVIEW

```typescript
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = aws.getCallerIdentity({});
const logging = new aws.s3.Bucket("logging", {bucket: "access-logging-bucket"});
const loggingBucketPolicy = aws.iam.getPolicyDocumentOutput({
    statements: [{\
        principals: [{\
            identifiers: ["logging.s3.amazonaws.com"],\
            type: "Service",\
        }],\
        actions: ["s3:PutObject"],\
        resources: [pulumi.interpolate`${logging.arn}/*`],\
        conditions: [{\
            test: "StringEquals",\
            variable: "aws:SourceAccount",\
            values: [current.then(current => current.accountId)],\
        }],\
    }],
});
const loggingBucketPolicy2 = new aws.s3.BucketPolicy("logging", {
    bucket: logging.bucket,
    policy: loggingBucketPolicy.apply(loggingBucketPolicy => loggingBucketPolicy.json),
});
const example = new aws.s3.Bucket("example", {bucket: "example-bucket"});
const exampleBucketLogging = new aws.s3.BucketLogging("example", {
    bucket: example.bucket,
    targetBucket: logging.bucket,
    targetPrefix: "log/",
    targetObjectKeyFormat: {
        partitionedPrefix: {
            partitionDateSource: "EventTime",
        },
    },
});
```

Copy

```python
import pulumi
import pulumi_aws as aws

current = aws.get_caller_identity()
logging = aws.s3.Bucket("logging", bucket="access-logging-bucket")
logging_bucket_policy = aws.iam.get_policy_document_output(statements=[{\
    "principals": [{\
        "identifiers": ["logging.s3.amazonaws.com"],\
        "type": "Service",\
    }],\
    "actions": ["s3:PutObject"],\
    "resources": [logging.arn.apply(lambda arn: f"{arn}/*")],\
    "conditions": [{\
        "test": "StringEquals",\
        "variable": "aws:SourceAccount",\
        "values": [current.account_id],\
    }],\
}])
logging_bucket_policy2 = aws.s3.BucketPolicy("logging",
    bucket=logging.bucket,
    policy=logging_bucket_policy.json)
example = aws.s3.Bucket("example", bucket="example-bucket")
example_bucket_logging = aws.s3.BucketLogging("example",
    bucket=example.bucket,
    target_bucket=logging.bucket,
    target_prefix="log/",
    target_object_key_format={
        "partitioned_prefix": {
            "partition_date_source": "EventTime",
        },
    })
```

Copy

```go
package main

import (
	"fmt"

"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
		if err != nil {
			return err
		}
		logging, err := s3.NewBucket(ctx, "logging", &s3.BucketArgs{
			Bucket: pulumi.String("access-logging-bucket"),
		})
		if err != nil {
			return err
		}
		loggingBucketPolicy := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
			Statements: iam.GetPolicyDocumentStatementArray{
				&iam.GetPolicyDocumentStatementArgs{
					Principals: iam.GetPolicyDocumentStatementPrincipalArray{
						&iam.GetPolicyDocumentStatementPrincipalArgs{
							Identifiers: pulumi.StringArray{
								pulumi.String("logging.s3.amazonaws.com"),
							},
							Type: pulumi.String("Service"),
						},
					},
					Actions: pulumi.StringArray{
						pulumi.String("s3:PutObject"),
					},
					Resources: pulumi.StringArray{
						logging.Arn.ApplyT(func(arn string) (string, error) {
							return fmt.Sprintf("%v/*", arn), nil
						}).(pulumi.StringOutput),
					},
					Conditions: iam.GetPolicyDocumentStatementConditionArray{
						&iam.GetPolicyDocumentStatementConditionArgs{
							Test:     pulumi.String("StringEquals"),
							Variable: pulumi.String("aws:SourceAccount"),
							Values: pulumi.StringArray{
								pulumi.String(current.AccountId),
							},
						},
					},
				},
			},
		}, nil)
		_, err = s3.NewBucketPolicy(ctx, "logging", &s3.BucketPolicyArgs{
			Bucket: logging.Bucket,
			Policy: pulumi.String(loggingBucketPolicy.ApplyT(func(loggingBucketPolicy iam.GetPolicyDocumentResult) (*string, error) {
				return &loggingBucketPolicy.Json, nil
			}).(pulumi.StringPtrOutput)),
		})
		if err != nil {
			return err
		}
		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
			Bucket: pulumi.String("example-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketLogging(ctx, "example", &s3.BucketLoggingArgs{
			Bucket:       example.Bucket,
			TargetBucket: logging.Bucket,
			TargetPrefix: pulumi.String("log/"),
			TargetObjectKeyFormat: &s3.BucketLoggingTargetObjectKeyFormatArgs{
				PartitionedPrefix: &s3.BucketLoggingTargetObjectKeyFormatPartitionedPrefixArgs{
					PartitionDateSource: pulumi.String("EventTime"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
```

Copy

```csharp
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var current = Aws.GetCallerIdentity.Invoke();

var logging = new Aws.S3.Bucket("logging", new()
    {
        BucketName = "access-logging-bucket",
    });

var loggingBucketPolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Identifiers = new[]
                        {
                            "logging.s3.amazonaws.com",
                        },
                        Type = "Service",
                    },
                },
                Actions = new[]
                {
                    "s3:PutObject",
                },
                Resources = new[]
                {
                    $"{logging.Arn}/*",
                },
                Conditions = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs
                    {
                        Test = "StringEquals",
                        Variable = "aws:SourceAccount",
                        Values = new[]
                        {
                            current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                        },
                    },
                },
            },
        },
    });

var loggingBucketPolicy2 = new Aws.S3.BucketPolicy("logging", new()
    {
        Bucket = logging.BucketName,
        Policy = loggingBucketPolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

var example = new Aws.S3.Bucket("example", new()
    {
        BucketName = "example-bucket",
    });

var exampleBucketLogging = new Aws.S3.BucketLogging("example", new()
    {
        Bucket = example.BucketName,
        TargetBucket = logging.BucketName,
        TargetPrefix = "log/",
        TargetObjectKeyFormat = new Aws.S3.Inputs.BucketLoggingTargetObjectKeyFormatArgs
        {
            PartitionedPrefix = new Aws.S3.Inputs.BucketLoggingTargetObjectKeyFormatPartitionedPrefixArgs
            {
                PartitionDateSource = "EventTime",
            },
        },
    });

});
```

Copy

```java
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.s3.BucketPolicy;
import com.pulumi.aws.s3.BucketPolicyArgs;
import com.pulumi.aws.s3.BucketLogging;
import com.pulumi.aws.s3.BucketLoggingArgs;
import com.pulumi.aws.s3.inputs.BucketLoggingTargetObjectKeyFormatArgs;
import com.pulumi.aws.s3.inputs.BucketLoggingTargetObjectKeyFormatPartitionedPrefixArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

public static void stack(Context ctx) {
        final var current = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
            .build());

var logging = new Bucket("logging", BucketArgs.builder()
            .bucket("access-logging-bucket")
            .build());

final var loggingBucketPolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .identifiers("logging.s3.amazonaws.com")
                    .type("Service")
                    .build())
                .actions("s3:PutObject")
                .resources(logging.arn().applyValue(_arn -> String.format("%s/*", _arn)))
                .conditions(GetPolicyDocumentStatementConditionArgs.builder()
                    .test("StringEquals")
                    .variable("aws:SourceAccount")
                    .values(current.accountId())
                    .build())
                .build())
            .build());

var loggingBucketPolicy2 = new BucketPolicy("loggingBucketPolicy2", BucketPolicyArgs.builder()
            .bucket(logging.bucket())
            .policy(loggingBucketPolicy.applyValue(_loggingBucketPolicy -> _loggingBucketPolicy.json()))
            .build());

var example = new Bucket("example", BucketArgs.builder()
            .bucket("example-bucket")
            .build());

var exampleBucketLogging = new BucketLogging("exampleBucketLogging", BucketLoggingArgs.builder()
            .bucket(example.bucket())
            .targetBucket(logging.bucket())
            .targetPrefix("log/")
            .targetObjectKeyFormat(BucketLoggingTargetObjectKeyFormatArgs.builder()
                .partitionedPrefix(BucketLoggingTargetObjectKeyFormatPartitionedPrefixArgs.builder()
                    .partitionDateSource("EventTime")
                    .build())
                .build())
            .build());

}
}
```

Copy

```yaml
resources:
  logging:
    type: aws:s3:Bucket
    properties:
      bucket: access-logging-bucket
  loggingBucketPolicy2:
    type: aws:s3:BucketPolicy
    name: logging
    properties:
      bucket: ${logging.bucket}
      policy: ${loggingBucketPolicy.json}
  example:
    type: aws:s3:Bucket
    properties:
      bucket: example-bucket
  exampleBucketLogging:
    type: aws:s3:BucketLogging
    name: example
    properties:
      bucket: ${example.bucket}
      targetBucket: ${logging.bucket}
      targetPrefix: log/
      targetObjectKeyFormat:
        partitionedPrefix:
          partitionDateSource: EventTime
variables:
  current:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}
  loggingBucketPolicy:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - principals:
              - identifiers:
                  - logging.s3.amazonaws.com
                type: Service
            actions:
              - s3:PutObject
            resources:
              - ${logging.arn}/*
            conditions:
              - test: StringEquals
                variable: aws:SourceAccount
                values:
                  - ${current.accountId}
```

Copy

```hcl
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_getcalleridentity" "current" {
}
data "aws_iam_getpolicydocument" "loggingBucketPolicy" {
  statements {
    principals {
      identifiers = ["logging.s3.amazonaws.com"]
      type        = "Service"
    }
    actions   = ["s3:PutObject"]
    resources = ["${aws_s3_bucket.logging.arn}/*"]
    conditions {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = [data.aws_getcalleridentity.current.account_id]
    }
  }
}

resource "aws_s3_bucket" "logging" {
  bucket = "access-logging-bucket"
}
resource "aws_s3_bucketpolicy" "logging" {
  bucket = aws_s3_bucket.logging.bucket
  policy = data.aws_iam_getpolicydocument.loggingBucketPolicy.json
}
resource "aws_s3_bucket" "example" {
  bucket = "example-bucket"
}
resource "aws_s3_bucketlogging" "example" {
  bucket        = aws_s3_bucket.example.bucket
  target_bucket = aws_s3_bucket.logging.bucket
  target_prefix = "log/"
  target_object_key_format = {
    partitioned_prefix = {
      partition_date_source = "EventTime"
    }
  }
}
```

Copy

### Grant permission by using bucket ACL [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#grant-permission-by-using-bucket-acl/index.html)

The [AWS Documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html) does not recommend using the ACL.

- TypeScript
- Python
- Go
- C#
- Java
- YAML
- HCL PREVIEW

```typescript
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.Bucket("example", {bucket: "my-tf-example-bucket"});
const exampleBucketAcl = new aws.s3.BucketAcl("example", {
    bucket: example.id,
    acl: "private",
});
const logBucket = new aws.s3.Bucket("log_bucket", {bucket: "my-tf-log-bucket"});
const logBucketAcl = new aws.s3.BucketAcl("log_bucket_acl", {
    bucket: logBucket.id,
    acl: "log-delivery-write",
});
const exampleBucketLogging = new aws.s3.BucketLogging("example", {
    bucket: example.id,
    targetBucket: logBucket.id,
    targetPrefix: "log/",
});
```

Copy

```python
import pulumi
import pulumi_aws as aws

example = aws.s3.Bucket("example", bucket="my-tf-example-bucket")
example_bucket_acl = aws.s3.BucketAcl("example",
    bucket=example.id,
    acl="private")
log_bucket = aws.s3.Bucket("log_bucket", bucket="my-tf-log-bucket")
log_bucket_acl = aws.s3.BucketAcl("log_bucket_acl",
    bucket=log_bucket.id,
    acl="log-delivery-write")
example_bucket_logging = aws.s3.BucketLogging("example",
    bucket=example.id,
    target_bucket=log_bucket.id,
    target_prefix="log/")
```

Copy

```go
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
			Bucket: pulumi.String("my-tf-example-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
			Bucket: example.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		logBucket, err := s3.NewBucket(ctx, "log_bucket", &s3.BucketArgs{
			Bucket: pulumi.String("my-tf-log-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "log_bucket_acl", &s3.BucketAclArgs{
			Bucket: logBucket.ID(),
			Acl:    pulumi.String("log-delivery-write"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketLogging(ctx, "example", &s3.BucketLoggingArgs{
			Bucket:       example.ID(),
			TargetBucket: logBucket.ID(),
			TargetPrefix: pulumi.String("log/"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
```

Copy

```csharp
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.S3.Bucket("example", new()
    {
        BucketName = "my-tf-example-bucket",
    });

var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
    {
        Bucket = example.Id,
        Acl = "private",
    });

var logBucket = new Aws.S3.Bucket("log_bucket", new()
    {
        BucketName = "my-tf-log-bucket",
    });

var logBucketAcl = new Aws.S3.BucketAcl("log_bucket_acl", new()
    {
        Bucket = logBucket.Id,
        Acl = "log-delivery-write",
    });

var exampleBucketLogging = new Aws.S3.BucketLogging("example", new()
    {
        Bucket = example.Id,
        TargetBucket = logBucket.Id,
        TargetPrefix = "log/",
    });

});
```

Copy

```java
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.s3.BucketAcl;
import com.pulumi.aws.s3.BucketAclArgs;
import com.pulumi.aws.s3.BucketLogging;
import com.pulumi.aws.s3.BucketLoggingArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

public static void stack(Context ctx) {
        var example = new Bucket("example", BucketArgs.builder()
            .bucket("my-tf-example-bucket")
            .build());

var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
            .bucket(example.id())
            .acl("private")
            .build());

var logBucket = new Bucket("logBucket", BucketArgs.builder()
            .bucket("my-tf-log-bucket")
            .build());

var logBucketAcl = new BucketAcl("logBucketAcl", BucketAclArgs.builder()
            .bucket(logBucket.id())
            .acl("log-delivery-write")
            .build());

var exampleBucketLogging = new BucketLogging("exampleBucketLogging", BucketLoggingArgs.builder()
            .bucket(example.id())
            .targetBucket(logBucket.id())
            .targetPrefix("log/")
            .build());

}
}
```

Copy

```yaml
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucket: my-tf-example-bucket
  exampleBucketAcl:
    type: aws:s3:BucketAcl
    name: example
    properties:
      bucket: ${example.id}
      acl: private
  logBucket:
    type: aws:s3:Bucket
    name: log_bucket
    properties:
      bucket: my-tf-log-bucket
  logBucketAcl:
    type: aws:s3:BucketAcl
    name: log_bucket_acl
    properties:
      bucket: ${logBucket.id}
      acl: log-delivery-write
  exampleBucketLogging:
    type: aws:s3:BucketLogging
    name: example
    properties:
      bucket: ${example.id}
      targetBucket: ${logBucket.id}
      targetPrefix: log/
```

Copy

```hcl
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_s3_bucket" "example" {
  bucket = "my-tf-example-bucket"
}
resource "aws_s3_bucketacl" "example" {
  bucket = aws_s3_bucket.example.id
  acl    = "private"
}
resource "aws_s3_bucket" "log_bucket" {
  bucket = "my-tf-log-bucket"
}
resource "aws_s3_bucketacl" "log_bucket_acl" {
  bucket = aws_s3_bucket.log_bucket.id
  acl    = "log-delivery-write"
}
resource "aws_s3_bucketlogging" "example" {
  bucket        = aws_s3_bucket.example.id
  target_bucket = aws_s3_bucket.log_bucket.id
  target_prefix = "log/"
}
```

Copy

## Create BucketLoggingV2 Resource [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#create/index.html)

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see [Resources](/content/docs/concepts/resources/index.html).

### Constructor syntax [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#constructor-syntax/index.html)

- TypeScript
- Python
- Go
- C#
- Java
- YAML
- HCL PREVIEW

```typescript
new BucketLoggingV2(name: string, args: BucketLoggingV2Args, opts?: CustomResourceOptions);
```

```python
@overload
def BucketLoggingV2(resource_name: str,
                    args: BucketLoggingV2Args,
                    opts: Optional[ResourceOptions] = None)

@overload
def BucketLoggingV2(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    bucket: Optional[str] = None,
                    expected_bucket_owner: Optional[str] = None,
                    region: Optional[str] = None,
                    target_bucket: Optional[str] = None,
                    target_grants: Optional[Sequence[BucketLoggingV2TargetGrantArgs]] = None,
                    target_object_key_format: Optional[BucketLoggingV2TargetObjectKeyFormatArgs] = None,
                    target_prefix: Optional[str] = None)
```

```go
func NewBucketLoggingV2(ctx *Context, name string, args BucketLoggingV2Args, opts ...ResourceOption) (*BucketLoggingV2, error)
```

```csharp
public BucketLoggingV2(string name, BucketLoggingV2Args args, CustomResourceOptions? opts = null)
```

```java
public BucketLoggingV2(String name, BucketLoggingV2Args args)
public BucketLoggingV2(String name, BucketLoggingV2Args args, CustomResourceOptions options)
```

```yaml
type: aws:s3:BucketLoggingV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
```

```hcl
resource "aws_s3_bucketloggingv2" "name" {
    # resource properties
}
```

#### Parameters [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#parameters/index.html)

nameThis property is required.stringThe unique name of the resource.argsThis property is required.[BucketLoggingV2Args](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)The arguments to resource properties.opts[CustomResourceOptions](/content/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions/index.html)Bag of options to control resource's behavior.

resource\_nameThis property is required.strThe unique name of the resource.argsThis property is required.[BucketLoggingV2Args](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)The arguments to resource properties.opts[ResourceOptions](/content/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions)Bag of options to control resource's behavior.

ctx[Context](https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context)Context object for the current deployment.nameThis property is required.stringThe unique name of the resource.argsThis property is required.[BucketLoggingV2Args](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)The arguments to resource properties.opts[ResourceOption](https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption)Bag of options to control resource's behavior.

nameThis property is required.stringThe unique name of the resource.argsThis property is required.[BucketLoggingV2Args](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)The arguments to resource properties.opts[CustomResourceOptions](/content/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html)Bag of options to control resource's behavior.

nameThis property is required.StringThe unique name of the resource.argsThis property is required.[BucketLoggingV2Args](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html)The arguments to resource properties.optionsCustomResourceOptionsBag of options to control resource's behavior.

## BucketLoggingV2 Resource Properties [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#properties/index.html)

To learn more about resource properties and how to use them, see [Inputs and Outputs](/content/docs/intro/concepts/inputs-outputs/index.html) in the Architecture and Concepts docs.

### Inputs [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#inputs/index.html)

In Python, inputs that are objects can be passed either as [argument classes or as dictionary literals](/content/docs/languages-sdks/python/#inputs-and-outputs/index.html).

The BucketLoggingV2 resource accepts the following [input](/content/docs/intro/concepts/inputs-outputs/index.html) properties:

[Bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_csharp/index.html)

This property is required.

Changes to this property will trigger replacement.

stringName of the bucket.[TargetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetbucket_csharp/index.html)This property is required.stringName of the bucket where you want Amazon S3 to store server access logs.[TargetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetprefix_csharp/index.html)This property is required.stringPrefix for all log object keys.[ExpectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expectedbucketowner_csharp/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[Region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_csharp/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[TargetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetgrants_csharp/index.html)[List<BucketLoggingV2TargetGrant>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetobjectkeyformat_csharp/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[Bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_go/index.html)

This property is required.

Changes to this property will trigger replacement.

stringName of the bucket.[TargetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetbucket_go/index.html)This property is required.stringName of the bucket where you want Amazon S3 to store server access logs.[TargetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetprefix_go/index.html)This property is required.stringPrefix for all log object keys.[ExpectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expectedbucketowner_go/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[Region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_go/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[TargetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetgrants_go/index.html)[\[\]BucketLoggingV2TargetGrantArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetobjectkeyformat_go/index.html)[BucketLoggingV2TargetObjectKeyFormatArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_hcl/index.html)

This property is required.

Changes to this property will trigger replacement.

stringName of the bucket.[target\_bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_bucket_hcl/index.html)This property is required.stringName of the bucket where you want Amazon S3 to store server access logs.[target\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_prefix_hcl/index.html)This property is required.stringPrefix for all log object keys.[expected\_bucket\_owner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expected_bucket_owner_hcl/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_hcl/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[target\_grants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_grants_hcl/index.html)[list(object)](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[target\_object\_key\_format](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_object_key_format_hcl/index.html)[object](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_java/index.html)

This property is required.

Changes to this property will trigger replacement.

StringName of the bucket.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetbucket_java/index.html)This property is required.StringName of the bucket where you want Amazon S3 to store server access logs.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetprefix_java/index.html)This property is required.StringPrefix for all log object keys.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expectedbucketowner_java/index.html)StringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_java/index.html)StringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetgrants_java/index.html)[List<BucketLoggingV2TargetGrant>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetobjectkeyformat_java/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_nodejs/index.html)

This property is required.

Changes to this property will trigger replacement.

stringName of the bucket.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetbucket_nodejs/index.html)This property is required.stringName of the bucket where you want Amazon S3 to store server access logs.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetprefix_nodejs/index.html)This property is required.stringPrefix for all log object keys.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expectedbucketowner_nodejs/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_nodejs/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetgrants_nodejs/index.html)[BucketLoggingV2TargetGrant\[\]](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetobjectkeyformat_nodejs/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_python/index.html)

This property is required.

Changes to this property will trigger replacement.

strName of the bucket.[target\_bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_bucket_python/index.html)This property is required.strName of the bucket where you want Amazon S3 to store server access logs.[target\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_prefix_python/index.html)This property is required.strPrefix for all log object keys.[expected\_bucket\_owner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expected_bucket_owner_python/index.html)strAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_python/index.html)strRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[target\_grants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_grants_python/index.html)[Sequence\[BucketLoggingV2TargetGrantArgs\]](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[target\_object\_key\_format](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#target_object_key_format_python/index.html)[BucketLoggingV2TargetObjectKeyFormatArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucket_yaml/index.html)

This property is required.

Changes to this property will trigger replacement.

StringName of the bucket.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetbucket_yaml/index.html)This property is required.StringName of the bucket where you want Amazon S3 to store server access logs.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetprefix_yaml/index.html)This property is required.StringPrefix for all log object keys.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#expectedbucketowner_yaml/index.html)StringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#region_yaml/index.html)StringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetgrants_yaml/index.html)[List<Property Map>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#targetobjectkeyformat_yaml/index.html)[Property Map](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.

### Outputs [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#outputs/index.html)

All [input](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#inputs/index.html) properties are implicitly available as output properties. Additionally, the BucketLoggingV2 resource produces the following output properties:

[Id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_csharp/index.html)stringThe provider-assigned unique ID for this managed resource.

[Id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_go/index.html)stringThe provider-assigned unique ID for this managed resource.

[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_hcl/index.html)stringThe provider-assigned unique ID for this managed resource.

[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_java/index.html)StringThe provider-assigned unique ID for this managed resource.

[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_nodejs/index.html)stringThe provider-assigned unique ID for this managed resource.

[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_python/index.html)strThe provider-assigned unique ID for this managed resource.

[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_yaml/index.html)StringThe provider-assigned unique ID for this managed resource.

## Look up Existing BucketLoggingV2 Resource [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#look-up/index.html)

Get an existing BucketLoggingV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

- TypeScript
- Python
- Go
- C#
- Java
- YAML
- HCL PREVIEW

```typescript
public static get(name: string, id: Input<ID>, state?: BucketLoggingV2State, opts?: CustomResourceOptions): BucketLoggingV2
```

```python
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        expected_bucket_owner: Optional[str] = None,
        region: Optional[str] = None,
        target_bucket: Optional[str] = None,
        target_grants: Optional[Sequence[BucketLoggingV2TargetGrantArgs]] = None,
        target_object_key_format: Optional[BucketLoggingV2TargetObjectKeyFormatArgs] = None,
        target_prefix: Optional[str] = None) -> BucketLoggingV2
```

```go
func GetBucketLoggingV2(ctx *Context, name string, id IDInput, state *BucketLoggingV2State, opts ...ResourceOption) (*BucketLoggingV2, error)
```

```csharp
public static BucketLoggingV2 Get(string name, Input<string> id, BucketLoggingV2State? state, CustomResourceOptions? opts = null)
```

```java
public static BucketLoggingV2 get(String name, Output<String> id, BucketLoggingV2State state, CustomResourceOptions options)
```

```yaml
resources:  _:    type: aws:s3:BucketLoggingV2    get:      id: ${id}
```

```hcl
import {
  to = aws_s3_bucketloggingv2.example
  id = "${id}"
}
```

nameThis property is required.The unique name of the resulting resource.idThis property is required.The _unique_ provider ID of the resource to lookup.stateAny extra arguments used during the lookup.optsA bag of options that control this resource's behavior.

resource\_nameThis property is required.The unique name of the resulting resource.idThis property is required.The _unique_ provider ID of the resource to lookup.

The following state arguments are supported:

[Bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_csharp/index.html)Changes to this property will trigger replacement.stringName of the bucket.[ExpectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expectedbucketowner_csharp/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[Region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_csharp/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[TargetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetbucket_csharp/index.html)stringName of the bucket where you want Amazon S3 to store server access logs.[TargetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetgrants_csharp/index.html)[List<BucketLoggingV2TargetGrant>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetobjectkeyformat_csharp/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[TargetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetprefix_csharp/index.html)stringPrefix for all log object keys.

[Bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_go/index.html)Changes to this property will trigger replacement.stringName of the bucket.[ExpectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expectedbucketowner_go/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[Region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_go/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[TargetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetbucket_go/index.html)stringName of the bucket where you want Amazon S3 to store server access logs.[TargetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetgrants_go/index.html)[\[\]BucketLoggingV2TargetGrantArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetobjectkeyformat_go/index.html)[BucketLoggingV2TargetObjectKeyFormatArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[TargetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetprefix_go/index.html)stringPrefix for all log object keys.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_hcl/index.html)Changes to this property will trigger replacement.stringName of the bucket.[expected\_bucket\_owner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expected_bucket_owner_hcl/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_hcl/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[target\_bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_bucket_hcl/index.html)stringName of the bucket where you want Amazon S3 to store server access logs.[target\_grants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_grants_hcl/index.html)[list(object)](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[target\_object\_key\_format](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_object_key_format_hcl/index.html)[object](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[target\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_prefix_hcl/index.html)stringPrefix for all log object keys.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_java/index.html)Changes to this property will trigger replacement.StringName of the bucket.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expectedbucketowner_java/index.html)StringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_java/index.html)StringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetbucket_java/index.html)StringName of the bucket where you want Amazon S3 to store server access logs.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetgrants_java/index.html)[List<BucketLoggingV2TargetGrant>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetobjectkeyformat_java/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetprefix_java/index.html)StringPrefix for all log object keys.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_nodejs/index.html)Changes to this property will trigger replacement.stringName of the bucket.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expectedbucketowner_nodejs/index.html)stringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_nodejs/index.html)stringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetbucket_nodejs/index.html)stringName of the bucket where you want Amazon S3 to store server access logs.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetgrants_nodejs/index.html)[BucketLoggingV2TargetGrant\[\]](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetobjectkeyformat_nodejs/index.html)[BucketLoggingV2TargetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetprefix_nodejs/index.html)stringPrefix for all log object keys.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_python/index.html)Changes to this property will trigger replacement.strName of the bucket.[expected\_bucket\_owner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expected_bucket_owner_python/index.html)strAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_python/index.html)strRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[target\_bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_bucket_python/index.html)strName of the bucket where you want Amazon S3 to store server access logs.[target\_grants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_grants_python/index.html)[Sequence\[BucketLoggingV2TargetGrantArgs\]](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[target\_object\_key\_format](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_object_key_format_python/index.html)[BucketLoggingV2TargetObjectKeyFormatArgs](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[target\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_target_prefix_python/index.html)strPrefix for all log object keys.

[bucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_bucket_yaml/index.html)Changes to this property will trigger replacement.StringName of the bucket.[expectedBucketOwner](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_expectedbucketowner_yaml/index.html)StringAccount ID of the expected bucket owner.

Deprecated: expected\_bucket\_owner is deprecated. It will be removed in a future verion of the provider.

[region](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_region_yaml/index.html)StringRegion where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.[targetBucket](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetbucket_yaml/index.html)StringName of the bucket where you want Amazon S3 to store server access logs.[targetGrants](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetgrants_yaml/index.html)[List<Property Map>](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrant/index.html)Set of configuration blocks with information for granting permissions. See below.[targetObjectKeyFormat](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetobjectkeyformat_yaml/index.html)[Property Map](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformat/index.html)Amazon S3 key format for log objects. See below.[targetPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#state_targetprefix_yaml/index.html)StringPrefix for all log object keys.

## Supporting Types [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#supporting-types/index.html)

#### BucketLoggingV2TargetGrant  , BucketLoggingV2TargetGrantArgs   [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#bucketloggingv2targetgrant/index.html)

[Grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_csharp/index.html)This property is required.[BucketLoggingV2TargetGrantGrantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[Permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_csharp/index.html)This property is required.stringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[Grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_go/index.html)This property is required.[BucketLoggingV2TargetGrantGrantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[Permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_go/index.html)This property is required.stringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_hcl/index.html)This property is required.[object](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_hcl/index.html)This property is required.stringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_java/index.html)This property is required.[BucketLoggingV2TargetGrantGrantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_java/index.html)This property is required.StringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_nodejs/index.html)This property is required.[BucketLoggingV2TargetGrantGrantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_nodejs/index.html)This property is required.stringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_python/index.html)This property is required.[BucketLoggingV2TargetGrantGrantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_python/index.html)This property is required.strLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

[grantee](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#grantee_yaml/index.html)This property is required.[Property Map](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetgrantgrantee/index.html)Configuration block for the person being granted permissions. See below.[permission](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#permission_yaml/index.html)This property is required.StringLogging permissions assigned to the grantee for the bucket. Valid values: `FULL_CONTROL`, `READ`, `WRITE`.

#### BucketLoggingV2TargetGrantGrantee  , BucketLoggingV2TargetGrantGranteeArgs   [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#bucketloggingv2targetgrantgrantee/index.html)

[Type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_csharp/index.html)This property is required.stringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[DisplayName](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#displayname_csharp/index.html)string

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[EmailAddress](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#emailaddress_csharp/index.html)stringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[Id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_csharp/index.html)stringCanonical user ID of the grantee.[Uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_csharp/index.html)stringURI of the grantee group.

[Type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_go/index.html)This property is required.stringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[DisplayName](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#displayname_go/index.html)string

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[EmailAddress](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#emailaddress_go/index.html)stringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[Id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_go/index.html)stringCanonical user ID of the grantee.[Uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_go/index.html)stringURI of the grantee group.

[type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_hcl/index.html)This property is required.stringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[display\_name](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#display_name_hcl/index.html)string

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[email\_address](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#email_address_hcl/index.html)stringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_hcl/index.html)stringCanonical user ID of the grantee.[uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_hcl/index.html)stringURI of the grantee group.

[type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_java/index.html)This property is required.StringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[displayName](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#displayname_java/index.html)String

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[emailAddress](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#emailaddress_java/index.html)StringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_java/index.html)StringCanonical user ID of the grantee.[uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_java/index.html)StringURI of the grantee group.

[type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_nodejs/index.html)This property is required.stringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[displayName](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#displayname_nodejs/index.html)string

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[emailAddress](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#emailaddress_nodejs/index.html)stringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_nodejs/index.html)stringCanonical user ID of the grantee.[uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_nodejs/index.html)stringURI of the grantee group.

[type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_python/index.html)This property is required.strType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[display\_name](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#display_name_python/index.html)str

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[email\_address](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#email_address_python/index.html)strEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_python/index.html)strCanonical user ID of the grantee.[uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_python/index.html)strURI of the grantee group.

[type](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#type_yaml/index.html)This property is required.StringType of grantee. Valid values: `CanonicalUser`, `AmazonCustomerByEmail`, `Group`.[displayName](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#displayname_yaml/index.html)String

Deprecated: display\_name is deprecated. This attribute is no longer returned by AWS and will be removed in a future major version.

[emailAddress](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#emailaddress_yaml/index.html)StringEmail address of the grantee. See [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for supported AWS regions where this argument can be specified.[id](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#id_yaml/index.html)StringCanonical user ID of the grantee.[uri](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#uri_yaml/index.html)StringURI of the grantee group.

#### BucketLoggingV2TargetObjectKeyFormat  , BucketLoggingV2TargetObjectKeyFormatArgs   [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#bucketloggingv2targetobjectkeyformat/index.html)

[PartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitionedprefix_csharp/index.html)[BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[SimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simpleprefix_csharp/index.html)[BucketLoggingV2TargetObjectKeyFormatSimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[PartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitionedprefix_go/index.html)[BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[SimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simpleprefix_go/index.html)[BucketLoggingV2TargetObjectKeyFormatSimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[partitioned\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitioned_prefix_hcl/index.html)[object](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[simple\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simple_prefix_hcl/index.html)[object](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[partitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitionedprefix_java/index.html)[BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[simplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simpleprefix_java/index.html)[BucketLoggingV2TargetObjectKeyFormatSimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[partitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitionedprefix_nodejs/index.html)[BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[simplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simpleprefix_nodejs/index.html)[BucketLoggingV2TargetObjectKeyFormatSimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[partitioned\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitioned_prefix_python/index.html)[BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[simple\_prefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simple_prefix_python/index.html)[BucketLoggingV2TargetObjectKeyFormatSimplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

[partitionedPrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitionedprefix_yaml/index.html)[Property Map](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)Partitioned S3 key for log objects, in the form `[targetPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. Conflicts with `simplePrefix`. See below.[simplePrefix](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#simpleprefix_yaml/index.html)[Property Map](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#bucketloggingv2targetobjectkeyformatsimpleprefix/index.html)Use the simple format for S3 keys for log objects, in the form `[targetPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`. To use, set `simplePrefix {}`. Conflicts with `partitionedPrefix`.

#### BucketLoggingV2TargetObjectKeyFormatPartitionedPrefix  , BucketLoggingV2TargetObjectKeyFormatPartitionedPrefixArgs   [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#bucketloggingv2targetobjectkeyformatpartitionedprefix/index.html)

[PartitionDateSource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitiondatesource_csharp/index.html)This property is required.stringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[PartitionDateSource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitiondatesource_go/index.html)This property is required.stringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[partition\_date\_source](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partition_date_source_hcl/index.html)This property is required.stringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[partitionDateSource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitiondatesource_java/index.html)This property is required.StringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[partitionDateSource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitiondatesource_nodejs/index.html)This property is required.stringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[partition\_date\_source](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partition_date_source_python/index.html)This property is required.strSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

[partitionDateSource](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/#partitiondatesource_yaml/index.html)This property is required.StringSpecifies the partition date source for the partitioned prefix. Valid values: `EventTime`, `DeliveryTime`.

## Import [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#import/index.html)

### Identity Schema [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#identity-schema/index.html)

#### Required [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#required/index.html)

- `bucket` (String) S3 bucket name.

#### Optional [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#optional/index.html)

- `accountId` (String) AWS Account where this resource is managed.
- `region` (String) Region where this resource is managed.

If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the `bucket` and `expectedBucketOwner` separated by a comma (`,`):

**Using `pulumi import` to import** S3 bucket logging using the `bucket` or using the `bucket` and `expectedBucketOwner` separated by a comma (`,`). For example:

If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the `bucket`:

```sh
$ pulumi import aws:s3/bucketLoggingV2:BucketLoggingV2 example bucket-name
```

Copy

```sh
$ pulumi import aws:s3/bucketLoggingV2:BucketLoggingV2 example bucket-name,123456789012
```

Copy

To learn more about importing existing cloud resources, see [Importing resources](/content/docs/using-pulumi/adopting-pulumi/import/index.html).

## Package Details [Anchor](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/\#package-details/index.html)

Viewing docs for AWS v7.32.0

published on Friday, May 29, 2026 by Pulumi

[Schema (JSON)](/content/registry/packages/aws/schema.json)

[pulumi/pulumi-aws](https://github.com/pulumi/pulumi-aws)

v7.32.0 (7.x, latest)v6.83.1 (6.x)v5.43.0 (5.x)

## On this page

## On this page

* * *

Related Resources

[s3.BucketV2](/content/registry/packages/aws/api-docs/s3/bucketv2/index.html)

- Copy Page

[Scroll to top](/content/registry/packages/aws/api-docs/s3/bucketloggingv2/# "Scroll to top"/index.html)

#### Try Pulumi Cloud free.  Your team will thank you.

[Start free trial](https://app.pulumi.com/signup?utm_source=registry&utm_medium=right-rail-banner&utm_campaign=try-pulumi-cloud&iaid=docs-try-pulumi-cloud-ad)
