|
| 1 | +--- |
| 2 | +page_title: "Scaleway: scaleway_object_bucket_acl" |
| 3 | +description: |- |
| 4 | +Manages Scaleway object storage bucket ACL resource. |
| 5 | +--- |
| 6 | + |
| 7 | +# scaleway_object_bucket |
| 8 | + |
| 9 | +Creates and manages Scaleway object storage bucket ACL. |
| 10 | +For more information, see [the documentation](https://www.scaleway.com/en/docs/storage/object/concepts/#access-control-list-(acl)). |
| 11 | + |
| 12 | +-> **Note:** `terraform destroy` does not delete the Object Bucket ACL but does remove the resource from Terraform state. |
| 13 | + |
| 14 | +-> **Note:** [Account identifiers](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) is not supported by scaleway. |
| 15 | + |
| 16 | +## Example Usage |
| 17 | + |
| 18 | +```hcl |
| 19 | +resource "scaleway_object_bucket" "some_bucket" { |
| 20 | + name = "some-unique-name" |
| 21 | +} |
| 22 | +
|
| 23 | +resource "scaleway_object_bucket_acl" "main" { |
| 24 | + bucket = scaleway_object_bucket.main.name |
| 25 | + acl = "private" |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +## Example with Grants |
| 30 | + |
| 31 | +```hcl |
| 32 | +resource "scaleway_object_bucket" "main" { |
| 33 | + name = "your-bucket" |
| 34 | +} |
| 35 | +
|
| 36 | +resource "scaleway_object_bucket_acl" "main" { |
| 37 | + bucket = scaleway_object_bucket.main.name |
| 38 | + access_control_policy { |
| 39 | + grant { |
| 40 | + grantee { |
| 41 | + id = "<project-id>:<project-id>" |
| 42 | + type = "CanonicalUser" |
| 43 | + } |
| 44 | + permission = "FULL_CONTROL" |
| 45 | + } |
| 46 | + |
| 47 | + grant { |
| 48 | + grantee { |
| 49 | + id = "<project-id>" |
| 50 | + type = "CanonicalUser" |
| 51 | + } |
| 52 | + permission = "WRITE" |
| 53 | + } |
| 54 | + |
| 55 | + owner { |
| 56 | + id = "<project-id>" |
| 57 | + } |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +## Arguments Reference |
| 63 | + |
| 64 | +The following arguments are supported: |
| 65 | + |
| 66 | +* `bucket` - (Required) The name of the bucket. |
| 67 | +* `acl` - (Optional) The canned ACL you want to apply to the bucket. |
| 68 | +* `access_control_policy` - (Optional, Conflicts with acl) A configuration block that sets the ACL permissions for an object per grantee documented below. |
| 69 | +* `expected_bucket_owner` - (Optional, Forces new resource) The project ID of the expected bucket owner. |
| 70 | +* `region` - (Optional) The [region](https://developers.scaleway.com/en/quickstart/#region-definition) in which the bucket should be created. |
| 71 | + |
| 72 | + |
| 73 | +## The ACL |
| 74 | + |
| 75 | +Please check the [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl_overview.html#canned-acl) |
| 76 | + |
| 77 | +## The Access Control policy |
| 78 | + |
| 79 | +The `access_control_policy` configuration block supports the following arguments: |
| 80 | + |
| 81 | +* `grant` - (Required) Set of grant configuration blocks documented below. |
| 82 | +* `owner` - (Required) Configuration block of the bucket owner's display name and ID documented below. |
| 83 | + |
| 84 | +## The Grant |
| 85 | + |
| 86 | +The `grant` configuration block supports the following arguments: |
| 87 | + |
| 88 | +* `grantee` - (Required) Configuration block for the project being granted permissions documented below. |
| 89 | +* `permission` - (Required) Logging permissions assigned to the grantee for the bucket. |
| 90 | + |
| 91 | +## The permission |
| 92 | + |
| 93 | +The following list shows each access policy permissions supported. |
| 94 | + |
| 95 | +`READ`, `WRITE`, `READ_ACP`, `WRITE_ACP`, `FULL_CONTROL` |
| 96 | + |
| 97 | +For more information about ACL permissions in the S3 bucket, see [ACL permissions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html). |
| 98 | + |
| 99 | +## The owner |
| 100 | + |
| 101 | +The `owner` configuration block supports the following arguments: |
| 102 | + |
| 103 | +* `id` - (Required) The ID of the project owner. |
| 104 | +* `display_name` - (Optional) The display name of the owner. |
| 105 | + |
| 106 | +## the grantee |
| 107 | + |
| 108 | +The `grantee` configuration block supports the following arguments: |
| 109 | + |
| 110 | +* `id` - (Required) The canonical user ID of the grantee. |
| 111 | +* `type` - (Required) Type of grantee. Valid values: CanonicalUser. |
| 112 | + |
| 113 | +## Attributes Reference |
| 114 | + |
| 115 | +In addition to all above arguments, the following attribute is exported: |
| 116 | + |
| 117 | +* `id` - The `region`,`bucket` and `acl` separated by (`/`). |
| 118 | + |
| 119 | +## Import |
| 120 | + |
| 121 | +Buckets can be imported using the `{region}/{bucketName}/{acl}` identifier, e.g. |
| 122 | + |
| 123 | +```bash |
| 124 | +$ terraform import scaleway_object_bucket_acl.some_bucket fr-par/some-bucket |
| 125 | +/private``` |
0 commit comments