Commit Graph

7631 Commits

Author SHA1 Message Date
Thomas Poindessous 4df07f2ed9 Added a test acceptance for the new functionality.
GOOGLE_COMPUTE_DISK_SNAPSHOT_URI must be set to a valid snapshot's uri like one of the output of
gcloud compute snapshots list --uri

GOOGLE_COMPUTE_DISK_SNAPSHOT_URI should be replaced by a proper snapshot made by TF (#11690)
2017-05-22 22:51:31 +02:00
Thomas Poindessous 674d635926 Golint from Atom 2017-05-22 22:51:31 +02:00
Thomas Poindessous deb9dae35c Be more specific on the regexp used to detect URI 2017-05-22 22:51:31 +02:00
Thomas Poindessous e510289d2b Enable use of URI for snapshot name 2017-05-22 22:51:30 +02:00
Dana Hoffman 3df593315f provider/google: add failover parameter to sql database instance (#14336)
* provider/google: add failover parameter to sql database instance

* provider/google: update sql database instance docs
2017-05-22 13:44:25 -07:00
Riley Karson 56f89e20d7 provider/google: Add import support to google_sql_user (#14457)
* Support importing google_sql_user

* Updated documentation to reflect that passwords are not retrieved.

* Added additional documentation detailing use.

* Removed unneeded d.setId() line from GoogleSqlUser Read method.

* Changed an errors.New() call to fmt.Errorf().

* Migrate schemas of existing GoogleSqlUser resources.

* Remove explicitly setting 'id' property

* Added google_sql_user to importability page.

* Changed separator to '/' from '.' and updated tests + debug messages.
2017-05-22 13:43:10 -07:00
Riley Karson 6ac78404e0 provider/google: Refactor google_storage_bucket tests (#14694) 2017-05-22 12:38:21 -07:00
Jake Champlin 9a7a243c5c Merge pull request #14733 from hashicorp/f-env-var-prerelease-string
core: Use environment variables to set VersionPrerelease at compile time
2017-05-22 14:55:00 -04:00
smasue bc3075c48b Missing short name in the service scope (Google compute instance) (#14633)
* Missing short name in the service scope (Google compute instance ). The missing short name is for Stackdriver Trace append.

* Missing short name in the service scope (Google compute instance ). The missing short name is for Stackdriver Trace readonly.
2017-05-22 12:21:59 -05:00
Joe Topjian cfb83f9d87 Merge pull request #14704 from jtopjian/openstack-instance-tenantnet-fix
provider/openstack: Catch error during instance network parsing
2017-05-22 09:29:11 -06:00
Joe Topjian a8bf3d8ab0 Merge pull request #14721 from jtopjian/os-dns
provider/openstack: Add openstack_dns_zone_v2 resource
2017-05-22 09:27:28 -06:00
Jake Champlin bd68789006
core: Use environment variables to set VersionPrerelease at compile time
Instead of using a hardcoded version prerelease string, which makes release automation difficult, set the version prerelease string from an environment variable via the go linker tool during compile time.

The environment variable `TF_RELEASE` should only be set via the `make bin` target, and thus leaves the version prerelease string unset. Otherwise, when running a local compile of terraform via the `make dev` makefile target, the version prerelease string is set to `"dev"`, as usual.

This also requires some changes to both the circonus and postgresql providers, as they directly used the `VersionPrerelease` constant. We now simply call the `VersionString()` function, which returns the proper interpolated version string with the prerelease string populated correctly.

`TF_RELEASE` is unset:

```sh
$ make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:38:19 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 209M
-rwxr-xr-x 1 jake jake 209M May 22 10:39 terraform

$ terraform version
Terraform v0.9.6-dev (fd472e4a86500606b03c314f70d11f2bc4bc84e5+CHANGES)
```

`TF_RELEASE` is set (mimicking the `make bin` target):

```sh
$ TF_RELEASE=1 make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:40:39 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 121M
-rwxr-xr-x 1 jake jake 121M May 22 10:42 terraform

$ terraform version
Terraform v0.9.6
```
2017-05-22 10:49:15 -04:00
Jake Champlin 722436a880 Merge pull request #14727 from hashicorp/b-fix-instance-panic
provider/aws: Fix panic on instance shutdown
2017-05-22 09:53:04 -04:00
Kit Ewbank 8e130b15e4 Add 'aws_kms_ciphertext' data source. (#14691) 2017-05-22 16:46:18 +03:00
Máximo Cuadros b8fb1b5ed9 ignition: tests as unit test (#14703) 2017-05-22 16:40:41 +03:00
Raphaël Pinson e7bfdea274 Add github_team data source (#14614)
* Add github_team data source

* github_team: add doc

* github_team data source: fix acceptance test
2017-05-22 16:29:18 +03:00
Januar cf8568fe55 provider/docker network alias (#14710)
* Add Network Alias configuration with network options

* Handle case where there's no network option

* Handle use case where network option is not available

* Handle use case where network option is not available

* Network alias only on user defined network

* Update documentation for docker provider on network aliases

* Remove unused variable

* Update documentation

* add unit test for docker container network

* fix unit test for docker container network
2017-05-22 09:20:32 -04:00
Radek Simko b90ad412d5 provider/aws: Increase timeout for creating security group (#14724) 2017-05-22 15:12:39 +02:00
Jake Champlin c1f4a6e9f8
provider/aws: Fix panic on instance shutdown
During an instance shut-down network interfaces may be detached during the `READ` method of a Terraform run.

This protects the case where a network interface was detached, and is now `nil` at the time of the Terraform run, fixing nil pointer dereferences.
2017-05-22 09:02:35 -04:00
Jake Champlin d85b8f0613 Merge pull request #14669 from hashicorp/b-add-validation-iam-role-policy
provider/aws: validation: Add validation function for IAM Policies
2017-05-22 08:26:24 -04:00
Paul Stack 542640c953 provider/aws: Do not dereference source_Dest_check in aws_instance (#14723)
Fixes: #14718

source_dest_check may not be set so we should pass the pointer to d.Set
func and allow it to dereference it safely
2017-05-22 10:44:30 +03:00
Radek Simko 600e587430 provider/aws: Configurable timeouts for EC2 instance + spot instance (#14711) 2017-05-22 09:27:06 +02:00
Radek Simko a6617c598a provider/aws: Increase timeout for retrying creation of CW log subs (#14722) 2017-05-22 09:26:24 +02:00
Radek Simko 9cb33d863d provider/aws: Increase timeout for deleting IGW (#14705) 2017-05-22 09:25:26 +02:00
Joe Topjian e0b5f4f833 provider/openstack: dns zone v2 updates and docs 2017-05-22 01:44:11 +00:00
jrperritt 5792b9fe76 provider/openstack: Add openstack_dns_zone_v2 resource 2017-05-22 01:44:11 +00:00
Radek Simko 4a671fc92e provider/aws: Retry IAM Role deletion on DeleteConflict (#14707)
* provider/aws: Retry IAM Role deletion on DeleteConflict

* provider/aws: Add 'IAM' to relevant test names
2017-05-22 00:35:09 +03:00
Radek Simko 3a41e45180 provider/aws: Retry ECS service update on InvalidParameterException (#14708) 2017-05-21 22:19:41 +03:00
Joe Topjian 6fe0471008 provider/openstack: Catch error during instance network parsing
This commit catches an error when the instance is parsing and building
its network list. This can happen when a cloud provider responds with
a non-JSON response for the list of networks.
2017-05-21 02:34:57 +00:00
Radek Simko 60bae99a94 provider/aws: Retry ElastiCache cluster deletion when it's snapshotting (#14700) 2017-05-21 00:42:33 +03:00
Radek Simko 66ed50866d provider/aws: Increase timeout for creation of route_table (#14701) 2017-05-21 00:40:33 +03:00
Radek Simko c0a2aa3b49 provider/aws: Allow updating tuples in WAF XssMatchSet + no tuples (#14671)
* provider/aws: Allow updating tuples in WAF XssMatchSet

* provider/aws: Allow WAF XssMatchSet with no tuples
2017-05-20 02:55:58 +02:00
Jake Champlin 6772360c2d Merge pull request #14688 from harijayms/manageddisk4TB
[MS] Adding support for 4TB disks
2017-05-19 17:57:54 -04:00
Jake Champlin 90b5d81933 Merge pull request #14685 from hashicorp/f-open-lightsail-regions
provider/aws: Allow lightsail resources to work in other regions
2017-05-19 17:16:13 -04:00
Eugene Chuvyrov 662373e12e Adding support for 4TB disks 2017-05-19 14:10:19 -07:00
Roberto Jung Drebes 6ab9d82cc5 wip: review changes:
- test arguments
 - set region, project in state
 - fix import error messages
 - get rid of peerFound
 - linkDiffSuppress
2017-05-19 23:05:54 +02:00
Jake Champlin 85895cecc7
provider/aws: rename usEast1Sess to r53Sess and document 2017-05-19 17:03:34 -04:00
Jake Champlin 22a82c0dfb Merge pull request #14683 from ewbankkit/github-provider-handle-nil-response
provider/github Check for potentially nil response from GitHub API client
2017-05-19 16:46:38 -04:00
Jake Champlin 0abfda4d8b
provider/aws: Allow lightsail resources to work in other regions
Previously lightsail was limited to `us-east-1` only. This restriction has now been lifted to new regions.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSLightsailInstance_euRegion'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/19 16:40:48 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSLightsailInstance_euRegion -timeout 120m
=== RUN   TestAccAWSLightsailInstance_euRegion
--- PASS: TestAccAWSLightsailInstance_euRegion (45.31s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    45.319s
```

Fixes: #14668
2017-05-19 16:44:07 -04:00
Kit Ewbank 7795904f78 Check for potentially nil response from GitHub API client. 2017-05-19 15:19:54 -04:00
Jake Champlin dffa575591
add docstring on ignored error 2017-05-19 14:36:39 -04:00
Kit Ewbank ca898d8d19 Add ability to 'terraform import' aws_kms_alias resources. 2017-05-19 14:35:54 -04:00
Radek Simko 79903cd7ea provider/aws: Allow updating tuples in WAF SQLInjectionMatchSet + no tuples (#14667)
* provider/aws: Allow updating tuples in WAF SQL Injection Match Set

* provider/aws: Allow WAF SQL Injection match set with no tuples
2017-05-19 17:59:15 +02:00
Jake Champlin 96e83817ef
provider/aws: validation: Add validation function for IAM Policies
The previous JSON validator that we were using for IAM policy documents wouldn't catch AWS IAM Policy errors.
The supplied policy document would pass our validator, then fail with the following API error:

```
 * aws_iam_role_policy.foo: Error putting IAM role policy tf_test_policy_ymw7hbil9w: MalformedPolicyDocument: The policy failed legacy parsing
                        status code: 400, request id: e7615d90-3c99-11e7-babc-c14e741605bf
```

This happens if the Policy Document doesn't start with the opening JSON bracket, and often happens in the following case:

```
policy = <<EOF
  {
      "Version": "2012-10-17",
      "Statement": [
          {
            ...
          }
      ]
  }
  EOF
```

Where, when using a HEREDOC, the policy document is indented incorrectly.

The new validation function for the IAM policies verifies that the first character of the supplied policy document is the leading JSON bracket, prior to validating the JSON string.

Test Output:

```
$ make test TEST=./builtin/providers/aws/ TESTARGS="-v -run=TestValidateIAMPolicyJsonString"
==> Checking that code complies with gofmt requirements...
==> Checking AWS provider for unchecked errors...
==> NOTE: at this time we only look for uncheck errors in the AWS package
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/19 10:56:32 Generated command/internal_plugin_list.go
go test -i ./builtin/providers/aws/ || exit 1
echo ./builtin/providers/aws/ | \
        xargs -t -n4 go test -v -run=TestValidateIAMPolicyJsonString -timeout=60s -parallel=4
go test -v -run=TestValidateIAMPolicyJsonString -timeout=60s -parallel=4 ./builtin/providers/aws/
=== RUN   TestValidateIAMPolicyJsonString
--- PASS: TestValidateIAMPolicyJsonString (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    0.009s
```

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAWSPolicy_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/19 10:38:43 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAWSPolicy_ -timeout 120m
=== RUN   TestAWSPolicy_namePrefix
--- PASS: TestAWSPolicy_namePrefix (20.01s)
=== RUN   TestAWSPolicy_invalidJson
--- PASS: TestAWSPolicy_invalidJson (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    20.027s
```

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSIAMRolePolicy_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/19 11:02:56 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSIAMRolePolicy_ -timeout 120m
=== RUN   TestAccAWSIAMRolePolicy_importBasic
--- PASS: TestAccAWSIAMRolePolicy_importBasic (18.45s)
=== RUN   TestAccAWSIAMRolePolicy_basic
--- PASS: TestAccAWSIAMRolePolicy_basic (35.92s)
=== RUN   TestAccAWSIAMRolePolicy_namePrefix
--- PASS: TestAccAWSIAMRolePolicy_namePrefix (14.78s)
=== RUN   TestAccAWSIAMRolePolicy_generatedName
--- PASS: TestAccAWSIAMRolePolicy_generatedName (20.20s)
=== RUN   TestAccAWSIAMRolePolicy_invalidJSON
--- PASS: TestAccAWSIAMRolePolicy_invalidJSON (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    89.363s
```
2017-05-19 11:11:44 -04:00
Paul Stack 65283fb47c provider/aws: Change AWS ssm_maintenance_window Read func (#14665)
Fixes: #14653

I was originally calling the wrong API method and only some of the
values were being persisted to state. By changing the API method, we can
now get all of the values and therefore can detech manual drift

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSSMMaintenanceWindow_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/19 16:56:27 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSSMMaintenanceWindow_ -timeout 120m
=== RUN   TestAccAWSSSMMaintenanceWindow_basic
--- PASS: TestAccAWSSSMMaintenanceWindow_basic (41.39s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	41.419s
```
2017-05-19 17:23:40 +03:00
Radek Simko a567cf00ce Merge pull request #14661 from hashicorp/b-aws-waf-size-constraint
provider/aws: Allow updating constraints in WAF SizeConstraintSet + no constraints
2017-05-19 16:00:36 +02:00
Radek Simko cacaf91ff2 provider/aws: Increase timeout for retrying deletion IAM server cert (#14655) 2017-05-19 16:37:07 +03:00
Radek Simko bf99b53d17
provider/aws: Allow WAF SizeConstraint with no tuples 2017-05-19 09:20:33 +02:00
Radek Simko 3fb671be1f
provider/aws: Allow updating constraints in WAF SizeConstraintSet 2017-05-19 09:20:26 +02:00
Radek Simko afe45b62df provider/aws: Allow updating tuples in WAF ByteMatchSet + no tuples (#14071)
* provider/aws: Allow updating tuples in WAF ByteMatchSet

* provider/aws: Allow WAF ByteMatchSet with no tuples
2017-05-19 09:13:58 +02:00
Paddy 2c94b46b14 provider/google: detach disks before deleting them.
When a `google_compute_disk` is attached to a `google_compute_instance`,
deleting can be tricky. GCP doesn't allow disks that are attached to
instances to be deleted. Normally, this is fine; the instance depends on
the disk, so by the time the disk is deleted, the instance should
already be gone.

However, some reports have cropped up (#8667) that deleting disks is
failing because they're still attached to instances. Though this
shouldn't happen, it appears it can happen under some unknown
conditions.

This PR adds logic that will attempt to detach disks from any instances
they're attached to before deleting the disks, adding another safeguard
that should prevent this behaviour.
2017-05-18 17:28:16 -07:00
Matt Robenolt 27927ddc2c provider/google: Add support for privateIpGoogleAccess on subnetworks (#14234) 2017-05-18 13:35:02 -07:00
Mike Tougeron 0e29b744df Mark the aws & gcs secrets as sensitive (#14634) 2017-05-18 15:29:13 -05:00
Clint c3d2f6bbe4 Fix issue with GCP Cloud SQL Instance `disk_autoresize` (#14582)
* provider/google: Fix server/state diff with disk_autoresize

* provider/google: Default true for disk.auto_resize

For sql_database_instance , to match the new API default.

Also adds diff suppression func for autoresize on 1st gen instances

* fix typos
2017-05-18 15:09:01 -05:00
clint shryock aae44290cd merge master 2017-05-18 13:56:55 -05:00
Radek Simko 740c92fc67 provider/aws: Support filtering in ASG data source (#14501) 2017-05-18 17:40:49 +02:00
Paul Stack 62347ea833 provider/aws: Fall back to old tagging mechanism for AWS gov and aws China (#14627)
Fixes: #14535

When in a `restricted` cloud, we should fall back to the old method of
tagging. Before this change we saw the following:

```
% terraform apply                                                                                                                                                                                         ✭
aws_instance.foo: Creating...
  ami:                          "" => "ami-0fa3c42c"
  associate_public_ip_address:  "" => "<computed>"
  availability_zone:            "" => "<computed>"
  ebs_block_device.#:           "" => "<computed>"
  ephemeral_block_device.#:     "" => "<computed>"
  instance_state:               "" => "<computed>"
  instance_type:                "" => "m1.small"
  ipv6_address_count:           "" => "<computed>"
  ipv6_addresses.#:             "" => "<computed>"
  key_name:                     "" => "<computed>"
  network_interface.#:          "" => "<computed>"
  network_interface_id:         "" => "<computed>"
  placement_group:              "" => "<computed>"
  primary_network_interface_id: "" => "<computed>"
  private_dns:                  "" => "<computed>"
  private_ip:                   "" => "<computed>"
  public_dns:                   "" => "<computed>"
  public_ip:                    "" => "<computed>"
  root_block_device.#:          "" => "<computed>"
  security_groups.#:            "" => "<computed>"
  source_dest_check:            "" => "true"
  subnet_id:                    "" => "<computed>"
  tags.%:                       "" => "1"
  tags.foo:                     "" => "bar"
  tenancy:                      "" => "<computed>"
  volume_tags.%:                "" => "<computed>"
  vpc_security_group_ids.#:     "" => "<computed>"
aws_instance.foo: Creation complete (ID: i-0009f227ae24791b9)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

% terraform plan                                                                                                                                                                                          ✭
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_instance.foo: Refreshing state... (ID: i-0009f227ae24791b9)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

~ aws_instance.foo
    tags.%:   "0" => "1"
    tags.foo: "" => "bar"

Plan: 0 to add, 1 to change, 0 to destroy.
```

After this patch, we see the following:

```
% terraform apply                                                                                                                                                                                       ✹ ✭
[WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider.
  If you did not expect to see this message you will need to remove the old plugin.
  See https://www.terraform.io/docs/internals/internal-plugins.html
aws_instance.foo: Creating...
  ami:                          "" => "ami-0fa3c42c"
  associate_public_ip_address:  "" => "<computed>"
  availability_zone:            "" => "<computed>"
  ebs_block_device.#:           "" => "<computed>"
  ephemeral_block_device.#:     "" => "<computed>"
  instance_state:               "" => "<computed>"
  instance_type:                "" => "m1.small"
  ipv6_address_count:           "" => "<computed>"
  ipv6_addresses.#:             "" => "<computed>"
  key_name:                     "" => "<computed>"
  network_interface.#:          "" => "<computed>"
  network_interface_id:         "" => "<computed>"
  placement_group:              "" => "<computed>"
  primary_network_interface_id: "" => "<computed>"
  private_dns:                  "" => "<computed>"
  private_ip:                   "" => "<computed>"
  public_dns:                   "" => "<computed>"
  public_ip:                    "" => "<computed>"
  root_block_device.#:          "" => "<computed>"
  security_groups.#:            "" => "<computed>"
  source_dest_check:            "" => "true"
  subnet_id:                    "" => "<computed>"
  tags.%:                       "" => "1"
  tags.foo:                     "" => "bar"
  tenancy:                      "" => "<computed>"
  volume_tags.%:                "" => "<computed>"
  vpc_security_group_ids.#:     "" => "<computed>"
aws_instance.foo: Creation complete (ID: i-04cd122e28f167a14)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

% terraform plan                                                                                                                                                                                        ✹ ✭
[WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider.
  If you did not expect to see this message you will need to remove the old plugin.
  See https://www.terraform.io/docs/internals/internal-plugins.html
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_instance.foo: Refreshing state... (ID: i-04cd122e28f167a14)
No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, Terraform
doesn't need to do anything.
```
2017-05-18 17:28:37 +03:00
Jake Champlin 3f10116c6b Merge pull request #14563 from raphink/rancher_member
rancher_environment: add member support
2017-05-18 09:54:40 -04:00
Vladislav Rassokhin 5e8306d02a Ensure schemas of `default_cache_behavior` and `cache_behavior` are same except `path_pattern` (#12628) 2017-05-18 16:42:04 +03:00
Radek Simko cf67a689db provider/aws: Randomize CloudFormation acceptance tests (#14623) 2017-05-18 15:39:51 +02:00
Raphaël Pinson 87b502d5cf
rancher_environment: fix typo 2017-05-18 15:20:42 +02:00
Paul Stack 4bb16ad7f8 provider/aws: Fix the aws_codebuild_project acceptance tests (#14626) 2017-05-18 16:19:56 +03:00
Radek Simko 506eaaa247 provider/aws: Raise timeout for attaching/detaching VPN GW (#14624) 2017-05-18 15:02:34 +02:00
Jake Champlin 9e4b62556a Merge pull request #14571 from hashicorp/b-handle-limit-exceeded
provider/aws: Handle LimitExceededException for subscriber limits
2017-05-18 08:34:30 -04:00
Radek Simko 02cacceee4 provider/aws: Fix RDS DB snapshot data source acc test (#14610) 2017-05-18 13:52:33 +02:00
Eugene Chuvyrov 5884d518e7 [MS] Adding support for VMSS Data Disks using Managed Disk feature (#14608)
* Added support for data disks with managed disks feature

* Updated docs with VMSS Data Disks changes
2017-05-18 14:30:19 +03:00
Techbrunch 71e5602d79 Fixes #14620 Handle migration of data when restoring db cluster from snapshot (#14622)
Add `preparing-data-migration` to the list of pending statuses when creating a cluster from a snapshot using a different engine.
2017-05-18 14:23:55 +03:00
Radek Simko f77ccc0520 provider/aws: Randomize SNS topic names in acceptance tests (#14618) 2017-05-18 11:45:19 +02:00
Radek Simko 1b532b519f provider/aws: Increase timeout for retrying creation of IAM server cert (#14609) 2017-05-18 11:43:50 +02:00
Raphaël Pinson 1392670a69
rancher_environment: initialize envClient only when members are set 2017-05-18 09:35:13 +02:00
Raphaël Pinson 4f521c74b0
rancher_environment: do not use a custom set function for members 2017-05-18 09:21:27 +02:00
Clint 2a36e75b9e provider/aws: Tag VPCs created in our tests to help track down leaks (#14596) 2017-05-17 16:26:40 -05:00
James Bardin 6254bb6387 don't rename imports except to avoid collisions 2017-05-17 15:35:04 -04:00
James Bardin 490ee8c17d convert dns tests with external deps tyo ACC tests
External network calls can fail, and shouldn't stop unit tests from
running.
2017-05-17 15:33:30 -04:00
Raphaël Pinson b6c9b2dc7a
Test members 2017-05-17 18:20:47 +02:00
Raphaël Pinson d75ff93165
rancher_environment: do not crash on empty members 2017-05-17 18:20:33 +02:00
Jake Champlin c56cccab48 Merge pull request #14570 from raphink/github_user
GitHub user
2017-05-17 11:33:48 -04:00
Caio Filipini 45ad54c816 provider/digitalocean: Add support for certificates
Besides the support for DO certificates themselves, this commit also
includes:

1) A new `RandTLSCert` function that generates a valid, self-signed TLS
certificate to be used in the test
2) A fix for the PEM encoding of the private key generated in
`RandSSHKeyPair`: the PEM was always empty
2017-05-17 17:20:40 +02:00
Caio Filipini 6681a86211 provider/digitalocean: Update godo for Certificates support
There are three "deeper" changes included with this update:

1) The `Detach` function got removed from the `StorageActionsService` in
favor of `DetachByDropletID` (which is now used in
`resource_digitalocean_volume.go`).

2) The `Update` function got removed from `TagsService` (renaming a tag
has been deprecated in the API).

3) Every function in godo now takes a `context.Context` as first
argument, so I've changed all calls to send in a `context.Background()`.
2017-05-17 17:20:40 +02:00
Raphaël Pinson 96a1622b03
github_user: add acceptance tests 2017-05-17 17:07:15 +02:00
Raphaël Pinson 5833ffe0d1
Use username instead of Id in log 2017-05-17 16:53:32 +02:00
cmorent 0c260d1341 providers/heroku: import heroku_pipeline_coupling resource (#14495) 2017-05-17 09:53:08 -05:00
Raphaël Pinson fc0d197be8
Add github_user data source 2017-05-17 15:04:25 +02:00
Jake Champlin d05fc51aa0
provider/aws: Handle LimitExceededException for subscriber limits
- Updates aws-sdk-go/request for retryer fix
 - Fixes dynamoDB exception handling to catch subscriber limit error

When the `aws-sdk-go` dep releases the next release, we can tag the vendor with the new
release version, and merge this. Until then, soft-updated the vendor solely for the `request` package to post fix.

DynamoDB Fix:
```
aws_dynamodb_table.bar: Creating...
  arn:                       "" => "<computed>"
  attribute.#:               "" => "1"
  attribute.4228504427.name: "" => "id"
  attribute.4228504427.type: "" => "S"
  hash_key:                  "" => "id"
  name:                      "" => "over-cap-test"
  read_capacity:             "" => "5"
  stream_arn:                "" => "<computed>"
  stream_enabled:            "" => "<computed>"
  stream_view_type:          "" => "<computed>"
  write_capacity:            "" => "5"
Error applying plan:

1 error(s) occurred:

* aws_dynamodb_table.bar: 1 error(s) occurred:

* aws_dynamodb_table.bar: AWS Error creating DynamoDB table: LimitExceededException: Subscriber limit exceeded: There is a limit of 256 tables per subscriber
        status code: 400, request id: J2MC7MR060VKBPHP9P6JG5B6Q3VV4KQNSO5AEMVJF66Q9ASUAAJG
```
2017-05-17 08:59:47 -04:00
Radek Simko 65d47774f2 provider/kubernetes: Add support for Service (#14554) 2017-05-17 14:43:53 +02:00
Jake Champlin da2659b8e9 Merge pull request #11710 from ewbankkit/aws_default_vpc-resource
resource/aws: Add 'aws_default_vpc' resource
2017-05-17 08:37:14 -04:00
Jake Champlin a53c8825a8 Merge pull request #14463 from ewbankkit/issue-5653
Nothing to update in cloudformation should not result in errors
2017-05-17 08:08:11 -04:00
Raphaël Pinson 03cabb7b7e
rancher_environment: add member support 2017-05-17 10:03:26 +02:00
Kit Ewbank 2ed7297fa3 Add 'aws_default_vpc' resource. 2017-05-16 20:15:40 -04:00
Paul Stack 8b7f17c039 provider/aws: Change of aws_subnet ipv6 causing update failure (#14545)
Fixes: #14530

When we found an update of IPv6 cidr block, we first tried to
disassociate the old cidr block association. This caused errors if there
was none, it threw an error, as we passed an empty associationId:

```
* aws_subnet.public_subnet.0: InvalidSubnetCidrBlockAssociationId.Malformed: The subnet CIDR block with association ID  is malformed
    status code: 400, request id: f438f468-9ca4-4000-ba78-63a0f25d390a
* aws_subnet.public_subnet[1]: 1 error(s) occurred:
```

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSubnet_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/16 18:28:45 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSubnet_ -timeout 120m
=== RUN   TestAccAWSSubnet_importBasic
--- PASS: TestAccAWSSubnet_importBasic (55.40s)
=== RUN   TestAccAWSSubnet_basic
--- PASS: TestAccAWSSubnet_basic (53.62s)
=== RUN   TestAccAWSSubnet_ipv6
--- PASS: TestAccAWSSubnet_ipv6 (125.87s)
=== RUN   TestAccAWSSubnet_enableIpv6
--- PASS: TestAccAWSSubnet_enableIpv6 (88.88s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	323.787s
```
2017-05-16 23:06:28 +03:00
Paul Stack 055c18e302 core/provider-split: Split out the Oracle OPC provider to new structure (#14362)
* core/providersplit: Split OPC Provider to separate repo

As we march towards Terraform 0.10.0, we are going to start building the
terraform providers as separate binaries - this will allow us to
continually release them. Before we go to 0.10.0, we need to be able to
continue building providers in the same manner, therefore, we have
hardcoded the path of the provider in the generate-plugins.go file

The interim solution will require us to vendor the opc provider and any
child dependencies, but when we get to 0.10.0, we will no longer have to
do this - the core will auto download the plugin binary. The plugin
package will have it's own dependencies vendored as well.

* core/providersplit: Removing the builtin version of OPC provider

* core/providersplit: Vendoring the OPC plugin

* core/providersplit: update internal plugin list

* core/providersplit: remove unused govendor item
2017-05-16 19:53:25 +03:00
Jake Champlin e4a50f2bae Merge pull request #14543 from hashicorp/b-opc-ip-addr-res
provider/opc: Correctly export `ip_address` in IP Addr Reservation
2017-05-16 10:43:13 -04:00
Paul Stack f351de9758 provider/aws: Set aws_subnet ipv6_cidr_block to computed (#14542)
Fixes: #14361

An IPv6 CIDR block is option and can be added *after* a subnet has been
created. Therefore, we should set it to `Computed: true`

Otherwise, a manually created IPv6 association will be removed on the
next terraform run
2017-05-16 17:34:16 +03:00
yanndegat 21d8125d5c provider/ovh: new provider (#12669)
* vendor: add go-ovh

* provider/ovh: new provider

* provider/ovh: Adding PublicCloud User Resource

* provider/ovh: Adding VRack Attachment Resource

* provider/ovh: Adding PublicCloud Network Resource

* provider/ovh: Adding PublicCloud Subnet Resource

* provider/ovh: Adding PublicCloud Regions Datasource

* provider/ovh: Adding PublicCloud Region Datasource

* provider/ovh: Fix Acctests using project's regions
2017-05-16 17:26:43 +03:00
Jake Champlin bc1a6b0261
provider/opc: Correctly export `ip_address` in IP Addr Reservation
Correctly sets the attribute `ip_address` in the `opc_compute_ip_address_reservation` resource.
Also updates documentation for the `ip_address_pool` attribute.

```
$ make testacc TEST=./builtin/providers/opc TESTARGS="-run=TestAccOPCIPAddressReservation_Basic"
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/16 10:15:53 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/opc -v -run=TestAccOPCIPAddressReservation_Basic -timeout 120m
=== RUN   TestAccOPCIPAddressReservation_Basic
--- PASS: TestAccOPCIPAddressReservation_Basic (22.60s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/opc    22.604s
```
2017-05-16 10:19:29 -04:00
Jake Champlin b9e188c5e0 Merge pull request #14528 from ewbankkit/issue-14527
Create rule(s) for prefix-list-only AWS security group ingress/egress permissions on 'terraform import'
2017-05-16 08:38:22 -04:00
mjsteger 9c0888ca88 Fix parsing of digitalocean dns records (#14215)
This changeset fixes how some digitalocean dns records were getting
parsed. In particular, it allows for understanding "@" as shorthand for
the domain itself, preventing terraform from suggesting changes that
wouldn't have any actual effect. This changeset also adds a trailing "."
to certain record types which are required to be submitted with a
trailing dot, but which digitalocean does not return with a trailing
dot, again preventing changes that wouldn't have an effect.

Tests have been added for the above, and with just adding the tests, the
current code is failing, as it is handling some records(e.g. MX)
incorrectly
2017-05-16 12:10:34 +03:00
Raphael Randschau 2c3d54b671 provider/scaleway: allow public_ip to be set (#14515)
this allows the IP <-> server relationship to be inverted as requested by #14175.
2017-05-16 11:59:39 +03:00
Christopher Elkins e1c4194dea Propagate AWS CodePipeline action roles (#14263)
* Propagate AWS CodePipeline action roles

* Add acceptance test for AWS CodePipeline action roles

* Isolate AWS CodePipeline service role acceptance test
2017-05-16 11:55:42 +03:00
Stephen Weatherford b65df9b5ac [MS] 14058 single placement group tf (#14510)
* Add single_placement_group to VMSS

* Add test, plus fixes

* Fix tests
2017-05-16 11:46:07 +03:00