forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hashicorp#1126 from modular-magician/codegen-pr-2302
Reverse parent attribute override for TF IAM
- Loading branch information
Showing
7 changed files
with
44 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ resource "google_compute_http_health_check" "default" { | |
resource "google_iap_web_backend_service_iam_member" "foo" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
role = "%{role}" | ||
member = "user:[email protected]" | ||
} | ||
|
@@ -154,7 +154,7 @@ data "google_iam_policy" "foo" { | |
resource "google_iap_web_backend_service_iam_policy" "foo" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
policy_data = "${data.google_iam_policy.foo.policy_data}" | ||
} | ||
`, context) | ||
|
@@ -176,7 +176,7 @@ resource "google_compute_http_health_check" "default" { | |
resource "google_iap_web_backend_service_iam_binding" "foo" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]"] | ||
} | ||
|
@@ -199,7 +199,7 @@ resource "google_compute_http_health_check" "default" { | |
resource "google_iap_web_backend_service_iam_binding" "foo" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]", "user:[email protected]"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ resource "google_pubsub_topic" "example" { | |
resource "google_pubsub_topic_iam_member" "foo" { | ||
project = "${google_pubsub_topic.example.project}" | ||
topic = "${google_pubsub_topic.example.id}" | ||
topic = "${google_pubsub_topic.example.name}" | ||
role = "%{role}" | ||
member = "user:[email protected]" | ||
} | ||
|
@@ -146,7 +146,7 @@ data "google_iam_policy" "foo" { | |
resource "google_pubsub_topic_iam_policy" "foo" { | ||
project = "${google_pubsub_topic.example.project}" | ||
topic = "${google_pubsub_topic.example.id}" | ||
topic = "${google_pubsub_topic.example.name}" | ||
policy_data = "${data.google_iam_policy.foo.policy_data}" | ||
} | ||
`, context) | ||
|
@@ -164,7 +164,7 @@ resource "google_pubsub_topic" "example" { | |
resource "google_pubsub_topic_iam_binding" "foo" { | ||
project = "${google_pubsub_topic.example.project}" | ||
topic = "${google_pubsub_topic.example.id}" | ||
topic = "${google_pubsub_topic.example.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]"] | ||
} | ||
|
@@ -183,7 +183,7 @@ resource "google_pubsub_topic" "example" { | |
resource "google_pubsub_topic_iam_binding" "foo" { | ||
project = "${google_pubsub_topic.example.project}" | ||
topic = "${google_pubsub_topic.example.id}" | ||
topic = "${google_pubsub_topic.example.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]", "user:[email protected]"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,7 @@ resource "google_sourcerepo_repository" "my-repo" { | |
resource "google_sourcerepo_repository_iam_member" "foo" { | ||
project = "${google_sourcerepo_repository.my-repo.project}" | ||
repository = "${google_sourcerepo_repository.my-repo.id}" | ||
repository = "${google_sourcerepo_repository.my-repo.name}" | ||
role = "%{role}" | ||
member = "user:[email protected]" | ||
} | ||
|
@@ -138,7 +138,7 @@ data "google_iam_policy" "foo" { | |
resource "google_sourcerepo_repository_iam_policy" "foo" { | ||
project = "${google_sourcerepo_repository.my-repo.project}" | ||
repository = "${google_sourcerepo_repository.my-repo.id}" | ||
repository = "${google_sourcerepo_repository.my-repo.name}" | ||
policy_data = "${data.google_iam_policy.foo.policy_data}" | ||
} | ||
`, context) | ||
|
@@ -152,7 +152,7 @@ resource "google_sourcerepo_repository" "my-repo" { | |
resource "google_sourcerepo_repository_iam_binding" "foo" { | ||
project = "${google_sourcerepo_repository.my-repo.project}" | ||
repository = "${google_sourcerepo_repository.my-repo.id}" | ||
repository = "${google_sourcerepo_repository.my-repo.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]"] | ||
} | ||
|
@@ -167,7 +167,7 @@ resource "google_sourcerepo_repository" "my-repo" { | |
resource "google_sourcerepo_repository_iam_binding" "foo" { | ||
project = "${google_sourcerepo_repository.my-repo.project}" | ||
repository = "${google_sourcerepo_repository.my-repo.id}" | ||
repository = "${google_sourcerepo_repository.my-repo.name}" | ||
role = "%{role}" | ||
members = ["user:[email protected]", "user:[email protected]"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ data "google_iam_policy" "admin" { | |
resource "google_iap_web_backend_service_iam_policy" "editor" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
policy_data = "${data.google_iam_policy.admin.policy_data}" | ||
} | ||
``` | ||
|
@@ -56,7 +56,7 @@ resource "google_iap_web_backend_service_iam_policy" "editor" { | |
```hcl | ||
resource "google_iap_web_backend_service_iam_binding" "editor" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
role = "roles/iap.httpsResourceAccessor" | ||
members = [ | ||
"user:[email protected]", | ||
|
@@ -69,7 +69,7 @@ resource "google_iap_web_backend_service_iam_binding" "editor" { | |
```hcl | ||
resource "google_iap_web_backend_service_iam_member" "editor" { | ||
project = "${google_compute_backend_service.default.project}" | ||
backend_service_name = "${google_compute_backend_service.default.name}" | ||
web_backend_service = "${google_compute_backend_service.default.name}" | ||
role = "roles/iap.httpsResourceAccessor" | ||
member = "user:[email protected]" | ||
} | ||
|
@@ -79,7 +79,7 @@ resource "google_iap_web_backend_service_iam_member" "editor" { | |
|
||
The following arguments are supported: | ||
|
||
* `backend_service_name` - (Required) Name or self link of a backend service. Used to find the parent resource to bind the IAM policy to | ||
* `web_backend_service` - (Required) Used to find the parent resource to bind the IAM policy to | ||
|
||
* `project` - (Optional) The ID of the project in which the resource belongs. | ||
If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used. | ||
|
@@ -112,11 +112,11 @@ exported: | |
Iap webbackendservice IAM resources can be imported using the project, resource identifiers, role and member. | ||
|
||
``` | ||
$ terraform import google_iap_web_backend_service_iam_policy.editor projects/{{project}}/iap_web/compute/services/{{backendServiceName}} | ||
$ terraform import google_iap_web_backend_service_iam_policy.editor projects/{{project}}/iap_web/compute/services/{{web_backend_service}} | ||
$ terraform import google_iap_web_backend_service_iam_binding.editor "projects/{{project}}/iap_web/compute/services/{{backendServiceName}} roles/iap.httpsResourceAccessor" | ||
$ terraform import google_iap_web_backend_service_iam_binding.editor "projects/{{project}}/iap_web/compute/services/{{web_backend_service}} roles/iap.httpsResourceAccessor" | ||
$ terraform import google_iap_web_backend_service_iam_member.editor "projects/{{project}}/iap_web/compute/services/{{backendServiceName}} roles/iap.httpsResourceAccessor [email protected]" | ||
$ terraform import google_iap_web_backend_service_iam_member.editor "projects/{{project}}/iap_web/compute/services/{{web_backend_service}} roles/iap.httpsResourceAccessor [email protected]" | ||
``` | ||
|
||
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ data "google_iam_policy" "admin" { | |
resource "google_pubsub_topic_iam_policy" "editor" { | ||
project = "${google_pubsub_topic_iam.example.project}" | ||
name = "${google_pubsub_topic_iam.example.id}" | ||
topic = "${google_pubsub_topic_iam.example.name}" | ||
policy_data = "${data.google_iam_policy.admin.policy_data}" | ||
} | ||
``` | ||
|
@@ -56,7 +56,7 @@ resource "google_pubsub_topic_iam_policy" "editor" { | |
```hcl | ||
resource "google_pubsub_topic_iam_binding" "editor" { | ||
project = "${google_pubsub_topic_iam.example.project}" | ||
name = "${google_pubsub_topic_iam.example.id}" | ||
topic = "${google_pubsub_topic_iam.example.name}" | ||
role = "roles/viewer" | ||
members = [ | ||
"user:[email protected]", | ||
|
@@ -69,7 +69,7 @@ resource "google_pubsub_topic_iam_binding" "editor" { | |
```hcl | ||
resource "google_pubsub_topic_iam_member" "editor" { | ||
project = "${google_pubsub_topic_iam.example.project}" | ||
name = "${google_pubsub_topic_iam.example.id}" | ||
topic = "${google_pubsub_topic_iam.example.name}" | ||
role = "roles/viewer" | ||
member = "user:[email protected]" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ data "google_iam_policy" "admin" { | |
resource "google_sourcerepo_repository_iam_policy" "editor" { | ||
project = "${google_sourcerepo_repository_iam.my-repo.project}" | ||
name = "${google_sourcerepo_repository_iam.my-repo.id}" | ||
repository = "${google_sourcerepo_repository_iam.my-repo.name}" | ||
policy_data = "${data.google_iam_policy.admin.policy_data}" | ||
} | ||
``` | ||
|
@@ -56,7 +56,7 @@ resource "google_sourcerepo_repository_iam_policy" "editor" { | |
```hcl | ||
resource "google_sourcerepo_repository_iam_binding" "editor" { | ||
project = "${google_sourcerepo_repository_iam.my-repo.project}" | ||
name = "${google_sourcerepo_repository_iam.my-repo.id}" | ||
repository = "${google_sourcerepo_repository_iam.my-repo.name}" | ||
role = "roles/viewer" | ||
members = [ | ||
"user:[email protected]", | ||
|
@@ -69,7 +69,7 @@ resource "google_sourcerepo_repository_iam_binding" "editor" { | |
```hcl | ||
resource "google_sourcerepo_repository_iam_member" "editor" { | ||
project = "${google_sourcerepo_repository_iam.my-repo.project}" | ||
name = "${google_sourcerepo_repository_iam.my-repo.id}" | ||
repository = "${google_sourcerepo_repository_iam.my-repo.name}" | ||
role = "roles/viewer" | ||
member = "user:[email protected]" | ||
} | ||
|