Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote public_access_prevention field on google_storage_bucket resource to GA, add to documentation #4777

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/6683.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
storage: Promoted `public_access_prevention` field on `google_storage_bucket` resource to GA
```
3 changes: 1 addition & 2 deletions google-beta/resource_storage_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ func TestAccStorageBucket_publicAccessPrevention(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccStorageBucket_publicAccessPrevention(bucketName, "enforced"),
Expand Down Expand Up @@ -1810,7 +1810,6 @@ resource "google_storage_bucket" "bucket" {
func testAccStorageBucket_publicAccessPrevention(bucketName string, prevention string) string {
return fmt.Sprintf(`
resource "google_storage_bucket" "bucket" {
provider = google-beta
name = "%s"
location = "US"
public_access_prevention = "%s"
Expand Down
15 changes: 15 additions & 0 deletions website/docs/r/storage_bucket.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ resource "google_storage_bucket" "auto-expire" {
}
}
```

## Example Usage - Enabling public access prevention

```hcl
resource "google_storage_bucket" "auto-expire" {
name = "no-public-access-bucket"
location = "US"
force_destroy = true

public_access_prevention = "enforced"
}
```

## Argument Reference

The following arguments are supported:
Expand Down Expand Up @@ -101,6 +114,8 @@ The following arguments are supported:

* `uniform_bucket_level_access` - (Optional, Default: false) Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.

* `public_access_prevention` - (Optional) Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses [public access prevention](https://cloud.google.com/storage/docs/public-access-prevention). only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".

* `custom_placement_config` - (Optional) The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is [documented below](#nested_custom_placement_config).

<a name="nested_lifecycle_rule"></a>The `lifecycle_rule` block supports:
Expand Down