mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #5766 from stack72/f-arm-template
provider/azurerm: Fix a potential panic in the `azurerm_template_deployment` resource
This commit is contained in:
commit
1888733803
@ -143,9 +143,8 @@ func resourceArmTemplateDeploymentRead(d *schema.ResourceData, meta interface{})
|
|||||||
}
|
}
|
||||||
var outputs map[string]string
|
var outputs map[string]string
|
||||||
if resp.Properties.Outputs != nil && len(*resp.Properties.Outputs) > 0 {
|
if resp.Properties.Outputs != nil && len(*resp.Properties.Outputs) > 0 {
|
||||||
|
outputs = make(map[string]string)
|
||||||
for key, output := range *resp.Properties.Outputs {
|
for key, output := range *resp.Properties.Outputs {
|
||||||
log.Printf("[INFO] Found Key %s", key)
|
|
||||||
|
|
||||||
outputMap := output.(map[string]interface{})
|
outputMap := output.(map[string]interface{})
|
||||||
outputValue, ok := outputMap["value"]
|
outputValue, ok := outputMap["value"]
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -156,6 +155,7 @@ func resourceArmTemplateDeploymentRead(d *schema.ResourceData, meta interface{})
|
|||||||
outputs[key] = outputValue.(string)
|
outputs[key] = outputValue.(string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Set("outputs", outputs)
|
d.Set("outputs", outputs)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user