Skip to content

Commit 0ec482c

Browse files
rajatagarwal-ibmRajat Agrawal
andauthored
fix: project id output (#34)
* feat: project id regex * feat: project id regex * feat: project id regex * feat: project id regex --------- Co-authored-by: Rajat Agrawal <rajat.agrawal@ibm.com>
1 parent e74afe4 commit 0ec482c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

configure_project/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ resource "restapi_object" "configure_project" {
5454
}
5555
EOT
5656
}
57+
58+
locals {
59+
project_id_object = restapi_object.configure_project[0].id
60+
project_id = regex("^.+/([a-f0-9\\-]+)$", local.project_id_object)[0]
61+
}

configure_project/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
output "project_id" {
2-
value = trimprefix(resource.restapi_object.configure_project[0].id, "/v2/projects/")
3-
description = "ID of the created project"
2+
value = local.project_id
3+
description = "ID of the created project."
44
}
55

66
output "project_location" {

0 commit comments

Comments
 (0)