Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to v11 of the Azure SDK for Go #367

Merged
merged 52 commits into from
Oct 13, 2017
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9e23493
Upgrading to v11.0.0-beta of the Azure SDK for Go
tombuildsstuff Oct 3, 2017
5574354
Updating Container Registry to SDK v11
tombuildsstuff Oct 3, 2017
de2ce0e
Updating Container Service
tombuildsstuff Oct 3, 2017
d8b2e7e
Fixing EventHubs
tombuildsstuff Oct 3, 2017
54c3df9
Fixing EventHub Authorisation rules
tombuildsstuff Oct 3, 2017
b4a75d5
Fixing EventHub Consumer Groups
tombuildsstuff Oct 3, 2017
4e99093
Fixing EventHub Namespaces
tombuildsstuff Oct 3, 2017
b6784db
Fixing Image
tombuildsstuff Oct 3, 2017
7831773
Updating KeyVault to SDK11
tombuildsstuff Oct 3, 2017
2b95ec5
Upgrading PostgreSQL to SDK11
tombuildsstuff Oct 3, 2017
e0168a7
Fixing the build for the Search Service
tombuildsstuff Oct 3, 2017
bda9b5c
Migrating ServiceBus Namespaces over to SDK 11
tombuildsstuff Oct 3, 2017
f57571b
Updating Service Bus Queues to SDK 11
tombuildsstuff Oct 3, 2017
165bf8f
Updating ServiceBus Subscriptions to SDK 11
tombuildsstuff Oct 3, 2017
bb3c9bd
Upgrading ServiceBus Topic to SDK 11
tombuildsstuff Oct 3, 2017
1ff098c
Upgrading SQL Database to SDK 11
tombuildsstuff Oct 3, 2017
8fe8bde
Upgrading SQL Servers to SDK 11
tombuildsstuff Oct 3, 2017
38710c6
Upgrading Storage Accounts to SDK 11
tombuildsstuff Oct 3, 2017
4927d23
Fixing Traffic Manager Endpoints
tombuildsstuff Oct 3, 2017
d063763
Upgrading Traffic Manager Profiles to SDK 11
tombuildsstuff Oct 3, 2017
a169e1f
Missed some tests
tombuildsstuff Oct 3, 2017
f1d5119
Adding a State Migration for Key Vault
tombuildsstuff Oct 4, 2017
372f599
State Migrations for the Container Registry
tombuildsstuff Oct 4, 2017
7aff104
Fixing the container registry tests
tombuildsstuff Oct 5, 2017
2c8b834
Fixing the key vault tests
tombuildsstuff Oct 5, 2017
3b479ec
Fixing the SQL Server creation
tombuildsstuff Oct 5, 2017
ac7b13c
Fixing the traffic manager profile
tombuildsstuff Oct 5, 2017
d2df758
Ensuring we set the encryption source
tombuildsstuff Oct 5, 2017
49844b1
Fixing broken tests
tombuildsstuff Oct 5, 2017
4a74121
Upgrading the new container service test
tombuildsstuff Oct 5, 2017
43c07d8
Updating to v11.1.0-beta of the Azure SDK for Go
tombuildsstuff Oct 9, 2017
ec7b4d5
Upgrading the Authorization SDK
tombuildsstuff Oct 12, 2017
8767cb6
Updating to the new enum values
tombuildsstuff Oct 12, 2017
2fa56ba
Automation: Free SKU is no longer valid
tombuildsstuff Oct 12, 2017
0504282
Managed{Basic} -> Basic
tombuildsstuff Oct 12, 2017
1b95d30
Including the update permission
tombuildsstuff Oct 12, 2017
06a353e
Fixing the Container Registry import tests
tombuildsstuff Oct 12, 2017
1f82fd4
Fixing the key vault permissions
tombuildsstuff Oct 12, 2017
ffd5ab8
Ignoring a defaulted field
tombuildsstuff Oct 12, 2017
d9ccf90
Fixing a typo
tombuildsstuff Oct 12, 2017
868fab2
Capacity is now Premium only
tombuildsstuff Oct 12, 2017
0d302f3
Fixing the snapshot tests
tombuildsstuff Oct 12, 2017
b3c5f8c
`storage_account_id` can only be set for Classic SKU's
tombuildsstuff Oct 12, 2017
86bfe57
Fixing the Container Registry tests
tombuildsstuff Oct 12, 2017
705b89a
Removing the deprectated location field
tombuildsstuff Oct 12, 2017
b72beee
More cleanup
tombuildsstuff Oct 12, 2017
42621f5
Linting
tombuildsstuff Oct 12, 2017
3edd7bf
Fixing Container Registry
tombuildsstuff Oct 12, 2017
29bd56c
Specifying the capacity for a Premium SKU
tombuildsstuff Oct 13, 2017
2c3d1aa
Fixing the Route tests
tombuildsstuff Oct 13, 2017
b828255
Removing the Defaults from the Deprecated fields
tombuildsstuff Oct 13, 2017
671356b
Adding a state migration for Account Encryption Source
tombuildsstuff Oct 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions azurerm/data_source_snapshot_test.go
Original file line number Diff line number Diff line change
@@ -112,11 +112,15 @@ resource "azurerm_key_vault" "test" {
object_id = "${data.azurerm_client_config.current.service_principal_object_id}"

key_permissions = [
"all",
"create",
"delete",
"get"
]

secret_permissions = [
"all",
"delete",
"get",
"set",
]
}

