Resource: aws_s3control_bucket_policy

Provides a resource to manage an S3 Control Bucket Policy.

Example Usage

resource "aws_s3control_bucket_policy" "example" {
  bucket = aws_s3control_bucket.example.arn
  policy = jsonencode({
    Id = "testBucketPolicy"
    Statement = [
      {
        Action = "s3-outposts:PutBucketLifecycleConfiguration"
        Effect = "Deny"
        Principal = {
          AWS = "*"
        }
        Resource = aws_s3control_bucket.example.arn
        Sid      = "statement1"
      }
    ]
    Version = "2012-10-17"
  })
}

Argument Reference

The following arguments are required:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import S3 Control Bucket Policies using the Amazon Resource Name (ARN). For example:

import {
  to = aws_s3control_bucket_policy.example
  id = "arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example"
}

Using terraform import, import S3 Control Bucket Policies using the Amazon Resource Name (ARN). For example:

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