Commit Graph

5640 Commits

Author SHA1 Message Date
Paul Stack 3472cab7d6 provider/aws: Fix panic in aws_acm_certificate datasource (#10051)
Fixes #10042
Fixes #9989

Another panic was found with this resource. IT essentially was causing a
panic when no certificates were found. This was due to the casting of
status to []string

There are times when there are no statuses passed in. Made the error
message a lot more generic now rather than having something like this

```

No certificate with statuses [] for domain mytestdomain.com found in this region.
```

This now becomes:

```
No certificate for domain mytestdomain.com found in this region.
```

Also, added a test to show that the panic is gone

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAwsAcmCertificateDataSource_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/11 15:11:33 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAwsAcmCertificateDataSource_ -timeout 120m
=== RUN   TestAccAwsAcmCertificateDataSource_noMatchReturnsError
--- PASS: TestAccAwsAcmCertificateDataSource_noMatchReturnsError (6.07s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws6.094s
```
2016-11-11 16:07:50 +02:00
Andreas Skarmutsos Lindh 5e32c144d5
Ignore AWS specific tags
Allows us to adopt resources created with CloudFormation.

Extend AWS specific tag ignoring to all tags*

Ignore AWS specific tags for autoscaling
2016-11-11 15:40:09 +02:00
Peter McAtominey 4996f3e289 provider/azurerm: allow updating load balancer sub-resources (#10016)
* provider/azurerm: allow updating of lb_rule resource

* check if rule is being updated rather than assuming created
* added test to cover guard against multiple rules with the same name

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMLoadBalancerRule_" -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerRule_basic
--- PASS: TestAccAzureRMLoadBalancerRule_basic (157.45s)
=== RUN   TestAccAzureRMLoadBalancerRule_removal
--- PASS: TestAccAzureRMLoadBalancerRule_removal (163.67s)
=== RUN   TestAccAzureRMLoadBalancerRule_inconsistentReads
--- PASS: TestAccAzureRMLoadBalancerRule_inconsistentReads (150.00s)
=== RUN   TestAccAzureRMLoadBalancerRule_update
--- PASS: TestAccAzureRMLoadBalancerRule_update (164.20s)
=== RUN   TestAccAzureRMLoadBalancerRule_duplicateRules
--- PASS: TestAccAzureRMLoadBalancerRule_duplicateRules (137.51s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	772.846s

* provider/azurerm: allow updating of lb_nat_rule resource

* check if NAT rule is being updated rather than assuming created
* added test to cover guard against multiple NAT rules with the same name

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMLoadBalancerNatRule" -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerNatRule_basic
--- PASS: TestAccAzureRMLoadBalancerNatRule_basic (148.48s)
=== RUN   TestAccAzureRMLoadBalancerNatRule_removal
--- PASS: TestAccAzureRMLoadBalancerNatRule_removal (163.48s)
=== RUN   TestAccAzureRMLoadBalancerNatRule_update
--- PASS: TestAccAzureRMLoadBalancerNatRule_update (176.97s)
=== RUN   TestAccAzureRMLoadBalancerNatRule_duplicate
--- PASS: TestAccAzureRMLoadBalancerNatRule_duplicate (136.36s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	625.301s

* provider/azurerm: allow updating of lb_probe resource

* check if probe is being updated rather than assuming created
* added test to cover guard against multiple probes with the same name

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMLoadBalancerProbe" -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerProbe_basic
--- PASS: TestAccAzureRMLoadBalancerProbe_basic (134.53s)
=== RUN   TestAccAzureRMLoadBalancerProbe_removal
--- PASS: TestAccAzureRMLoadBalancerProbe_removal (168.06s)
=== RUN   TestAccAzureRMLoadBalancerProbe_update
--- PASS: TestAccAzureRMLoadBalancerProbe_update (175.99s)
=== RUN   TestAccAzureRMLoadBalancerProbe_duplicate
--- PASS: TestAccAzureRMLoadBalancerProbe_duplicate (139.01s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	617.598s

* provider/azurerm: allow updating of lb_nat_pool resource

* check if NAT pool is being updated rather than assuming created
* added test to cover guard against multiple NAT pools with the same name

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMLoadBalancerNatPool" -timeout 120m
=== RUN   TestAccAzureRMLoadBalancerNatPool_basic
--- PASS: TestAccAzureRMLoadBalancerNatPool_basic (146.52s)
=== RUN   TestAccAzureRMLoadBalancerNatPool_removal
--- PASS: TestAccAzureRMLoadBalancerNatPool_removal (158.34s)
=== RUN   TestAccAzureRMLoadBalancerNatPool_update
--- PASS: TestAccAzureRMLoadBalancerNatPool_update (174.05s)
=== RUN   TestAccAzureRMLoadBalancerNatPool_duplicate
--- PASS: TestAccAzureRMLoadBalancerNatPool_duplicate (136.94s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	615.866s
2016-11-11 13:09:00 +02:00
Anshul Sharma e1919edbb3 Allow underscore in database_name [redshift] (#10019)
* allow underscore in database_name [redshift]

Fixes #10009

* Added Test Cases To Validate Redshift DBName

* Remove Old Test Cases Regarding Redshift DBName Validation

* Added More Test Cases For Redshift DBName
2016-11-11 11:59:00 +02:00
clint shryock 303b07e61f provider/aws: Update AutoScaling Schedule test files to avoid conflicts 2016-11-10 11:36:57 -06:00
stack72 e02960810d
provider/aws: Rename zone_id to hosted_zone_id in aws_db_instance
Also added a test to prove that the computed value gets set

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/10 06:26:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBInstance_basic -timeout 120m
=== RUN   TestAccAWSDBInstance_basic
--- PASS: TestAccAWSDBInstance_basic (634.33s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws634.347s
```
2016-11-10 06:41:43 +00:00
stack72 58412762eb
Merge branch 'master' of https://github.com/freeman/terraform into freeman-master 2016-11-10 06:11:47 +00:00
Mitchell Hashimoto fd498fbfff Merge pull request #9538 from hashicorp/f-nomad-provider
provider/nomad: Nomad provider for managing jobs
2016-11-09 18:34:55 -08:00
Mitchell Hashimoto f35996cd23
providers/nomad: suppress diff for identical jobspecs 2016-11-09 18:25:03 -08:00
Michel Rasschaert 62ea843ff3 zone_id exported attribute for db_instance resource 2016-11-09 19:54:09 +01:00
Mitchell Hashimoto 064691b03c Merge pull request #9997 from BedeGaming/azurerm-configure-panic
provider/azurerm: move ConfigureFunc outside of Provider literal, fixes nil reference
2016-11-09 09:56:45 -08:00
Paul Stack 643d42c412 provider/aws: AWS IAM, User and Role allow + in the name (#9991)
Fixes #9985

```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestValidateIamUserName'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/09 12:12:42 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestValidateIamUserName
-timeout 120m
=== RUN   TestValidateIamUserName
--- PASS: TestValidateIamUserName (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws0.026s
```
2016-11-09 15:54:15 +00:00
Paul Stack d66359b046 provider/aws: Fix panic when passing statuses to aws_acm_certificate (#9990)
Fixes #9989

When passing a list of statuses to the acm_certificate data source, we
were trying to cast a schema.TypeList directly to []string

We need to do it via an []interface{} and then cast to string when
ranging over the results. Without this, we get a panic
2016-11-09 15:53:36 +00:00
Peter McAtominey a23c5bda72 provider/azurerm: move ConfigureFunc outside of Provider literal, fixes nil reference
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMDnsARecord_basic -timeout 120m
=== RUN   TestAccAzureRMDnsARecord_basic
--- PASS: TestAccAzureRMDnsARecord_basic (91.92s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	91.994s
2016-11-09 15:49:14 +00:00
Nick Santamaria 8949419bef provider/aws: Add key_name_prefix argument to aws_key_pair resource (#9993)
* Added key_name_prefix to aws_key_pair resource schema.

* Added logic to prefix the aws_key_pair name on create.

* Added aws_key_pair test config for key_name_prefix case.

* Copied test cases from testAccAWSSecurityGroup namespace.

* Modified copied test case to suit aws_key_pair resource.

* Changed required flag to optional on key_name argument for aws_key_pair resource.

* Added documentation for key_name_prefix argument.

* Code style fix.

* Fixed undefined variable error in test.
2016-11-09 15:35:51 +00:00
Peter McAtominey 464fb021f7 provider/azurerm: add virtual_machine_extension resource (#9962)
Picked up from where #6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s)
=== RUN   TestAccAzureRMVirtualMachineExtension_linuxDiagnostics
--- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s)
PASS
ok 	github.com/hashicorp/terraform/builtin/providers/azurerm	3254.663s
2016-11-09 15:13:48 +00:00
ddcprg 27527ef3cb EMR Cluster - core_instance_count doesn't actually refer to core instances 2016-11-09 08:47:23 -06:00
jmasseo 77ca7001a8 removing toLower from flattenElastiCacheParameters - aws_elasticache_parameter_group parameters can be case sensitive (#9820) 2016-11-09 11:34:00 +00:00
Raphael Randschau e5ff0f0cb2 provider/scaleway: update sdk (#9976)
the SDK updates includes an fix for the image cache, which might lead to wrong
images ids being returned on lookup...
2016-11-09 09:32:56 +00:00
Mitchell Hashimoto 2b7177cfe7 Merge pull request #9607 from hashicorp/f-provider-stop-redo
terraform: ResourceProvider.Stop (redo)
2016-11-08 15:58:48 -08:00
Mitchell Hashimoto 646b3c1b68 Merge pull request #9158 from hashicorp/f-vault-provider
Vault Provider
2016-11-08 15:27:33 -08:00
Raphael Randschau b0772b9131 provider/scaleway: retry volume attachment create/ destroy (#9972)
this PR fixes a flakyness in the `scaleway_volume_attachment` resource, as
described below:

when attaching/ detaching a volume from a `scaleway_server`, the server needs to
be stopped. even though the code already waits for the server to be stopped, the
`PatchServer` calls gets a `400 server is being stopped or rebooted` error
response.

If the API returns the `400` we bail, leaving terraform in a broken state.

Assuming this is the only error that the API might return to us, as the payload
itself is correct, this retry behaviour should fix the issue.

\cc @stack72 PTAL
2016-11-08 21:57:33 +00:00
Paddy 78f8fea1fa Merge pull request #9950 from optimisticanshul/9928-aws-redshift-enhanced-vpc-routing
Added AWS Redshift Enhanced VPC Routing
2016-11-08 11:02:37 -08:00
Clint 81e599e53f Merge pull request #9600 from HotelsDotCom/master
AWS EMR resource - Support for Service Access Security Group
2016-11-08 11:36:03 -06:00
Anshul Sharma e9821eaced Updated Redshift Documentation and Added Test Cases for Redshift Enchaned VPC routing 2016-11-08 18:13:10 +05:30
Anshul Sharma 1030cc1344 Added AWS Redshift Enhanced VPC Routing 2016-11-08 17:36:29 +05:30
Paddy 8ba6ed708a provider/google: throw an error for invalid disks
When configuring an instance's attached disk, if the attached disk has
both the disk and type attributes set, it would previously cause
terraform to crash with a nil pointer exception. The root cause was that
we only instantiate the InitializeParams property of the disk if its
disk attribute isn't set, and we try to write to the InitializeParams
property when the type attribute is set. So setting both caused the
InitializeParams property to not be initialized, then written to.

Now we throw an error explaining that the configuration can't have both
the disk and the type set.

Fixes #6495.
2016-11-07 16:11:00 -08:00
Paul Stack 38cd7947b6 provider/aws: Fix the validateFunc of aws_elasticache_replication_group (#9918)
Fixes #9895

The replication_group_id should allow length to be max of 20 not 16

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestResourceAWSElastiCacheReplicationGroupIdValidation'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/07 16:17:52 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestResourceAWSElastiCacheReplicationGroupIdValidation -timeout
120m
=== RUN   TestResourceAWSElastiCacheReplicationGroupIdValidation
--- PASS: TestResourceAWSElastiCacheReplicationGroupIdValidation (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws0.032s
```
2016-11-07 21:02:00 +00:00
Paul Stack c0442ee63f provider/aws: aws_alb_target_group arn_suffix missing the targetgroup (#9911)
The work to add the arn_suffix in #9734 skipped adding the targetgroup/
part of the arn

This PR adds it

//cc @firthh

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/07 12:19:16 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBTargetGroup_ -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (47.23s)
=== RUN   TestAccAWSALBTargetGroup_changeNameForceNew
--- PASS: TestAccAWSALBTargetGroup_changeNameForceNew (80.09s)
=== RUN   TestAccAWSALBTargetGroup_changeProtocolForceNew
--- PASS: TestAccAWSALBTargetGroup_changeProtocolForceNew (87.45s)
=== RUN   TestAccAWSALBTargetGroup_changePortForceNew
--- PASS: TestAccAWSALBTargetGroup_changePortForceNew (78.47s)
=== RUN   TestAccAWSALBTargetGroup_changeVpcForceNew
--- PASS: TestAccAWSALBTargetGroup_changeVpcForceNew (73.53s)
=== RUN   TestAccAWSALBTargetGroup_tags
--- PASS: TestAccAWSALBTargetGroup_tags (75.60s)
=== RUN   TestAccAWSALBTargetGroup_updateHealthCheck
--- PASS: TestAccAWSALBTargetGroup_updateHealthCheck (76.40s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	518.777s
```
2016-11-07 20:17:43 +00:00
Paul Stack 3f032ff611 provider/aws: Setting static_routes_only on import of vpn_connection (#9802)
fixes #9110

An error was found where, static_routes_only was not set on a vpn
connection import. This commit introduces setting the static_routes_only
to false when no Options are found. This follows the AWS convention as follows:

```
- options (structure)

Indicates whether the VPN connection requires static routes. If you are creating a VPN connection for a device that does not support BGP, you must specify true .
Default: false

```

So we take it that `static_options_only` is false by default

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnConnection_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 10:38:18 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnConnection_ -timeout 120m
=== RUN   TestAccAWSVpnConnection_importBasic
--- PASS: TestAccAWSVpnConnection_importBasic (178.29s)
=== RUN   TestAccAWSVpnConnection_basic
--- PASS: TestAccAWSVpnConnection_basic (336.81s)
=== RUN   TestAccAWSVpnConnection_withoutStaticRoutes
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (195.45s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	710.572s
```
2016-11-07 16:12:41 +00:00
Masayuki Morita f68d5e82f3 provider/aws: Fix bug #9863 destroying aws_iam_user with force_destroy does not work (#9900) 2016-11-07 10:37:32 +00:00
Tom Harvey b15b7e1c40 provider/azurerm: EventHubs (#9889)
* Implemented EventHubs

* Missing the sidebar link

* Fixing the type

* Fixing the docs for Namespace

* Removing premium tests

* Checking the correct status code on delete

* Added a test case for the import

* Documentation for importing

* Fixing a typo
2016-11-07 10:19:59 +00:00
James Nugent a0c5d42fa4 provider/random: Separate read from create
We now generate the read operation which sets the various encodings of
the random value such that adding new ones does not require generating a
new random value.

We also verify that these are set correctly via the acceptance tests.
2016-11-06 17:05:11 -06:00
James Nugent 65a8c7bb3f Merge pull request #9903 from hashicorp/random-std-b64-encoding
provider/random: Add b64_std to random_id
2016-11-06 16:25:08 -06:00
James Nugent 9f4e1ec5eb Merge pull request #9865 from sthulb/remove-dep-mime/multipart
Remove sthulb/mime/multipart
2016-11-06 10:24:45 -06:00
James Nugent a7451bfab3 provider/random: Use schema Noop functions 2016-11-06 10:07:38 -06:00
James Nugent 314a56e503 provider/random: Add b64_std to random_id
This commit makes three related changes to the `random_id` resource:

1. Deprecate the `b64` attribute
2. Introduce a new `b64_url` attribute which functions in the same
   manner as the original `b64` attribute
3. Introduce a new `b64_std` attribute which uses standard base64
   encoding for the value rather than URL encoding.

Resource identifiers continue to use URL encoded base 64.

The reason for adding standard encoding of the base 64 value is to allow
the use of generated values as a Serf Encryption Key for separating
Consul clusters - these rely on standard encoding and do not permit some
characters which are allowed by URL encoding. `b64_url` is introduced
in order that there is consistency in specifying the desired encoding
during interpolation.
2016-11-06 09:58:24 -06:00
Joe Topjian 6f67b693c0 Merge pull request #9836 from fatmcgav/openstack_fw_firewall_v1_add_value_specs
provider/openstack: Add 'value_specs' option to 'openstack_fw_firewall_v1' resource
2016-11-05 09:04:04 -06:00
Raphael Randschau fc0455f63a provider/scaleway: fix `scaleway_image` datasource returning unknown images (#9899)
* provider/scaleway: expose scaleway_image lookup error

* provider/scaleway: fix image lookup error

fixes #9472
2016-11-05 11:37:02 +00:00
Gavin Williams b0981566ec provider/openstack: Add 'value_specs' option to 'openstack_fw_firewall_v1' resource
Refactor to use common 'types.go' and 'MapValueSpecs' function.
Website docs updated to reflect changes.
2016-11-05 10:17:33 +00:00
Gavin Williams d3b2c15a2c provider/openstack: Add 'value_specs' option to 'openstack_fw_policy_v1' resource
Refactor to use common 'types.go' and 'MapValueSpecs' function.
Website docs updated to reflect additions
2016-11-04 19:06:25 +00:00
Paddy a15726d069 Merge pull request #9857 from hashicorp/paddy_8822_fix_spot_fleet_ebs
provider/aws: Fix hashing of EBS volumes in spot fleet requests to prevent panics
2016-11-04 09:38:38 -07:00
Mitchell Hashimoto 125b7f4d44 Merge pull request #9806 from hashicorp/f-modify-aws-user-agent
provider/aws: Modify AWS User-Agent to new format
2016-11-04 08:50:15 -07:00
Joe Topjian c3d6bdd440 Merge pull request #9834 from fatmcgav/openstack_firewall_rule_v1_add_value_specs
provider/openstack: Add 'value_specs' option to 'openstack_fw_rule_v1' resource
2016-11-04 09:14:19 -06:00
Clint abcc766344 Merge pull request #9871 from hashicorp/b-aws-opsworks-tests
provider/aws: Decouple and randomize OpsWorks test configs
2016-11-04 09:40:48 -05:00
clint shryock 639a088897 provider/aws: Decouple and randomize OpsWorks test configs 2016-11-04 09:33:07 -05:00
James Nugent c75369d65d Merge pull request #8359 from hashicorp/f-aws-acm-datasource
provider/aws: New Data Source: aws_acm_certificate
2016-11-04 07:49:58 -04:00
Simon Thulbourn 1ca1f86713 Remove sthulb/mine/multipart
This dep was meant as a stopgap for a patch in the stdlib of Go which I
wrote.

The patch was released in Go 1.7. We can now remove my fork and go back
to the stdlib
2016-11-04 11:23:21 +00:00
Gavin Williams e3246bc63e provider/openstack: Add 'value_specs' option to 'openstack_fw_rule_v1' resource.
Refactor to use common 'types.go' and 'MapValueSpecs' function.
Website docs updated.
2016-11-04 07:19:50 +00:00
Joe Topjian 41adcb8388 Merge pull request #9832 from fatmcgav/openstack_fw_firewall_v1_admin_state_up_default
provider/openstack: resource_openstack_fw_firewall_v1 'admin_state_up' should default to 'true'
2016-11-03 19:35:10 -06:00