BucketPolicyArgs

data class BucketPolicyArgs(val bucket: Output<String>? = null, val policy: Output<String>? = null) : ConvertibleToJava<BucketPolicyArgs>

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 aws.s3.BucketPolicy resource.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3control.BucketPolicy;
import com.pulumi.aws.s3control.BucketPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
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 BucketPolicy("example", BucketPolicyArgs.builder()
.bucket(aws_s3control_bucket.example().arn())
.policy(serializeJson(
jsonObject(
jsonProperty("Id", "testBucketPolicy"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "s3-outposts:PutBucketLifecycleConfiguration"),
jsonProperty("Effect", "Deny"),
jsonProperty("Principal", jsonObject(
jsonProperty("AWS", "*")
)),
jsonProperty("Resource", aws_s3control_bucket.example().arn()),
jsonProperty("Sid", "statement1")
))),
jsonProperty("Version", "2012-10-17")
)))
.build());
}
}

Import

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

$ pulumi import aws:s3control/bucketPolicy:BucketPolicy example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example

Constructors

Link copied to clipboard
constructor(bucket: Output<String>? = null, policy: Output<String>? = null)

Properties

Link copied to clipboard
val bucket: Output<String>? = null

Amazon Resource Name (ARN) of the bucket.

Link copied to clipboard
val policy: Output<String>? = null

JSON string of the resource policy.

Functions

Link copied to clipboard
open override fun toJava(): BucketPolicyArgs