Skip to content

Commit

Permalink
* Set sku to optional and default to Developer
Browse files Browse the repository at this point in the history
* Removed sku from additional_location schema
* Removed code for flattening sku under additional locations
  • Loading branch information
torresdal committed Jul 14, 2018
1 parent 3b1397d commit eb0a81e
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions azurerm/resource_arm_api_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func resourceArmApiManagementService() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
// Default: string(apimanagement.SkuTypeDeveloper),
Optional: true,
Default: string(apimanagement.SkuTypeDeveloper),
ValidateFunc: validation.StringInSlice([]string{
string(apimanagement.SkuTypeDeveloper),
string(apimanagement.SkuTypeBasic),
Expand Down Expand Up @@ -87,25 +87,6 @@ func resourceArmApiManagementService() *schema.Resource {
Schema: map[string]*schema.Schema{
"location": locationSchema(),

"sku": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"capacity": {
Type: schema.TypeInt,
Optional: true,
Default: 1,
},
},
},
},

"gateway_regional_url": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -512,7 +493,6 @@ func expandAzureRmApiManagementAdditionalLocations(d *schema.ResourceData, sku *
for _, v := range inputLocations {
config := v.(map[string]interface{})
location := config["location"].(string)
// sku := expandAzureRmApiManagementSku(config["sku"].([]interface{}))

additionalLocation := apimanagement.AdditionalLocation{
Location: &location,
Expand Down Expand Up @@ -591,12 +571,6 @@ func flattenApiManagementAdditionalLocations(props *[]apimanagement.AdditionalLo
additional_location["gateway_regional_url"] = *prop.GatewayRegionalURL
}

if prop.Sku != nil {
if sku := flattenApiManagementServiceSku(prop.Sku); sku != nil {
additional_location["sku"] = sku
}
}

additional_locations = append(additional_locations, additional_location)
}
}
Expand Down

0 comments on commit eb0a81e

Please sign in to comment.