Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 1.74 KB

upgrading_to_iam_5.0.md

File metadata and controls

72 lines (58 loc) · 1.74 KB

Upgrading to IAM 5.0

The 5.0 release of IAM is a backward incompatible release. The top-level interface was removed entirely in favor of using the specific resource submodules directly.

Details

When using the root module in 4.0 you would have to specify additional resource-specific variables, e.g. projects_bindings, folders_bindings etc as follows:

 module "iam" {
   source  = "terraform-google-modules/iam/google"
   version = "~> 4.0"

   projects = ["project-123456"]

   projects_bindings = {
     "roles/storage.admin" = [
       "serviceAccount:a-service-account@cft.tips",
     ]
   }

   pubsub_topics_bindings = {}
   pubsub_subscriptions_bindings = {}
   storage_buckets_bindings = {}
   subnets_bindings = {}
   subnets_region = ""
   organizations_bindings = {}
   kms_crypto_keys_bindings = {}
   kms_key_rings_bindings = {}
   service_accounts_bindings = {}
   folders_bindings = {}
 }

Upgrade Instructions

The 5.0 release has deprecated the root module, so you should switch to a specific submodule, where setting defaults for *_bindings variables is dropped:

 module "iam" {
-  source  = "terraform-google-modules/iam/google"
+  source  = "terraform-google-modules/iam/google//modules/projects_iam"
-  version = "~> 4.0"
+  version = "~> 5.0"

   projects = ["project-123456"]

-  projects_bindings = {
+  bindings = {
     "roles/storage.admin" = [
        "serviceAccount:a-service-account@cft.tips",
     ]
   }

-  pubsub_topics_bindings = {}
-  pubsub_subscriptions_bindings = {}
-  storage_buckets_bindings = {}
-  subnets_bindings = {}
-  subnets_region = ""
-  organizations_bindings = {}
-  kms_crypto_keys_bindings = {}
-  kms_key_rings_bindings = {}
-  service_accounts_bindings = {}
-  folders_bindings = {}
 }