aws.s3.BucketAcl
Provides an S3 bucket ACL resource.
Note: destroy does not delete the S3 Bucket ACL but does remove the resource from state.
This resource cannot be used with S3 directory buckets.
Example Usage
With private ACL
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 exampleBucketOwnershipControls = new aws.s3.BucketOwnershipControls("example", {
    bucket: example.id,
    rule: {
        objectOwnership: "BucketOwnerPreferred",
    },
});
const exampleBucketAcl = new aws.s3.BucketAcl("example", {
    bucket: example.id,
    acl: "private",
}, {
    dependsOn: [exampleBucketOwnershipControls],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.Bucket("example", bucket="my-tf-example-bucket")
example_bucket_ownership_controls = aws.s3.BucketOwnershipControls("example",
    bucket=example.id,
    rule={
        "object_ownership": "BucketOwnerPreferred",
    })
example_bucket_acl = aws.s3.BucketAcl("example",
    bucket=example.id,
    acl="private",
    opts = pulumi.ResourceOptions(depends_on=[example_bucket_ownership_controls]))
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
		}
		exampleBucketOwnershipControls, err := s3.NewBucketOwnershipControls(ctx, "example", &s3.BucketOwnershipControlsArgs{
			Bucket: example.ID(),
			Rule: &s3.BucketOwnershipControlsRuleArgs{
				ObjectOwnership: pulumi.String("BucketOwnerPreferred"),
			},
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
			Bucket: example.ID(),
			Acl:    pulumi.String("private"),
		}, pulumi.DependsOn([]pulumi.Resource{
			exampleBucketOwnershipControls,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
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 exampleBucketOwnershipControls = new Aws.S3.BucketOwnershipControls("example", new()
    {
        Bucket = example.Id,
        Rule = new Aws.S3.Inputs.BucketOwnershipControlsRuleArgs
        {
            ObjectOwnership = "BucketOwnerPreferred",
        },
    });
    var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
    {
        Bucket = example.Id,
        Acl = "private",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            exampleBucketOwnershipControls,
        },
    });
});
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.BucketOwnershipControls;
import com.pulumi.aws.s3.BucketOwnershipControlsArgs;
import com.pulumi.aws.s3.inputs.BucketOwnershipControlsRuleArgs;
import com.pulumi.aws.s3.BucketAcl;
import com.pulumi.aws.s3.BucketAclArgs;
import com.pulumi.resources.CustomResourceOptions;
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 Bucket("example", BucketArgs.builder()
            .bucket("my-tf-example-bucket")
            .build());
        var exampleBucketOwnershipControls = new BucketOwnershipControls("exampleBucketOwnershipControls", BucketOwnershipControlsArgs.builder()
            .bucket(example.id())
            .rule(BucketOwnershipControlsRuleArgs.builder()
                .objectOwnership("BucketOwnerPreferred")
                .build())
            .build());
        var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
            .bucket(example.id())
            .acl("private")
            .build(), CustomResourceOptions.builder()
                .dependsOn(exampleBucketOwnershipControls)
                .build());
    }
}
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucket: my-tf-example-bucket
  exampleBucketOwnershipControls:
    type: aws:s3:BucketOwnershipControls
    name: example
    properties:
      bucket: ${example.id}
      rule:
        objectOwnership: BucketOwnerPreferred
  exampleBucketAcl:
    type: aws:s3:BucketAcl
    name: example
    properties:
      bucket: ${example.id}
      acl: private
    options:
      dependsOn:
        - ${exampleBucketOwnershipControls}
