Commit Graph

6165 Commits

Author SHA1 Message Date
Jake Champlin 327b9e2549 Merge pull request #11795 from hashicorp/b-respect-400-rds-deletion
provider/aws: Catch 400 error from rds_cluster
2017-02-08 14:26:24 -05:00
Jake Champlin 6dd979605d
provider/aws: Catch 400 error from rds_cluster
Previously, an `aws_rds_cluster` that contains active instance groups would timeout on a destroy, if the destroy was able to only target the rds_cluster and not include the instance groups.
This would result in a `400` response from AWS, and Terraform would sit in a wait-loop until a 15-minute timeout while waiting for the cluster to be destroyed.

This catches the error returned from the `DeleteDBCluster` function call such that the proper error case can be returned to the user.

`400` from the AWS API:
```
2017/02/08 13:40:47 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/02/08 13:40:47 [DEBUG] plugin: terraform: HTTP/1.1 400 Bad Request
2017/02/08 13:40:47 [DEBUG] plugin: terraform: Connection: close
2017/02/08 13:40:47 [DEBUG] plugin: terraform: Content-Length: 337
2017/02/08 13:40:47 [DEBUG] plugin: terraform: Content-Type: text/xml
2017/02/08 13:40:47 [DEBUG] plugin: terraform: Date: Wed, 08 Feb 2017 18:40:46 GMT
2017/02/08 13:40:47 [DEBUG] plugin: terraform: X-Amzn-Requestid: 1b4a76cc-ee2e-11e6-867d-2311ebaffd3e
2017/02/08 13:40:47 [DEBUG] plugin: terraform:
2017/02/08 13:40:47 [DEBUG] plugin: terraform: <ErrorResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/">
2017/02/08 13:40:47 [DEBUG] plugin: terraform:   <Error>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:     <Type>Sender</Type>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:     <Code>InvalidDBClusterStateFault</Code>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:     <Message>Cluster cannot be deleted, it still contains DB instances in non-deleting state.</Message>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:   </Error>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:   <RequestId>1b4a76cc-ee2e-11e6-867d-2311ebaffd3e</RequestId>
2017/02/08 13:40:47 [DEBUG] plugin: terraform: </ErrorResponse>
2017/02/08 13:40:47 [DEBUG] plugin: terraform:
2017/02/08 13:40:47 [DEBUG] plugin: terraform: -----------------------------------------------------
```

Error returns now,  as expected:
```
Error applying plan:

2017/02/08 13:40:47 [DEBUG] plugin: waiting for all plugin processes to complete...
1 error(s) occurred:

* aws_rds_cluster.jake (destroy): 1 error(s) occurred:

2017/02/08 13:40:47 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/08 13:40:47 [DEBUG] plugin: waiting for all plugin processes to complete...
* aws_rds_cluster.jake: RDS Cluster cannot be deleted: Cluster cannot be deleted, it still contains DB instances in non-deleting state.
```
2017-02-08 13:59:21 -05:00
Paddy 6257aff676 provider/google: update DNS names in tests.
Our DNS tests were using terraform.test as a DNS name, which GCP was
erroring on, as we haven't proven we own the domain (and can't, as we
don't). To solve this, I updated the tests to use hashicorptest.com,
which we _do_ own, and which we have proven ownership of. The tests now
pass.
2017-02-08 10:24:04 -08:00
Jake Champlin 49697eb5de
provider/aws: Fix spot_fleet request tests
Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously.

