Skip to content

Commit

Permalink
Merge branch 'master' into feature/aks-node-public-ip-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
aristosvo authored and Aris van Ommeren committed May 21, 2021
2 parents 72c8edf + b2ac2e3 commit a3ad4db
Show file tree
Hide file tree
Showing 399 changed files with 34,360 additions and 4,849 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Lock Threads'

on:
schedule:
- cron: '50 1 * * *'

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-comment: >
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
issue-lock-inactive-days: '30'
pr-lock-comment: >
I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
pr-lock-inactive-days: '30'
13 changes: 0 additions & 13 deletions .hashibot.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,3 @@ queued_behavior "release_commenter" "releases" {
```
EOF
}

poll "closed_issue_locker" "locker" {
schedule = "0 50 14 * * *"
closed_for = "720h" # 30 days
max_issues = 500
sleep_between_issues = "5s"

message = <<-EOF
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
EOF
}
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var services = mapOf(
"cognitive" to "Cognitive Services",
"communication" to "Communication",
"compute" to "Compute",
"consumption" to "Consumption",
"containers" to "Container Services",
"cosmos" to "CosmosDB",
"costmanagement" to "Cost Management",
Expand Down
396 changes: 396 additions & 0 deletions CHANGELOG-v2.md

Large diffs are not rendered by default.

390 changes: 24 additions & 366 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions azurerm/internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
cognitiveServices "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cognitive/client"
communication "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/communication/client"
compute "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/compute/client"
consumption "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/consumption/client"
containerServices "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/client"
cosmosdb "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos/client"
costmanagement "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/costmanagement/client"
Expand Down Expand Up @@ -123,6 +124,7 @@ type Client struct {
Cognitive *cognitiveServices.Client
Communication *communication.Client
Compute *compute.Client
Consumption *consumption.Client
Containers *containerServices.Client
Cosmos *cosmosdb.Client
CostManagement *costmanagement.Client
Expand Down Expand Up @@ -225,6 +227,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.Cognitive = cognitiveServices.NewClient(o)
client.Communication = communication.NewClient(o)
client.Compute = compute.NewClient(o)
client.Consumption = consumption.NewClient(o)
client.Containers = containerServices.NewClient(o)
client.Cosmos = cosmosdb.NewClient(o)
client.CostManagement = costmanagement.NewClient(o)
Expand Down
2 changes: 2 additions & 0 deletions azurerm/internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cognitive"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/communication"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/compute"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/consumption"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/costmanagement"
Expand Down Expand Up @@ -127,6 +128,7 @@ func SupportedUntypedServices() []sdk.UntypedServiceRegistration {
communication.Registration{},
compute.Registration{},
containers.Registration{},
consumption.Registration{},
cosmos.Registration{},
costmanagement.Registration{},
customproviders.Registration{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ resource "azurerm_key_vault" "test" {
"get",
"list",
"set",
"delete"
"delete",
"recover"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ resource "azurerm_key_vault" "test" {
"get",
"list",
"set",
"delete"
"delete",
"recover"
]
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/internal/services/bot/bot_healthbot_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func resourceHealthbotServiceRead(d *schema.ResourceData, meta interface{}) erro
}

if props := resp.Properties; props != nil {
d.Set("bot_management_portal_link", props.BotManagementPortalLink)
d.Set("bot_management_portal_url", props.BotManagementPortalLink)
}
return tags.FlattenAndSet(d, resp.Tags)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestAccLinuxVirtualMachine_networkPublicDynamicPrivateDynamicIP(t *testing.
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("private_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").IsEmpty(),
),
},
data.ImportStep(),
Expand All @@ -205,7 +205,7 @@ func TestAccLinuxVirtualMachine_networkPublicDynamicPrivateStaticIP(t *testing.T
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("private_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").IsEmpty(),
),
},
data.ImportStep(),
Expand All @@ -222,7 +222,7 @@ func TestAccLinuxVirtualMachine_networkPublicDynamicUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("private_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").IsEmpty(),
),
},
data.ImportStep(),
Expand All @@ -231,7 +231,7 @@ func TestAccLinuxVirtualMachine_networkPublicDynamicUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("private_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").Exists(),
check.That(data.ResourceName).Key("public_ip_address").IsEmpty(),
),
},
data.ImportStep(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ resource "azurerm_linux_virtual_machine" "test" {
name = "acctestVM-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
size = "Standard_DS3_V2"
size = "Standard_DS3_v2"
admin_username = "adminuser"
network_interface_ids = [
azurerm_network_interface.test.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ resource "azurerm_linux_virtual_machine" "test" {
name = "acctestVM-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
size = "Standard_D2S_V3"
size = "Standard_D2s_v3"
admin_username = "adminuser"
network_interface_ids = [
azurerm_network_interface.test.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" {
"azurerm_key_vault_access_policy.disk-encryption",
]
}
`, r.disksOSDisk_diskEncryptionSetDependencies(data), data.RandomInteger)
`, r.disksOSDisk_diskEncryptionSetResource(data), data.RandomInteger)
}

func (r LinuxVirtualMachineScaleSetResource) disksOSDiskEphemeral(data acceptance.TestData) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ func TestAccLinuxVirtualMachineScaleSet_imagesAutomaticUpdate(t *testing.T) {
})
}

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

data.ResourceTest(t, r, []resource.TestStep{
{
Config: r.imagesDisableAutomaticUpdate(data, "16.04-LTS"),
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(
"admin_password",
),
{
Config: r.imagesDisableAutomaticUpdate(data, "18.04-LTS"),
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(
"admin_password",
),
})
}

func TestAccLinuxVirtualMachineScaleSet_imagesFromCapturedVirtualMachineImage(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine_scale_set", "test")
r := LinuxVirtualMachineScaleSetResource{}
Expand Down Expand Up @@ -287,6 +313,59 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" {
`, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, version)
}

