Commit Graph

285 Commits

Author SHA1 Message Date
Mitchell Hashimoto 990df480dc
providers/azurerm: convert to Stop() usage as example 2016-10-25 12:08:36 -07:00
Mitchell Hashimoto 60140b28f4
Revert "Merge pull request #9536 from hashicorp/f-provider-stop"
This reverts commit c3a4cff133, reversing
changes made to 791a02e6e4.

This change requires plugin recompilation and we should hold off until a
minor release for that.
2016-10-25 12:00:36 -07:00
Mitchell Hashimoto d7402d0473
providers/azurerm: don't leak the context cancellation function 2016-10-25 11:47:47 -07:00
Mitchell Hashimoto 86eb30b8a2
helper/schema: expose stop information as a Context 2016-10-25 11:32:30 -07:00
Mitchell Hashimoto 9089aa24d5
providers/azurerm: convert to Stop() usage as example 2016-10-25 11:32:17 -07:00
Jonathan Rudenberg d265a6fee3 provider/azurerm: Add disk_size_gb param to VM storage_os_disk (#9200)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_basicLinuxMachine -timeout 120m
    === RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
    --- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (540.83s)
    PASS
    ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	540.841s

    TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_withDataDisk -timeout 120m
    === RUN   TestAccAzureRMVirtualMachine_withDataDisk
    --- PASS: TestAccAzureRMVirtualMachine_withDataDisk (431.19s)
    PASS
    ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	431.203s
2016-10-25 17:54:55 +01:00
Peter McAtominey c199d1fde2 provider/azurerm: fix servicebus_topic updating values (#9323)
enable_partitioning set to ForceNew
requires_duplicate_detection set to ForceNew

max_size_in_megabytes would cause a loop if enable_partitioning was true as this
causes the value to be multiplied by 16 for it's effective value, this computed
value is then returned by the ARM API in the same field which caused Terraform
to always detect a change

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusTopic -timeout 120m
=== RUN   TestAccAzureRMServiceBusTopic_importBasic
--- PASS: TestAccAzureRMServiceBusTopic_importBasic (345.08s)
=== RUN   TestAccAzureRMServiceBusTopic_basic
--- PASS: TestAccAzureRMServiceBusTopic_basic (342.23s)
=== RUN   TestAccAzureRMServiceBusTopic_update
--- PASS: TestAccAzureRMServiceBusTopic_update (359.56s)
=== RUN   TestAccAzureRMServiceBusTopic_enablePartitioning
--- PASS: TestAccAzureRMServiceBusTopic_enablePartitioning (362.80s)
=== RUN   TestAccAzureRMServiceBusTopic_enableDuplicateDetection
--- PASS: TestAccAzureRMServiceBusTopic_enableDuplicateDetection (364.97s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1774.657s
```
2016-10-25 16:34:08 +01:00
Tom Harvey 59a81da74e provider/azurerm: Event Hub Namespaces (#9297)
Add support for EventHub NameSpaces
2016-10-25 15:50:07 +01:00
Paul Stack d485512d71 Merge pull request #9468 from wendorf/arm_loadbalancer_rule_naming_fix
Azure RM loadbalancer rules have correct naming restrictions
2016-10-25 15:12:26 +01:00
Paul Stack a24a068196 Merge pull request #8674 from enieuw/feature/arm_storage_file
provider/azurerm: Implement azurerm_storage_share
2016-10-25 14:16:46 +01:00
Paul Stack ecb467aa7d Merge pull request #9478 from BedeGaming/azurerm-keyvault
provider/azurerm: key_vault resource and client_config datasource
2016-10-25 13:35:29 +01:00
Peter McAtominey e7d64b28bd provider/azurerm: add key_vault resource
- vendor keyvault sdk package

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMKeyV -timeout 120m
=== RUN   TestAccAzureRMKeyVault_importBasic
--- PASS: TestAccAzureRMKeyVault_importBasic (89.01s)
=== RUN   TestAccAzureRMKeyVault_basic
--- PASS: TestAccAzureRMKeyVault_basic (83.36s)
=== RUN   TestAccAzureRMKeyVault_update
--- PASS: TestAccAzureRMKeyVault_update (102.83s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	275.285s
```
2016-10-25 13:01:45 +01:00
Paul Stack f7d4110b2d Merge pull request #9455 from BedeGaming/azurerm-lb-concurrency-fix
provider/azurerm: lock mutex in load_balancer resources
2016-10-24 14:29:29 +01:00
Paul Stack 3f16f3d4c9 Merge pull request #9207 from BedeGaming/azurerm-nic-hash
provider/azurerm: write load_balanacer attributes to network_interface_card hash
2016-10-24 14:26:20 +01:00
Paul Stack b35ab4de62 Merge pull request #9307 from BedeGaming/azurerm-tags-computed-fix
provider/azurerm: fix computed tags causing non-empty plan
2016-10-24 14:20:00 +01:00
Paul Stack 7ac85e9f6d Merge pull request #9408 from BedeGaming/azurerm-storage-account-tier
provider/azurerm: add account_kind and access_tier to storage_account
2016-10-24 14:15:34 +01:00
Peter McAtominey 6f72b2c36a provider/azurerm: lock mutex in load_balancer resources
This fixes races between sub resources causing inconsistent writes of the load
balancer resource

Fixes #9424

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMLoadBalancer -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerBackEndAddressPool_basic
--- PASS: TestAccAzureRMLoadBalancerBackEndAddressPool_basic (150.95s)
=== RUN   TestAccAzureRMLoadBalancerBackEndAddressPool_removal
--- PASS: TestAccAzureRMLoadBalancerBackEndAddressPool_removal (146.25s)
=== RUN   TestAccAzureRMLoadBalancerNatPool_basic
--- PASS: TestAccAzureRMLoadBalancerNatPool_basic (157.43s)
=== RUN   TestAccAzureRMLoadBalancerNatPool_removal
--- PASS: TestAccAzureRMLoadBalancerNatPool_removal (169.46s)
=== RUN   TestAccAzureRMLoadBalancerNatRule_basic
--- PASS: TestAccAzureRMLoadBalancerNatRule_basic (149.04s)
=== RUN   TestAccAzureRMLoadBalancerNatRule_removal
--- PASS: TestAccAzureRMLoadBalancerNatRule_removal (170.35s)
=== RUN   TestAccAzureRMLoadBalancerProbe_basic
--- PASS: TestAccAzureRMLoadBalancerProbe_basic (146.88s)
=== RUN   TestAccAzureRMLoadBalancerProbe_removal
--- PASS: TestAccAzureRMLoadBalancerProbe_removal (166.25s)
=== RUN   TestAccAzureRMLoadBalancerRule_basic
--- PASS: TestAccAzureRMLoadBalancerRule_basic (146.36s)
=== RUN   TestAccAzureRMLoadBalancerRule_removal
--- PASS: TestAccAzureRMLoadBalancerRule_removal (164.24s)
=== RUN   TestAccAzureRMLoadBalancerRule_inconsistentReads
--- PASS: TestAccAzureRMLoadBalancerRule_inconsistentReads (153.19s)
=== RUN   TestAccAzureRMLoadBalancer_basic
--- PASS: TestAccAzureRMLoadBalancer_basic (102.59s)
=== RUN   TestAccAzureRMLoadBalancer_frontEndConfig
--- PASS: TestAccAzureRMLoadBalancer_frontEndConfig (187.92s)
=== RUN   TestAccAzureRMLoadBalancer_tags
--- PASS: TestAccAzureRMLoadBalancer_tags (119.93s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	2130.930s
```
2016-10-20 14:59:01 +01:00
Peter McAtominey 6374cc7d33 provider/azurerm: add client_config data source
azurerm_client_config provides access to:

 - client_id
 - tenant_id
 - subscription_id

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMClientConfig -timeout 120m
=== RUN   TestAccAzureRMClientConfig_basic
--- PASS: TestAccAzureRMClientConfig_basic (27.79s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	27.862s
```
2016-10-20 11:29:48 +01:00
Dan Wendorf 957d1cb3a8 Azure RM loadbalancer rules have correct naming restrictions
- The name cannot be empty
- The name cannot be more than 80 characters
- The name must begin with a letter or number
- The name must end with a letter, number, or underscore
- The name must only contain letters, numbers, underscores, periods, or hyphens
2016-10-19 17:58:44 -07:00
James Nugent e2f3832769 provider/azurerm: Fix error message wording 2016-10-18 08:00:38 -05:00
Andreas Kyrris 182ebf3abb Use better variable naming. 2016-10-18 10:44:15 +01:00
Andreas Kyrris da12ed640a Checking for azure credentials isn't required.
The check for ARM_SUBSCRIPTION_ID breaks the PR testing. The PR
testing isn't trying to check acceptance tests anyway.
There will still be a correct failure for missing ARM_SUBSCRIPTION_ID
when running the acceptance test due to the later testAccPreCheck().
2016-10-18 09:26:36 +01:00
Andreas Kyrris 7b133ad356 Fix id of azurerm_lb_backend_address_pool, azurerm_lb_rule, azurerm_lb_nat_rule, azurerm_lb_nat_pool. 2016-10-18 08:48:25 +01:00
Andreas Kyrris 4a22fa0438 Use Probe's property to lookup loadbalancer_id. 2016-10-18 08:33:31 +01:00
Andreas Kyrris e63d120b57 Fix id of azurerm_lb_probe. 2016-10-18 08:33:31 +01:00
Andreas Kyrris a0ad874d25 Update test for azurerm_lb_nat_rule id. 2016-10-18 08:33:31 +01:00
Andreas Kyrris 4bf1985453 Update test for azurerm_lb_nat_pool id. 2016-10-18 08:33:31 +01:00
Andreas Kyrris f4980bf1b5 Update test for azurerm_lb_rule id. 2016-10-18 08:33:31 +01:00
Andreas Kyrris c1d4397673 Update test for azurerm_lb_probe id. 2016-10-18 08:33:31 +01:00
Andreas Kyrris 25794f6692 Update test for azurerm_lb_backend_address_pool id. 2016-10-18 08:33:31 +01:00
Peter McAtominey 89b49f809b provider/azurerm: add account_kind and access_tier to storage_account resource
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMStorageAccount -timeout 120m
=== RUN   TestAccAzureRMStorageAccount_importBasic
--- PASS: TestAccAzureRMStorageAccount_importBasic (140.06s)
=== RUN   TestAccAzureRMStorageAccount_basic
--- PASS: TestAccAzureRMStorageAccount_basic (155.43s)
=== RUN   TestAccAzureRMStorageAccount_disappears
--- PASS: TestAccAzureRMStorageAccount_disappears (134.99s)
=== RUN   TestAccAzureRMStorageAccount_blobEncryption
--- PASS: TestAccAzureRMStorageAccount_blobEncryption (161.59s)
=== RUN   TestAccAzureRMStorageAccount_blobStorageWithUpdate
--- PASS: TestAccAzureRMStorageAccount_blobStorageWithUpdate (131.49s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	723.694s
2016-10-17 17:49:07 +01:00
Eric Nieuwenhuijsen 3e651a7130 provider/azurerm: Implement azurerm_storage_share 2016-10-11 11:41:21 +02:00
James Nugent f1503d3b39 Merge pull request #9305 from BedeGaming/azurerm-lb-rule-validation
provider/azurerm: fix loadbanacer_rule tests failing validation
2016-10-10 22:42:56 -04:00
Peter McAtominey a07275df5e provider/azurerm: fix computed tags causing non-empty plan
The tag schema was changed in #9199, setting the Computed flag, this was causing
the plan to not be empty for resources which support tags but none were set, as
no value would be set by flattenAndSetTags.

Setting an empty map instead fixes the issue, ran original failing test and an
update tags test to ensure nothing else was broken.

Depends on #9305.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMCdnProfile -timeout 120m
=== RUN   TestAccAzureRMCdnProfile_importWithTags
--- PASS: TestAccAzureRMCdnProfile_importWithTags (171.64s)
=== RUN   TestAccAzureRMCdnProfile_basic
--- PASS: TestAccAzureRMCdnProfile_basic (162.70s)
=== RUN   TestAccAzureRMCdnProfile_withTags
--- PASS: TestAccAzureRMCdnProfile_withTags (203.12s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	537.538s
```
2016-10-10 14:19:20 +01:00
Peter McAtominey d60b9ab018 provider/azurerm: fix cdn_profile ID parsing, add import capability
cdn_profile resource was using `Profiles` instead of `profiles` to gather the
name in the read and delete methods, added importing capability with test to
confirm read now works as expected.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMCdnProfile -timeout 120m
=== RUN   TestAccAzureRMCdnProfile_importWithTags
--- PASS: TestAccAzureRMCdnProfile_importWithTags (170.00s)
=== RUN   TestAccAzureRMCdnProfile_basic
--- PASS: TestAccAzureRMCdnProfile_basic (166.33s)
=== RUN   TestAccAzureRMCdnProfile_withTags
--- PASS: TestAccAzureRMCdnProfile_withTags (185.94s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	522.333s
```
2016-10-10 14:03:48 +01:00
Peter McAtominey c4963dd66e provider/azurerm: fix loadbanacer_rule tests failing validation
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMLoadBalancerRule -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerRule_basic
--- PASS: TestAccAzureRMLoadBalancerRule_basic (149.43s)
=== RUN   TestAccAzureRMLoadBalancerRule_removal
--- PASS: TestAccAzureRMLoadBalancerRule_removal (165.38s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	314.894s
2016-10-10 10:16:16 +01:00
Paul Stack 89138fe22b Merge pull request #9122 from hashicorp/b-arm-vm-diagnostics
provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func
2016-10-07 19:42:15 +01:00
stack72 dcfdc6ab30
provider/azurerm: arm_virtual_machine diagnostics_profile was causing a
panic on the Read func

Fixes #8995

The Diagnostics profile was a badly laid out resource. All we needed to
set was whether it was enabled and the storage account to save the logs
to. The old schema parameter was deprecated and replaced with a much
simplier structure

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_diagnosticsProfile'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/29 12:21:04 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_diagnosticsProfile -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_diagnosticsProfile
--- PASS: TestAccAzureRMVirtualMachine_diagnosticsProfile (1066.76s)
PASS
ok
github.com/hashicorp/terraform/builtin/providers/azurerm1066.776s
```
2016-10-07 19:36:45 +01:00
Paul Stack a085c8d71e provider/azurerm: Add Load Balancer resources (#9199)
* provider/azurerm: Add AzureRM Loadbalancer resource

Adds support for the elusive Azure LoadBalancer

* [x] `azurerm_lb`
* [x] `azurerm_lb_backend_address_pool`
* [x] `azurerm_lb_rule`
* [x] `azurerm_lb_nat_rule`
* [x] `azurerm_lb_probe`
* [x] `azurerm_lb_nat_pool`

Test Results:

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMLoadbalancer'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMLoadbalancer -timeout 120m
=== RUN   TestAccAzureRMLoadbalancerBackEndAddressPool_basic
--- PASS: TestAccAzureRMLoadbalancerBackEndAddressPool_basic (207.26s)
=== RUN   TestAccAzureRMLoadbalancerBackEndAddressPool_removal
--- PASS: TestAccAzureRMLoadbalancerBackEndAddressPool_removal (165.89s)
=== RUN   TestAccAzureRMLoadbalancerNatRule_basic
--- PASS: TestAccAzureRMLoadbalancerNatRule_basic (179.30s)
=== RUN   TestAccAzureRMLoadbalancerNatRule_removal
--- PASS: TestAccAzureRMLoadbalancerNatRule_removal (180.73s)
=== RUN   TestAccAzureRMLoadbalancerRule_basic
--- PASS: TestAccAzureRMLoadbalancerRule_basic (170.40s)
=== RUN   TestAccAzureRMLoadbalancerRule_removal
--- PASS: TestAccAzureRMLoadbalancerRule_removal (204.23s)
=== RUN   TestAccAzureRMLoadbalancer_basic
--- PASS: TestAccAzureRMLoadbalancer_basic (136.03s)
=== RUN   TestAccAzureRMLoadbalancer_frontEndConfig
--- PASS: TestAccAzureRMLoadbalancer_frontEndConfig (214.47s)
=== RUN   TestAccAzureRMLoadbalancer_tags
--- PASS: TestAccAzureRMLoadbalancer_tags (215.52s)
=== RUN   TestAccAzureRMLoadbalancerProbe_basic
--- PASS: TestAccAzureRMLoadbalancerProbe_basic (183.36s)
=== RUN   TestAccAzureRMLoadbalancerProbe_removal
--- PASS: TestAccAzureRMLoadbalancerProbe_removal (185.86s)
=== RUN   TestAccAzureRMLoadbalancerNatPool_basic
--- PASS: TestAccAzureRMLoadbalancerNatPool_basic (161.47s)
=== RUN   TestAccAzureRMLoadbalancerNatPool_removal
--- PASS: TestAccAzureRMLoadbalancerNatPool_removal (167.38s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
1673.852s
```

* provider/azurerm: Documentation for the ARM LB resources
2016-10-07 14:14:26 -04:00
Paul Stack 4ac7d0a6bb Merge pull request #8103 from BedeGaming/validation-helper
helper: create validation package to provide common validation functions
2016-10-07 13:42:29 +01:00
Paul Stack 250be11fdd Merge pull request #9073 from carinadigital/GH-9072
provider/azurerm: set resource_group_name on resource import
2016-10-07 13:29:08 +01:00
Peter McAtominey 0cb6e7df8b provider/azurerm: add enable_blob_encryption to storage_account resource
This allows Storage Service Encryption to be enabled.

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMStorageAccount -timeout 120m
=== RUN   TestAccAzureRMStorageAccount_importBasic
--- PASS: TestAccAzureRMStorageAccount_importBasic (139.00s)
=== RUN   TestAccAzureRMStorageAccount_basic
--- PASS: TestAccAzureRMStorageAccount_basic (151.03s)
=== RUN   TestAccAzureRMStorageAccount_blobEncryption
--- PASS: TestAccAzureRMStorageAccount_blobEncryption (149.94s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	440.051s
2016-10-06 22:50:02 +01:00
Paul Stack 97ad032474 Merge pull request #8859 from carinadigital/arm-vm-fix
provider/azurerm: Terraform Plan errors when created resources disappear
2016-10-06 22:38:30 +01:00
Paul Stack e012c4fcc5 Merge pull request #9242 from BedeGaming/azurerm-sb-namespace-keys
provider/azurerm: expose default keys for servicebus_namespace
2016-10-06 21:53:23 +01:00
Peter McAtominey f733d6aa8a provider/azurerm: expose default keys for servicebus_namespace
A default authorization rule is created by Azure which, if present is exported by
the resource.

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusNamespace -timeout 120m
=== RUN   TestAccAzureRMServiceBusNamespaceCapacity_validation
--- PASS: TestAccAzureRMServiceBusNamespaceCapacity_validation (0.00s)
=== RUN   TestAccAzureRMServiceBusNamespaceSku_validation
--- PASS: TestAccAzureRMServiceBusNamespaceSku_validation (0.00s)
=== RUN   TestAccAzureRMServiceBusNamespace_basic
--- PASS: TestAccAzureRMServiceBusNamespace_basic (352.03s)
=== RUN   TestAccAzureRMServiceBusNamespace_readDefaultKeys
--- PASS: TestAccAzureRMServiceBusNamespace_readDefaultKeys (349.17s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	701.278s
2016-10-05 22:12:28 +01:00
stack72 9089b415d4
provider/azurerm: Support AzureRM Sql Database DataWarehouse
Fixes #9194

Removes the validation for the types and adds an acceptance test to make
sure we get a successful Sql Database created

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMSqlDatabase_datawarehouse'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/03 21:57:16 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMSqlDatabase_datawarehouse -timeout 120m
=== RUN   TestAccAzureRMSqlDatabase_datawarehouse
--- PASS: TestAccAzureRMSqlDatabase_datawarehouse (307.95s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm307.963s
```
2016-10-04 14:38:51 +01:00
Peter McAtominey 86b984a68d provider/azurerm: write load_balanacer attributes to network_interface_card hash
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMNetworkInterface -timeout 120m
=== RUN   TestAccAzureRMNetworkInterface_basic
--- PASS: TestAccAzureRMNetworkInterface_basic (197.24s)
=== RUN   TestAccAzureRMNetworkInterface_enableIPForwarding
--- PASS: TestAccAzureRMNetworkInterface_enableIPForwarding (188.65s)
=== RUN   TestAccAzureRMNetworkInterface_withTags
--- PASS: TestAccAzureRMNetworkInterface_withTags (226.13s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	612.088s
2016-10-04 14:36:43 +01:00
Paul Stack 3c63c80b86 Merge pull request #9185 from BedeGaming/azurerm-servicebus-sub
provider/azurerm: add servicebus_subscription resource
2016-10-03 17:35:31 +01:00
Paul Stack 122a985767 Merge pull request #9163 from BedeGaming/azurerm-resource-id-fix
provider/azurerm: fix resource ID parsing for subscriptions resources
2016-10-03 17:07:36 +01:00
Andreas Kyrris 409ec88157 Fix failing acceptance tests by using case insensitive diff function.
Some resource fail due to resource_group_name always being stored as
lowercase. For those resources we add the case insensitive diff
function.
2016-10-03 15:46:34 +01:00
Andreas Kyrris da2bb09a32 Update tests to include capitalisation of resource group names.
Some azurerm resources store resource_group_name in lowercase only.
Other store resource_group_name using lower and upper case.
Ensure that all test cases use capitalisation in resource_group_name
to find errors in diffs due to capitalisation.

Some resource_group_name were refactored to match naming scheme
across the azurerm tests.
2016-10-03 15:46:34 +01:00
Andreas Kyrris b2f85a766c Fix import of resource group name for azurerm_sql_firewall_rule. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 48055158b6 Fix import of resource group name for azurerm_local_network_gateway. 2016-10-03 15:46:34 +01:00
Andreas Kyrris d7c0050e18 Fix import of resource group name for azurerm_availability_set. 2016-10-03 15:46:34 +01:00
Andreas Kyrris bc3be270f1 Fix import of resource group name for azurerm_traffic_manager_profile. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 0394a4e072 Fix import of resource group name for azurerm_traffic_manager_endpoint. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 9998adb6ad Fix import of resource group name for azurerm_network_security_group_rule. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 8c678121e6 Fix import of resource group name for azurerm_network_security_group. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 3a047c06ba Fix import of resource group name for azurerm_virtual_network_peering. 2016-10-03 15:46:34 +01:00
Andreas Kyrris e60d5dd260 Fix import of resource group name for azurerm_virtual_network. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 9916e6b2f2 Fix import of resource group name for azurerm_dns_zone. 2016-10-03 15:46:34 +01:00
Andreas Kyrris 82cc9d3e56 Supress diffs for differences in resource_group_name capitalisation. 2016-10-03 15:46:34 +01:00
Andreas Kyrris e589fee01c Set resource_group_name when reading from API. 2016-10-03 15:46:34 +01:00
Andreas Kyrris e55852888a Check state of resource_group_name on import. 2016-10-03 15:46:34 +01:00
Peter McAtominey 475fd4decb provider/azurerm: add servicebus_subscription resource
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusSubscription -timeout 120m
=== RUN   TestAccAzureRMServiceBusSubscription_importBasic
--- PASS: TestAccAzureRMServiceBusSubscription_importBasic (339.00s)
=== RUN   TestAccAzureRMServiceBusSubscription_basic
--- PASS: TestAccAzureRMServiceBusSubscription_basic (328.47s)
=== RUN   TestAccAzureRMServiceBusSubscription_update
--- PASS: TestAccAzureRMServiceBusSubscription_update (368.95s)
=== RUN   TestAccAzureRMServiceBusSubscription_updateRequiresSession
--- PASS: TestAccAzureRMServiceBusSubscription_updateRequiresSession (348.47s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1384.966s
2016-10-03 15:27:28 +01:00
Peter McAtominey cdbf0d7df4 provider/azurerm: add servicebus_topic resource
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusTopic -timeout 120m
=== RUN   TestAccAzureRMServiceBusTopic_importBasic
--- PASS: TestAccAzureRMServiceBusTopic_importBasic (328.72s)
=== RUN   TestAccAzureRMServiceBusTopic_basic
--- PASS: TestAccAzureRMServiceBusTopic_basic (331.04s)
=== RUN   TestAccAzureRMServiceBusTopic_update
--- PASS: TestAccAzureRMServiceBusTopic_update (348.69s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1008.588s
2016-10-03 11:25:50 +01:00
Andreas Kyrris e5219ba56d Fixes behaviour when azurerm resources disappear.
Regressions were introduced when fixing
https://github.com/hashicorp/terraform/pull/8607 . Specifically when
resources in the statefile are deleted or missing in real life, then
terraform plan would exit with an error when it recieved a 404 not
found. The correct behaviour would be to show a plan with the offer to
create the missing resources.
2016-10-03 10:10:10 +01:00
Andreas Kyrris 00c0c75b16 Add tests to azurerm resources for cases where created resources
disappear.
2016-10-03 10:10:10 +01:00
Peter McAtominey 70d5914e1b provider/azurerm: fix resource ID parsing for subscriptions resources
If a resource ID has more than one subscriptions key, as is the case for Service
Bus subscriptions the Azure SubscriptionID field was overwritten by the second
value.

TF_ACC= go test ./builtin/providers/azurerm -run TestParseAzureResourceID -timeout=30s -parallel=4
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	0.060s
2016-10-01 17:47:19 +01:00
Peter McAtominey 9fb9b67381 provider/azurerm: update Azure SDK
Based off master v4
2016-09-22 10:15:57 +01:00
Krzysztof Wilczynski e999ae77ba
Add normalizeJsonString and validateJsonString functions.
This commit adds ValidateFunc to the policy attribute so that JSON parsing
errors can be caught early. Generally, when there is a ValidateFunc set for the
attribute, one can safely assume that before any of the creation and/or update
of the existing resource would happen it would have to succeed validation. Also
adds support for new helper function which is used to normalise JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:34:50 +01:00
Krzysztof Wilczynski 1eed5ddbe0 Fix. Correct a typo in the error message. (#8882)
This comment corrects a simple typo in the error message issued when the
credentials are not working and/or do not offer access to AzureRM, etc.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-16 16:09:20 +01:00
stack72 0fe822e822
provider/azurerm: Removing the diagnostics part of the test from the azurerm virtual machine unattended acceptance test 2016-09-12 17:52:54 +01:00
stack72 971b08f320
Merge conflict resolution of virtual_machine.html.markdown in AzureRM 2016-09-12 11:13:24 +01:00
Paul Hinze 0db012fcf1
provider/azurerm: Remove editorialization from comment 2016-09-05 15:03:58 -05:00
stack72 392f634ff4
provider/azurerm: Reordering the checks after an Azure API Get
We are receiving suggestions of a panic as follows:

```
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic: runtime error: invalid memory address or nil pointer dereference
2016/09/01 07:21:55 [DEBUG] plugin: terraform: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa3170f]
2016/09/01 07:21:55 [DEBUG] plugin: terraform:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: goroutine 114 [running]:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic(0x27f4e60, 0xc4200100e0)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: 	/opt/go/src/runtime/panic.go:500 +0x1a1
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc4206d8060, 0x2995620, 0xc4204d0000, 0x0, 0x17)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: 	/opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:488 +0x1ff
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc420017a40, 0xc42040c780, 0x2995620, 0xc4204d0000, 0xc42019c990, 0x1, 0x0)
```

This is because the code is as follows:

```
resp, err := client.Get(resGroup, vnetName, name)
if resp.StatusCode == http.StatusNotFound {
	d.SetId("")
	return nil
}
if err != nil {
	return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
```

When a request throws an error, the response object isn't valid. Therefore, we need to flip that code to check the error first

```
resp, err := client.Get(resGroup, vnetName, name)
if err != nil {
	return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
if resp.StatusCode == http.StatusNotFound {
	d.SetId("")
	return nil
}
```
2016-09-01 15:31:42 +01:00
James Nugent c853eb5525 Update CHANGELOG.md 2016-08-23 14:38:48 +02:00
Jeff Goldschrafe 08f2e6797b provider/azurerm: support Diagnostics Profile
Add support for a diagnostics profile, which allows boot diagnostics to
be enabled on a virtual machine.
2016-08-18 23:46:47 -04:00
Kristinn Örn Sigurðsson 7f096a677f provider/azurerm: Public IP - Setting idle timeout value caused panic. (#8283)
Setting the idle_timeout_in_minutes value of the azurerm_public_ip
resource always caused a panic.

This fixes it and adds a test to actually test that particular
attribute.
2016-08-18 14:05:14 +01:00
Mitchell Hashimoto 31dbddbfdc
providers/azurerm: more reliable testing of ID being available for
storage account
2016-08-16 09:49:54 -07:00
Mitchell Hashimoto ecad167e31
providers/azurerm: address PR feedback 2016-08-16 09:42:05 -07:00
Mitchell Hashimoto 284725fa94
providers/azurerm: timeout storage account for an hour 2016-08-16 09:26:33 -07:00
Mitchell Hashimoto ccb972ae50
providers/azurerm: attempt to read storage account ID if cancelled 2016-08-16 09:18:00 -07:00
Mitchell Hashimoto 8dafcb36fd
providers/azurerm: cancellable storage account creation 2016-08-15 21:12:32 -07:00
Andy Royle e18b1962a9 provider/azurerm: Add support for servicebus namespaces (#8195)
* add dep for servicebus client from azure-sdk-for-node

* add servicebus namespaces support

* add docs for servicebus_namespaces

* add Microsoft.ServiceBus to providers list
2016-08-15 18:00:00 +01:00
Dave Walter ec42a98cb2 Azure blob contents can be copied from an existing blob (#8126)
- adds "source_uri" field

- "source_uri" expects the URI to an existing blob that you have access
  to
- it can be in a different storage account, or in the Azure File service

- the docs have been updated to reflect the change

Signed-off-by: Dan Wendorf <dwendorf@pivotal.io>
2016-08-14 11:14:41 +01:00
Peter McAtominey e67f141561 provider/azurerm: create virtual_network_peering resource (#8168)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualNetworkPeering -timeout 120m
=== RUN   TestAccAzureRMVirtualNetworkPeering_importBasic
--- PASS: TestAccAzureRMVirtualNetworkPeering_importBasic (225.50s)
=== RUN   TestAccAzureRMVirtualNetworkPeering_basic
--- PASS: TestAccAzureRMVirtualNetworkPeering_basic (216.95s)
=== RUN   TestAccAzureRMVirtualNetworkPeering_update
--- PASS: TestAccAzureRMVirtualNetworkPeering_update (266.97s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	709.545s
2016-08-13 22:37:46 +04:00
Peter McAtominey d7285d1b14 provider/azurerm: fix; add tests for importing traffic manager resources (#8111)
* provider/azurerm: add test for importing traffic manager profile resource

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTrafficManagerProfile_import -timeout 120m
=== RUN   TestAccAzureRMTrafficManagerProfile_importBasic
--- PASS: TestAccAzureRMTrafficManagerProfile_importBasic (84.50s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	84.722s

* provider/azurerm: fix; add test for importing traffic_manager_endpoint resource

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTrafficManagerEndpoint -timeout 120m
=== RUN   TestAccAzureRMTrafficManagerEndpoint_importBasic
--- PASS: TestAccAzureRMTrafficManagerEndpoint_importBasic (130.66s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basic
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basic (152.87s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal (151.55s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updateWeight
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updateWeight (199.33s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updatePriority
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updatePriority (113.15s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints
--- PASS: TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints (97.05s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	844.740s
2016-08-11 16:00:23 +12:00
Peter McAtominey 012fd9825f provider/azurerm: refactor traffic_manager_ resources to use validation helpers
Updated:
	traffic_manager_profile
	traffic_manager_endpoint
2016-08-10 14:48:20 +01:00
Ryan Moran 85b551a934 Adds support for uploading blobs to azure storage from local source
- adds "source", "parallelism", and "attempts" fields
- supports both block and page type blobs
- uploads run concurrently
- page blobs skip empty byte ranges to efficiently upload large sparse
  files

- "source" expects an absolute path to a file on the local file
  system
- "parallelism" expects an integer value that indicates the number of
  workers per CPU core to run for concurrent uploads
- "attempts" expects an integer value for number of attempts to make per
  page or block when uploading

Signed-off-by: Raina Masand <rmasand@pivotal.io>
2016-08-04 16:08:30 -07:00
Peter McAtominey cc18e4d7ca provider/azurerm: add traffic manager resources (#7826)
* provider/azurerm: vendor arm/trafficmanager package

* provider/azurerm: add azurerm_traffic_manager_profile resource

* provider/azurerm: add azurerm_traffic_manager_endpoint resource

* provider/azurerm: document traffic manager resources

* provider/azurerm: use short type argument for traffic manager endpoint

The resource now takes the short type for example azureEndpoints instead of the
long form Microsoft.Network/TrafficManagerProfiles/azureEndpoints.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTrafficManagerEndpoint -timeout 120m
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basic
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basic (179.72s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal (171.36s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updateWeight
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updateWeight (167.24s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updatePriority
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updatePriority (192.91s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints
--- PASS: TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints (111.18s)
PASS
ok   github.com/hashicorp/terraform/builtin/providers/azurerm    822.534s
```

* provider/azurerm: remove unnecesary dereferences in traffic manager resources

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTrafficManager -timeout 120m
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basic
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basic (176.08s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal
--- PASS: TestAccAzureRMTrafficManagerEndpoint_basicDisableExternal (172.28s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updateWeight
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updateWeight (148.97s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_updatePriority
--- PASS: TestAccAzureRMTrafficManagerEndpoint_updatePriority (101.18s)
=== RUN   TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints
--- PASS: TestAccAzureRMTrafficManagerEndpoint_nestedEndpoints (88.33s)
=== RUN   TestAccAzureRMTrafficManagerProfile_weighted
--- PASS: TestAccAzureRMTrafficManagerProfile_weighted (80.92s)
=== RUN   TestAccAzureRMTrafficManagerProfile_performance
--- PASS: TestAccAzureRMTrafficManagerProfile_performance (82.98s)
=== RUN   TestAccAzureRMTrafficManagerProfile_priority
--- PASS: TestAccAzureRMTrafficManagerProfile_priority (81.07s)
=== RUN   TestAccAzureRMTrafficManagerProfile_withTags
--- PASS: TestAccAzureRMTrafficManagerProfile_withTags (102.50s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1034.458s
```
2016-07-31 23:46:15 +01:00
Paul Stack c3ec9c7948 provider/azurerm: `azurerm_storage_blob` validation fix (#7328)
The validation for the `azurerm_storage_blob` `type` parameter was
checking for `blob` where it should have been `block`

This commits fixes it up

```
make testacc TEST=./builtin/providers/azurerm
TESTARGS='-run=TestResourceAzureRMStorageBlobType_validation'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestResourceAzureRMStorageBlobType_validation -timeout 120m
=== RUN   TestResourceAzureRMStorageBlobType_validation
--- PASS: TestResourceAzureRMStorageBlobType_validation (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
0.014s
```
2016-07-28 13:32:40 +01:00
Paul Stack 630de403ce provider/azurerm: Wait for `azurerm_storage_account` to be available (#7329)
Fixes #7005 where a container tried to provision *before* the storage
account was available. We now wait for the Storage Account to be in the
`Succeeded` state before returning

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMStorageAccount_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMStorageAccount_ -timeout 120m
=== RUN   TestAccAzureRMStorageAccount_basic
--- PASS: TestAccAzureRMStorageAccount_basic (163.68s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
163.695s
```
2016-07-27 22:57:02 +01:00
Paul Stack 61c5c9f56b provider/azurerm: `azurerm_storage_table` resource (#7327)
* provider/azurerm: `azurerm_storage_table` resource

Fixes #7257

``````

* Update resource_arm_storage_table.go

* Update resource_arm_storage_table.go
2016-07-27 22:49:43 +01:00
Paul Stack 390e1acb3c provider/azurerm: Change of `availability_set_id` on (#7650)
`azurerm_virtual_machine` should ForceNew

Fixes #6873

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_ChangeAvailbilitySet'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_ChangeAvailbilitySet -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_ChangeAvailbilitySet
--- PASS: TestAccAzureRMVirtualMachine_ChangeAvailbilitySet (976.35s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
976.367s
```
2016-07-27 22:39:03 +01:00
Peter McAtominey 1c13cc994b provider/azurerm: add option to delete VMs Data disks on termination (#7793)
```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_deleteVHD -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptOut
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptOut (621.84s)
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptIn
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptIn (623.95s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1245.930s
```
2016-07-25 17:57:02 +01:00
James Bardin f66d1a10a4 Add VersionString
We conditionally format version with VersionPrerelease in a number of
places. Add a package-level function where we can unify the version
format. Replace most of version formatting in terraform, but leave th
few instances set from the top-level package to make sure we don't break
anything before release.
2016-07-21 16:43:49 -04:00
Paul Stack af4cc20ec0 provider/azurerm: `azurerm_virtual_machine` computer_name now Required (#7308)
Fixes #7299 where it was found that computer_name is not optional (as
the msdn documentation states)

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_ -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
--- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (403.53s)
=== RUN   TestAccAzureRMVirtualMachine_tags
--- PASS: TestAccAzureRMVirtualMachine_tags (488.46s)
=== RUN   TestAccAzureRMVirtualMachine_updateMachineSize
--- PASS: TestAccAzureRMVirtualMachine_updateMachineSize (601.82s)
=== RUN   TestAccAzureRMVirtualMachine_basicWindowsMachine
--- PASS: TestAccAzureRMVirtualMachine_basicWindowsMachine (646.75s)
=== RUN   TestAccAzureRMVirtualMachine_windowsUnattendedConfig
--- PASS: TestAccAzureRMVirtualMachine_windowsUnattendedConfig (891.42s)
=== RUN   TestAccAzureRMVirtualMachine_winRMConfig
--- PASS: TestAccAzureRMVirtualMachine_winRMConfig (768.73s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	3800.734s
```
2016-07-20 20:03:54 +01:00
Peter McAtominey c9138daacc provider/azurerm: dump entire Request/Response in autorest Decorator (#7719) 2016-07-20 20:02:40 +01:00
Steven Eschinger 9c095d66e1 azurerm: fix vault_certificates in vm/scale_set (#7681)
When setting the certificate_url and certificate_store values in
os_profile_secrets / vault_certificates for a Windows VM in AzureRM, I
was getting the following error:

```
[DEBUG] Error setting Virtual Machine Storage OS Profile Secrets:
&errors.errorString{s:"Invalid address to set:
[]string{\"os_profile_secrets\", \"0\", \"vault_certificates\"}"}
```

This seems to resolve the issue.
2016-07-18 10:20:18 +01:00