```
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN   TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)|
nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='']
##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN   TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO
rSubnetInRegion (54.59s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN   TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan
ceTypesInSameAz (55.50s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN   TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList
 (56.05s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN   TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN   TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP
ASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN   TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne
tInGivenList (60.75s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN   TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip
leInstanceTypesInSameSubnet (61.80s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='']
##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN   TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN
ewRequest (98.70s)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='']
##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN   TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n
PASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='']
##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity']
##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation']
##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN   TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s
)|nPASS|n']
##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='']
##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation']
```
2017-02-08 09:20:19 -05:00
Radek Simko 3fbc037b8f provider/aws: Remove deprecated DynamoDB & Kinesis endpoint fields (#11778) 2017-02-08 13:29:08 +00:00
Radek Simko c25579a6f8 provider/aws: Add aws_elasticsearch_domain_policy (#8648) 2017-02-08 13:20:57 +00:00
Radek Simko d3c9a4b265 provider/aws: Unify custom endpoint fields in provider schema (#11768) 2017-02-08 13:08:59 +00:00
Paul Stack 6a44f258e6 provider/aws: Raise the codebuild_project create timeout (#11777)
Found in testing that a timeout of 30 seconds didn't allow for the error
message that codebuild wasn't supported in eu-west-2

Discussed this with @radeksimko and he suggested a timeout raise
2017-02-08 13:03:58 +00:00
Liam Bennett d760f2102a Latest updates to aws_ssm_document resource. (#11671)
A parameter `document_type` and a few more attributes returned based
upon the new API.
2017-02-08 12:45:38 +00:00
Jake Champlin 28b9f3f8fb Merge pull request #11744 from hashicorp/b-fix-db-event-import
provider/aws: Fix aws_db_event_subscription import
2017-02-07 14:40:41 -05:00
Jake Champlin 1ab17bf5d3 Merge pull request #11735 from hashicorp/paddy_11728_with_tests
Revert backwards incompatibility in google_project.policy_data
2017-02-07 11:50:59 -05:00
Jake Champlin 20a75ec6d7
provider/aws: Fix aws_db_event_subscription import
Previously the db_event_subscription import would only work if there was a single db_event_subscription resource. This fixes the import, allowing it to work as expected.

Also fixes the acceptance test for the resource to reflect this.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBEventSubscription_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/07 10:38:10 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDBEventSubscription_importBasic -timeout 120m
=== RUN   TestAccAWSDBEventSubscription_importBasic
--- PASS: TestAccAWSDBEventSubscription_importBasic (633.33s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    633.353s
```
2017-02-07 11:01:26 -05:00
Traver Tischio 441b1cca90 provider/fastly Adds healthcheck service (#11709)
* Adds schema for fastly healthcheck

* Handles changes to the fastly healthcheck

* Flattens and refreshed fastly healthchecks

* Adds testing for fastly healthcheck

* Adds website documentation for fastly healthcheck

* Fixes terraform syntax in test examples
2017-02-07 11:34:58 +01:00
Erik Jansson e3e24f4592 Fix nil pointer in resource_aws_codebuild_project (#11740) 2017-02-07 11:25:29 +01:00
Paddy faa640dfe8 Add a test that would have caught backwards incompatibility.
Add a test that would have caught the backwards incompatibility where
project IAM bindings aren't merged, but are overwritten.
2017-02-06 22:27:28 -08:00
Dana Hoffman 32c71b88a4 Merge pull request #11548 from zopanix/patch-1
Added forceNew on accessConfig in google_compute_instance_template
2017-02-06 17:19:55 -08:00
Jake Champlin f5c4d7bfc3
provider/aws: Fix aws_db_event_subscription acceptance test
Fixes the `TestAccAWSDBEventSubscription_basicUpdate` acceptance test

`TestAccAWSDBEventSubscription_importBasic` is still failing, but has been failing since November.
2017-02-06 18:24:15 -05:00
Evan Brown 7d5c405c96 providers/google: Fix google_project IAM bug
This changes removes read of the deprecated `policy_data` attr in
the `google_project` resource.

0.8.5 introduced new behavior that incorrectly read the `policy_data`
field during the read lifecycle event. This caused Terraform to
assume it owned not just policy defined in the data source, but
everything that was associated with the project. Migrating from 0.8.4
to 0.8.5, this would cause the config (partial) to be compared to the
state (complete, as it was read from the API) and assume some
policies had been explicitly deleted. Terraform would then delete them.

Fixes #11556
2017-02-06 14:16:22 -08:00
Jake Champlin 4eda693710
fix validator test 2017-02-06 15:16:59 -05:00
Jake Champlin 5481fd941a
provider/fastly: Allow specifying log format version
Allows the user to specify the log format version when setting up `s3logging` on the fastly service resource.

Requires an update to the vendored `go-fastly` dependency.

Also adds an additional acceptance test for the new attribute.

```
$ make testacc TEST=./builtin/providers/fastly TESTARGS='-run=TestAccFastlyServiceV1_s3logging'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/06 14:51:55 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/fastly -v -run=TestAccFastlyServiceV1_s3logging -timeout 120m
=== RUN   TestAccFastlyServiceV1_s3logging_basic
--- PASS: TestAccFastlyServiceV1_s3logging_basic (36.11s)
=== RUN   TestAccFastlyServiceV1_s3logging_s3_env
--- PASS: TestAccFastlyServiceV1_s3logging_s3_env (15.35s)
=== RUN   TestAccFastlyServiceV1_s3logging_formatVersion
--- PASS: TestAccFastlyServiceV1_s3logging_formatVersion (15.71s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/fastly 67.186s
```
2017-02-06 14:54:58 -05:00
Jake Champlin 17dfa0c8e3 Merge pull request #11691 from hashicorp/f-update-nomad-jobspec-parser
provider/nomad: Update jobspec parser
2017-02-06 12:02:37 -05:00
Clint 2e0b30efbb Merge pull request #11678 from snakeb1t/iam_instance_profile_availcheck
provider/aws: fix instance profile creation false negative
2017-02-06 08:48:54 -06:00
John Engelman 1efd5ff814 [Rancher] - allow for importing resources using environment ID to target (#11688) 2017-02-05 11:35:48 +01:00
netjunki 64e2381cb2 validate aws_alb_target_group name is less than 32 characters (#11699) 2017-02-05 11:24:24 +01:00
Kit Ewbank 1ab38ceae5 Return route_table_id from aws_route_table data source. (#11703) 2017-02-05 11:19:25 +01:00
Tamas Szasz e001ecac2c Provide the certificate ID in the aws data source (#11693)
ID is used in aws cloudfront distributions and probably in other aws resources as well
2017-02-04 12:34:16 +00:00
ValFadeev cb8d85fc50 provider/aws: New DataSource: aws_partition (#11675) 2017-02-04 11:54:45 +00:00
Jake Champlin 79c117877e
provider/nomad: Update jobspec parser
Updates vendored Nomad jobspec parser such that parameterized nomad job files can no be parsed and used with Terraform.
Also fixes tests to adhere to new jobspec version, and update documentation to reflect such as well.
2017-02-03 18:19:23 -05:00
Xavier Sellier dbe647dd56 Add epsilon to the regex date validation 2017-02-03 13:52:22 -05:00
Paul Tittle bd5fc5d0e0 provider/aws: fix instance profile creation false negative
fixes https://github.com/hashicorp/terraform/issues/9474

discussion of approach in https://github.com/hashicorp/terraform/pull/11634
2017-02-03 13:27:50 -05:00
Paul Stack ced96aa90b provider/aws: Set aws_db_cluster to snapshot by default (#11668)
As requested in #11448

Terraform didn't snapshot AWS DB Instances by default. We are going to
change that behaviour going forward.
2017-02-03 17:21:25 +00:00
Jason Felice ab33435863 Fix error message for when home directory not found 2017-02-03 08:52:53 -08:00
Jason Felice 8a7a6c6059 Use go-homedir (as vault does) 2017-02-03 08:52:53 -08:00
Jason Felice bb1756c86a Read ~/.vault-token if token not supplied another way
Closes #11365
2017-02-03 08:52:53 -08:00
Clint 195e668865 Merge pull request #11674 from hashicorp/b-aws-test-fixes
provider/aws: More test fixing
2017-02-03 10:41:16 -06:00
clint shryock 549256ed1d fix transcoder tests 2017-02-03 10:40:33 -06:00
clint shryock 9ad75cfdc6 fix db subnet test 2017-02-03 10:22:46 -06:00
Jake Champlin 7e71dfce0f Merge pull request #11649 from hashicorp/b-fix-spot-request-bug
provider/aws: Fix spot_instance_request bug
2017-02-03 09:23:54 -05:00
Raphaël Pinson acd7320e1f rancher: set environment_id on import (#11594) 2017-02-03 12:34:26 +00:00
Matthew Frahry d421829aaa Add test to PR 9320 (#11645) 2017-02-03 11:50:57 +00:00
Jake Champlin a58f292d88
provider/aws: Fix spot_instance_request bug
Discovered after #11619 was fixed, and while fixing acceptance tests for the `aws_spot_instance_request` resource.
Previously the `aws_spot_instance_request` resource wouldn't populate any of the block device attributes from the resulting instance's metadata. This fixes that issue, and also fixes the `aws_spot_instance_request` acceptance tests to be more equipped for running in parallel.

 ```
 make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotInstanceRequest_'
 ==> Checking that code complies with gofmt requirements...
 go generate $(go list ./... | grep -v /terraform/vendor/)
 2017/02/02 18:02:37 Generated command/internal_plugin_list.go
 TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotInstanceRequest_ -timeout 120m
 === RUN   TestAccAWSSpotInstanceRequest_basic
 --- PASS: TestAccAWSSpotInstanceRequest_basic (111.96s)
 === RUN   TestAccAWSSpotInstanceRequest_withBlockDuration
 --- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (105.12s)
 === RUN   TestAccAWSSpotInstanceRequest_vpc
 --- PASS: TestAccAWSSpotInstanceRequest_vpc (115.81s)
 === RUN   TestAccAWSSpotInstanceRequest_SubnetAndSG
 --- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSG (130.46s)
 PASS
 ok      github.com/hashicorp/terraform/builtin/providers/aws    463.377s
 ```
2017-02-02 18:57:50 -05:00
Jake Champlin 188a00cbe0 Merge pull request #11642 from hashicorp/f-improve-iam-tests
provider/aws: Improve IAM Group AccTests
2017-02-02 14:10:51 -05:00
Jake Champlin 643a52ab3e
provider/aws: Improve IAM Group AccTests
Improve the iam_group acceptance tests. Previously, the iam_group would overlap when running our tests in parallel. This fixes that.
2017-02-02 13:03:39 -05:00
Jake Champlin e4a36c3d7a
provider/aws: Better handle parallel tests spot-fleet-req
Better handle parallel testing of the `aws_spot_fleet_request` resource. Previously we were catching a lot of errors due to naming the policy_attachment resource the same between tests.
2017-02-02 12:48:52 -05:00
Clint aa7aa19592 Merge pull request #11637 from hashicorp/b-aws-test-fixes
provider/aws: More lambda test fixes
2017-02-02 10:30:23 -06:00
liamjbennett 4aa5117e82
New resource aws_codebuild_project 2017-02-02 16:13:51 +00:00
clint shryock 8cede07657 fix missing %s 2017-02-02 10:04:27 -06:00
clint shryock 27c1dd8097 provider/aws: More lambda test cleanups 2017-02-02 09:57:44 -06:00
Jake Champlin 755040b177 Merge pull request #11617 from hashicorp/f-tags-dynamodb
provider/aws: Add tag support to the dynamodb table resource
2017-02-02 09:44:54 -05:00
Jake Champlin dacc765a5e
update casing for dynamoDb 2017-02-02 09:20:33 -05:00