Commit Graph

16406 Commits

Author SHA1 Message Date
Jake Champlin fcec0a9f3d
provider/aws: Fix AMI creation from snapshot issue
Previously the AMI creation accepted a static value for the AMI's block device's volume size.
This change allows the user to omit the `volume_size` attribute, in order to mimic the AWS API behavior, which will use the EBS Volume's size.

Also fixes a potential panic case when setting `iops` on the AMI's block device.

The `aws_ami` resource previously didn't have any acceptance tests, adds two acceptance tests and a full testing suite for the `aws_ami` resource, so further tests can be written, as well as expansion upon the other `aws_ami_*` acceptance tests

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAMI_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 20:18:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAMI_ -timeout 120m
=== RUN   TestAccAWSAMI_basic
--- PASS: TestAccAWSAMI_basic (44.21s)
=== RUN   TestAccAWSAMI_snapshotSize
--- PASS: TestAccAWSAMI_snapshotSize (45.08s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    89.320s
```
2017-02-09 20:30:26 -05:00
Dana Hoffman ccb3674c04 Merge pull request #11840 from danawillow/gke-version
provider/google: Update node version in container cluster test
2017-02-09 16:33:43 -08:00
Dana Hoffman b18e7bcfd2 provider/google: Update node version in container cluster test 2017-02-09 16:14:00 -08:00
James Bardin 4d00c29706 Merge pull request #11836 from hashicorp/jbardin/state-locking
Add locking during backend configuration
2017-02-09 18:30:10 -05:00
Dana Hoffman d8e4f9545f Merge pull request #11646 from danawillow/google-subnetwork
provider/google: set subnetwork_project to computed
2017-02-09 15:01:15 -08:00
Clint 25d6507a7a Merge pull request #11505 from ewbankkit/aws_vpc_peering_connection_accepter-resource
provider/aws: Add 'aws_vpc_peering_connection_accepter' resource
2017-02-09 16:30:51 -06:00
Jake Champlin 3b372b649b Merge pull request #11833 from hashicorp/f-redshift-cluster-acctests
provider/aws: Update redshift_cluster acceptance tests
2017-02-09 16:20:52 -05:00
Clint b1a70b5560 Merge pull request #11829 from hashicorp/b-aws-test-fixes
provider/aws: Set the qualifier to an empty string if the parsing fai…
2017-02-09 15:17:25 -06:00
James Bardin 92cea2478d Add test for nil *os.File in ReadState 2017-02-09 16:06:07 -05:00
James Bardin 0c1b138719 Add state locking during backend init
During backend initialization, especially during a migration, there is a
chance that an existing state could be overwritten.

Attempt to get a locks when writing the new state. It would be nice to
always have a lock when reading the states, but the recursive structure
of the Meta.Backend config functions makes that quite complex.
2017-02-09 15:47:27 -05:00
Jake Champlin 8618973c5c Merge pull request #11523 from 2uinc/vault-init-fix
Use vault api.DefaultConfig()
2017-02-09 15:18:49 -05:00
Jake Champlin 53d081e89f
provider/aws: Update redshift_cluster acceptance tests
Allows failing redshift_cluster acceptance tests to pass when ran in parallel

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftCluster_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 11:15:49 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftCluster_ -timeout 120m
=== RUN   TestAccAWSRedshiftCluster_importBasic
--- PASS: TestAccAWSRedshiftCluster_importBasic (593.87s)
=== RUN   TestAccAWSRedshiftCluster_basic
--- PASS: TestAccAWSRedshiftCluster_basic (663.11s)
=== RUN   TestAccAWSRedshiftCluster_kmsKey
--- PASS: TestAccAWSRedshiftCluster_kmsKey (684.31s)
=== RUN   TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
--- PASS: TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled (914.33s)
=== RUN   TestAccAWSRedshiftCluster_loggingEnabled
=== RUN   TestAccAWSRedshiftCluster_loggingEnabled
--- PASS: TestAccAWSRedshiftCluster_loggingEnabled (764.83s)
=== RUN   TestAccAWSRedshiftCluster_iamRoles
--- PASS: TestAccAWSRedshiftCluster_iamRoles (907.82s)
=== RUN   TestAccAWSRedshiftCluster_publiclyAccessible
--- PASS: TestAccAWSRedshiftCluster_publiclyAccessible (691.63s)
=== RUN   TestAccAWSRedshiftCluster_updateNodeCount
--- PASS: TestAccAWSRedshiftCluster_updateNodeCount (1881.95s)
=== RUN   TestAccAWSRedshiftCluster_tags
--- PASS: TestAccAWSRedshiftCluster_tags (586.80s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    6995.524s
```
2017-02-09 14:58:37 -05:00
Seth Vargo 9aa32d7ac3 Merge pull request #11831 from hashicorp/sethvargo-patch-1-1
Change cache to 4h
2017-02-09 14:40:51 -05:00
Seth Vargo 22653eeb24 Cache assets longer 2017-02-09 14:39:37 -05:00
Seth Vargo b23c2aaa07 Change cache to 4h 2017-02-09 14:36:47 -05:00
Daren Desjardins 5718294386 state/remote/s3: Fix Bug with Assume Role for Federated IAM Account (#10067)
* Enable remote s3 state support for assume role

- provide role_arn in backend config to enable assume role

Fixes #8739

* Check for errors after obtaining credentials
2017-02-09 16:54:49 +00:00
clint shryock 0d8a6fb998 provider/aws: Set the qualifier to an empty string if the parsing fails, to attempt to detect drift 2017-02-09 10:42:51 -06:00
Jake Champlin 057341acf8 Merge pull request #11827 from hashicorp/f-redshift-sg-acctests
provider/aws: Update Redshift SG Acctests
2017-02-09 11:19:44 -05:00
Jake Champlin d91bbe441f
provider/aws: Update Redshift SG Acctests
Allows redshift security group tests to better handle being ran in parallel.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftSecurityGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 10:40:25 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftSecurityGroup_ -timeout 120m
=== RUN   TestAccAWSRedshiftSecurityGroup_importBasic
--- PASS: TestAccAWSRedshiftSecurityGroup_importBasic (12.98s)
=== RUN   TestAccAWSRedshiftSecurityGroup_ingressCidr
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (11.02s)
=== RUN   TestAccAWSRedshiftSecurityGroup_updateIngressCidr
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (32.81s)
=== RUN   TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (14.82s)
=== RUN   TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (37.43s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    109.090s
```
2017-02-09 10:55:12 -05:00
clint shryock 86bf9fde83 provider/aws: fix testAccInstanceDataSourceConfig_keyPair from possibly leaking instances if tmp-key already existed 2017-02-09 09:50:36 -06:00
James Bardin 5c2e945b3c Fix format string and typos 2017-02-09 10:27:42 -05:00
Jake Champlin 767764ff10 Merge pull request #11826 from hashicorp/f-redshift-parameter-group-test-fixes
provider/aws: Fix redshift parameter group acctests
2017-02-09 10:24:11 -05:00
Jake Champlin 35c773a616
provider/aws: Fix redshift parameter group acctests
Allows the redshift parameter group acceptance tests handle being ran in parallel better

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftParameterGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 10:16:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftParameterGroup_ -timeout 120m
=== RUN   TestAccAWSRedshiftParameterGroup_importBasic
--- PASS: TestAccAWSRedshiftParameterGroup_importBasic (15.17s)
=== RUN   TestAccAWSRedshiftParameterGroup_withParameters
--- PASS: TestAccAWSRedshiftParameterGroup_withParameters (13.16s)
=== RUN   TestAccAWSRedshiftParameterGroup_withoutParameters
--- PASS: TestAccAWSRedshiftParameterGroup_withoutParameters (12.58s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    40.940s
```
2017-02-09 10:18:31 -05:00
Jake Champlin 9064954ca0 Merge pull request #11825 from hashicorp/f-update-lb-policy-acctests
provider/aws: Update aws_elb policy acctests
2017-02-09 10:16:20 -05:00
Jake Champlin c899e8d49e
provider/aws: Update aws_elb policy acctests
Updates the aws_elb acceptance tests to better handle parallel test runs

 ```
 $ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSLoadBalancerPolicy_'
 ==> Checking that code complies with gofmt requirements...
 go generate $(go list ./... | grep -v /terraform/vendor/)
 2017/02/09 10:04:58 Generated command/internal_plugin_list.go
 TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSLoadBalancerPolicy_ -timeout 120m
 === RUN   TestAccAWSLoadBalancerPolicy_basic
 --- PASS: TestAccAWSLoadBalancerPolicy_basic (24.50s)
 === RUN   TestAccAWSLoadBalancerPolicy_updateWhileAssigned
 --- PASS: TestAccAWSLoadBalancerPolicy_updateWhileAssigned (42.34s)
 PASS
 ok      github.com/hashicorp/terraform/builtin/providers/aws    66.866s
 ```
2017-02-09 10:08:05 -05:00
Jake Champlin 597bcabd49 Merge pull request #11823 from hashicorp/f-update-aws-kms-acctests
provider/aws: Update KMS Alias acceptance tests
2017-02-09 09:57:27 -05:00
Jake Champlin 6869fae6f3
provider/aws: Update KMS Alias acceptance tests
Updates KMS tests to ensure compatibility with running our tests in parallel

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSKmsAlias_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 09:43:42 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSKmsAlias_ -timeout 120m
=== RUN   TestAccAWSKmsAlias_basic
--- PASS: TestAccAWSKmsAlias_basic (51.63s)
=== RUN   TestAccAWSKmsAlias_name_prefix
--- PASS: TestAccAWSKmsAlias_name_prefix (39.58s)
=== RUN   TestAccAWSKmsAlias_no_name
--- PASS: TestAccAWSKmsAlias_no_name (42.27s)
=== RUN   TestAccAWSKmsAlias_multiple
--- PASS: TestAccAWSKmsAlias_multiple (40.04s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    173.547s
```
2017-02-09 09:49:34 -05:00
Jake Champlin 30fc87ce55 Merge pull request #11818 from hashicorp/f-update-ecs-task-definition-tests
provider/aws: Fix ECS Task Definition tests
2017-02-09 09:31:25 -05:00
Jake Champlin 39dcd55e06 Merge pull request #11817 from hashicorp/f-resource-api-gateway-method-testfix
provider/aws: Fix aws_api_gateway acceptance test
2017-02-09 09:23:59 -05:00
Jake Champlin 9f0c5103d4
provider/aws: Fix ECS Task Definition tests
When ran in parallel the tests `TestAccAwsEcsTaskDefinition_withNetwork` and `TestAccAwsEcsTaskDefinition_withTask` will overlap with each other due to the shared naming of the `iam_role` resource.

This fixes these tests to allow running in parallel on TeamCity.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAwsEcsTaskDefinition_withTask'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 09:20:03 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAwsEcsTaskDefinition_withTask -timeout 120m
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    0.022s
```

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAwsEcsTaskDefinition_withNetwork'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 09:21:10 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAwsEcsTaskDefinition_withNetwork -timeout 120m
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    0.026s
```
2017-02-09 09:23:32 -05:00
Jake Champlin cf4b175ac1
provider/aws: Fix aws_api_gateway acceptance test
Fixes the `TestAccAwsAPIGatewayMethod_customauthorizer` acceptance test which would previously fail if the iam_role resources would leak

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAwsAPIGatewayMethod_customauthorizer'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/09 09:10:07 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAwsAPIGatewayMethod_customauthorizer -timeout 120m
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    0.022s
```
2017-02-09 09:11:55 -05:00
Jake Champlin 103ce56e70 Merge pull request #11809 from hashicorp/b-fix-aws-sg-rule-create
provider/aws: Fix AWS Security Group Rule Timeout
2017-02-09 08:16:07 -05:00
Paul Stack 4964ec402f provider/aws: Bump Create and Delete timeouts to 60 mins on (#11793)
directory_service

Fixes: #11781
2017-02-09 11:44:50 +00:00
Paul Stack 7310b26896 provider/aws: Make aws_dms_endpoint database_name optional (#11792)
Not required for MySQL

Fixes: #11791
2017-02-09 11:43:14 +00:00
Joe Topjian beb00e287d Merge pull request #10271 from ljfranklin/PR-openstack-ssl-content
Allow OpenStack SSL certs + keys to take path or content
2017-02-08 22:11:31 -07:00
Jake Champlin 30cd37d8cc Merge pull request #11810 from f440/fix-broken-document
Fix invalid markdown syntax
2017-02-08 22:04:39 -05:00
f440 f597442c87 Fix invalid markdown syntax 2017-02-09 11:49:49 +09:00
Jake Champlin 6fa0946571
provider/aws: Fix AWS Security Group Rule Timeout
An AWS Security Group Rule requires at least one of `cidr_blocks`, `self`, or `source_security_group_id` in order to be successfully created.
 If the `aws_security_group_rule` doesn't contain one of these attributes, the AWS API will still return a `200` response, and not report any error in the response.

 Example response from the API on a malformed submission:
 ```
2017/02/08 16:04:33 [DEBUG] plugin: terraform: -----------------------------------------------------
2017/02/08 16:04:33 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/08 16:04:33 [DEBUG] [aws-sdk-go] DEBUG: Response ec2/AuthorizeSecurityGroupIngress Details:
2017/02/08 16:04:33 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/02/08 16:04:33 [DEBUG] plugin: terraform: HTTP/1.1 200 OK
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Connection: close
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Transfer-Encoding: chunked
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Content-Type: text/xml;charset=UTF-8
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Date: Wed, 08 Feb 2017 21:04:33 GMT
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Server: AmazonEC2
2017/02/08 16:04:33 [DEBUG] plugin: terraform: Vary: Accept-Encoding
2017/02/08 16:04:33 [DEBUG] plugin: terraform:
2017/02/08 16:04:33 [DEBUG] plugin: terraform: 102
2017/02/08 16:04:33 [DEBUG] plugin: terraform: <?xml version="1.0" encoding="UTF-8"?>
2017/02/08 16:04:33 [DEBUG] plugin: terraform: <AuthorizeSecurityGroupIngressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
2017/02/08 16:04:33 [DEBUG] plugin: terraform:     <requestId>ac08c33f-8043-46d4-b637-4c4b2fc7a094</requestId>
2017/02/08 16:04:33 [DEBUG] plugin: terraform:     <return>true</return>
2017/02/08 16:04:33 [DEBUG] plugin: terraform: </AuthorizeSecurityGroupIngressResponse>
2017/02/08 16:04:33 [DEBUG] plugin: terraform: 0
2017/02/08 16:04:33 [DEBUG] plugin: terraform:
2017/02/08 16:04:33 [DEBUG] plugin: terraform:
2017/02/08 16:04:33 [DEBUG] plugin: terraform: -----------------------------------------------------
```

This previously caused Terraform to wait until the security_group_rule propagated, which never happened due to the silent failure.

The changeset ensures that one of the required attributes are set prior to creating the aws_security_group_rule.
Also catches the error returned from the retry function. Previously the error was ignored, and only logged at the `DEBUG` level.
2017-02-08 21:30:30 -05:00
Kevin Burke 5bd8fab828 website: remove stray backticks (#11807) 2017-02-08 18:01:14 -08:00
Dana Hoffman df0210401d provider/google: set subnetwork_project to computed 2017-02-08 15:26:47 -08:00
Dana Hoffman 0a60142080 Merge pull request #11650 from danawillow/google-container
provider/google: set additional_zones to computed and disallow the original zone from appearing in the list
2017-02-08 15:12:08 -08:00
James Bardin 1448cb66fb Merge pull request #11787 from hashicorp/jbardin/state-locking
Add consul state locking
2017-02-08 15:37:16 -05:00
Mitchell Hashimoto 1b7afe7bdb Merge pull request #11765 from hashicorp/b-destroy-state
terraform: node referenceable name from state shuldn't contain path
2017-02-08 11:54:04 -08:00
Mitchell Hashimoto a5ab6e447b command/apply: update help text to be "parallel" instead of concurrent 2017-02-08 11:49:08 -08:00
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 f8fdd6eba0 Merge pull request #11794 from hashicorp/paddy_fix_gcp_dns_tests
provider/google: update DNS names in tests.
2017-02-08 10:41:50 -08: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
James Bardin 80fab23e04 Don't test consul using demo.consul.io
We shoudn't require an external service for unit test.

TODO: create some proper acceptance tests for consul
2017-02-08 11:34:31 -05:00
James Bardin 14d965722e Use single state.LockInfo struct
Remove redundant structures
2017-02-08 11:34:31 -05:00