rename iam variable in source repo module

This commit is contained in:
Ludovico Magnocavallo
2020-11-05 08:58:05 +01:00
parent 7e96e899d5
commit 462a7023cd
7 changed files with 114 additions and 8 deletions

View File

@@ -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&#40;set&#40;string&#41;&#41;">map(set(string))</code> | | <code title="">{}</code> |
| *iam* | IAM bindings in {ROLE => [MEMBERS]} format. | <code title="map&#40;list&#40;string&#41;&#41;">map(list(string))</code> | | <code title="">{}</code> |
## Outputs

View File

@@ -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

View File

@@ -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
}