From 29f59a995e26178302d6f2a0f0f64a97adcc3298 Mon Sep 17 00:00:00 2001 From: Roman Schwarz Date: Fri, 20 Sep 2024 10:12:47 +0200 Subject: [PATCH] Fix `image` output Signed-off-by: Roman Schwarz --- README.md | 15 +++++++++------ outputs.tf | 18 ++++++++++-------- tests/local/input_image.tftest.hcl | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index dac1251..0ed779f 100644 --- a/README.md +++ b/README.md @@ -799,12 +799,15 @@ Attributes: Attribute | Description -- | -- -`publisher` | The publisher of the image. -`offer` | The offer of the image. -`sku` | The SKU of the image. -`version` | The version of the image. -`architecture` | The virtual machine achitecture. Can be `x86` or `arm64`. -`operating_system` | The operating system. Can be `Windows` or `Linux`. + `architecture` | The image architecture. + `offer` | The image offer. + `operating_system` | The image operating system. + `publisher` | The image publisher. + `sku` | The image Stock Keeping Unit (SKU). + `urn` | The full image URN. + `urnAlias` | The image alias URN. + || **NOTE**: Only [Azure Image Quick start templates](#azure-image-quick-start-templates) have an alias URN + `version` | The image version. ### [key\_vault\_secret\_id](#output\_key\_vault\_secret\_id) diff --git a/outputs.tf b/outputs.tf index 37eacc1..01dfd65 100644 --- a/outputs.tf +++ b/outputs.tf @@ -101,16 +101,18 @@ output "image" { Attribute | Description -- | -- - `publisher` | The publisher of the image. - `offer` | The offer of the image. - `sku` | The SKU of the image. - `version` | The version of the image. - `architecture` | The virtual machine achitecture. Can be `x86` or `arm64`. - `operating_system` | The operating system. Can be `Windows` or `Linux`. - + `architecture` | The image architecture. + `offer` | The image offer. + `operating_system` | The image operating system. + `publisher` | The image publisher. + `sku` | The image Stock Keeping Unit (SKU). + `urn` | The full image URN. + `urnAlias` | The image alias URN. + || **NOTE**: Only [Azure Image Quick start templates](#azure-image-quick-start-templates) have an alias URN + `version` | The image version. EOT - value = local.image_full + value = local.image } output "key_vault_secret_id" { diff --git a/tests/local/input_image.tftest.hcl b/tests/local/input_image.tftest.hcl index 6e6b2af..bf399f9 100644 --- a/tests/local/input_image.tftest.hcl +++ b/tests/local/input_image.tftest.hcl @@ -73,12 +73,12 @@ run "should_image_result_in_expected_output" { condition = output.image == tomap({ architecture = "x64" offer = "WindowsServer" + operating_system = "Windows" publisher = "MicrosoftWindowsServer" sku = "2022-datacenter-g2" urn = "MicrosoftWindowsServer:WindowsServer:2022-datacenter-g2:latest" urnAlias = "Win2022Datacenter" version = "latest" - operating_system = "Windows" }) error_message = "Output image not equal to expected value" }