With public-read ACL
This example explicitly disables the default S3 bucket security settings. This should be done with caution, as all bucket objects become publicly exposed.
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 exampleBucketOwnershipControls = new aws.s3.BucketOwnershipControls("example", {
    bucket: example.id,
    rule: {
        objectOwnership: "BucketOwnerPreferred",
    },
});
const exampleBucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock("example", {
    bucket: example.id,
    blockPublicAcls: false,
    blockPublicPolicy: false,
    ignorePublicAcls: false,
    restrictPublicBuckets: false,
});
const exampleBucketAcl = new aws.s3.BucketAcl("example", {
    bucket: example.id,
    acl: "public-read",
}, {
    dependsOn: [
        exampleBucketOwnershipControls,
        exampleBucketPublicAccessBlock,
    ],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.Bucket("example", bucket="my-tf-example-bucket")
example_bucket_ownership_controls = aws.s3.BucketOwnershipControls("example",
    bucket=example.id,
    rule={
        "object_ownership": "BucketOwnerPreferred",
    })
example_bucket_public_access_block = aws.s3.BucketPublicAccessBlock("example",
    bucket=example.id,
    block_public_acls=False,
    block_public_policy=False,
    ignore_public_acls=False,
    restrict_public_buckets=False)
example_bucket_acl = aws.s3.BucketAcl("example",
    bucket=example.id,
    acl="public-read",
    opts = pulumi.ResourceOptions(depends_on=[
            example_bucket_ownership_controls,
            example_bucket_public_access_block,
        ]))
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
		}
		exampleBucketOwnershipControls, err := s3.NewBucketOwnershipControls(ctx, "example", &s3.BucketOwnershipControlsArgs{
			Bucket: example.ID(),
			Rule: &s3.BucketOwnershipControlsRuleArgs{
				ObjectOwnership: pulumi.String("BucketOwnerPreferred"),
			},
		})
		if err != nil {
			return err
		}
		exampleBucketPublicAccessBlock, err := s3.NewBucketPublicAccessBlock(ctx, "example", &s3.BucketPublicAccessBlockArgs{
			Bucket:                example.ID(),
			BlockPublicAcls:       pulumi.Bool(false),
			BlockPublicPolicy:     pulumi.Bool(false),
			IgnorePublicAcls:      pulumi.Bool(false),
			RestrictPublicBuckets: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
			Bucket: example.ID(),
			Acl:    pulumi.String("public-read"),
		}, pulumi.DependsOn([]pulumi.Resource{
			exampleBucketOwnershipControls,
			exampleBucketPublicAccessBlock,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
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 exampleBucketOwnershipControls = new Aws.S3.BucketOwnershipControls("example", new()
    {
        Bucket = example.Id,
        Rule = new Aws.S3.Inputs.BucketOwnershipControlsRuleArgs
        {
            ObjectOwnership = "BucketOwnerPreferred",
        },
    });
    var exampleBucketPublicAccessBlock = new Aws.S3.BucketPublicAccessBlock("example", new()
    {
        Bucket = example.Id,
        BlockPublicAcls = false,
        BlockPublicPolicy = false,
        IgnorePublicAcls = false,
        RestrictPublicBuckets = false,
    });
    var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
    {
        Bucket = example.Id,
        Acl = "public-read",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            exampleBucketOwnershipControls,
            exampleBucketPublicAccessBlock,
        },
    });
});
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.BucketOwnershipControls;
import com.pulumi.aws.s3.BucketOwnershipControlsArgs;
import com.pulumi.aws.s3.inputs.BucketOwnershipControlsRuleArgs;
import com.pulumi.aws.s3.BucketPublicAccessBlock;
import com.pulumi.aws.s3.BucketPublicAccessBlockArgs;
import com.pulumi.aws.s3.BucketAcl;
import com.pulumi.aws.s3.BucketAclArgs;
import com.pulumi.resources.CustomResourceOptions;
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 Bucket("example", BucketArgs.builder()
            .bucket("my-tf-example-bucket")
            .build());
        var exampleBucketOwnershipControls = new BucketOwnershipControls("exampleBucketOwnershipControls", BucketOwnershipControlsArgs.builder()
            .bucket(example.id())
            .rule(BucketOwnershipControlsRuleArgs.builder()
                .objectOwnership("BucketOwnerPreferred")
                .build())
            .build());
        var exampleBucketPublicAccessBlock = new BucketPublicAccessBlock("exampleBucketPublicAccessBlock", BucketPublicAccessBlockArgs.builder()
            .bucket(example.id())
            .blockPublicAcls(false)
            .blockPublicPolicy(false)
            .ignorePublicAcls(false)
            .restrictPublicBuckets(false)
            .build());
        var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
            .bucket(example.id())
            .acl("public-read")
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    exampleBucketOwnershipControls,
                    exampleBucketPublicAccessBlock)
                .build());
    }
}
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucket: my-tf-example-bucket
  exampleBucketOwnershipControls:
    type: aws:s3:BucketOwnershipControls
    name: example
    properties:
      bucket: ${example.id}
      rule:
        objectOwnership: BucketOwnerPreferred
  exampleBucketPublicAccessBlock:
    type: aws:s3:BucketPublicAccessBlock
    name: example
    properties:
      bucket: ${example.id}
      blockPublicAcls: false
      blockPublicPolicy: false
      ignorePublicAcls: false
      restrictPublicBuckets: false
  exampleBucketAcl:
    type: aws:s3:BucketAcl
    name: example
    properties:
      bucket: ${example.id}
      acl: public-read
    options:
      dependsOn:
        - ${exampleBucketOwnershipControls}
        - ${exampleBucketPublicAccessBlock}
With Grants
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.s3.getCanonicalUserId({});
const example = new aws.s3.Bucket("example", {bucket: "my-tf-example-bucket"});
const exampleBucketOwnershipControls = new aws.s3.BucketOwnershipControls("example", {
    bucket: example.id,
    rule: {
        objectOwnership: "BucketOwnerPreferred",
    },
});
const exampleBucketAcl = new aws.s3.BucketAcl("example", {
    bucket: example.id,
    accessControlPolicy: {
        grants: [
            {
                grantee: {
                    id: current.then(current => current.id),
                    type: "CanonicalUser",
                },
                permission: "READ",
            },
            {
                grantee: {
                    type: "Group",
                    uri: "http://acs.amazonaws.com/groups/s3/LogDelivery",
                },
                permission: "READ_ACP",
            },
        ],
        owner: {
            id: current.then(current => current.id),
        },
    },
}, {
    dependsOn: [exampleBucketOwnershipControls],
});
import pulumi
import pulumi_aws as aws
current = aws.s3.get_canonical_user_id()
example = aws.s3.Bucket("example", bucket="my-tf-example-bucket")
example_bucket_ownership_controls = aws.s3.BucketOwnershipControls("example",
    bucket=example.id,
    rule={
        "object_ownership": "BucketOwnerPreferred",
    })
