Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…r-azurerm into managed-grafana
  • Loading branch information
ms-zhenhua committed Aug 2, 2022
2 parents 1d056eb + ee184ed commit 4afb2f0
Show file tree
Hide file tree
Showing 1,103 changed files with 2,389 additions and 1,479 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4136,7 +4136,7 @@ NOTES:

FEATURES:

* **Custom Timeouts:** - all resources within the Azure Provider now allow configuring custom timeouts - please [see Terraform's Timeout documentation](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) and the documentation in each data source resource for more information.
* **Custom Timeouts:** - all resources within the Azure Provider now allow configuring custom timeouts - please [see Terraform's Timeout documentation](https://www.terraform.io/language/resources/syntax#operation-timeouts) and the documentation in each data source resource for more information.
* **Requires Import:** The Azure Provider now checks for the presence of an existing resource prior to creating it - which means that if you try and create a resource which already exists (without importing it) you'll be prompted to import this into the state.
* **New Data Source:** `azurerm_app_service_environment` ([#5508](https://github.com/hashicorp/terraform-provider-azurerm/issues/5508))
* **New Data Source:** `azurerm_eventhub_authorization_rule` ([#5805](https://github.com/hashicorp/terraform-provider-azurerm/issues/5805))
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 3.17.0 (Unreleased)

ENHANCEMENTS:

* Data Source: `azurerm_proximity_placement_group` - refactoring to use `hashicorp/go-azure-sdk` [GH-17776]
* `azurerm_linux_virtual_machine_scale_set` - the property `instances` is now Optional and defaults to `0` [GH-17836]
* `azurerm_log_analytics_cluster` - updated validation for the `size_gb` property [GH-17780]
* `azurerm_proximity_placement_group` - refactoring to use `hashicorp/go-azure-sdk` [GH-17776]

BUG FIXES:

* Data Source: `azurerm_private_dns_zone` - returning the correct Resource ID when not specifying the `resource_group_name` [GH-17729]

## 3.16.0 (July 28, 2022)

FEATURES:
Expand Down
2 changes: 1 addition & 1 deletion contributing/topics/guide-new-data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ In addition to the Arguments listed above - the following Attributes are exporte

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions:

* `read` - (Defaults to 5 minutes) Used when retrieving the Resource Group.
```
Expand Down
2 changes: 1 addition & 1 deletion contributing/topics/guide-new-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ In addition to the Arguments listed above - the following Attributes are exporte

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions:

* `create` - (Defaults to 30 minutes) Used when creating the Resource Group.
* `read` - (Defaults to 5 minutes) Used when retrieving the Resource Group.
Expand Down
2 changes: 1 addition & 1 deletion contributing/topics/guide-opening-a-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Firstly all contributions are welcome!

There is no change to small for us to accept and minor formatting, consistency and documentation PRs are very welcome! However, before making any large or structural changes it is recommended to seek feedback (preferably by reaching out in our community slack) to prevent wasted time and effort. We may already be working on a solution, or have a different direction we would like to take.
There is no change too small for us to accept and minor formatting, consistency and documentation PRs are very welcome! However, before making any large or structural changes it is recommended to seek feedback (preferably by reaching out in our community slack) to prevent wasted time and effort. We may already be working on a solution, or have a different direction we would like to take.

If you are ever unsure please just reach out, we are more than happy to guide you in the right direction!

Expand Down
2 changes: 1 addition & 1 deletion examples/app-service/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example provisions a Linux App Service which runs multiple Docker Container
### Notes

* The Container is launched on the first HTTP Request, which can take a while.
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/docs/configuration/resources.html#lifecycle), for example:
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes), for example:

```hcl
resource "azurerm_app_service" "test" {
Expand Down
2 changes: 1 addition & 1 deletion examples/app-service/docker-kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example provisions a Linux App Service which runs multiple Docker Container
### Notes

* The Container is launched on the first HTTP Request, which can take a while.
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/docs/configuration/resources.html#lifecycle), for example:
* If you're not using App Service Slots and Deployments are handled outside of Terraform - [it's possible to ignore changes to specific fields in the configuration using `ignore_changes` within Terraform's `lifecycle` block](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes), for example:

```hcl
resource "azurerm_app_service" "test" {
Expand Down
5 changes: 3 additions & 2 deletions internal/services/compute/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
"github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)
Expand All @@ -24,7 +25,7 @@ type Client struct {
GalleryImageVersionsClient *compute.GalleryImageVersionsClient
ImagesClient *compute.ImagesClient
MarketplaceAgreementsClient *marketplaceordering.MarketplaceAgreementsClient
ProximityPlacementGroupsClient *compute.ProximityPlacementGroupsClient
ProximityPlacementGroupsClient *proximityplacementgroups.ProximityPlacementGroupsClient
SSHPublicKeysClient *sshpublickeys.SshPublicKeysClient
SnapshotsClient *compute.SnapshotsClient
UsageClient *compute.UsageClient
Expand Down Expand Up @@ -84,7 +85,7 @@ func NewClient(o *common.ClientOptions) *Client {
marketplaceAgreementsClient := marketplaceordering.NewMarketplaceAgreementsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&marketplaceAgreementsClient.Client, o.ResourceManagerAuthorizer)

proximityPlacementGroupsClient := compute.NewProximityPlacementGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
proximityPlacementGroupsClient := proximityplacementgroups.NewProximityPlacementGroupsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&proximityPlacementGroupsClient.Client, o.ResourceManagerAuthorizer)

snapshotsClient := compute.NewSnapshotsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
Expand Down
3 changes: 2 additions & 1 deletion internal/services/compute/linux_virtual_machine_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
Expand Down Expand Up @@ -254,7 +255,7 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource {
"proximity_placement_group_id": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: computeValidate.ProximityPlacementGroupID,
ValidateFunc: proximityplacementgroups.ValidateProximityPlacementGroupID,
// the Compute/VM API is broken and returns the Resource Group name in UPPERCASE :shrug:
// tracked by https://github.com/Azure/azure-rest-api-specs/issues/19424
DiffSuppressFunc: suppress.CaseDifference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/zones"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
Expand Down Expand Up @@ -1058,7 +1059,8 @@ func resourceLinuxVirtualMachineScaleSetSchema() map[string]*pluginsdk.Schema {

"instances": {
Type: pluginsdk.TypeInt,
Required: true,
Optional: true,
Default: 0,
ValidateFunc: validation.IntAtLeast(0),
},

Expand Down Expand Up @@ -1203,7 +1205,7 @@ func resourceLinuxVirtualMachineScaleSetSchema() map[string]*pluginsdk.Schema {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validate.ProximityPlacementGroupID,
ValidateFunc: proximityplacementgroups.ValidateProximityPlacementGroupID,
// the Compute API is broken and returns the Resource Group name in UPPERCASE :shrug:, github issue: https://github.com/Azure/azure-rest-api-specs/issues/10016
DiffSuppressFunc: suppress.CaseDifference,
ConflictsWith: []string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ func TestAccLinuxVirtualMachineScaleSet_scalingCapacityReservationGroupId(t *tes
})
}

func TestAccLinuxVirtualMachineScaleSet_defaultInstanceCount(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine_scale_set", "test")
r := LinuxVirtualMachineScaleSetResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.defaultInstanceCount(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("admin_password"),
})
}

func TestAccLinuxVirtualMachineScaleSet_scalingInstanceCount(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine_scale_set", "test")
r := LinuxVirtualMachineScaleSetResource{}
Expand Down Expand Up @@ -436,6 +451,46 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" {
`, r.template(data), data.RandomInteger, instanceCount)
}

func (r LinuxVirtualMachineScaleSetResource) defaultInstanceCount(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_linux_virtual_machine_scale_set" "test" {
name = "acctestvmss-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku = "Standard_F2"
admin_username = "adminuser"
admin_password = "P@ssword1234!"
disable_password_authentication = false
source_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
os_disk {
storage_account_type = "Standard_LRS"
caching = "ReadWrite"
}
network_interface {
name = "example"
primary = true
ip_configuration {
name = "internal"
primary = true
subnet_id = azurerm_subnet.test.id
}
}
}
`, r.template(data), data.RandomInteger)
}

func (r LinuxVirtualMachineScaleSetResource) scalingInstanceCountIgnoreUpdatedSku(data acceptance.TestData, instanceCount int) string {
return fmt.Sprintf(`
%s
Expand Down
69 changes: 0 additions & 69 deletions internal/services/compute/parse/proximity_placement_group.go

This file was deleted.

112 changes: 0 additions & 112 deletions internal/services/compute/parse/proximity_placement_group_test.go

This file was deleted.

Loading

0 comments on commit 4afb2f0

Please sign in to comment.