Improve tests and documentation for azurerm_template_deployment outputs (#13567)

* Improve tests and documentation for azurerm_template_deployment outputs

* Updating to match the latest changes in master
This commit is contained in:
Glen Mailer 2017-05-05 17:51:59 +01:00 committed by Tom Harvey
parent 7c6d1956b0
commit 4ac56338de
2 changed files with 25 additions and 4 deletions

View File

@ -298,7 +298,14 @@ var testAccAzureRMTemplateDeployment_withParams = `
}
output "test" {
value = "${azurerm_template_deployment.test.outputs.testOutput}"
value = "${azurerm_template_deployment.test.outputs["testOutput"]}"
}
resource "azurerm_storage_container" "using-outputs" {
name = "vhds"
resource_group_name = "${azurerm_resource_group.test.name}"
storage_account_name = "${azurerm_template_deployment.test.outputs["accountName"]}"
container_access_type = "private"
}
resource "azurerm_template_deployment" "test" {
@ -362,6 +369,10 @@ var testAccAzureRMTemplateDeployment_withParams = `
"testOutput": {
"type": "string",
"value": "Output Value"
},
"accountName": {
"type": "string",
"value": "[variables('storageAccountName')]"
}
}
}

View File

@ -70,12 +70,22 @@ resource "azurerm_template_deployment" "test" {
}
}
}
]
],
"outputs": {
"storageAccountName": {
"type": "string",
"value": "[variables('storageAccountName')]"
}
}
}
DEPLOY
deployment_mode = "Incremental"
}
output "storageAccountName" {
value = "${azurerm_template_deployment.test.outputs["storageAccountName"]}"
}
```
## Argument Reference
@ -92,13 +102,13 @@ The following arguments are supported:
* `template_body` - (Optional) Specifies the JSON definition for the template.
* `parameters` - (Optional) Specifies the name and value pairs that define the deployment parameters for the template.
## Attributes Reference
The following attributes are exported:
* `id` - The Template Deployment ID.
* `outputs` - A map of supported scalar output types returned from the deployment (currently, Azure Template Deployment outputs of type String, Int and Bool are supported, and are converted to strings - others will be ignored).
* `outputs` - A map of supported scalar output types returned from the deployment (currently, Azure Template Deployment outputs of type String, Int and Bool are supported, and are converted to strings - others will be ignored) and can be accessed using `.outputs["name"]`.
## Note