Skip to content

Commit

Permalink
Merge branch 'master' into api-management
Browse files Browse the repository at this point in the history
* master: (95 commits)
  Some more AzureStack changes for route table resource and datasource (hashicorp#1807)
  backport AzureStack route resource PR comments (hashicorp#1810)
  Updating to include hashicorp#1799
  Bug Fix of azurerm_virtual_machine.storage_os_disk.image_uri (hashicorp#1799)
  Updating to include hashicorp#1693
  IoT Hub add endpoints and routes (hashicorp#1693)
  Updating to include hashicorp#1789
  Added support for EventHub compatible EndPoints and Paths (hashicorp#1789)
  Updating to include hashicorp#1798
  Remove client side validation for azure network plugin (hashicorp#1798)
  backport azure stack route_table PR review comments (hashicorp#1790)
  Update CHAGELOG.md to include hashicorp#1795
  Fix: Corrected regexp for eventhub name
  reset verb
  fix some pointer dereferences
  Fix indentation on application_gateway.html.markdown (hashicorp#1780)
  folded subscription and [az]schema packages into azure
  consolidate CaseDifference Supression functions
  Cleanup after v1.13.0 release
  v1.13.0
  ...
  • Loading branch information
torresdal committed Aug 23, 2018
2 parents c9c9df2 + a4ca56f commit 2183b30
Show file tree
Hide file tree
Showing 128 changed files with 13,091 additions and 5,412 deletions.
77 changes: 69 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,78 @@
## 1.12.0 (Unreleased)
## 1.14.0 (Unreleased)

IMPROVEMENTS:

* `azurerm_iothub` - exporting the `event_hub_events_endpoint`, `event_hub_events_path`, `event_hub_operations_endpoint` and `event_hub_operations_path` fields [GH-1789]
* `azurerm_iothub` - support for `endpoint` and `route` blocks [GH-1693]

BUG FIXES:

* `azurerm_eventhub` - updating the validation to support periods, hyphens and underscores [GH-1795]
* `azurerm_eventhub_authorization_rule` - updating the validation error [GH-1795]
* `azurerm_eventhub_consumer_group` - updating the validation to support periods, hyphens and underscores [GH-1795]
* `azurerm_eventhub_namespace` - updating the validation error [GH-1795]
* `azurerm_kubernetes_cluster` - removing validation for the `pod_cidr` field when `network_plugin` is set to `azure` [GH-1798]
* `azurerm_virtual_machine` - setting the `image_uri` property within the `storage_os_disk` block [GH-1799]

## 1.13.0 (August 15, 2018)

FEATURES:

* **New Data Source:** `azurerm_log_analytics_workspace` ([#1755](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1755))
* **New Resource:** `azurerm_monitor_action_group` ([#1725](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1725))

IMPROVEMENTS:

* dependencies: upgrading to `2018-04-01` of the IoTHub SDK ([#1717](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1717))
* Azure CLI Auth - using the `USERPROFILE` environment variable to locate the users home directory, if set ([#1718](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1718))
* Data Source `azurerm_kubernetes_cluster` - exposing the `max_pods` field within the `agent_pool_profile` block ([#1753](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1753))
* Data Source: `azurerm_kubernetes_cluster` - exposing the `add_on_profile` block ([#1751](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1751))
* `azurerm_automation_schedule` - adding the `week_days`, `month_days` and `monthly_occurrence` properties ([#1626](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1626))
* `azurerm_container_group` - adding a new `commands` field / deprecating the `command` field ([#1740](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1740))
* `azurerm_iothub` - support for the `Basic` SKU ([#1717](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1717))
* `azurerm_kubernetes_cluster` - support for `max_pods` within the `agent_pool_profile` block ([#1753](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1753))
* `azurerm_kubernetes_cluster` - support for the `add_on_profile` block ([#1751](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1751))
* `azurerm_kubernetes_cluster` - validation for when `pod_cidr` is set with a `network_plugin` set to `azure` ([#1763](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1763))
* `azurerm_kubernetes_cluster` - `client_id` and `client_secret` in the `service_principal` block are now ForceNew ([#1737](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1737))
* `azurerm_kubernetes_cluster` - `docker_bridge_cidr`, `dns_service_ip` and `service_cidr` are now conditionally set ([#1715](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1715))
* `azurerm_lb_nat_rule` - `protocol` property now supports `All` ([#1736](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1736))
* `azurerm_lb_nat_pool` - `protocol` property now supports `All` ([#1748](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1748))
* `azurerm_lb_probe` - `protocol` property now supports `Https` ([#1742](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1742))
* `azurerm_lb_rule` - support for the `All` protocol / adding validation ([#1754](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1754))

BUG FIXES:

* `azurerm_application_insights` - handling a `HTTP 201` being returned from the Create API which working around a breaking change in the API ([#1769](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1769))
* `azurerm_autoscale_setting` - filtering out the `$tags` tag ([#1770](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1770))
* `azurerm_eventhub` - allowing underscores in the name field ([#1768](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1768))
* `azurerm_eventhub_authorization_rule` - allowing underscores in the name field ([#1768](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1768))
* `azurerm_eventhub_consumer_group` - allowing underscores in the name field ([#1768](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1768))

## 1.12.0 (August 03, 2018)

UPGRADE NOTES:

* **Please Note:** When upgrading to v1.12.0 of the Azure Provider, you may need to specify the `priority` of any VM Scale Sets created between v1.6 of the Provider and v1.12. ([#1586](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1586))

FEATURES:

* **New Data Source:** `azurerm_container_registry` [GH-1642]
* **New Data Source:** `azurerm_container_registry` ([#1642](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1642))
* **New Resource:** `azurerm_service_fabric_cluster` ([#4](https://github.com/terraform-providers/terraform-provider-azurerm/issues/4))

IMPROVEMENTS:

* sdk: switching from `WaitForCompletion` -> `WaitForCompletionRef` when polling Future's [GH-1660]
* Data Source: `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block [GH-1479]
* Data Source: `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field [GH-1649]
* `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block [GH-1479]
* `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field [GH-1649]
* `azurerm_virtual_machine` - setting the connection information for Provisioners [GH-1646]
* sdk: switching from `WaitForCompletion` -> `WaitForCompletionRef` when polling Future's ([#1660](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1660))
* Data Source: `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block ([#1479](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1479))
* Data Source: `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field ([#1649](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1649))
* `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block ([#1479](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1479))
* `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field ([#1649](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1649))
* `azurerm_role_assignment` - retrying resource creation to match the Azure CLI's behaviour ([#1647](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1647))
* `azurerm_virtual_machine` - setting the connection information for Provisioners ([#1646](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1646))


BUG FIXES:

* `azurerm_virtual_machine_scale_set` - removing the default of `priority`, since this isn't set on older instances. ([#1586](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1586))

## 1.11.0 (July 25, 2018)

Expand Down
20 changes: 18 additions & 2 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2018-01-01/eventgrid"
"github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub"
"github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
"github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices"
"github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices"
keyVault "github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault"
"github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault"
"github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic"
Expand All @@ -50,6 +50,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler"
"github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search"
"github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus"
"github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2018-02-01/servicefabric"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage"
"github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager"
"github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web"
Expand Down Expand Up @@ -169,6 +170,7 @@ type ArmClient struct {
logicWorkflowsClient logic.WorkflowsClient

// Monitor
actionGroupsClient insights.ActionGroupsClient
monitorAlertRulesClient insights.AlertRulesClient

// MSI
Expand Down Expand Up @@ -215,7 +217,7 @@ type ArmClient struct {
resourceGroupsClient resources.GroupsClient
subscriptionsClient subscriptions.Client

//Scheduler
// Scheduler
schedulerJobCollectionsClient scheduler.JobCollectionsClient
schedulerJobsClient scheduler.JobsClient

Expand All @@ -229,6 +231,9 @@ type ArmClient struct {
serviceBusSubscriptionsClient servicebus.SubscriptionsClient
serviceBusSubscriptionRulesClient servicebus.RulesClient

// Service Fabric
serviceFabricClustersClient servicefabric.ClustersClient

// Storage
storageServiceClient storage.AccountsClient
storageUsageClient storage.UsageClient
Expand Down Expand Up @@ -433,6 +438,7 @@ func getArmClient(c *authentication.Config) (*ArmClient, error) {
client.registerResourcesClients(endpoint, c.SubscriptionID, auth)
client.registerSearchClients(endpoint, c.SubscriptionID, auth)
client.registerServiceBusClients(endpoint, c.SubscriptionID, auth)
client.registerServiceFabricClients(endpoint, c.SubscriptionID, auth)
client.registerSchedulerClients(endpoint, c.SubscriptionID, auth)
client.registerStorageClients(endpoint, c.SubscriptionID, auth)
client.registerTrafficManagerClients(endpoint, c.SubscriptionID, auth)
Expand Down Expand Up @@ -787,6 +793,10 @@ func (c *ArmClient) registerLogicClients(endpoint, subscriptionId string, auth a
}

func (c *ArmClient) registerMonitorClients(endpoint, subscriptionId string, auth autorest.Authorizer, sender autorest.Sender) {
actionGroupsClient := insights.NewActionGroupsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&actionGroupsClient.Client, auth)
c.actionGroupsClient = actionGroupsClient

arc := insights.NewAlertRulesClientWithBaseURI(endpoint, subscriptionId)
setUserAgent(&arc.Client)
arc.Authorizer = auth
Expand Down Expand Up @@ -994,6 +1004,12 @@ func (c *ArmClient) registerServiceBusClients(endpoint, subscriptionId string, a
c.serviceBusSubscriptionRulesClient = subscriptionRulesClient
}

func (c *ArmClient) registerServiceFabricClients(endpoint, subscriptionId string, auth autorest.Authorizer) {
clustersClient := servicefabric.NewClustersClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&clustersClient.Client, auth)
c.serviceFabricClustersClient = clustersClient
}

func (c *ArmClient) registerStorageClients(endpoint, subscriptionId string, auth autorest.Authorizer) {
accountsClient := storage.NewAccountsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&accountsClient.Client, auth)
Expand Down
6 changes: 3 additions & 3 deletions azurerm/data_source_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -28,7 +28,7 @@ func dataSourceArmAppService() *schema.Resource {
Computed: true,
},

"site_config": azSchema.AppServiceSiteConfigSchema(),
"site_config": azure.SchemaAppServiceSiteConfig(),

"client_affinity_enabled": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -192,7 +192,7 @@ func dataSourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error
return err
}

siteConfig := azSchema.FlattenAppServiceSiteConfig(configResp.SiteConfig)
siteConfig := azure.FlattenAppServiceSiteConfig(configResp.SiteConfig)
if err := d.Set("site_config", siteConfig); err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions azurerm/data_source_key_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault"
"github.com/hashicorp/terraform/helper/schema"
kvschema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -139,12 +139,12 @@ func dataSourceArmKeyVaultRead(d *schema.ResourceData, meta interface{}) error {
d.Set("enabled_for_disk_encryption", props.EnabledForDiskEncryption)
d.Set("enabled_for_template_deployment", props.EnabledForTemplateDeployment)
if err := d.Set("sku", flattenKeyVaultDataSourceSku(props.Sku)); err != nil {
return fmt.Errorf("Error flattening `sku` for KeyVault %q: %+v", resp.Name, err)
return fmt.Errorf("Error flattening `sku` for KeyVault %q: %+v", *resp.Name, err)
}

flattenedPolicies := kvschema.FlattenKeyVaultAccessPolicies(props.AccessPolicies)
flattenedPolicies := azure.FlattenKeyVaultAccessPolicies(props.AccessPolicies)
if err := d.Set("access_policy", flattenedPolicies); err != nil {
return fmt.Errorf("Error flattening `access_policy` for KeyVault %q: %+v", resp.Name, err)
return fmt.Errorf("Error flattening `access_policy` for KeyVault %q: %+v", *resp.Name, err)
}
d.Set("vault_uri", props.VaultURI)
}
Expand Down
113 changes: 107 additions & 6 deletions azurerm/data_source_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func dataSourceArmKubernetesCluster() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},

"max_pods": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down Expand Up @@ -199,6 +204,48 @@ func dataSourceArmKubernetesCluster() *schema.Resource {
},
},

"addon_profile": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"http_application_routing": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Computed: true,
},
"http_application_routing_zone_name": {
Type: schema.TypeString,
Computed: true,
},
},
},
},

"oms_agent": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Computed: true,
},
"log_analytics_workspace_id": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
},
},

"tags": tagsForDataSourceSchema(),
},
}
Expand Down Expand Up @@ -245,23 +292,27 @@ func dataSourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Error setting `linux_profile`: %+v", err)
}

addonProfiles := flattenKubernetesClusterDataSourceAddonProfiles(props.AddonProfiles)
if err := d.Set("addon_profile", addonProfiles); err != nil {
return fmt.Errorf("Error setting `addon_profile`: %+v", err)
}

agentPoolProfiles := flattenKubernetesClusterDataSourceAgentPoolProfiles(props.AgentPoolProfiles)
if err := d.Set("agent_pool_profile", agentPoolProfiles); err != nil {
return fmt.Errorf("Error setting `agent_pool_profile`: %+v", err)
}

networkProfile := flattenKubernetesClusterDataSourceNetworkProfile(props.NetworkProfile)
if err := d.Set("network_profile", networkProfile); err != nil {
return fmt.Errorf("Error setting `network_profile`: %+v", err)
}

servicePrincipal := flattenKubernetesClusterDataSourceServicePrincipalProfile(resp.ManagedClusterProperties.ServicePrincipalProfile)
if err := d.Set("service_principal", servicePrincipal); err != nil {
return fmt.Errorf("Error setting `service_principal`: %+v", err)
}
}

networkProfile := flattenKubernetesClusterDataSourceNetworkProfile(resp.NetworkProfile)

if err := d.Set("network_profile", networkProfile); err != nil {
return fmt.Errorf("Error setting `network_profile`: %+v", err)
}

kubeConfigRaw, kubeConfig := flattenKubernetesClusterDataSourceAccessProfile(&profile)
d.Set("kube_config_raw", kubeConfigRaw)

Expand Down Expand Up @@ -339,6 +390,10 @@ func flattenKubernetesClusterDataSourceAgentPoolProfiles(input *[]containerservi
agentPoolProfile["os_type"] = string(profile.OsType)
}

if profile.MaxPods != nil {
agentPoolProfile["max_pods"] = int(*profile.MaxPods)
}

agentPoolProfiles = append(agentPoolProfiles, agentPoolProfile)
}

Expand Down Expand Up @@ -419,3 +474,49 @@ func flattenKubernetesClusterDataSourceNetworkProfile(profile *containerservice.

return []interface{}{values}
}

func flattenKubernetesClusterDataSourceAddonProfiles(profile map[string]*containerservice.ManagedClusterAddonProfile) interface{} {
values := make(map[string]interface{}, 0)

routes := make([]interface{}, 0)
if httpApplicationRouting := profile["httpApplicationRouting"]; httpApplicationRouting != nil {
enabled := false
if enabledVal := httpApplicationRouting.Enabled; enabledVal != nil {
enabled = *enabledVal
}

zoneName := ""
if v := httpApplicationRouting.Config["HTTPApplicationRoutingZoneName"]; v != nil {
zoneName = *v
}

output := map[string]interface{}{
"enabled": enabled,
"http_application_routing_zone_name": zoneName,
}
routes = append(routes, output)
}
values["http_application_routing"] = routes

agents := make([]interface{}, 0)
if omsAgent := profile["omsAgent"]; omsAgent != nil {
enabled := false
if enabledVal := omsAgent.Enabled; enabledVal != nil {
enabled = *enabledVal
}

workspaceId := ""
if workspaceResourceID := omsAgent.Config["logAnalyticsWorkspaceResourceID"]; workspaceResourceID != nil {
workspaceId = *workspaceResourceID
}

output := map[string]interface{}{
"enabled": enabled,
"log_analytics_workspace_id": workspaceId,
}
agents = append(agents, output)
}
values["oms_agent"] = agents

return []interface{}{values}
}
Loading

0 comments on commit 2183b30

Please sign in to comment.