Commit Graph

7415 Commits

Author SHA1 Message Date
Radek Simko e773e59aaf provider/aws: Increase EIP update timeout (#14381) 2017-05-11 12:51:48 +02:00
Radek Simko a846b1b3b0 provider/aws: Fix test config for SES Receipt Rule (#14383) 2017-05-11 12:51:26 +02:00
Sean Chittenden 67a27b4a45 Make triton machine deletes synchronous. 2017-05-11 11:42:15 +03:00
tombuildsstuff b3a02b0b78 Ensuring we return an empty slice to match 2017-05-11 11:39:26 +03:00
tombuildsstuff 6fa4ee9997 Formatting 2017-05-11 11:39:26 +03:00
tombuildsstuff 3e23e94c39 Locking on the Subnet's and Virtual Network's given only one NIC in a subnet can be modified at once 2017-05-11 11:39:26 +03:00
tombuildsstuff 58ce4a7223 Refactoring the lockMultiple function out 2017-05-11 11:39:26 +03:00
Jake Champlin 570651bb06 Merge pull request #14299 from hashicorp/f-sg-add-issue-3205
provider/aws: Fix SG update on instance with multiple network interfaces
2017-05-10 20:14:06 -04:00
Paddy 25ed7cc6c0 Merge pull request #14280 from hashicorp/paddy_container_versions
providers/google: add google_container_versions data source.
2017-05-10 15:50:16 -07:00
Paddy 9078efc478 Update test names. 2017-05-10 15:12:14 -07:00
Paddy 1709ea4414 google_container_versions => google_container_engine_versions
As per feedback from @danawillow and @radeksimko.
2017-05-10 15:01:15 -07:00
Sean Chittenden b6eb0abcef
Chase API breakage from github.com/joyent/triton-go: add context.Background() 2017-05-10 14:54:57 -07:00
Evan Phoenix f1a8b2888b Merge pull request #14334 from hashicorp/f-govcloud-s3-tags
Don't error out getting s3 object tags in govcloud
2017-05-10 14:45:13 -07:00
Paddy 51b1c7b084 Merge pull request #14089 from hashicorp/b-aws-waf-rule
provider/aws: Allow updating predicates in WAF Rule + no predicates
2017-05-10 13:58:17 -07:00
Chris Johnson d1b5eac587 provider/heroku: Fix heroku_cert update of ssl cert (#14240)
* Attempt to write a new test for cert update

Trying to surface this bug with a test:
https://github.com/hashicorp/terraform/issues/5930

* Fix the error

* Fix the test for the update operation

* Break apart tests for EU vs US to cleanse test run

* Refactor Update to more closely match create, increase debug logging

* Reflect differences of EU and US regions via separate tests

* Add comment re: why of test breakout

* Removed the “SetId” as it was unnecessary

* Ensure the SSL Addon has been provisioned
2017-05-10 15:52:55 -05:00
Clint 24e00af217 provider/aws: Force lowercasing for DB Option group name or name_prefix (#14366) 2017-05-10 15:42:10 -05:00
Radek Simko f868a59ffa provider/google: Log HTTP requests and responses in DEBUG mode (#14281) 2017-05-10 21:16:43 +02:00
Evan Phoenix 3c68a992c6 Be explicit about when tags are supported on S3 2017-05-10 11:13:03 -07:00
Alexander 9517d80a35 provider/google: BigQuery Table (#13743)
* Add resource

* Add tests

* Add documentation

* Fix invalid comment

* Remove MinItems

* Add newline

* Store expected ID and format

* Add import note

* expiration_time can be computed if dataset has an expiration_time set

* Handle 404 using new check function
2017-05-10 10:20:39 -07:00
stack72 db432ad765 provider/aws: Adding IPv6 address to instance causes perpetual diff
Fixes: #14032

When you are using an IPv6 address directly to an instance, it was
causing the ipv6_address_count to try and ForceNew resource. It wasn't
marked as computed

I was able to see this here:

```
-/+ aws_instance.test
    ami:                          "ami-c5eabbf5" => "ami-c5eabbf5"
    associate_public_ip_address:  "false" => "<computed>"
    availability_zone:            "us-west-2a" => "<computed>"
    ebs_block_device.#:           "0" => "<computed>"
    ephemeral_block_device.#:     "0" => "<computed>"
    instance_state:               "running" => "<computed>"
    instance_type:                "t2.micro" => "t2.micro"
    ipv6_address_count:           "1" => "0" (forces new resource)
    ipv6_addresses.#:             "1" => "1"
    ipv6_addresses.0:             "2600:1f14:bb2:e501::10" => "2600:1f14:bb2:e501::10"
    key_name:                     "" => "<computed>"
    network_interface.#:          "0" => "<computed>"
    network_interface_id:         "eni-d19115ec" => "<computed>"
    placement_group:              "" => "<computed>"
    primary_network_interface_id: "eni-d19115ec" => "<computed>"
    private_dns:                  "ip-10-20-1-252.us-west-2.compute.internal" => "<computed>"
    private_ip:                   "10.20.1.252" => "<computed>"
    public_dns:                   "" => "<computed>"
    public_ip:                    "" => "<computed>"
    root_block_device.#:          "1" => "<computed>"
    security_groups.#:            "0" => "<computed>"
    source_dest_check:            "true" => "true"
    subnet_id:                    "subnet-3fdfb476" => "subnet-3fdfb476"
    tags.%:                       "1" => "1"
    tags.Name:                    "stack72" => "stack72"
    tenancy:                      "default" => "<computed>"
    volume_tags.%:                "0" => "<computed>"
    vpc_security_group_ids.#:     "1" => "<computed>"
```

It now works as expected:

```
% 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_vpc.foo: Refreshing state... (ID: vpc-fa61669d)
aws_subnet.foo: Refreshing state... (ID: subnet-3fdfb476)
aws_internet_gateway.foo: Refreshing state... (ID: igw-70629a17)
aws_route_table.test: Refreshing state... (ID: rtb-0a52e16c)
aws_instance.test: Refreshing state... (ID: i-0971755345296aca5)
aws_route_table_association.a: Refreshing state... (ID: rtbassoc-b12493c8)
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-10 18:39:20 +03:00
Radek Simko 6b4643fbdc provider/aws: Increase timeouts for Route Table retries (#14345) 2017-05-10 14:41:49 +02:00
Dana Hoffman 37911bcc99 provider/google: Handle all 404 checks in read functions via the new function 2017-05-10 14:50:19 +03:00
Evan Phoenix 1ff7fe5ebe Use properly described error 2017-05-09 15:41:12 -07:00
Evan Phoenix 2171e2118f Don't error out getting s3 object tags in govcloud 2017-05-09 15:39:58 -07:00
stack72 930a41b7c0 provider/aws: Slight design change to aws_elasticache_replication_group
We should error check up front on the use of num_cache_nodes and
cluster_mode. This allows us to write a test to make sure all works as
expected

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/09 19:04:56 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (40.58s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	40.603s
```
2017-05-09 20:37:28 +03:00
Derrick Petzold 55a4ce2838 Feature request: Support for ElastiCache Redis cluster mode #9419
Added support for provisioning a native redis cluster elasticache replication group.
A new TypeSet attribute `cluster_mode` has been added. It requires the following
fields:

  - `replicas_per_node_group` - The number of replica nodes in each node group
  - `num_node_groups` - The number of node groups for this Redis replication group

Notes:

  - `automatic_failover_enabled` must be set to true.
  - `number_cache_clusters` is now a optional and computed field. If `cluster_mode` is set
    its value will be computed as:
 	  ```num_node_groups + num_node_groups * replicas_per_node_group```

Below is a sample config:

  resource "aws_elasticache_replication_group" "bar" {
      replication_group_id = "tf-redis-cluser"
      replication_group_description = "test description"
      node_type = "cache.t2.micro"
      port = 6379
      parameter_group_name = "default.redis3.2.cluster.on"
      automatic_failover_enabled = true
      cluster_mode {
          replicas_per_node_group = 1
          num_node_groups = 2
      }
  }
2017-05-09 20:37:28 +03:00
Paul Stack 67bbad1cf0 provider/aws: Update the ignoring of AWS specific tags (#14321)
We were too greedy with the AWS specific tags ignore function - we
basically were ignoring anything starting with `aws` rather than just
using `aws:`

Fixes: #14308
Fixes: #14247
2017-05-09 20:19:33 +03:00
Jake Champlin 770b861508 Merge pull request #14304 from paybyphone/zero-value-aws-lb-names
Allows zero-value ELB and ALB names
2017-05-09 13:16:41 -04:00
Jake Champlin 4677aca349 Merge pull request #14319 from hashicorp/f-update-partition-check
provider/aws: Use helper methods for checking partition
2017-05-09 12:30:07 -04:00
Jake Champlin 67ea7a3a08
reverse if statement 2017-05-09 12:19:50 -04:00
Jake Champlin 19e29c2944
provider/aws: Use helper methods for checking partition 2017-05-09 12:17:27 -04:00
Clint 88c2e29f91 provider/aws: Consolidate IAM Account Alias tests (#14316)
* provider/aws: combine aws alias tests

* tweaks

* fix up

* uncomment
2017-05-09 11:12:07 -05:00
Jake Champlin 7b05d7f050 Merge pull request #12414 from jmcarp/govcloud-cloudwatchlogs-tags
Skip tag operations on cloudwatch logs in govcloud partition.
2017-05-09 12:10:09 -04:00
Paul Stack 9dd4e5bcb0 provider/aws: Add support for targets to aws_ssm_association (#14246)
* provider/aws: Add support for targets to aws_ssm_association

Fixes: #13975

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSSMAssociation_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/05 20:32:43 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSSMAssociation_ -timeout 120m
=== RUN   TestAccAWSSSMAssociation_basic
--- PASS: TestAccAWSSSMAssociation_basic (139.13s)
=== RUN   TestAccAWSSSMAssociation_withTargets
--- PASS: TestAccAWSSSMAssociation_withTargets (33.19s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	172.343s
```

* Update ssm_association.html.markdown
2017-05-09 17:48:57 +03:00
Jake Champlin 930832d5eb Merge pull request #14271 from sbfaulkner/fix-data_dns_txt_record_set
Fix data dns txt record set
2017-05-09 10:01:09 -04:00
Dana Hoffman 1438eacdad provider/google: better visibility for compute_region_backend_service (#14301) 2017-05-09 13:10:14 +03:00
stack72 d637885dc3
provider/aws: Removal of Optional from aws_ses_domain_identity arn param
```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAwsSESDomainIdentity_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/09 13:05:15 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAwsSESDomainIdentity_ -timeout 120m
=== RUN   TestAccAwsSESDomainIdentity_basic
--- PASS: TestAccAwsSESDomainIdentity_basic (23.53s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	23.545s
```
2017-05-09 13:06:11 +03:00
stack72 880071ded5
Merge branch 'ses-arn' of https://github.com/joshuaspence/terraform into joshuaspence-ses-arn 2017-05-09 13:04:27 +03:00
Joshua Spence f488e385f2 Add `arn` attribute to `aws_ses_domain_identity` resource 2017-05-09 17:14:51 +10:00
Graham Davison 7ad0cdd8b0 Allows zero-value ELB and ALB names 2017-05-08 23:06:59 -07:00
Radek Simko 178488f4bd provider/kubernetes: Add support for limit_range (#14285) 2017-05-09 05:07:17 +02:00
Dmitrii Korotovskii ace0456d58 http provider and http request data source 2017-05-08 17:37:48 -07:00
emily 64c2e68de9 Add additional properties for google resource storage bucket object. (#14259) 2017-05-08 16:35:47 -07:00
Jake Champlin 0d6891d505
provider/aws: Fix attach of SG to instance with multiple network interfaces
With an EC2 instance that only had a single network interface, the primary interface, the Update function would call `ModifyInstanceAttribute()` on the target instance. This would only work if there was a single network interface attached to the EC2 instance. If, however, a secondary network interface was attached to the instance, the `ModifyInstanceAttribute()` API call would fail with the following error message:

 > There are multiple interfaces attached to instance 'i-XXXXX'. Please specify an interface ID for the operation instead.

 After this changeset, modifying instance security groups now makes the correct call to `ModifyNetworkInterfaceAttribute()` in order to modify the list of security groups on the primary network interface, as initially configured during the instances creation.

 This change is also safe from an instance that has a non-default primary network interface, as the instance attribute `vpc_security_group_ids` conflicts with the new `network_interface` attribute.

 Test Output:

 ```
 $ make testacc TEST=./builtin/providers/aws TESTARGS="-run=TestAccAWSInstance_addSecurityGroupNetworkInterface"
 ==> Checking that code complies with gofmt requirements...
 go generate $(go list ./... | grep -v /terraform/vendor/)
 2017/05/08 17:52:42 Generated command/internal_plugin_list.go
 TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_addSecurityGroupNetworkInterface -timeout 120m
 === RUN   TestAccAWSInstance_addSecurityGroupNetworkInterface
 --- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (327.75s)
 PASS
 ok      github.com/hashicorp/terraform/builtin/providers/aws    327.756s
```
2017-05-08 18:30:22 -04:00
clint shryock 8b252d19ab provider/aws: Update TestAccAWSCloudWatchEventTarget_ssmDocument / TestAccAWSCloudWatchEventTarget_full tests to avoid name collisions 2017-05-08 16:22:58 -05:00
Sergiusz Bazański 0175129d9e Fix Google Cloud Service Account provider .Read (#14282)
The implementation would return an error if the resource was detected as
removed - this would break Terraform instead of making it re-create the
missing service account.
2017-05-08 09:02:54 -05:00
Radek Simko 296a3b2381 provider/kubernetes: Add support for resource_quota (#13914) 2017-05-08 13:43:24 +02:00
Paul Stack 221a88610b provider/aws: Add support for importing Kinesis Streams (#14278)
Fixes: #14260

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSKinesisStream_import'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/08 10:32:47 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSKinesisStream_import -timeout 120m
=== RUN   TestAccAWSKinesisStream_importBasic
--- PASS: TestAccAWSKinesisStream_importBasic (101.93s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	101.978s
```
2017-05-08 14:11:23 +03:00
Paul Stack 03e4e00673 provider/aws: Refresh ssm document from state on 404 (#14279)
* provider/aws: Refresh ssm document from state on 404

Originally reported in #13976

When an SSM Document was deleted outside of Terraform, a terraform
refresh would return the following:

```
% 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_ssm_document.foo: Refreshing state... (ID: test_document-stack72)
Error refreshing state: 1 error(s) occurred:

* aws_ssm_document.foo: aws_ssm_document.foo: [ERROR] Error describing SSM document: InvalidDocument:
	status code: 400, request id: 70c9bed1-33bb-11e7-99aa-697e9b0914e9

```

On applying this patch, it now looks as follows:

```
% 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_ssm_document.foo: Refreshing state... (ID: test_document-stack72)
  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_ssm_document.foo
      arn:              "<computed>"
      content:          "    {\n      \"schemaVersion\": \"1.2\",\n      \"description\": \"Check ip configuration of a Linux instance.\",\n      \"parameters\": {\n\n      },\n      \"runtimeConfig\": {\n        \"aws:runShellScript\": {\n          \"properties\": [\n            {\n              \"id\": \"0.aws:runShellScript\",\n              \"runCommand\": [\"ifconfig\"]\n            }\n          ]\n        }\n      }\n    }\n"
      created_date:     "<computed>"
      default_version:  "<computed>"
      description:      "<computed>"
      document_type:    "Command"
      hash:             "<computed>"
      hash_type:        "<computed>"
      latest_version:   "<computed>"
      name:             "test_document-stack72"
      owner:            "<computed>"
      parameter.#:      "<computed>"
      platform_types.#: "<computed>"
      schema_version:   "<computed>"
      status:           "<computed>"

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

* Update resource_aws_ssm_document.go
2017-05-08 13:50:16 +03:00
Radek Simko b3eefecc05 provider/aws: Retry deletion of AWSConfig Rule on ResourceInUseException (#14269) 2017-05-08 11:15:12 +02:00