Skip to content

Resource: awsS3ControlBucketPolicy

Provides a resource to manage an S3 Control Bucket Policy.

-> This functionality is for managing S3 on Outposts. To manage S3 Bucket Policies in an AWS Partition, see the awsS3BucketPolicy resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.s3ControlBucketPolicy.S3ControlBucketPolicy(this, "example", {
  bucket: "${aws_s3control_bucket.example.arn}",
  policy:
    '${jsonencode({\n    Id = "testBucketPolicy"\n    Statement = [\n      {\n        Action = "s3-outposts:PutBucketLifecycleConfiguration"\n        Effect = "Deny"\n        Principal = {\n          AWS = "*"\n        }\n        Resource = aws_s3control_bucket.example.arn\n        Sid      = "statement1"\n      }\n    ]\n    Version = "2012-10-17"\n  })}',
});

Argument Reference

The following arguments are required:

  • bucket - (Required) Amazon Resource Name (ARN) of the bucket.
  • policy - (Required) JSON string of the resource policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Amazon Resource Name (ARN) of the bucket.

Import

S3 Control Bucket Policies can be imported using the Amazon Resource Name (ARN), e.g.,

$ terraform import aws_s3control_bucket_policy.example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example