8 changes: 4 additions & 4 deletions azurerm/import_arm_automation_account_test.go
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAzureRMAutomationAccount_importAccountWithFreeSku(t *testing.T) {
func TestAccAzureRMAutomationAccount_importBasic(t *testing.T) {
resourceName := "azurerm_automation_account.test"

ri := acctest.RandInt()
config := testAccAzureRMAutomationAccount_skuFree(ri, testLocation())
config := testAccAzureRMAutomationAccount_basic(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
@@ -31,11 +31,11 @@ func TestAccAzureRMAutomationAccount_importAccountWithFreeSku(t *testing.T) {
})
}

func TestAccAzureRMAutomationAccount_importAccountWithBasicSku(t *testing.T) {
func TestAccAzureRMAutomationAccount_importComplete(t *testing.T) {
resourceName := "azurerm_automation_account.test"

ri := acctest.RandInt()
config := testAccAzureRMAutomationAccount_skuBasic(ri, testLocation())
config := testAccAzureRMAutomationAccount_complete(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
79 changes: 77 additions & 2 deletions azurerm/import_arm_container_registry_test.go
Original file line number Diff line number Diff line change
@@ -7,12 +7,87 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAzureRMContainerRegistry_importBasic(t *testing.T) {
func TestAccAzureRMContainerRegistry_importBasicClassic(t *testing.T) {
resourceName := "azurerm_container_registry.test"

ri := acctest.RandInt()
rs := acctest.RandString(4)
config := testAccAzureRMContainerRegistry_basic(ri, rs, testLocation())
config := testAccAzureRMContainerRegistry_basicUnmanaged(ri, rs, testLocation(), "Classic")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
Steps: []resource.TestStep{
{
Config: config,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"storage_account"},
},
},
})
}

func TestAccAzureRMContainerRegistry_importBasicBasic(t *testing.T) {
resourceName := "azurerm_container_registry.test"

ri := acctest.RandInt()
config := testAccAzureRMContainerRegistry_basicManaged(ri, testLocation(), "Basic")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
Steps: []resource.TestStep{
{
Config: config,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"storage_account"},
},
},
})
}

func TestAccAzureRMContainerRegistry_importBasicManagedStandard(t *testing.T) {
resourceName := "azurerm_container_registry.test"

ri := acctest.RandInt()
config := testAccAzureRMContainerRegistry_basicManaged(ri, testLocation(), "Standard")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
Steps: []resource.TestStep{
{
Config: config,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"storage_account"},
},
},
})
}

