Skip to content

Commit

Permalink
fix: Use uniform_bucket_level_access flag instead due to deprecation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmak committed Sep 16, 2020
1 parent a16305d commit f287581
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -95,7 +95,7 @@ The following dependencies must be available:

- [Terraform][terraform] v0.12
- For Terraform v0.11 see the [Compatibility](#compatibility) section above
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v2.0
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v3.0

### Service Account

Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_buckets/main.tf
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 2.18.0"
version = "~> 3.38.0"
}

resource "random_string" "prefix" {
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Expand Up @@ -38,7 +38,7 @@ resource "google_storage_bucket" "buckets" {
lower(element(var.names, count.index)),
false,
)
bucket_policy_only = lookup(
uniform_bucket_level_access = lookup(
var.bucket_policy_only,
lower(element(var.names, count.index)),
true,
Expand Down
14 changes: 7 additions & 7 deletions modules/simple_bucket/main.tf
Expand Up @@ -15,13 +15,13 @@
*/

resource "google_storage_bucket" "bucket" {
name = var.name
project = var.project_id
location = var.location
storage_class = var.storage_class
bucket_policy_only = var.bucket_policy_only
labels = var.labels
force_destroy = var.force_destroy
name = var.name
project = var.project_id
location = var.location
storage_class = var.storage_class
uniform_bucket_level_access = var.bucket_policy_only
labels = var.labels
force_destroy = var.force_destroy

versioning {
enabled = var.versioning
Expand Down
2 changes: 0 additions & 2 deletions test/integration/multiple_buckets/controls/gsutil.rb
Expand Up @@ -55,7 +55,6 @@
it { expect(action['storageClass']).to eq("NEARLINE") }
it { expect(action['type']).to eq("SetStorageClass") }
it { expect(condition['age']).to eq(10) }
it { expect(condition['isLive']).to eq(false) }
it { expect(condition['matchesStorageClass']).to eq(%w(MULTI_REGIONAL STANDARD DURABLE_REDUCED_AVAILABILITY)) }
end

Expand All @@ -71,7 +70,6 @@
it { expect(action['storageClass']).to eq("NEARLINE") }
it { expect(action['type']).to eq("SetStorageClass") }
it { expect(condition['age']).to eq(10) }
it { expect(condition['isLive']).to eq(false) }
it { expect(condition['matchesStorageClass']).to eq(%w(MULTI_REGIONAL STANDARD DURABLE_REDUCED_AVAILABILITY)) }
end

Expand Down
2 changes: 1 addition & 1 deletion test/setup/main.tf
Expand Up @@ -16,7 +16,7 @@

module "project" {
source = "terraform-google-modules/project-factory/google"
version = "~> 3.0"
version = "~> 9.0.0"

name = "ci-cloud-storage"
random_project_id = "true"
Expand Down
2 changes: 1 addition & 1 deletion test/setup/versions.tf
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 2.18.0"
version = "~> 3.38.0"
}

terraform {
Expand Down

0 comments on commit f287581

Please sign in to comment.