Skip to content

Commit

Permalink
Adding a ConflictsWith for Parameters / Parameters Body fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Mar 14, 2018
1 parent 9c4a5fc commit 35b7e68
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions azurerm/resource_arm_template_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -39,24 +40,32 @@ func resourceArmTemplateDeployment() *schema.Resource {
},

"parameters": {
Type: schema.TypeMap,
Optional: true,
Type: schema.TypeMap,
Optional: true,
ConflictsWith: []string{"parameters_body"},
},

"parameters_body": {
Type: schema.TypeString,
Optional: true,
StateFunc: normalizeJson,
ConflictsWith: []string{"parameters"},
},

"deployment_mode": {
Type: schema.TypeString,
Optional: true,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
string(resources.Complete),
string(resources.Incremental),
}, true),
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},

"outputs": {
Type: schema.TypeMap,
Computed: true,
},

"deployment_mode": {
Type: schema.TypeString,
Required: true,
},
},
}
}
Expand All @@ -70,7 +79,7 @@ func resourceArmTemplateDeploymentCreate(d *schema.ResourceData, meta interface{
resourceGroup := d.Get("resource_group_name").(string)
deploymentMode := d.Get("deployment_mode").(string)

log.Printf("[INFO] preparing arguments for Azure ARM Template Deployment creation.")
log.Printf("[INFO] preparing arguments for AzureRM Template Deployment creation.")
properties := resources.DeploymentProperties{
Mode: resources.DeploymentMode(deploymentMode),
}
Expand Down

0 comments on commit 35b7e68

Please sign in to comment.