example_bucket_acl = aws.s3.BucketAcl("example",
    bucket=example.id,
    access_control_policy={
        "grants": [
            {
                "grantee": {
                    "id": current.id,
                    "type": "CanonicalUser",
                },
                "permission": "READ",
            },
            {
                "grantee": {
                    "type": "Group",
                    "uri": "http://acs.amazonaws.com/groups/s3/LogDelivery",
                },
                "permission": "READ_ACP",
            },
        ],
        "owner": {
            "id": current.id,
        },
    },
    opts = pulumi.ResourceOptions(depends_on=[example_bucket_ownership_controls]))
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 {
		current, err := s3.GetCanonicalUserId(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
			Bucket: pulumi.String("my-tf-example-bucket"),
		})
		if err != nil {
			return err
		}
		exampleBucketOwnershipControls, err := s3.NewBucketOwnershipControls(ctx, "example", &s3.BucketOwnershipControlsArgs{
			Bucket: example.ID(),
			Rule: &s3.BucketOwnershipControlsRuleArgs{
				ObjectOwnership: pulumi.String("BucketOwnerPreferred"),
			},
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
			Bucket: example.ID(),
			AccessControlPolicy: &s3.BucketAclAccessControlPolicyArgs{
				Grants: s3.BucketAclAccessControlPolicyGrantArray{
					&s3.BucketAclAccessControlPolicyGrantArgs{
						Grantee: &s3.BucketAclAccessControlPolicyGrantGranteeArgs{
							Id:   pulumi.String(current.Id),
							Type: pulumi.String("CanonicalUser"),
						},
						Permission: pulumi.String("READ"),
					},
					&s3.BucketAclAccessControlPolicyGrantArgs{
						Grantee: &s3.BucketAclAccessControlPolicyGrantGranteeArgs{
							Type: pulumi.String("Group"),
							Uri:  pulumi.String("http://acs.amazonaws.com/groups/s3/LogDelivery"),
						},
						Permission: pulumi.String("READ_ACP"),
					},
				},
				Owner: &s3.BucketAclAccessControlPolicyOwnerArgs{
					Id: pulumi.String(current.Id),
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			exampleBucketOwnershipControls,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var current = Aws.S3.GetCanonicalUserId.Invoke();
    var example = new Aws.S3.Bucket("example", new()
    {
        BucketName = "my-tf-example-bucket",
    });
    var exampleBucketOwnershipControls = new Aws.S3.BucketOwnershipControls("example", new()
    {
        Bucket = example.Id,
        Rule = new Aws.S3.Inputs.BucketOwnershipControlsRuleArgs
        {
            ObjectOwnership = "BucketOwnerPreferred",
        },
    });
    var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
    {
        Bucket = example.Id,
        AccessControlPolicy = new Aws.S3.Inputs.BucketAclAccessControlPolicyArgs
        {
            Grants = new[]
            {
                new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantArgs
                {
                    Grantee = new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantGranteeArgs
                    {
                        Id = current.Apply(getCanonicalUserIdResult => getCanonicalUserIdResult.Id),
                        Type = "CanonicalUser",
                    },
                    Permission = "READ",
                },
                new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantArgs
                {
                    Grantee = new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantGranteeArgs
                    {
                        Type = "Group",
                        Uri = "http://acs.amazonaws.com/groups/s3/LogDelivery",
                    },
                    Permission = "READ_ACP",
                },
            },
            Owner = new Aws.S3.Inputs.BucketAclAccessControlPolicyOwnerArgs
            {
                Id = current.Apply(getCanonicalUserIdResult => getCanonicalUserIdResult.Id),
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            exampleBucketOwnershipControls,
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.S3Functions;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.s3.BucketOwnershipControls;
import com.pulumi.aws.s3.BucketOwnershipControlsArgs;
import com.pulumi.aws.s3.inputs.BucketOwnershipControlsRuleArgs;
import com.pulumi.aws.s3.BucketAcl;
import com.pulumi.aws.s3.BucketAclArgs;
import com.pulumi.aws.s3.inputs.BucketAclAccessControlPolicyArgs;
import com.pulumi.aws.s3.inputs.BucketAclAccessControlPolicyOwnerArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        final var current = S3Functions.getCanonicalUserId(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
        var example = new Bucket("example", BucketArgs.builder()
            .bucket("my-tf-example-bucket")
            .build());
        var exampleBucketOwnershipControls = new BucketOwnershipControls("exampleBucketOwnershipControls", BucketOwnershipControlsArgs.builder()
            .bucket(example.id())
            .rule(BucketOwnershipControlsRuleArgs.builder()
                .objectOwnership("BucketOwnerPreferred")
                .build())
            .build());
        var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
            .bucket(example.id())
            .accessControlPolicy(BucketAclAccessControlPolicyArgs.builder()
                .grants(                
                    BucketAclAccessControlPolicyGrantArgs.builder()
                        .grantee(BucketAclAccessControlPolicyGrantGranteeArgs.builder()
                            .id(current.id())
                            .type("CanonicalUser")
                            .build())
                        .permission("READ")
                        .build(),
                    BucketAclAccessControlPolicyGrantArgs.builder()
                        .grantee(BucketAclAccessControlPolicyGrantGranteeArgs.builder()
                            .type("Group")
                            .uri("http://acs.amazonaws.com/groups/s3/LogDelivery")
                            .build())
                        .permission("READ_ACP")
                        .build())
                .owner(BucketAclAccessControlPolicyOwnerArgs.builder()
                    .id(current.id())
                    .build())
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(exampleBucketOwnershipControls)
                .build());
    }
}
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucket: my-tf-example-bucket
  exampleBucketOwnershipControls:
    type: aws:s3:BucketOwnershipControls
    name: example
    properties:
      bucket: ${example.id}
      rule:
        objectOwnership: BucketOwnerPreferred
  exampleBucketAcl:
    type: aws:s3:BucketAcl
    name: example
    properties:
      bucket: ${example.id}
      accessControlPolicy:
        grants:
          - grantee:
              id: ${current.id}
              type: CanonicalUser
            permission: READ
          - grantee:
              type: Group
              uri: http://acs.amazonaws.com/groups/s3/LogDelivery
            permission: READ_ACP
        owner:
          id: ${current.id}
    options:
      dependsOn:
        - ${exampleBucketOwnershipControls}
variables:
  current:
    fn::invoke:
      function: aws:s3:getCanonicalUserId
      arguments: {}
Create BucketAcl Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketAcl(name: string, args: BucketAclArgs, opts?: CustomResourceOptions);@overload
def BucketAcl(resource_name: str,
              args: BucketAclArgs,
              opts: Optional[ResourceOptions] = None)
@overload
def BucketAcl(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              bucket: Optional[str] = None,
              access_control_policy: Optional[BucketAclAccessControlPolicyArgs] = None,
              acl: Optional[str] = None,
              expected_bucket_owner: Optional[str] = None,
              region: Optional[str] = None)func NewBucketAcl(ctx *Context, name string, args BucketAclArgs, opts ...ResourceOption) (*BucketAcl, error)public BucketAcl(string name, BucketAclArgs args, CustomResourceOptions? opts = null)
public BucketAcl(String name, BucketAclArgs args)
public BucketAcl(String name, BucketAclArgs args, CustomResourceOptions options)
type: aws:s3:BucketAcl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BucketAclArgs
- 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 BucketAclArgs
- 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 BucketAclArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketAclArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketAclArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var bucketAclResource = new Aws.S3.BucketAcl("bucketAclResource", new()
{
    Bucket = "string",
    AccessControlPolicy = new Aws.S3.Inputs.BucketAclAccessControlPolicyArgs
    {
        Owner = new Aws.S3.Inputs.BucketAclAccessControlPolicyOwnerArgs
        {
            Id = "string",
        },
        Grants = new[]
        {
            new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantArgs
            {
                Permission = "string",
                Grantee = new Aws.S3.Inputs.BucketAclAccessControlPolicyGrantGranteeArgs
                {
                    Type = "string",
                    EmailAddress = "string",
                    Id = "string",
                    Uri = "string",
                },
            },
        },
    },
    Acl = "string",
    ExpectedBucketOwner = "string",
    Region = "string",
});
example, err := s3.NewBucketAcl(ctx, "bucketAclResource", &s3.BucketAclArgs{
	Bucket: pulumi.String("string"),
	AccessControlPolicy: &s3.BucketAclAccessControlPolicyArgs{
		Owner: &s3.BucketAclAccessControlPolicyOwnerArgs{
			Id: pulumi.String("string"),
		},
		Grants: s3.BucketAclAccessControlPolicyGrantArray{
			&s3.BucketAclAccessControlPolicyGrantArgs{
				Permission: pulumi.String("string"),
				Grantee: &s3.BucketAclAccessControlPolicyGrantGranteeArgs{
					Type:         pulumi.String("string"),
					EmailAddress: pulumi.String("string"),
					Id:           pulumi.String("string"),
					Uri:          pulumi.String("string"),
				},
			},
		},
	},
	Acl:                 pulumi.String("string"),
	ExpectedBucketOwner: pulumi.String("string"),
	Region:              pulumi.String("string"),
})
var bucketAclResource = new BucketAcl("bucketAclResource", BucketAclArgs.builder()
    .bucket("string")
    .accessControlPolicy(BucketAclAccessControlPolicyArgs.builder()
        .owner(BucketAclAccessControlPolicyOwnerArgs.builder()
            .id("string")
            .build())
        .grants(BucketAclAccessControlPolicyGrantArgs.builder()
            .permission("string")
            .grantee(BucketAclAccessControlPolicyGrantGranteeArgs.builder()
                .type("string")
                .emailAddress("string")
                .id("string")
                .uri("string")
                .build())
            .build())
        .build())
    .acl("string")
    .expectedBucketOwner("string")
    .region("string")
    .build());
bucket_acl_resource = aws.s3.BucketAcl("bucketAclResource",
    bucket="string",
    access_control_policy={
        "owner": {
            "id": "string",
        },
        "grants": [{
            "permission": "string",
            "grantee": {
                "type": "string",
                "email_address": "string",
                "id": "string",
                "uri": "string",
            },
        }],
    },
    acl="string",
    expected_bucket_owner="string",
    region="string")
const bucketAclResource = new aws.s3.BucketAcl("bucketAclResource", {
    bucket: "string",
    accessControlPolicy: {
        owner: {
            id: "string",
        },
        grants: [{
            permission: "string",
            grantee: {
                type: "string",
                emailAddress: "string",
                id: "string",
                uri: "string",
            },
        }],
    },
    acl: "string",
    expectedBucketOwner: "string",
    region: "string",
});
type: aws:s3:BucketAcl
properties:
    accessControlPolicy:
        grants:
            - grantee:
                emailAddress: string
                id: string
                type: string
                uri: string
              permission: string
        owner:
            id: string
    acl: string
    bucket: string
    expectedBucketOwner: string
    region: string
BucketAcl Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The BucketAcl resource accepts the following input properties:
- Bucket string
- Bucket to which to apply the ACL.
- AccessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- Acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Bucket string
- Bucket to which to apply the ACL.
- AccessControl BucketPolicy Acl Access Control Policy Args 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- Acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Bucket to which to apply the ACL.
- accessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl String
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket string
- Bucket to which to apply the ACL.
- accessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- expectedBucket stringOwner 
- Account ID of the expected bucket owner.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket str
- Bucket to which to apply the ACL.
- access_control_ Bucketpolicy Acl Access Control Policy Args 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl str
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- expected_bucket_ strowner 
- Account ID of the expected bucket owner.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Bucket to which to apply the ACL.
- accessControl Property MapPolicy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl String
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketAcl 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing BucketAcl Resource
Get an existing BucketAcl 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?: BucketAclState, opts?: CustomResourceOptions): BucketAcl@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_control_policy: Optional[BucketAclAccessControlPolicyArgs] = None,
        acl: Optional[str] = None,
        bucket: Optional[str] = None,
        expected_bucket_owner: Optional[str] = None,
        region: Optional[str] = None) -> BucketAclfunc GetBucketAcl(ctx *Context, name string, id IDInput, state *BucketAclState, opts ...ResourceOption) (*BucketAcl, error)public static BucketAcl Get(string name, Input<string> id, BucketAclState? state, CustomResourceOptions? opts = null)public static BucketAcl get(String name, Output<String> id, BucketAclState state, CustomResourceOptions options)resources:  _:    type: aws:s3:BucketAcl    get:      id: ${id}- 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.
- 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.
- AccessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- Acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- Bucket string
- Bucket to which to apply the ACL.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- AccessControl BucketPolicy Acl Access Control Policy Args 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- Acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- Bucket string
- Bucket to which to apply the ACL.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- accessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl String
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- bucket String
- Bucket to which to apply the ACL.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- accessControl BucketPolicy Acl Access Control Policy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl string
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- bucket string
- Bucket to which to apply the ACL.
- expectedBucket stringOwner 
- Account ID of the expected bucket owner.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- access_control_ Bucketpolicy Acl Access Control Policy Args 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl str
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- bucket str
- Bucket to which to apply the ACL.
- expected_bucket_ strowner 
- Account ID of the expected bucket owner.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- accessControl Property MapPolicy 
- Configuration block that sets the ACL permissions for an object per grantee. See below.
- acl String
- Specifies the Canned ACL to apply to the bucket. Valid values: private,public-read,public-read-write,aws-exec-read,authenticated-read,bucket-owner-read,bucket-owner-full-control,log-delivery-write. Full details are available on the AWS documentation.
- bucket String
- Bucket to which to apply the ACL.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Supporting Types
BucketAclAccessControlPolicy, BucketAclAccessControlPolicyArgs          
- Owner
BucketAcl Access Control Policy Owner 
- Configuration block for the bucket owner's display name and ID. See below.
- Grants
List<BucketAcl Access Control Policy Grant> 
- Set of grantconfiguration blocks. See below.
- Owner
BucketAcl Access Control Policy Owner 
- Configuration block for the bucket owner's display name and ID. See below.
- Grants
[]BucketAcl Access Control Policy Grant 
- Set of grantconfiguration blocks. See below.
- owner
BucketAcl Access Control Policy Owner 
- Configuration block for the bucket owner's display name and ID. See below.
- grants
List<BucketAcl Access Control Policy Grant> 
- Set of grantconfiguration blocks. See below.
- owner
BucketAcl Access Control Policy Owner 
- Configuration block for the bucket owner's display name and ID. See below.
- grants
BucketAcl Access Control Policy Grant[] 
- Set of grantconfiguration blocks. See below.
- owner
BucketAcl Access Control Policy Owner 
- Configuration block for the bucket owner's display name and ID. See below.
- grants
Sequence[BucketAcl Access Control Policy Grant] 
- Set of grantconfiguration blocks. See below.
- owner Property Map
- Configuration block for the bucket owner's display name and ID. See below.
- grants List<Property Map>
- Set of grantconfiguration blocks. See below.
BucketAclAccessControlPolicyGrant, BucketAclAccessControlPolicyGrantArgs            
- Permission string
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- Grantee
BucketAcl Access Control Policy Grant Grantee 
- Configuration block for the person being granted permissions. See below.
- Permission string
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- Grantee
BucketAcl Access Control Policy Grant Grantee 
- Configuration block for the person being granted permissions. See below.
- permission String
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- grantee
BucketAcl Access Control Policy Grant Grantee 
- Configuration block for the person being granted permissions. See below.
- permission string
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- grantee
BucketAcl Access Control Policy Grant Grantee 
- Configuration block for the person being granted permissions. See below.
- permission str
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- grantee
BucketAcl Access Control Policy Grant Grantee 
- Configuration block for the person being granted permissions. See below.
- permission String
- Logging permissions assigned to the grantee for the bucket. Valid values: FULL_CONTROL,WRITE,WRITE_ACP,READ,READ_ACP. See What permissions can I grant? for more details about what each permission means in the context of buckets.
- grantee Property Map
- Configuration block for the person being granted permissions. See below.
BucketAclAccessControlPolicyGrantGrantee, BucketAclAccessControlPolicyGrantGranteeArgs              
- Type string
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- DisplayName string
- Display name of the owner.
- EmailAddress string
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- Id string
- Canonical user ID of the grantee.
- Uri string
- URI of the grantee group.
- Type string
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- DisplayName string
- Display name of the owner.
- EmailAddress string
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- Id string
- Canonical user ID of the grantee.
- Uri string
- URI of the grantee group.
- type String
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- displayName String
- Display name of the owner.
- emailAddress String
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- id String
- Canonical user ID of the grantee.
- uri String
- URI of the grantee group.
- type string
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- displayName string
- Display name of the owner.
- emailAddress string
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- id string
- Canonical user ID of the grantee.
- uri string
- URI of the grantee group.
- type str
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- display_name str
- Display name of the owner.
- email_address str
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- id str
- Canonical user ID of the grantee.
- uri str
- URI of the grantee group.
- type String
- Type of grantee. Valid values: CanonicalUser,AmazonCustomerByEmail,Group.
- displayName String
- Display name of the owner.
- emailAddress String
- Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.
- id String
- Canonical user ID of the grantee.
- uri String
- URI of the grantee group.
BucketAclAccessControlPolicyOwner, BucketAclAccessControlPolicyOwnerArgs            
- Id string
- ID of the owner.
- DisplayName string
- Display name of the owner.
- Id string
- ID of the owner.
- DisplayName string
- Display name of the owner.
- id String
- ID of the owner.
- displayName String
- Display name of the owner.
- id string
- ID of the owner.
- displayName string
- Display name of the owner.
- id str
- ID of the owner.
- display_name str
- Display name of the owner.
- id String
- ID of the owner.
- displayName String
- Display name of the owner.
Import
Identity Schema
Required
- bucket(String) S3 bucket name.
Optional
- account_id(String) AWS Account where this resource is managed.
- acl(String) Canned ACL to apply to the bucket.
- expected_bucket_owner(String) Account ID of the expected bucket owner.
- region(String) Region where this resource is managed.
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, and the source bucket is configured with a
canned ACL (i.e. predefined grant), import using the bucket and acl separated by a comma (,):
terraform
import {
to = aws_s3_bucket_acl.example
id = “bucket-name,private”
}
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, and the source bucket is not configured with a canned ACL (i.e. predefined grant), imported using the bucket and expected_bucket_owner separated by a comma (,):
terraform
import {
to = aws_s3_bucket_acl.example
id = “bucket-name,123456789012”
}
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, and the source bucket is configured with a
canned ACL (i.e. predefined grant), imported using the bucket, expected_bucket_owner, and acl separated by commas (,):
terraform
import {
to = aws_s3_bucket_acl.example
id = “bucket-name,123456789012,private”
}
Using pulumi import to import using bucket, expected_bucket_owner, and/or acl, depending on your situation. For example:
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, and the source bucket is not configured with a
canned ACL (i.e. predefined grant), import using the bucket:
console
% pulumi import aws_s3_bucket_acl.example bucket-name
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, and the source bucket is configured with a canned ACL (i.e. predefined grant), import using the bucket and acl separated by a comma (,):
console
% pulumi import aws_s3_bucket_acl.example bucket-name,private
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, and the source bucket is not configured with a canned ACL (i.e. predefined grant), imported using the bucket and expected_bucket_owner separated by a comma (,):
console
% pulumi import aws_s3_bucket_acl.example bucket-name,123456789012
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, and the source bucket is configured with a canned ACL (i.e. predefined grant), imported using the bucket, expected_bucket_owner, and acl separated by commas (,):
console
% pulumi import aws_s3_bucket_acl.example bucket-name,123456789012,private
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.
