Commit Graph

5132 Commits

Author SHA1 Message Date
clint shryock 5b87cd49a9 provider/aws: Update EFS resource to read performance mode and creation_token 2016-10-05 13:48:35 -05:00
Clint e2c74fce7f Merge pull request #9230 from lifesum/route53_healthcheck
provider/aws - Add update support for `search_string` in aws_cloudwatch_metric_alarm
2016-10-05 08:52:34 -05:00
Alexander Hellbom f6c66025cc Add update support for `search_string` 2016-10-05 13:25:00 +02:00
Paul Stack aa97ebd0e7 Merge pull request #9220 from AMeng/import-db-event-sub
provider/aws: Import aws_db_event_subscription
2016-10-05 01:03:53 +01:00
AMeng b7fae4028c provider/aws: Import aws_db_event_subscription 2016-10-04 15:24:30 -06:00
Michael Henry ad8bff98bb Extract integration type validator 2016-10-04 12:51:18 -04:00
Michael Henry 71b62d83b2 Allow new aws api-gateway integration types
The added types are 'AWS_PROXY' for integrating with lambdas and
'HTTP_PROXY' for integrating via http.

See http://docs.aws.amazon.com/apigateway/api-reference/resource/integration/
2016-10-04 12:23:04 -04:00
Paul Stack 60f0603f1c Merge pull request #9175 from PayscaleNateW/provider/aws/fix-acceptance-test-log-bucket
Provider/aws/fix acceptance test log bucket
2016-10-04 00:07:52 +01:00
Nathaniel Weinstein ff6469be89 Made import and base s3origin tests more independent, by supplying different random ints to each of their test runs 2016-10-03 15:11:46 -07:00
Paul Stack 3c63c80b86 Merge pull request #9185 from BedeGaming/azurerm-servicebus-sub
provider/azurerm: add servicebus_subscription resource
2016-10-03 17:35:31 +01:00
Paul Stack 122a985767 Merge pull request #9163 from BedeGaming/azurerm-resource-id-fix
provider/azurerm: fix resource ID parsing for subscriptions resources
2016-10-03 17:07:36 +01:00
Paul Stack 2d90f8a91c Merge pull request #9140 from hashicorp/import-aws-elasticache_replication_groups
provider/aws: Support Import of AWS elasticache_replication_groups
2016-10-03 16:59:31 +01:00
stack72 520f96e84b
provider/aws: Support Import of AWS elasticache_replication_groups
Fixes #9094

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/30 00:09:04 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheReplicationGroup_importBasic -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_importBasic
--- PASS: TestAccAWSElasticacheReplicationGroup_importBasic (756.38s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws756.398s
```
2016-10-03 16:52:29 +01:00
stack72 17cb9a19da
Merge branch 'DJRH-import-opsworks-stacks' 2016-10-03 16:48:23 +01:00
stack72 fa3051a42b
provider/aws: Rename the Import aws_opsworks_stack import test
The casing on the test name was causing it not to run with the entire
test suite

```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestAccAWSOpsworksStack'             2 ↵ ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/03 16:43:07 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSOpsworksStack
-timeout 120m
=== RUN   TestAccAWSOpsworksStackImportBasic
--- PASS: TestAccAWSOpsworksStackImportBasic (49.00s)
=== RUN   TestAccAWSOpsworksStackNoVpc
--- PASS: TestAccAWSOpsworksStackNoVpc (36.10s)
=== RUN   TestAccAWSOpsworksStackVpc
--- PASS: TestAccAWSOpsworksStackVpc (73.27s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws158.385s
```
2016-10-03 16:45:02 +01:00
Paul Stack 90f74dae21 Merge pull request #9188 from hashicorp/b-aws-ssm-retry-delete
provider/aws: Add retry to the `aws_ssm_document` delete func
2016-10-03 16:38:52 +01:00
stack72 2f81f47d49
Merge branch 'import-opsworks-stacks' of https://github.com/DJRH/terraform into DJRH-import-opsworks-stacks 2016-10-03 16:23:03 +01:00
stack72 09e9e3a662
provider/aws: Add retry to the `aws_ssm_document` delete func
As noticed in the acceptance tests, we were expecting the document to be
deleted but it was still found

```
=== RUN   TestAccAWSSSMDocument_permission
--- FAIL: TestAccAWSSSMDocument_permission (5.60s)
    testing.go:329: Error destroying resource! WARNING: Dangling
    resources
            may exist. The full state and error is shown below.

                            Error: Check failed: Expected AWS SSM
                            Document to be gone, but was still found

                                            State: <no state>
```
2016-10-03 16:14:15 +01:00
clint shryock 2c934f9686 provider/aws: Insert log when removing volume attachment if not found 2016-10-03 09:57:42 -05:00
Clint f1c5f848e9 Merge pull request #9023 from Jonnymcc/destroying-detached-vol-attch-res
provider/aws: Skip DetachVolume if volume is not attached
2016-10-03 09:56:49 -05:00
Paul Stack 7cba88931a Merge pull request #9125 from hashicorp/b-aws-r53-alias-refresh
provider/aws: aws_route53_record alias refresh manually updated record
2016-10-03 15:55:23 +01:00
Peter McAtominey 475fd4decb provider/azurerm: add servicebus_subscription resource
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusSubscription -timeout 120m
=== RUN   TestAccAzureRMServiceBusSubscription_importBasic
--- PASS: TestAccAzureRMServiceBusSubscription_importBasic (339.00s)
=== RUN   TestAccAzureRMServiceBusSubscription_basic
--- PASS: TestAccAzureRMServiceBusSubscription_basic (328.47s)
=== RUN   TestAccAzureRMServiceBusSubscription_update
--- PASS: TestAccAzureRMServiceBusSubscription_update (368.95s)
=== RUN   TestAccAzureRMServiceBusSubscription_updateRequiresSession
--- PASS: TestAccAzureRMServiceBusSubscription_updateRequiresSession (348.47s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1384.966s
2016-10-03 15:27:28 +01:00
Paul Stack 727825ca99 Merge pull request #9151 from BedeGaming/azurerm-servicebus-topic
provider/azurerm: add servicebus_topic resource
2016-10-03 15:00:47 +02:00
DJ Home 967335eae3 Merge branch 'master' into import-opsworks-stacks 2016-10-03 11:28:28 +01:00
Peter McAtominey cdbf0d7df4 provider/azurerm: add servicebus_topic resource
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusTopic -timeout 120m
=== RUN   TestAccAzureRMServiceBusTopic_importBasic
--- PASS: TestAccAzureRMServiceBusTopic_importBasic (328.72s)
=== RUN   TestAccAzureRMServiceBusTopic_basic
--- PASS: TestAccAzureRMServiceBusTopic_basic (331.04s)
=== RUN   TestAccAzureRMServiceBusTopic_update
--- PASS: TestAccAzureRMServiceBusTopic_update (348.69s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1008.588s
2016-10-03 11:25:50 +01:00
Nathaniel Weinstein 69e56beac7 Fixed acceptance test that was failing due to undefined log bucket 2016-10-02 22:28:34 -07:00
Nathaniel Weinstein 822c8f9a32 Fixed acceptance test that was failing due to undefined log bucket 2016-10-02 22:23:03 -07:00
Peter McAtominey 70d5914e1b provider/azurerm: fix resource ID parsing for subscriptions resources
If a resource ID has more than one subscriptions key, as is the case for Service
Bus subscriptions the Azure SubscriptionID field was overwritten by the second
value.

TF_ACC= go test ./builtin/providers/azurerm -run TestParseAzureResourceID -timeout=30s -parallel=4
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	0.060s
2016-10-01 17:47:19 +01:00
clint shryock de3a7b5d20 give security groups their own sgProtocolIntegers methodw 2016-09-30 15:45:25 -05:00
clint shryock 2cc28f6137 revert netacl protocolIntegers change from 45da08c67f 2016-09-30 15:45:25 -05:00
clint shryock 6282c0fabf provider/aws: Regression test for NetAcl + ESP protocol 2016-09-30 15:45:25 -05:00
Jonathan McCall dc4a7b7d25 Simplify check for already detached volume before destroying 2016-09-30 14:11:50 -04:00
Jonathan McCall f3deaab878 Remove resource if volume to detach is missing 2016-09-30 14:11:50 -04:00
Jonathan McCall a3ceb25dd7 Skip DetachVolume if volume is not attached 2016-09-30 14:11:50 -04:00
DJ Home 73f20ec88d Revert region to us-west-2 (and set us-west-2 as default region in acceptance test class) 2016-09-30 13:33:00 +01:00
James Nugent 506268aabe Merge pull request #9035 from apparentlymart/tls-cert-request-resource
Restore tls_cert_request to being a managed resource
2016-09-30 00:29:48 -05:00
Clint 7337a346ec provider/aws: Fix issue with updating ELB subnets for subnets in the same AZ (#9131)
* provider/aws: Regression test for #9120

* provider/aws: Fix issue with updating ELB subnets for subnets in the same AZ
2016-09-29 13:01:09 -05:00
stack72 ae2b8d45db
provider/aws: aws_route53_record alias refresh manually updated record
Fixes #9108

When an aws_route53_record alias is created with terraform and then
modified via cli or console, terraform wasn't picking up the changes. I
had the following config:

```
resource "aws_route53_record" "alias" {
  zone_id = "${aws_route53_zone.main.zone_id}"
  name = "www"
  type = "A"

  alias {
  	zone_id = "${aws_elb.main.zone_id}"
  	name = "${aws_elb.main.dns_name}"
  	evaluate_target_health = true
  }
}
```

I changed the evaluate_health_target on the AWS console and terraform plan showed me this:

```
% 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_route53_zone.main: Refreshing state... (ID: Z32Z9B1UPAIP6X)
aws_elb.main: Refreshing state... (ID: foobar-terraform-elb-1111)
aws_route53_record.alias: Refreshing state... (ID: Z32Z9B1UPAIP6X_www_A)

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
```

When rebuilding the provider with the changes in the PR, a terraform plan then 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
[WARN] /Users/stacko/Code/go/bin/terraform-provider-azurerm overrides an internal plugin for azurerm-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_route53_zone.main: Refreshing state... (ID: Z32Z9B1UPAIP6X)
aws_elb.main: Refreshing state... (ID: foobar-terraform-elb-1111)
aws_route53_record.alias: Refreshing state... (ID: Z32Z9B1UPAIP6X_www_A)

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_route53_record.alias
    alias.1050468691.evaluate_target_health: "" => "true"
    alias.1050468691.name:                   "" => "foobar-terraform-elb-1111-522021794.us-west-2.elb.amazonaws.com"
    alias.1050468691.zone_id:                "" => "Z1H1FL5HABSF5"
    alias.2906616344.evaluate_target_health: "false" => "false"
    alias.2906616344.name:                   "foobar-terraform-elb-1111-522021794.us-west-2.elb.amazonaws.com." => ""
    alias.2906616344.zone_id:                "Z1H1FL5HABSF5" => ""

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

the apply then changed the target back to true

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRoute53Record_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/29 18:17:23 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRoute53Record_ -timeout 120m
=== RUN   TestAccAWSRoute53Record_basic
--- PASS: TestAccAWSRoute53Record_basic (120.63s)
=== RUN   TestAccAWSRoute53Record_basic_fqdn
--- PASS: TestAccAWSRoute53Record_basic_fqdn (131.81s)
=== RUN   TestAccAWSRoute53Record_txtSupport
--- PASS: TestAccAWSRoute53Record_txtSupport (128.40s)
=== RUN   TestAccAWSRoute53Record_spfSupport
--- PASS: TestAccAWSRoute53Record_spfSupport (120.06s)
=== RUN   TestAccAWSRoute53Record_generatesSuffix
--- PASS: TestAccAWSRoute53Record_generatesSuffix (114.02s)
=== RUN   TestAccAWSRoute53Record_wildcard
--- PASS: TestAccAWSRoute53Record_wildcard (165.54s)
=== RUN   TestAccAWSRoute53Record_failover
--- PASS: TestAccAWSRoute53Record_failover (118.10s)
=== RUN   TestAccAWSRoute53Record_weighted_basic
--- PASS: TestAccAWSRoute53Record_weighted_basic (128.10s)
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (132.62s)
=== RUN   TestAccAWSRoute53Record_s3_alias
--- PASS: TestAccAWSRoute53Record_s3_alias (132.12s)
=== RUN   TestAccAWSRoute53Record_weighted_alias
--- PASS: TestAccAWSRoute53Record_weighted_alias (237.92s)
=== RUN   TestAccAWSRoute53Record_geolocation_basic
--- PASS: TestAccAWSRoute53Record_geolocation_basic (121.95s)
=== RUN   TestAccAWSRoute53Record_latency_basic
--- PASS: TestAccAWSRoute53Record_latency_basic (123.40s)
=== RUN   TestAccAWSRoute53Record_TypeChange
--- PASS: TestAccAWSRoute53Record_TypeChange (198.24s)
=== RUN   TestAccAWSRoute53Record_empty
--- PASS: TestAccAWSRoute53Record_empty (119.68s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws2092.597s
```
2016-09-29 18:54:32 +01:00
DJ Home 979afcecdc Fix acceptance tests 2016-09-29 13:00:52 +01:00
DJ Home 1bc154535f Add ability to import OpsWorks stacks 2016-09-29 11:44:58 +01:00
Paul Stack 5f8cd8e69f Merge pull request #9101 from hashicorp/b-aws-elasticache-panic-parameter-group
provider/aws: Modifying the parameter_group_name of aws_elasticache_replication_group caused a panic
2016-09-28 20:27:01 +01:00
Paul Stack 10eb572437 Merge pull request #9050 from hashicorp/b-aws-ecr-delete-timeout
provider/aws: Add retry logic to the aws_ecr_repository delete func
2016-09-28 20:10:35 +01:00
Paul Stack 9202bb4751 Merge pull request #9011 from hashicorp/f-aws-cloudfront-tags
provider/aws: Add support for tags to aws_cloudfront_distribution
2016-09-28 19:54:47 +01:00
Paul Stack b6718de299 Merge pull request #9010 from hashicorp/aws-elasticache-cluster-import
Aws elasticache cluster import
2016-09-28 19:49:42 +01:00
Mickaël Canévet 1521517068 network_id is computed (#9102) 2016-09-28 17:35:37 +02:00
stack72 13cf370d07
provider/aws: Add support for tags to aws_cloudfront_distribution
Fixes #8959

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudFrontDistribution_S3OriginWithTags'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 16:30:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudFrontDistribution_S3OriginWithTags -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1234.66s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1234.680s
```
2016-09-28 13:18:41 +01:00
stack72 b02a5c47ec
provider/aws: Support Import of aws_elasticache_cluster
Initial tests were failing as follows:

```
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- FAIL: TestAccAWSElasticacheCluster_importBasic (362.66s)
        testing.go:265: Step 1 error: ImportStateVerify attributes not
        equivalent. Difference is shown below. Top is actual, bottom is
        expected.

        (map[string]string) {

        }

(map[string]string) (len=2) {
             (string) (len=20) "parameter_group_name": (string) (len=20)
             "default.memcached1.4",
                             (string) (len=22) "security_group_names.#":
                             (string) (len=1) "0"

}

FAIL
exit status 1
```

The import of ElastiCache clusters helped to point out 3 things:

1. Currently, we were trying to set the parameter_group_name as follows:

```
d.Set("parameter_group_name", c.CacheParameterGroup)
```

Unfortunately, c.CacheParameterGroup is a struct not a string. This was
causing the test import failure. So this had to be replaced as follows:

```
if c.CacheParameterGroup != nil {
      d.Set("parameter_group_name", c.CacheParameterGroup.CacheParameterGroupName)
}
```

2. We were trying to set the security_group_names as follows:

```
d.Set("security_group_names", c.CacheSecurityGroups)
```

The CacheSecurityGroups was actually a []* so had to be changed to work
as follows:

```
if len(c.CacheSecurityGroups) > 0 {
            d.Set("security_group_names",
            flattenElastiCacheSecurityGroupNames(c.CacheSecurityGroups))

}
```

3. We were trying to set the security_group_ids as follows:

```
d.Set("security_group_ids", c.SecurityGroups)
```

This is another []* and needs to be changed as follows:

```
if len(c.SecurityGroups) > 0 {
            d.Set("security_group_ids",
            flattenElastiCacheSecurityGroupIds(c.SecurityGroups))

}
```

This then allows the import test to pass as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 10:59:01 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_importBasic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- PASS: TestAccAWSElasticacheCluster_importBasic (351.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    351.981s
```

As a final test, I ran the basic ElastiCache cluster creation to make
sure all passed as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 11:05:51 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_basic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_basic
--- PASS: TestAccAWSElasticacheCluster_basic (809.25s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    809.267s
```
2016-09-28 12:29:20 +01:00
stack72 15c8534538
provider/aws: Add retry logic to the aws_ecr_repository delete func
Fixes #8597

There was sometimes an issue where Terraform was deleting the ECR
repository from the statefile before the reposity was actually deleted.

Added retry logic for Terraform to wait for the repository to be deleted
before proceeding with the statefile update

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEcrRepository_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 12:46:57 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEcrRepository_ -timeout 120m
=== RUN   TestAccAWSEcrRepository_importBasic
--- PASS: TestAccAWSEcrRepository_importBasic (17.86s)
=== RUN   TestAccAWSEcrRepository_basic
--- PASS: TestAccAWSEcrRepository_basic (16.40s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    34.288s
```
2016-09-28 12:01:13 +01:00
stack72 2efd93a67e
provider/aws: Modifying the parameter_group_name of
aws_elasticache_replication_group caused a panic

Fixes #9097

The update for `parameter_group_name` was trying to find the incorrect
value to set `cache_parameter_group_name` - this is what was causing the
panic

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_updateParameterGroup'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/28 11:17:30 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheReplicationGroup_updateParameterGroup -timeout
120m
=== RUN   TestAccAWSElasticacheReplicationGroup_updateParameterGroup
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup
(903.90s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws903.931s
```
2016-09-28 11:48:17 +01:00
Paul Stack d4dd615b52 Merge pull request #9052 from hashicorp/b-aws-rds-option-group
provider/aws: aws_db_option_group flattenOptions failing due to missing values
2016-09-28 11:18:28 +01:00