Created
September 13, 2024 18:50
-
-
Save Satak/d0b3d00b16d92066d7e01f89fb099bd8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
my-resource-1: | |
current_version: 1.9.0 | |
product: my-manually-set-product | |
my-resource-2: | |
current_version: ${api.current_version} | |
product: ${api.product} |
This file contains hidden or 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
locals { | |
# Parse the API response | |
api_response = jsondecode(data.http.api.response_body) | |
# Process conf.yaml as a template | |
conf = yamldecode(templatefile("${path.module}/conf.yaml", { | |
api = local.api_response | |
})) | |
} | |
data "http" "api" { | |
url = "https://checkpoint-api.hashicorp.com/v1/check/terraform" | |
} | |
output "data" { | |
value = data.http.api.response_body | |
} | |
output "conf" { | |
value = local.conf | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment