Commit Graph

3854 Commits

Author SHA1 Message Date
Paul Stack d938d263f6 provider/aws: Add support for treat_missing_data to cloudwatch_metric_alarm (#13358)
* provider/aws: Add support for treat_missing_data to cloudwatch_metric_alarm

Fixes: #13263

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/05 08:51:06 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCloudWatchMetricAlarm -timeout 120m
=== RUN   TestAccAWSCloudWatchMetricAlarm_importBasic
--- PASS: TestAccAWSCloudWatchMetricAlarm_importBasic (23.93s)
=== RUN   TestAccAWSCloudWatchMetricAlarm_basic
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (27.81s)
=== RUN   TestAccAWSCloudWatchMetricAlarm_treatMissingData
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (43.39s)
=== RUN   TestAccAWSCloudWatchMetricAlarm_extendedStatistic
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (26.80s)
=== RUN   TestAccAWSCloudWatchMetricAlarm_missingStatistic
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (5.95s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	127.899s
```

* provider/aws: Set cloudwatch_metric_alarm treamt_missing_data to missing

This follows what the AWS API does. We had to add a state migration for
this to make sure that the user doesn't see any unexpected activity on
their Terraform plans

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAWSCloudWatchMetricAlarmMigrateState'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/05 14:51:32 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAWSCloudWatchMetricAlarmMigrateState -timeout 120m
=== RUN   TestAWSCloudWatchMetricAlarmMigrateState
2017/04/05 14:52:13 [INFO] Found AWS CloudWatch Metric Alarm State v0; migrating to v1
2017/04/05 14:52:13 [DEBUG] Attributes before migration: map[string]string{}
2017/04/05 14:52:13 [DEBUG] Attributes after migration: map[string]string{"treat_missing_data":"missing"}
--- PASS: TestAWSCloudWatchMetricAlarmMigrateState (0.00s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	0.018s
```
2017-04-05 13:17:47 +01:00
Radek Simko cd79471ecb provider/aws: Increase Beanstalk 'ready' timeout (#13359) 2017-04-05 13:11:55 +01:00
Radek Simko affce99a8e provider/aws: Increase launch_configuration creation timeout (#13357) 2017-04-05 13:10:46 +01:00
Radek Simko 77150880e0 provider/aws: Increase subnet deletion timeout (#13356) 2017-04-05 13:09:44 +01:00
Radek Simko 1c0cd0dd8f provider/aws: Fix wrong config in ES domain acceptance test (#13362) 2017-04-05 12:27:56 +01:00
Paul Stack 5cad27bb2e provider/aws: Migrate aws_dms_* resources away from AWS waiters (#13291)
The AWS waiter package has changed location in the 1.8.0 version of the
SDK. DMS will need to mitigate a breaking change because of this

Between @radeksimko and myself, we think that we should migrate the DMS
resources to using the Terraform state refresh func pattern that is used
across the entire of the AWS provider. DMS is the *only* resource that
currently uses the AWS waiters, so the LOE to migrate is pretty low
2017-04-05 06:48:37 +01:00
Matthew Frahry c3175a556f Merge pull request #13337 from hashicorp/p-aws-iam-keybase-test
Removed newline from keybase username
2017-04-04 09:55:39 -06:00
= 92e75ff2cb Removed newline from keybase username 2017-04-04 09:33:49 -06:00
Paul Stack 2686768802 provider/aws: Recreate opsworks_stack on change of service_role_arn (#13325)
Fixes: #13305

From the docs - http://docs.aws.amazon.com/cli/latest/reference/opsworks/update-stack.html

```
--service-role-arn (string)

Do not use this parameter. You cannot update a stack's service role.
```
2017-04-04 16:20:53 +01:00
Radek Simko 77fe5f8746 provider/aws: Increase AMI retry timeouts (#13324) 2017-04-04 15:46:14 +01:00
Radek Simko 275972ca59 provider/aws: Increase timeout for deploying cloudfront distribution (#13319) 2017-04-04 15:44:17 +01:00
Radek Simko 0dddb48239 provider/aws: Improve logging & docs for caller_identity (#13316) 2017-04-04 15:41:30 +01:00
Matthew Frahry 8e470fc01c Merge pull request #13178 from hashicorp/p-aws-randomize-test-names2
provider/aws: Randomize test names
2017-04-04 08:33:24 -06:00
Marc Vieira-Cardinal (VA2MVC) 82af03aca5 Fixed typo 2017-04-04 08:57:16 -04:00
Paul Stack 6025967c95 provider/aws: Support ip_address_type for aws_alb (#13227)
Fixes: #11429

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALB_updatedIpAddressType'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/31 20:12:20 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALB_updatedIpAddressType -timeout 120m
=== RUN   TestAccAWSALB_updatedIpAddressType
--- PASS: TestAccAWSALB_updatedIpAddressType (284.42s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	284.447s
```
2017-04-04 11:29:47 +01:00
Radek Simko 2697532c8f
aws: Randomize IAM policy name in acc test 2017-04-04 11:07:55 +01:00
Martin Atkins 638038428a Merge #13188: aws_subnet_ids data source 2017-04-03 15:17:15 -07:00
= 35ceeb15f4 final fix after merge with master 2017-04-03 13:27:43 -06:00
Jake Champlin 5cce6b9966 Merge pull request #13092 from hashicorp/f-update-sts-caller-identity
provider/aws: Update calling_identity
2017-04-03 14:29:28 -04:00
Jake Champlin 75e61606bb
dont dereference pointers on Set 2017-04-03 14:10:57 -04:00
Matthew Frahry 02d3e1c12e Merge branch 'master' into p-aws-randomize-test-names2 2017-04-03 11:34:16 -06:00
= 1b2653b0bd randomizes all bgp_asn values 2017-04-03 11:17:59 -06:00
= e2d7d5fc68 Removed random provider frm iam policy attachment test 2017-04-03 08:11:54 -06:00
Paul Stack b80d3e5701 provider/aws: Set stickiness to computed in alb_target_group (#13278)
The Default values set by AWS were breaking the AWS ALB Listener Rule
tests. The stickiness parameter needed to be set to be Computed: true to
remove this discrepancy

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBListenerRule_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/03 01:23:47 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBListenerRule_basic -timeout 120m
=== RUN   TestAccAWSALBListenerRule_basic
--- PASS: TestAccAWSALBListenerRule_basic (235.36s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	235.397s
```
2017-04-03 12:11:45 +03:00
stack72 d209dc1a32
provider/aws: Fixup AWS db instance acceptance tests with default security group 2017-04-03 01:48:45 +03:00
Masayuki Morita 4b9ec9c920 provider/aws: Validate aws_ecs_task_definition.container_definitions (#12161) 2017-04-01 17:31:32 +01:00
Jonathan Camp b8f6e2a70a provider/aws: handle aws_lambda_function missing s3 key error (#10960)
* ensure NoSuchKey is not a retryable error

* Simplify err handling + lower log msg severity
2017-04-01 15:39:46 +01:00
Doug Neal 0c4c578552 provider/aws: Implement aws_ses_domain_identity (#13098)
* provider/aws: New resource: aws_ses_domain_identity

Provide a resource to manage domain identities in SES. Exports the
verification_code attribute which can be used to add the TXT record to
the domain to complete the domain verification.

* provider/aws: Acceptance tests for aws_ses_domain_identity

* Resource aws_ses_domain_identity: Documentation update

Provide documentation for the new resource type.
2017-04-01 06:57:34 +01:00
Colin Wood d7a319f239 Fix accpetence test to work 2017-03-31 10:57:07 -07:00
Joshua Spence d25c310468 Add `name_prefix` to RDS resources (#13232)
Adds `name_prefix` (or, in some cases, `identifier_prefix`) support to all AWS RDS resources.
2017-03-31 20:22:57 +03:00
Colin Wood a424fffd48 Add support for aws_subnet_ids as a data source 2017-03-31 10:22:39 -07:00
Gauthier Wallet 42557dae12 provider/aws: Added API Gateway integration update (#13249) 2017-03-31 19:45:06 +03:00
Paul Stack 74c0353231 provider/aws: Wait for aws_opsworks_instance to be running when it's specified (#13218)
Fixes: #9959

When we specify that we want an opsworks_instance state of running, we
should wait for that the be the case. This will then allow us to use the
Computed values (e.g. private_ip) etc and allow us to use provisioners
as part of the terraform config

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSOpsworksInstance'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/30 20:55:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSOpsworksInstance -timeout 120m
=== RUN   TestAccAWSOpsworksInstance_importBasic
--- PASS: TestAccAWSOpsworksInstance_importBasic (72.28s)
=== RUN   TestAccAWSOpsworksInstance
--- PASS: TestAccAWSOpsworksInstance (110.17s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	182.479s
```
2017-03-31 14:45:45 +03:00
Paul Stack d06db23197 provider/aws: Set aws_vpn_connection to recreate when in deleted state (#13204)
Fixes: #12440

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnConnection_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/30 16:16:13 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnConnection_ -timeout 120m
=== RUN   TestAccAWSVpnConnection_importBasic
--- PASS: TestAccAWSVpnConnection_importBasic (208.68s)
=== RUN   TestAccAWSVpnConnection_basic
--- PASS: TestAccAWSVpnConnection_basic (391.02s)
=== RUN   TestAccAWSVpnConnection_withoutStaticRoutes
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (316.99s)
=== RUN   TestAccAWSVpnConnection_disappears
--- PASS: TestAccAWSVpnConnection_disappears (202.84s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	1119.563s
```
2017-03-31 14:40:37 +03:00
Paul Stack 46a5cd543c provider/aws: Refresh aws_alb_target_group tags (#13200)
Fixes: #8847

We actually didn't get the list of tags from the API, therefore, any
manual changes were not actually showing up in subsequent plans

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/30 15:45:53 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBTargetGroup_basic -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (62.76s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	62.787s
```
2017-03-31 14:36:15 +03:00
Paul Stack e4e9d1e073 provider/aws: Preserve default retain_on_delete in cloudfront import (#13209)
Fixes: #10969
2017-03-31 14:34:51 +03:00
Paul Stack 293922e5ae provider/aws: Refresh aws_alb_target_group stickiness on manual updates (#13199)
Fixes: #13167

When changes to the target group were made via CLI or AWS Console, they
were not being picked up by terraform. This is because we were not
catching an error setting the `stickiness` parameters:

```
Error refreshing state: 1 error(s) occurred:

* aws_alb_target_group.test: aws_alb_target_group.test: stickiness.0.enabled: '' expected type 'bool', got unconvertible type 'string'
```

This meant that changes were not picked up in the following plan. The changes mean the following now:

```
~ aws_alb_target_group.test
    stickiness.0.cookie_duration: "10440" => "10000"
    stickiness.0.enabled:         "false" => "true"

Plan: 0 to add, 1 to change, 0 to destroy.
```
2017-03-31 14:28:56 +03:00
Radek Simko 829649f44c provider/aws: Add support for Lightsail Static IP Attachment (#13207) 2017-03-31 07:30:25 +01:00
Paul Stack 7fce65d427 provider/aws: Add DiffSuppression to aws_ecs_service placement_strategies (#13220)
Fixes: #13216

Prior to Terraform 0.9.2, we always set placement_strategies to
lowercase. Therefore, people using it in Terraform 0.9.2 are getting
continual diffs:

```
-/+ aws_ecs_service.mongo
    cluster:                             "arn:aws:ecs:us-west-2:187416307283:cluster/terraformecstest1" => "arn:aws:ecs:us-west-2:187416307283:cluster/terraformecstest1"
    deployment_maximum_percent:          "200" => "200"
    deployment_minimum_healthy_percent:  "100" => "100"
    desired_count:                       "1" => "1"
    name:                                "mongodb" => "mongodb"
    placement_strategy.#:                "1" => "1"
    placement_strategy.1676812570.field: "instanceid" => "" (forces new resource)
    placement_strategy.1676812570.type:  "spread" => "" (forces new resource)
    placement_strategy.3946258308.field: "" => "instanceId" (forces new resource)
    placement_strategy.3946258308.type:  "" => "spread" (forces new resource)
    task_definition:                     "arn:aws:ecs:us-west-2:187416307283:task-definition/mongodb:1991" => "arn:aws:ecs:us-west-2:187416307283:task-definition/mongodb:1991"

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

This adds a DiffSuppression func to make sure this doesn't trigger a
ForceNew resource:

```
% 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_ecs_cluster.default: Refreshing state... (ID: arn:aws:e...ecstest1)
aws_ecs_task_definition.mongo: Refreshing state... (ID: mongodb)
aws_ecs_service.mongo: Refreshing state... (ID: arn:aws:e.../mongodb)
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-03-30 23:42:16 +03:00
Jake Champlin 0f7b43ad75 Merge pull request #13213 from mathematician/aws-iam-role-data-source
Added data source aws_iam_role
2017-03-30 12:36:08 -04:00
mathematician fc4cec3c40 Create AWS IAM Role data source, acceptance tests, documentation, and website link 2017-03-30 11:09:11 -05:00
Radek Simko 7d8a6f8533 provider/aws: Add support for aws_lightsail_static_ip (#13175) 2017-03-30 14:59:28 +01:00
Paul Stack 9ed8bb2498 provider/aws: Support the ability to enable / disable ipv6 support in (#12527)
VPC

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpc_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/28 15:49:20 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpc_ -timeout 120m
=== RUN   TestAccAWSVpc_importBasic
--- PASS: TestAccAWSVpc_importBasic (102.01s)
=== RUN   TestAccAWSVpc_basic
--- PASS: TestAccAWSVpc_basic (63.75s)
=== RUN   TestAccAWSVpc_enableIpv6
--- PASS: TestAccAWSVpc_enableIpv6 (231.41s)
=== RUN   TestAccAWSVpc_dedicatedTenancy
--- PASS: TestAccAWSVpc_dedicatedTenancy (66.65s)
=== RUN   TestAccAWSVpc_tags
--- PASS: TestAccAWSVpc_tags (130.26s)
=== RUN   TestAccAWSVpc_update
--- PASS: TestAccAWSVpc_update (120.21s)
=== RUN   TestAccAWSVpc_bothDnsOptionsSet
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (50.10s)
=== RUN   TestAccAWSVpc_DisabledDnsSupport
--- PASS: TestAccAWSVpc_DisabledDnsSupport (67.47s)
=== RUN   TestAccAWSVpc_classiclinkOptionSet
--- PASS: TestAccAWSVpc_classiclinkOptionSet (64.57s)
PASS
ok	github.com/hashicorp/terraform/builtin/providers/aws	896.464s
```
2017-03-30 16:20:42 +03:00
Ian Morgan 1dca12201a fix error message in route53 data source (#13174) 2017-03-30 11:12:15 +03:00
= fae435c5d8 Add randomness to vpn connection test 2017-03-29 15:10:21 -06:00
= 0aa9d71f7f add randomness to iam policy attachments 2017-03-29 14:24:19 -06:00
Paul Hinze 43242bbeae Merge pull request #13140 from hashicorp/b-rds-snapshot-restore-db-name
provider/aws: Don't set DBName on `aws_db_instance` from snapshot
2017-03-29 14:17:32 -05:00
Radek Simko dc5b1d936b provider/aws: Increase timeouts for ELB (#13161) 2017-03-29 18:10:38 +01:00
Radek Simko 75979afcb7 provider/aws: Fix ES Domain acceptance tests (#13160) 2017-03-29 18:07:11 +01:00
Radek Simko 261f5f8a76 provider/aws: Increase timeout for AMI registration (#13159) 2017-03-29 18:06:17 +01:00