2015-09-16 18:46:46 +00:00
---
layout: "google"
page_title: "Google: google_storage_object_acl"
2015-10-23 14:10:41 +00:00
sidebar_current: "docs-google-storage-object-acl"
2015-09-16 18:46:46 +00:00
description: |-
Creates a new object ACL in Google Cloud Storage.
---
# google\_storage\_object\_acl
2017-06-06 23:08:45 +00:00
Creates a new object ACL in Google cloud storage service (GCS). For more information see
[the official documentation ](https://cloud.google.com/storage/docs/access-control/lists )
and
[API ](https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls ).
2015-09-16 18:46:46 +00:00
## Example Usage
Create an object ACL with one owner and one reader.
2017-04-17 10:17:54 +00:00
```hcl
2015-09-16 18:46:46 +00:00
resource "google_storage_bucket" "image-store" {
2016-04-10 21:34:15 +00:00
name = "image-store-bucket"
location = "EU"
2015-09-16 18:46:46 +00:00
}
resource "google_storage_bucket_object" "image" {
2017-02-18 22:48:50 +00:00
name = "image1"
2017-11-02 17:50:54 +00:00
bucket = "${google_storage_bucket.image-store.name}"
2016-04-10 21:34:15 +00:00
source = "image1.jpg"
2015-09-16 18:46:46 +00:00
}
resource "google_storage_object_acl" "image-store-acl" {
2017-11-02 17:50:54 +00:00
bucket = "${google_storage_bucket.image-store.name}"
object = "${google_storage_bucket_object.image.name}"
2015-09-16 18:46:46 +00:00
2016-04-10 21:34:15 +00:00
role_entity = [
"OWNER:user-my.email@gmail.com",
"READER:group-mygroup",
]
}
2015-09-16 18:46:46 +00:00
```
## Argument Reference
* `bucket` - (Required) The name of the bucket it applies to.
2016-04-10 21:34:15 +00:00
2015-09-16 18:46:46 +00:00
* `object` - (Required) The name of the object it applies to.
2016-04-10 21:34:15 +00:00
- - -
2015-09-16 18:46:46 +00:00
* `predefined_acl` - (Optional) The [canned GCS ACL ](https://cloud.google.com/storage/docs/access-control#predefined-acl ) to apply. Must be set if `role_entity` is not.
2016-04-10 21:34:15 +00:00
2015-09-16 18:46:46 +00:00
* `role_entity` - (Optional) List of role/entity pairs in the form `ROLE:entity` . See [GCS Object ACL documentation ](https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls ) for more details. Must be set if `predefined_acl` is not.
2016-04-10 21:34:15 +00:00
## Attributes Reference
Only the arguments listed above are exposed as attributes.