Commit Graph

5142 Commits

Author SHA1 Message Date
Paul Stack 97ad032474 Merge pull request #8859 from carinadigital/arm-vm-fix
provider/azurerm: Terraform Plan errors when created resources disappear
2016-10-06 22:38:30 +01:00
Paul Stack e012c4fcc5 Merge pull request #9242 from BedeGaming/azurerm-sb-namespace-keys
provider/azurerm: expose default keys for servicebus_namespace
2016-10-06 21:53:23 +01:00
Krzysztof Wilczynski 1260b3a9b5
Add new "ANY" as valid HTTP method to API Gateway validator.
This commit adds a new HTTP method to a list of valid HTTP methods which
is now accepted by API Gateway.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-10-06 16:11:45 +01:00
Peter McAtominey f733d6aa8a provider/azurerm: expose default keys for servicebus_namespace
A default authorization rule is created by Azure which, if present is exported by
the resource.

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusNamespace -timeout 120m
=== RUN   TestAccAzureRMServiceBusNamespaceCapacity_validation
--- PASS: TestAccAzureRMServiceBusNamespaceCapacity_validation (0.00s)
=== RUN   TestAccAzureRMServiceBusNamespaceSku_validation
--- PASS: TestAccAzureRMServiceBusNamespaceSku_validation (0.00s)
=== RUN   TestAccAzureRMServiceBusNamespace_basic
--- PASS: TestAccAzureRMServiceBusNamespace_basic (352.03s)
=== RUN   TestAccAzureRMServiceBusNamespace_readDefaultKeys
--- PASS: TestAccAzureRMServiceBusNamespace_readDefaultKeys (349.17s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	701.278s
2016-10-05 22:12:28 +01:00
clint shryock dad6face2b re-go-fmt after rebase
use us-west-2 region in tests

update test with working config

provider/aws: Update EMR contribution with passing test, polling for instance in DELETE method

remove defaulted role

document emr_cluster

rename aws_emr -> aws_emr_cluster

update docs for name change

update delete timeout/polling

rename emr taskgroup to emr instance group

default instance group count to 0, down from 60

update to ref emr_cluster, emr_instance_group

more cleanups for instance groups; need to read and update

add read, delete method for instance groups

refactor the read method to seperate out the fetching of the specific group

more refactoring for finding instance groups

update emr instance group docs

err check on reading HTTP. Dont' return the error, just log it

refactor the create method to catch optionals

additional cleanups, added a read method

update test to be non-master-only

wrap up the READ method for clusters

poll for instance group to be running after a modification

patch up a possible deref

provider/aws: EMR cleanups

fix test naming

remove outdated docs

randomize emr_profile names
2016-10-05 14:30:16 -05:00
Brian Chen ad8679e916 basic emr implementation
quick emr resize implementation

ass task group

not force new

add task group

check empty slices

clean up

rename to initial_instance_count

add task instance group as resource

cluster resize core group

clean up

add name option

log info

clean up

change log debug format

clean up

add missing security groups for master and slave

add bootstrap actions

add options for bootstrap action

add tags option

clean up

fix for tags array

support delimiters : =

bootstrap actions fix

add configurations item

load local or remote config

rename function

support multiple bootstrap actions

default value 0 for core group

follow aws api able to create a master only

tags use terraform tag schema

option item for log_uri

ec2_attribute as option

add emr task group accTests

add embedded json config

add embedded json config

add service_role and instance_profile

add partial state support for either the "TERMINATED" or "TERMINATED_WITH_ERRORS" state

not allowing to change name or instance_type for task group

"core_instance_type" change into "Optional" and  "Computed"

apply MaxItems for ec2Attributes

remove all debug "fmt.Println"

clean up debug info and useless variable

Expose visible_to_all_users as an option, default will be true

remove debug info

logging should happen before setId("")

add hanChange checking first

clean up debug log

add some force new

double check the core group existed

add waiting and polling, until cluster up

testcase add EMR cluster id and status checking

clean up using common way to read ec2_attributes
2016-10-05 14:30:16 -05:00
Paul Stack 5192c7d14c Merge pull request #9196 from hashicorp/arm-sql-datawarehouse
provider/azurerm: Support AzureRM Sql Database DataWarehouse
2016-10-05 20:19:17 +01:00
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
stack72 9089b415d4
provider/azurerm: Support AzureRM Sql Database DataWarehouse
Fixes #9194

Removes the validation for the types and adds an acceptance test to make
sure we get a successful Sql Database created

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMSqlDatabase_datawarehouse'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/03 21:57:16 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMSqlDatabase_datawarehouse -timeout 120m
=== RUN   TestAccAzureRMSqlDatabase_datawarehouse
--- PASS: TestAccAzureRMSqlDatabase_datawarehouse (307.95s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm307.963s
```
2016-10-04 14:38:51 +01: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
Andreas Kyrris e5219ba56d Fixes behaviour when azurerm resources disappear.
Regressions were introduced when fixing
https://github.com/hashicorp/terraform/pull/8607 . Specifically when
resources in the statefile are deleted or missing in real life, then
terraform plan would exit with an error when it recieved a 404 not
found. The correct behaviour would be to show a plan with the offer to
create the missing resources.
2016-10-03 10:10:10 +01:00
Andreas Kyrris 00c0c75b16 Add tests to azurerm resources for cases where created resources
disappear.
2016-10-03 10:10:10 +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