func TestAccAzureRMContainerRegistry_importBasicManagedPremium(t *testing.T) {
resourceName := "azurerm_container_registry.test"

ri := acctest.RandInt()
config := testAccAzureRMContainerRegistry_basicManaged(ri, testLocation(), "Premium")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
1 change: 0 additions & 1 deletion azurerm/import_arm_storage_account_test.go
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ func TestAccAzureRMStorageAccount_importBasic(t *testing.T) {
{
Config: config,
},

{
ResourceName: resourceName,
ImportState: true,
20 changes: 13 additions & 7 deletions azurerm/provider_test.go
Original file line number Diff line number Diff line change
@@ -84,16 +84,14 @@ func testArmEnvironment() (*azure.Environment, error) {
return &env, nil
}

func TestAccAzureRMResourceProviderRegistration(t *testing.T) {
environment := testArmEnvironmentName()

func testGetAzureConfig(t *testing.T) *Config {
if os.Getenv(resource.TestEnvVar) == "" {
t.Skip(fmt.Sprintf(
"Integration test skipped unless env '%s' set",
resource.TestEnvVar))
return
t.Skip(fmt.Sprintf("Integration test skipped unless env '%s' set", resource.TestEnvVar))
return nil
}

environment := testArmEnvironmentName()

// we deliberately don't use the main config - since we care about
config := Config{
SubscriptionID: os.Getenv("ARM_SUBSCRIPTION_ID"),
@@ -103,6 +101,14 @@ func TestAccAzureRMResourceProviderRegistration(t *testing.T) {
Environment: environment,
SkipProviderRegistration: false,
}
return &config
}

func TestAccAzureRMResourceProviderRegistration(t *testing.T) {
config := testGetAzureConfig(t)
if config == nil {
return
}

armClient, err := config.getArmClient()
if err != nil {
5 changes: 3 additions & 2 deletions azurerm/resource_arm_automation_account.go
Original file line number Diff line number Diff line change
@@ -39,16 +39,17 @@ func resourceArmAutomationAccount() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Optional: true,
Default: string(automation.Basic),
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
ValidateFunc: validation.StringInSlice([]string{
string(automation.Free),
string(automation.Basic),
}, true),
},
},
},
},

"tags": tagsSchema(),
},
}
23 changes: 14 additions & 9 deletions azurerm/resource_arm_automation_account_test.go
Original file line number Diff line number Diff line change
@@ -10,10 +10,10 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func TestAccAzureRMAutomationAccount_skuBasic(t *testing.T) {
func TestAccAzureRMAutomationAccount_basic(t *testing.T) {
ri := acctest.RandInt()
resourceName := "azurerm_automation_account.test"
config := testAccAzureRMAutomationAccount_skuBasic(ri, testLocation())
config := testAccAzureRMAutomationAccount_basic(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
@@ -31,10 +31,10 @@ func TestAccAzureRMAutomationAccount_skuBasic(t *testing.T) {
})
}

func TestAccAzureRMAutomationAccount_skuFree(t *testing.T) {
func TestAccAzureRMAutomationAccount_complete(t *testing.T) {
ri := acctest.RandInt()
resourceName := "azurerm_automation_account.test"
config := testAccAzureRMAutomationAccount_skuFree(ri, testLocation())
config := testAccAzureRMAutomationAccount_complete(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
@@ -45,7 +45,8 @@ func TestAccAzureRMAutomationAccount_skuFree(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAutomationAccountExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "sku.0.name", "Free"),
resource.TestCheckResourceAttr(resourceName, "sku.0.name", "Basic"),
resource.TestCheckResourceAttr(resourceName, "tags.hello", "world"),
),
},
},
@@ -110,7 +111,7 @@ func testCheckAzureRMAutomationAccountExists(name string) resource.TestCheckFunc
}
}

func testAccAzureRMAutomationAccount_skuBasic(rInt int, location string) string {
func testAccAzureRMAutomationAccount_basic(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
@@ -122,13 +123,13 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Basic"
name = "Basic"
}
}
`, rInt, location, rInt)
}

func testAccAzureRMAutomationAccount_skuFree(rInt int, location string) string {
func testAccAzureRMAutomationAccount_complete(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
@@ -140,7 +141,11 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}

tags {
"hello" = "world"
}
}
`, rInt, location, rInt)
6 changes: 3 additions & 3 deletions azurerm/resource_arm_automation_credential_test.go
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}
}

@@ -153,12 +153,12 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}
}

resource "azurerm_automation_credential" "test" {
name = "acctest-%d"
name = "acctest-%d"
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_automation_account.test.name}"
username = "test_user"
6 changes: 3 additions & 3 deletions azurerm/resource_arm_automation_runbook_test.go
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}
}

@@ -158,7 +158,7 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}
}

@@ -173,7 +173,7 @@ resource "azurerm_automation_runbook" "test" {
description = "This is a test runbook for terraform acceptance test"
runbook_type = "PowerShellWorkflow"
publish_content_link {
uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"
uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"
version = "1.0.0.0"
hash {
algorithm = "SHA256"
8 changes: 4 additions & 4 deletions azurerm/resource_arm_automation_schedule_test.go
Original file line number Diff line number Diff line change
@@ -109,16 +109,16 @@ resource "azurerm_automation_account" "test" {
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
name = "Free"
name = "Basic"
}
}

resource "azurerm_automation_schedule" "test" {
name = "OneTimer-%d"
name = "OneTimer-%d"
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_automation_account.test.name}"
frequency = "OneTime"
timezone = "Central Europe Standard Time"
frequency = "OneTime"
timezone = "Central Europe Standard Time"
start_time = "%s"
description = "This is a test runbook for terraform acceptance test"
}
Loading