func (r LinuxVirtualMachineScaleSetResource) imagesDisableAutomaticUpdate(data acceptance.TestData, version string) 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"
instances = 1
admin_username = "adminuser"
admin_password = "P@ssword1234!"
upgrade_mode = "Automatic"
disable_password_authentication = false
source_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "%s"
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
}
}
automatic_os_upgrade_policy {
disable_automatic_rollback = false
enable_automatic_os_upgrade = false
}
rolling_upgrade_policy {
max_batch_instance_percent = 100
max_unhealthy_instance_percent = 100
max_unhealthy_upgraded_instance_percent = 100
pause_time_between_batches = "PT30S"
}
}
`, r.template(data), data.RandomInteger, version)
}

func (r LinuxVirtualMachineScaleSetResource) imagesFromVirtualMachinePrerequisites(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHost(t *testing.T) {
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
})
}

Expand All @@ -523,24 +522,21 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHostUpdate(t *testing.T
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
{
Config: r.otherEncryptionAtHost(data, false),
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
{
Config: r.otherEncryptionAtHost(data, true),
Check: resource.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
})
}

Expand All @@ -555,8 +551,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherEncryptionAtHostWithCMK(t *testing.
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
})
}

Expand All @@ -571,8 +566,7 @@ func TestAccLinuxVirtualMachineScaleSet_otherPlatformFaultDomainCount(t *testing
check.That(data.ResourceName).ExistsInAzure(r),
),
},
// TODO - extension should be changed to extension.0.protected_settings when either binary testing is available or this feature is promoted from beta
data.ImportStep("admin_password", "extension"),
data.ImportStep("admin_password", "extension.0.protected_settings"),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *schema.ResourceData, meta inte

hasHealthExtension := false
if vmExtensionsRaw, ok := d.GetOk("extension"); ok {
virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.([]interface{}))
virtualMachineProfile.ExtensionProfile, hasHealthExtension, err = expandVirtualMachineScaleSetExtensions(vmExtensionsRaw.(*schema.Set).List())
if err != nil {
return err
}
Expand All @@ -432,8 +432,10 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *schema.ResourceData, meta inte

// otherwise the service return the error:
// Automatic OS Upgrade is not supported for this Virtual Machine Scale Set because a health probe or health extension was not specified.
if upgradeMode == compute.Automatic && len(automaticOSUpgradePolicyRaw) > 0 && (healthProbeId == "" && !hasHealthExtension) {
return fmt.Errorf("`health_probe_id` must be set or a health extension must be specified when `upgrade_mode` is set to %q and `automatic_os_upgrade_policy` block exists", string(upgradeMode))
if upgradeMode == compute.Automatic && len(automaticOSUpgradePolicyRaw) > 0 {
if *automaticOSUpgradePolicy.EnableAutomaticOSUpgrade && (healthProbeId == "" && !hasHealthExtension) {
return fmt.Errorf("`health_probe_id` must be set or a health extension must be specified when `upgrade_mode` is set to %q and `automatic_os_upgrade_policy` block exists", string(upgradeMode))
}
}

// otherwise the service return the error:
Expand Down Expand Up @@ -822,7 +824,7 @@ func resourceLinuxVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta inte
if d.HasChanges("extension", "extensions_time_budget") {
updateInstances = true

extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").([]interface{}))
extensionProfile, _, err := expandVirtualMachineScaleSetExtensions(d.Get("extension").(*schema.Set).List())
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit a3ad4db

Please sign in to comment.