Commit Graph

4538 Commits

Author SHA1 Message Date
stack72 33233be247
provider/azurerm: Change of `azurerm_virtual_machine` computer_name now
ForceNew

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_ChangeComputerName'
==> 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_ChangeComputerName -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_ChangeComputerName
--- PASS: TestAccAzureRMVirtualMachine_ChangeComputerName (965.04s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
965.051s
```
2016-07-14 15:48:41 +01:00
Peter McAtominey 324e78020d provider/azurerm: fix tests removed in c141050929 (#7640)
The tests were removed due to a nil pointer panic in
testCheckAzureRMVirtualMachineOSDiskVHDExistance when the storage account itself
had been deleted in the destroy stage

Added a test to cover opting out of VHD delete rather than polluting the basic
linux VM test.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_deleteVHDOpt -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptOut
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptOut (731.54s)
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptIn
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptIn (590.87s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1322.529s
```

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_basicLinuxMachine -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
^[--- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (587.63s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	587.738s
```
2016-07-14 14:20:42 +01:00
stack72 c141050929
provider/azurerm: Remove tests for delete_on_termination 2016-07-14 08:33:30 +01:00
Peter McAtominey 37e3aa9d8c provider/azurerm: destroy azurerm_virtual_machine OS Disk VHD on deletion (#7584)
* provider/azurerm: destroy azurerm_virtual_machine OS Disk VHD on deletion

The OS Disk previously wasn't deleted with the VM, this causes subsequent
apply operations which recreate the VM to fail as the VHD blob already exists.

Fixes #6610

* provider/azurerm: add delete_os_disk_on_termination to azurerm_virtual_machine

delete_os_disk_on_termination is a bool which defaults to false to avoid making
a breaking change, and to follow the same flow as the Azure API
2016-07-13 23:52:20 +01:00
Raphael Randschau 9081cabd6e Add scaleway provider (#7331)
* Add scaleway provider

this PR allows the entire scaleway stack to be managed with terraform

example usage looks like this:

```
provider "scaleway" {
  api_key = "snap"
  organization = "snip"
}

resource "scaleway_ip" "base" {
  server = "${scaleway_server.base.id}"
}

resource "scaleway_server" "base" {
  name = "test"
  # ubuntu 14.04
  image = "aecaed73-51a5-4439-a127-6d8229847145"
  type = "C2S"
}

resource "scaleway_volume" "test" {
  name = "test"
  size_in_gb = 20
  type = "l_ssd"
}

resource "scaleway_volume_attachment" "test" {
  server = "${scaleway_server.base.id}"
  volume = "${scaleway_volume.test.id}"
}

resource "scaleway_security_group" "base" {
  name = "public"
  description = "public gateway"
}

resource "scaleway_security_group_rule" "http-ingress" {
  security_group = "${scaleway_security_group.base.id}"

  action = "accept"
  direction = "inbound"
  ip_range = "0.0.0.0/0"
  protocol = "TCP"
  port = 80
}

resource "scaleway_security_group_rule" "http-egress" {
  security_group = "${scaleway_security_group.base.id}"

  action = "accept"
  direction = "outbound"
  ip_range = "0.0.0.0/0"
  protocol = "TCP"
  port = 80
}
```

Note that volume attachments require the server to be stopped, which can lead to
downtimes of you attach new volumes to already used servers

* Update IP read to handle 404 gracefully

* Read back resource on update

* Ensure IP detachment works as expected

Sadly this is not part of the official scaleway api just yet

* Adjust detachIP helper

based on feedback from @QuentinPerez in
https://github.com/scaleway/scaleway-cli/pull/378

* Cleanup documentation

* Rename api_key to access_key

following @stack72 suggestion and rename the provider api_key for more clarity

* Make tests less chatty by using custom logger
2016-07-13 21:03:41 +01:00
Sander van Harmelen b05d5fb449 Merge pull request #7612 from svanharmelen/b-cloudstack-provider
provider/cloudstack: fix and improve several use cases
2016-07-13 20:35:31 +02:00
James Nugent 28438daeb4 provider/aws: Fix IDs in aws_iam_policy_document
We cannot use the "id" field to represent policy ID, because it is used
internally by Terraform. Also change the "id" field within a statement
to "sid" for consistency with the generated JSON.
2016-07-13 12:10:20 -06:00
James Nugent 788bff46e2 Merge pull request #7563 from hashicorp/b-ignore-changes-dependency
terraform: another set of ignore_changes fixes
2016-07-13 11:06:49 -06:00
James Nugent ecdc5065bf Merge pull request #7620 from hashicorp/import-arm-dnszone
provider/azurerm: Support Import for `azurerm_dns_zone`
2016-07-13 09:43:05 -06:00
James Nugent 1f136a73e6 Merge pull request #7621 from hashicorp/import-arm-sa
provider/azurerm: Support Import `azurerm_storage_account`
2016-07-13 09:42:47 -06:00
James Nugent 79d0c22360 Merge pull request #7624 from hashicorp/import-arm-vnet
provider/azurerm: Support Import of `azurerm_virtual_network`
2016-07-13 09:42:32 -06:00
James Nugent e506213cc8 Merge pull request #7625 from hashicorp/import-arm-sqlfirewall_rule
provider/azurerm: Support Import of `azurerm_sql_firewall_rule`
2016-07-13 09:42:12 -06:00
James Nugent 25c786898f Merge pull request #7626 from hashicorp/import-arm-lng
provider/azurerm: Support Import `azurerm_local_network_gateway`
2016-07-13 09:41:59 -06:00
James Nugent 9b3968aa14 Merge pull request #7627 from hashicorp/import-arm-nsg
provider/azurerm: Support Import of `azurerm_network_security_group`
2016-07-13 09:41:28 -06:00
Antoine Grondin 3d6fe76b52 provider/digitalocean: adds a volume resource (#7560)
* provider/digitalocean: add support for volumes

* provider/digitalocean: add documentation for volume resource
2016-07-13 15:36:37 +01:00
stack72 c0f14840f3
provider/azurerm: Support Import of `azurerm_network_security_group`
```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMNetworkSecurityGroup_'
==> 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=TestAccAzureRMNetworkSecurityGroup_ -timeout 120m
=== RUN   TestAccAzureRMNetworkSecurityGroup_importBasic
--- PASS: TestAccAzureRMNetworkSecurityGroup_importBasic (148.03s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_basic
--- PASS: TestAccAzureRMNetworkSecurityGroup_basic (143.72s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_withTags
--- PASS: TestAccAzureRMNetworkSecurityGroup_withTags (180.05s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_addingExtraRules
--- PASS: TestAccAzureRMNetworkSecurityGroup_addingExtraRules (236.28s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
708.099s
```
2016-07-13 13:42:50 +01:00
stack72 bab8032058
provider/azurerm: Support Import `azurerm_local_network_gateway`
```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMLocalNetworkGateway_'
==> 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=TestAccAzureRMLocalNetworkGateway_ -timeout 120m
=== RUN   TestAccAzureRMLocalNetworkGateway_importBasic
--- PASS: TestAccAzureRMLocalNetworkGateway_importBasic (137.98s)
=== RUN   TestAccAzureRMLocalNetworkGateway_basic
--- PASS: TestAccAzureRMLocalNetworkGateway_basic (128.17s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
266.169s
```
2016-07-13 13:14:59 +01:00
stack72 5cd908e748
provider/azurerm: Support Import of `azurerm_sql_firewall_rule`
```
% make testacc TEST=./builtin/providers/azurerm  TESTARGS='-run=TestAccAzureRMSqlFirewallRule_'
==> 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=TestAccAzureRMSqlFirewallRule_ -timeout 120m
=== RUN   TestAccAzureRMSqlFirewallRule_importBasic
--- PASS: TestAccAzureRMSqlFirewallRule_importBasic (146.88s)
=== RUN   TestAccAzureRMSqlFirewallRule_basic
--- PASS: TestAccAzureRMSqlFirewallRule_basic (154.34s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
301.231s
```
2016-07-13 12:53:24 +01:00
stack72 dc9dc74026
provider/azurerm: Support Import of `azurerm_virtual_network`
```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualNetwork_'
==> 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=TestAccAzureRMVirtualNetwork_ -timeout 120m
=== RUN   TestAccAzureRMVirtualNetwork_importBasic
--- PASS: TestAccAzureRMVirtualNetwork_importBasic (129.61s)
=== RUN   TestAccAzureRMVirtualNetwork_basic
--- PASS: TestAccAzureRMVirtualNetwork_basic (128.37s)
=== RUN   TestAccAzureRMVirtualNetwork_withTags
--- PASS: TestAccAzureRMVirtualNetwork_withTags (151.55s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
409.541s
```
2016-07-13 12:32:34 +01:00
stack72 ddf8cde450
provider/azurerm: Support Import `azurerm_storage_account`
Also included the randomizing of the storage account and resource group
names

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMStorageAccount_'
==> 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=TestAccAzureRMStorageAccount_ -timeout 120m
=== RUN   TestAccAzureRMStorageAccount_importBasic
--- PASS: TestAccAzureRMStorageAccount_importBasic (141.66s)
=== RUN   TestAccAzureRMStorageAccount_basic
--- PASS: TestAccAzureRMStorageAccount_basic (160.18s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
301.852s
```
2016-07-13 12:08:44 +01:00
stack72 b4051d0b98
provider/azurerm: Support Import for `azurerm_dns_zone`
```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMDnsZone_'
==> 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=TestAccAzureRMDnsZone_ -timeout 120m
=== RUN   TestAccAzureRMDnsZone_importBasic
--- PASS: TestAccAzureRMDnsZone_importBasic (88.68s)
=== RUN   TestAccAzureRMDnsZone_basic
--- PASS: TestAccAzureRMDnsZone_basic (93.18s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
181.874s
```
2016-07-13 11:43:05 +01:00
Clint 3cea29176f provider/aws: Safely get ELB values (#7585)
- removes dereferences to avoid nil crashes
2016-07-13 10:07:56 +01:00
dkalleg 72660750fd Setting admin_state_up default to true
This is to be inline with OpenStack defaulting admin_state_up to true.
2016-07-12 18:08:16 -07:00
Sander van Harmelen 28543694de Fix refresing an IP when it’s no longer associated 2016-07-12 21:32:56 +02:00
Justin Nauman 71532fff8b - Adding in additional retry logic due to latency with AWS delete (#7312) 2016-07-12 13:19:55 -06:00
Sander van Harmelen 29ce2df873 Fix refresing ACL rules when the ACL is deleted 2016-07-12 21:11:22 +02:00
Sander van Harmelen b55da4c3e7 Fix creating networks without specifying IP ranges 2016-07-12 21:11:22 +02:00
Sander van Harmelen bdb35006cd Fix several bugs in different resources
- Make sure attaching a disk or a NIC is tried a couple of times as this only works after the OS has fully booted;
- Stop using the device name instead of ID as the names differ depending on the hypervisor that you are using;
- VPC’s do not always have a source NAT IP;
2016-07-12 21:11:22 +02:00
Sander van Harmelen 9ddeb70312 Merge pull request #7074 from serbaut/user_data_update
provider/cloudstack: do not force a new resource when updating instance user_data
2016-07-12 21:08:11 +02:00
James Nugent 6cc47c3f5a Merge pull request #7587 from hashicorp/b-template-file-validate-strings
provider/template: validate vars are primitives
2016-07-12 11:35:31 -06:00
Radek Simko df40b91fb8 provider/aws: Allow importing iam_saml_provider (#7605) 2016-07-12 17:04:01 +01:00
Derek Abdine 7bdc060d24 provider/logentries: Implementing logentries provider (#7067)
* logentries provider

* logentries vendoring

* logentries docs
2016-07-12 14:14:39 +01:00
Paul Stack 4582cbeb5e provider/digitalocean: Add Test for DO Tag Import (#7602)
```
% make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanTag_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/digitalocean -v
-run=TestAccDigitalOceanTag_ -timeout 120m
=== RUN   TestAccDigitalOceanTag_importBasic
--- PASS: TestAccDigitalOceanTag_importBasic (2.42s)
=== RUN   TestAccDigitalOceanTag_Basic
--- PASS: TestAccDigitalOceanTag_Basic (1.72s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean
4.151s
```
2016-07-12 13:16:34 +01:00
Paul Stack 7a58ad95f5 provider/aws: Support Import for `aws_simpledb_domain` (#7601)
```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSimpleDBDomain_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSSimpleDBDomain_ -timeout 120m
=== RUN   TestAccAWSSimpleDBDomain_importBasic
--- PASS: TestAccAWSSimpleDBDomain_importBasic (19.59s)
=== RUN   TestAccAWSSimpleDBDomain_basic
--- PASS: TestAccAWSSimpleDBDomain_basic (19.93s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    39.535s
```
2016-07-12 13:15:47 +01:00
Martin Häger 32abd937f1 SimpleDB domain resource (#7600) 2016-07-12 12:55:58 +01:00
Joe Topjian 8b80d05103 provider/openstack: Support Import of OpenStack Block Storage Volumes (#7347) 2016-07-12 09:13:52 +01:00
Paul Stack 303ba86cf6 provider/aws: Allow `port` on `aws_db_instance` to be updated (#7441)
Fixes #2439

Port used to ForceNew, it has now been changed to allow it to be
updated. 2 changes were needed:

1. Setting the port back to state
2. Adding the wait for state function to the Update func

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_portUpdate'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBInstance_portUpdate -timeout 120m
=== RUN   TestAccAWSDBInstance_portUpdate
--- PASS: TestAccAWSDBInstance_portUpdate (699.84s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    699.861s
```
2016-07-12 09:07:25 +01:00
dkalleg 9cbdc80937 vSphere Provider - Fix destroy when vm is powered off or has networks (#7206)
This patch adds a wait when powering on a vm so setupVirtualMachine does
not return until the vm is actually powered on.  This allows other
functions to work off the assumption that the current state of the vm
is not in flux. During resourceVSphereVirtualMachineRead(), the wait for
IP would cause a hang for any VM with no network interfaces or for vms
that had been powered off for any reason.  This also means that the user
could not delete a vm with no network interfaces or that is powered off.
Checking power state before trying to check for network interfaces.
Resolves https://github.com/hashicorp/terraform/issues/7168
2016-07-12 09:05:02 +01:00
dkalleg 71c694cc5f Additional SCSI controller types support (#7525)
This allows the user to specify new controller types.  Before when
specifying 'scsi', govmomi defaults to lsilogic-parallel. This patch
allows the user to now specify 'scsi-lsi-parallel', 'scsi-buslogic',
scsi-paravirtual', and 'scsi-lsi-sas'. Resolves issue
https://github.com/hashicorp/terraform/issues/7202
2016-07-12 09:02:41 +01:00
Radek Simko 8fa75ea383 provider/aws: Allow import of KMS key (#7599) 2016-07-12 08:49:33 +01:00
Radek Simko 40e05ecc33 provider/aws: Allow import of glacier_vault (#7596) 2016-07-12 08:49:26 +01:00
Radek Simko d69256dcb4 Merge pull request #7594 from TimeIncOSS/f-aws-efs-mt
provider/aws: Allow import of efs_mount_target
2016-07-12 00:26:30 +01:00
Clint 8cb2a482a8 provider/triton: Update base packages in tests (#7593) 2016-07-11 17:23:09 -06:00
Radek Simko 86c1661205 provider/aws: Allow import of efs_mount_target 2016-07-12 00:18:13 +01:00
Radek Simko f5ef8f36c2 provider/aws: Allow import of efs_file_system 2016-07-12 00:02:47 +01:00
clint shryock edd67547bc remove debug statements 2016-07-11 15:12:15 -06:00
stack72 ceeab2ad12 provider/aws: Support Import for `aws_api_gateway_key`
Previously, the `stage_key` were not being set back to state in the Read
func. Changing this means the tests now run as follows:

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAPIGatewayApiKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSAPIGatewayApiKey_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayApiKey_importBasic
--- PASS: TestAccAWSAPIGatewayApiKey_importBasic (42.42s)
=== RUN   TestAccAWSAPIGatewayApiKey_basic
--- PASS: TestAccAWSAPIGatewayApiKey_basic (42.11s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    84.549s
```
2016-07-11 15:11:30 -06:00
Paul Hinze b7e854fa8b
provider/template: validate vars are primitives
Closes #7160 by returning a proper error.
2016-07-11 16:01:05 -05:00
Paul Stack ea4483d8b6 provider/aws: Support Import `aws_rds_cluster_instance` (#7522)
We were not setting all the values in the read Func. One other issue, we
were setting the *wrong* db_parameter_name value to state

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSClusterInstance_import'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRDSClusterInstance_import -timeout 120m
=== RUN   TestAccAWSRDSClusterInstance_importBasic
--- PASS: TestAccAWSRDSClusterInstance_importBasic (1201.80s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1201.814s
```
2016-07-11 14:59:14 -06:00
Paul Stack 38e3d3ba87 provider/aws: Support Import `aws_cloudfront_origin_access_identity` (#7506)
* provider/aws: Support Import `aws_cloudfront_origin_access_identity`

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudFrontOriginAccessIdentity_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudFrontOriginAccessIdentity_ -timeout 120m
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_importBasic
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_importBasic (17.07s)
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_basic
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_basic (15.34s)
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_noComment
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_noComment (16.29s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    48.717s
```

* Update import_aws_cloudfront_origin_access_identity_test.go
2016-07-11 14:58:25 -06:00