BucketOwnershipControls

Provides a resource to manage S3 Bucket Ownership Controls. For more information, see the S3 Developer Guide.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleBucket = new Aws.S3.Bucket("exampleBucket", new Aws.S3.BucketArgs
        {
        });
        var exampleBucketOwnershipControls = new Aws.S3.BucketOwnershipControls("exampleBucketOwnershipControls", new Aws.S3.BucketOwnershipControlsArgs
        {
            Bucket = exampleBucket.Id,
            Rule = new Aws.S3.Inputs.BucketOwnershipControlsRuleArgs
            {
                ObjectOwnership = "BucketOwnerPreferred",
            },
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleBucket, err := s3.NewBucket(ctx, "exampleBucket", nil)
		if err != nil {
			return err
		}
		_, err = s3.NewBucketOwnershipControls(ctx, "exampleBucketOwnershipControls", &s3.BucketOwnershipControlsArgs{
			Bucket: exampleBucket.ID(),
			Rule: &s3.BucketOwnershipControlsRuleArgs{
				ObjectOwnership: pulumi.String("BucketOwnerPreferred"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_bucket = aws.s3.Bucket("exampleBucket")
example_bucket_ownership_controls = aws.s3.BucketOwnershipControls("exampleBucketOwnershipControls",
    bucket=example_bucket.id,
    rule=aws.s3.BucketOwnershipControlsRuleArgs(
        object_ownership="BucketOwnerPreferred",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleBucket = new aws.s3.Bucket("exampleBucket", {});
const exampleBucketOwnershipControls = new aws.s3.BucketOwnershipControls("exampleBucketOwnershipControls", {
    bucket: exampleBucket.id,
    rule: {
        objectOwnership: "BucketOwnerPreferred",
    },
});

Create a BucketOwnershipControls Resource

new BucketOwnershipControls(name: string, args: BucketOwnershipControlsArgs, opts?: CustomResourceOptions);
@overload
def BucketOwnershipControls(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            bucket: Optional[str] = None,
                            rule: Optional[BucketOwnershipControlsRuleArgs] = None)
@overload
def BucketOwnershipControls(resource_name: str,
                            args: BucketOwnershipControlsArgs,
                            opts: Optional[ResourceOptions] = None)
func NewBucketOwnershipControls(ctx *Context, name string, args BucketOwnershipControlsArgs, opts ...ResourceOption) (*BucketOwnershipControls, error)
public BucketOwnershipControls(string name, BucketOwnershipControlsArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args BucketOwnershipControlsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args BucketOwnershipControlsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BucketOwnershipControlsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BucketOwnershipControlsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

BucketOwnershipControls Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The BucketOwnershipControls resource accepts the following input properties:

Bucket string
The name of the bucket that you want to associate this access point with.
Rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.
Bucket string
The name of the bucket that you want to associate this access point with.
Rule BucketOwnershipControlsRule
Configuration block(s) with Ownership Controls rules. Detailed below.
bucket string
The name of the bucket that you want to associate this access point with.
rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.
bucket str
The name of the bucket that you want to associate this access point with.
rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.

Outputs

All input properties are implicitly available as output properties. Additionally, the BucketOwnershipControls resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing BucketOwnershipControls Resource

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

public static get(name: string, id: Input<ID>, state?: BucketOwnershipControlsState, opts?: CustomResourceOptions): BucketOwnershipControls
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        rule: Optional[BucketOwnershipControlsRuleArgs] = None) -> BucketOwnershipControls
func GetBucketOwnershipControls(ctx *Context, name string, id IDInput, state *BucketOwnershipControlsState, opts ...ResourceOption) (*BucketOwnershipControls, error)
public static BucketOwnershipControls Get(string name, Input<string> id, BucketOwnershipControlsState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Bucket string
The name of the bucket that you want to associate this access point with.
Rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.
Bucket string
The name of the bucket that you want to associate this access point with.
Rule BucketOwnershipControlsRule
Configuration block(s) with Ownership Controls rules. Detailed below.
bucket string
The name of the bucket that you want to associate this access point with.
rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.
bucket str
The name of the bucket that you want to associate this access point with.
rule BucketOwnershipControlsRuleArgs
Configuration block(s) with Ownership Controls rules. Detailed below.

Supporting Types

BucketOwnershipControlsRule

ObjectOwnership string
Object ownership. Valid values: BucketOwnerPreferred or ObjectWriter
ObjectOwnership string
Object ownership. Valid values: BucketOwnerPreferred or ObjectWriter
objectOwnership string
Object ownership. Valid values: BucketOwnerPreferred or ObjectWriter
object_ownership str
Object ownership. Valid values: BucketOwnerPreferred or ObjectWriter

Import

S3 Bucket Ownership Controls can be imported using S3 Bucket name, e.g.

 $ pulumi import aws:s3/bucketOwnershipControls:BucketOwnershipControls example my-bucket

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.