rename iam variable in source repo module
This commit is contained in:
@@ -12,7 +12,7 @@ module "repo" {
|
||||
source e = "./modules/source-repository"
|
||||
project_id = "my-project"
|
||||
name = "my-repo"
|
||||
iam_members = {
|
||||
iam = {
|
||||
"roles/source.reader" = ["user:foo@example.com"]
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,9 @@ module "repo" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---: |:---:|:---:|
|
||||
| name | Repository topic name. | <code title="">string</code> | ✓ | |
|
||||
| name | Repository name. | <code title="">string</code> | ✓ | |
|
||||
| project_id | Project used for resources. | <code title="">string</code> | ✓ | |
|
||||
| *iam_members* | IAM members for each topic role. | <code title="map(set(string))">map(set(string))</code> | | <code title="">{}</code> |
|
||||
| *iam* | IAM bindings in {ROLE => [MEMBERS]} format. | <code title="map(list(string))">map(list(string))</code> | | <code title="">{}</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ resource "google_sourcerepo_repository" "default" {
|
||||
}
|
||||
|
||||
resource "google_sourcerepo_repository_iam_binding" "default" {
|
||||
for_each = var.iam_members
|
||||
for_each = var.iam
|
||||
project = var.project_id
|
||||
repository = google_sourcerepo_repository.default.name
|
||||
role = each.key
|
||||
|
||||
@@ -19,13 +19,13 @@ variable "project_id" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "iam_members" {
|
||||
description = "IAM members for each topic role."
|
||||
type = map(set(string))
|
||||
variable "iam" {
|
||||
description = "IAM bindings in {ROLE => [MEMBERS]} format."
|
||||
type = map(list(string))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
description = "Repository topic name."
|
||||
description = "Repository name."
|
||||
type = string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user