GoogleCloudPlatform / GoogleCloudPlatform/deploymentmanager-samples

declaring empty role bindings for a storage bucket

Open
#297 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jinja
Stars
951
Forks
700
PR merge metrics
No merged PRs in 30d

Description

The below is part of my expanded config pertaining to a bucket. I have a role binding declared for the bucket.
```
- accessControl:
gcpIamPolicy:
bindings:
- members:
- serviceAccount:ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
role: roles/storage.objectViewer
metadata:
dependsOn:
- PROJECT_ID
- PROJECT_ID-storage-component.googleapis.com
name: BUCKET_NAME
properties:
location: us
name: BUCKET_NAME
project: PROJECT_ID
storageClass: MULTI_REGIONAL
versioning:
enabled: true
type: gcp-types/storage-v1:buckets
```

What is the correct way to redeclare the bucket without role bindings?

Here is what I have tried:

empty `accessControl`
```
- accessControl: {}
metadata:
dependsOn:
- PROJECT_ID
- PROJECT_ID-storage-component.googleapis.com
name: BUCKET_NAME
properties:
location: us
name: BUCKET_NAME
project: PROJECT_ID
storageClass: MULTI_REGIONAL
versioning:
enabled: true
type: gcp-types/storage-v1:buckets
```
then I get the following error message when deploying
```
BUCKET_NAME: {"ResourceType":"gcp-types/storage-v1:buckets","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"A policy to update must be provided.","reason":"required"}],"message":"A policy to update must be provided.","statusMessage":"Bad Request","requestPath":"https://www.googleapis.com/storage/v1/b/BUCKET_NAME/iam","httpMethod":"PUT"}}
```
no `accessControl`
```
- metadata:
dependsOn:
- PROJECT_ID
- PROJECT_ID-storage-component.googleapis.com
name: BUCKET_NAME
properties:
location: us
name: BUCKET_NAME
project: PROJECT_ID
storageClass: MULTI_REGIONAL
versioning:
enabled: true
type: gcp-types/storage-v1:buckets
```
I also get the same error message.

I've also tried
```
- accessControl:
gcpIamPolicy: {}
```
and
```
- accessControl:
gcpIamPolicy:
bindings: []
```

Any help would be appreciated! right now we have to always leave a role binding on every bucket :(

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.