Skip to content

Commit

Permalink
Make output for access level depend on resource
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Sep 19, 2019
1 parent d5cb981 commit 1cb6b95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/access_level/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* limitations under the License.
*/

locals {
output_name = google_access_context_manager_access_level.access_level.name
}

resource "google_access_context_manager_access_level" "access_level" {
provider = google
parent = "accessPolicies/${var.policy}"
Expand Down
7 changes: 6 additions & 1 deletion modules/access_level/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@

output "name" {
description = "Description of the AccessLevel and its use. Does not affect behavior."
value = var.name
value = split("/", local.output_name)[3]
}

output "name_id" {
description = "The fully-qualified name of the Access Level. Format: accessPolicies/{policy_id}/accessLevels/{name}"
value = local.output_name
}

0 comments on commit 1cb6b95

Please sign in to comment.