Commit Graph

6260 Commits

Author SHA1 Message Date
Jake Champlin 755040b177 Merge pull request #11617 from hashicorp/f-tags-dynamodb
provider/aws: Add tag support to the dynamodb table resource
2017-02-02 09:44:54 -05:00
Jake Champlin dacc765a5e
update casing for dynamoDb 2017-02-02 09:20:33 -05:00
Jasmin Gacic b862cd2ccb Terraform provider ProfitBricks - Data Sources (#11520)
* Terraform ProfitBricks Builder

* make fmt

* Merge remote-tracking branch 'upstream/master' into terraform-provider-profitbricks

# Conflicts:
#	command/internal_plugin_list.go

* Addressing PR remarks

* Removed importers

* Added ProfitBricks Data Sources

* Added documentation

* Updated to REST v3:
- nat parameter for Nics
- availabilityZone for Volumes

Minor code clean up

* Minor code clean up

* Fixed typo in volume documentation

* make fmt

* Addressing requested changes

* Added a step in load balancer tests in CheckDestroy where we are making sure that the test doesn't leave dangling resources in ProfitBricks

* Changed expected image name

* Fixed data center test
Code clean up
2017-02-02 13:26:14 +00:00
stack72 c8a2d40c82
provider/aws: Fixing a merge conflict issue in validators.go 2017-02-02 10:30:41 +00:00
Jack Bruno be56c7d2f6 provider/aws: Add AWS DMS (data migration service) resources (#11122)
* Add aws dms vendoring

* Add aws dms endpoint resource

* Add aws dms replication instance resource

* Add aws dms replication subnet group resource

* Add aws dms replication task resource

* Fix aws dms resource go vet errors

* Review fixes: Add id validators for all resources. Add validator for endpoint engine_name.

* Add aws dms resources to importability list

* Review fixes: Add aws dms iam role dependencies to test cases

* Review fixes: Adjustments for handling input values

* Add aws dms replication subnet group tagging

* Fix aws dms subnet group doesn't use standard error for resource not found

* Missed update of aws dms vendored version

* Add aws dms certificate resource

* Update aws dms resources to force new for immutable attributes

* Fix tests failing on subnet deletion by adding explicit dependencies. Combine import tests with basic tests to cut down runtime.
2017-02-02 10:30:05 +00:00
Raymond Fallon b30ef0f58d Update Application Auto Scaling to support scaling an Amazon EC2 Spot fleet. (#8697)
* provider/aws: Update Application Auto Scaling service model

  - Add support for automatically scaling an Amazon EC2 Spot fleet.

* Remove duplicate policy_type check.

* Test creating a scalable target for a splot fleet request.

* Test creating a scaling policy for a splot fleet request.

* Update resource docs to support scaling an Amazon EC2 Spot fleet.

  - aws_appautoscaling_policy
  - aws_appautoscaling_target

* Remove arn attribute from aws_appautoscaling_target

  - No arn is generated or returned for this resource.

* Remove optional name attribute from aws_appautoscaling_target

  - ScalableTargets do not have a name
  - I think this was copied from aws_appautoscaling_policy

* AWS Application Autoscaling resource documentation tweaks

  - include a target resource in the policy example
  - sort attributes by alpha
  - fixup markdown
  - add spaces to test config
2017-02-02 09:39:22 +00:00
Alexander e2603bedec provider/pagerduty: Fix tests (#11622)
* Fix typo in user_reference

* Disable rotation_virtual_start check
2017-02-01 23:51:17 +00:00
Dana Hoffman b16ef83b9a Merge pull request #11590 from evandbrown/google-cloud-sql-pw
providers/google: No default root user for SQL
2017-02-01 15:43:23 -08:00
Alexander 3884c86b44 provider/pagerduty: pagerduty_addon resource (#11620)
* Add resource

* Add tests

* Add documentation
2017-02-01 22:59:29 +00:00
Clint 8f063d6773 Merge pull request #11621 from hashicorp/b-aws-test-fixes
provider/aws: Some Lambda test fixes
2017-02-01 16:39:15 -06:00
clint shryock f87f0f5ba6 provider/aws: Fix permissions for IAM role in Lambda tests 2017-02-01 15:59:40 -06:00
Jake Champlin f135ce8b09 Merge pull request #11619 from hashicorp/b-fix-instance-root-block-device
provider/aws: Fix root-block-device bug
2017-02-01 16:31:23 -05:00
Jake Champlin 3d22adbd5d
provider/aws: Fix root-block-device bug
Previously the `root_block_device` config map was a `schema.TypeSet` with an empty `Set` function, and a hard-limit of 1 on the attribute block.
This prevented a user from making any real changes inside the attribute block, thus leaving the user with a `Apply complete!` message, and nothing changed.

The schema API has since been updated, and we can now specify the `root_block_device` as a `schema.TypeList` with `MaxItems` set to `1`. This fixes the issue, and allows the user to update the `aws_instance`'s `root_block_device` attribute, and see changes actually propagate.
2017-02-01 16:25:07 -05:00
Dana Hoffman cd246545af Merge pull request #11020 from drebes/remote_traffic_selector
provider/google: remote_traffic_selector for google_compute_vpn_tunnel
2017-02-01 13:04:06 -08:00
Alexander dd0f2f11ae provider/pagerduty: pagerduty_escalation_policy data source (#11616)
* Add data source

* Add tests

* Add documentation

* Remove unnecessary id from schema
2017-02-01 20:53:31 +00:00
Jake Champlin 91e0fed333
provider/aws: Add tag support to the dynamodb table resource
Adds tag support to the `aws_dynamodb_table` resource. Also adds a test for the resource, and a test to ensure that the tags are populated correctly from a resource import.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDynamoDBTable_tags'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/01 15:35:00 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDynamoDBTable_tags -timeout 120m
=== RUN   TestAccAWSDynamoDBTable_tags
--- PASS: TestAccAWSDynamoDBTable_tags (28.69s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    28.713s
```

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDynamoDbTable_importTags'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/01 15:39:49 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDynamoDbTable_importTags -timeout 120m
=== RUN   TestAccAWSDynamoDbTable_importTags
--- PASS: TestAccAWSDynamoDbTable_importTags (30.62s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    30.645s
```
2017-02-01 15:44:30 -05:00
Alexander 2c59c9d44e provider/pagerduty: pagerduty_schedule data source (#11614)
* Add data source

* Add tests

* Add documentation

* Remove unnecessary id from schema
2017-02-01 20:01:46 +00:00
John Engelman f0dd9b23a3 Closes #11567. Handled Rancher deleted resources. (#11607)
* Fix some spec names.

* Closes #11567 .Handle deleted/purged resources from Rancher.
2017-02-01 19:49:17 +00:00
clint shryock b592f8d35d provider/aws: Fix lambda source mapping tests 2017-02-01 13:25:24 -06:00
Jake Champlin b51edd6175 Merge pull request #11612 from hashicorp/b-fix-beanstalk-env-acctests
provider/aws: Fixes aws beanstalk env acc tests
2017-02-01 13:22:32 -05:00
Paul Stack 851cc46548 provider/aws: Guard against panic in aws_vpc_endpoint_association (#11613)
I believe that if no VPC Endpoints were returned from the AWS API, we
were not guarding against a panic. We were strill trying to inspect the
RouteTableIds. This commit will ensure that no errors are thrown before
trying to use the RouteTableIds

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpcEndpointRouteTableAssociation_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/01 18:06:29 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpcEndpointRouteTableAssociation_ -timeout 120m
=== RUN   TestAccAWSVpcEndpointRouteTableAssociation_basic
--- PASS: TestAccAWSVpcEndpointRouteTableAssociation_basic (42.83s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	42.859s
```
2017-02-01 18:14:41 +00:00
Jake Champlin f7db75da58
provider/aws: Fixes aws beanstalk env acc tests
Fixes the beanstalk env tests such that they can run in parallel better. Previously, only the beanstalk application was randomized, now the beanstalk environment is also randomized to help better facilitate running our tests in parallel.

```
=== RUN   TestAccAWSBeanstalkEnv_outputs
--- PASS: TestAccAWSBeanstalkEnv_outputs (388.74s)
=== RUN   TestAccAWSBeanstalkEnv_cname_prefix
--- PASS: TestAccAWSBeanstalkEnv_cname_prefix (386.78s)
=== RUN   TestAccAWSBeanstalkEnv_config
--- PASS: TestAccAWSBeanstalkEnv_config (532.56s)
=== RUN   TestAccAWSBeanstalkEnv_resource
--- PASS: TestAccAWSBeanstalkEnv_resource (420.47s)
=== RUN   TestAccAWSBeanstalkEnv_vpc
--- PASS: TestAccAWSBeanstalkEnv_vpc (516.02s)
=== RUN   TestAccAWSBeanstalkEnv_template_change
--- PASS: TestAccAWSBeanstalkEnv_template_change (623.38s)
=== RUN   TestAccAWSBeanstalkEnv_basic_settings_update
--- PASS: TestAccAWSBeanstalkEnv_basic_settings_update (705.32s)
```
2017-02-01 13:09:43 -05:00
James Bardin 9c1775a28c Merge pull request #11554 from hashicorp/jbardin/local-exec-context
Remove race around local-exec Wait
2017-02-01 12:39:41 -05:00
Peter McAtominey bbde0537d1 provider/azurerm: support import for load balancer and sub resources (#11610)
implemented ResourceImporter for sub resources which extracts the lb id
deprecated location on each sub resource as it was unused
2017-02-01 17:17:51 +00:00
James Bardin ff2936bb3f Fix cancellation when spawning a subprocess
If the shell spawns a subprocess which doesn't close the output file
descriptors, the exec.Cmd will block on Wait() (see
golang.org/issue/18874). Use an os.Pipe to provide the command with a
real file descriptor so the exec package doesn't need to do the copy
manually. This in turn may block our own reading goroutine, but we can
select on that and leave it for cleanup later.
2017-02-01 12:01:29 -05:00
Mike Fowler 23e01de515 provider/google-cloud: Add second generation disk specification options (#11571)
* Add second generation disk specification options.

* Adjust test check to match resource read behaviour.
2017-02-01 16:20:31 +00:00
Doug Neal babc52202c Succeed creating aws_volume_attachment if identical attachment exists (#11060)
If an `aws_volume_attachment` is identical to one that already exists in
the API, don't attempt to re-create it (which fails), simply act as
though the creation command had already been run and continue.

This allows Terraform to cleanly recover from a situation where a volume
attachment action hangs indefinitely, possibly due to a bad instance
state, requiring manual intervention such as an instance reboot. In such
a situation, Terraform believes the attachment has failed, when in fact
it succeeded after the timeout had expired. On the subsequent retry run,
attempting to re-create the attachment will fail outright, due to the
AttachVolume API call being non-idempotent. This patch implements the
idempotency client-side by matching the (name, vID, iID) tuple.

Note that volume attachments are not assigned an ID by the API.
2017-02-01 15:41:53 +00:00
Jake Champlin c83a971efb Merge pull request #11605 from hashicorp/f-add-docs-ecs-cluster-datasource
documentation: Add documentation for the ECS Cluster Data Source
2017-02-01 10:08:03 -05:00
Jake Champlin ac73ce4199
documentation: Add documentation for the ECS Cluster Data Source
Adds documentation for the ECS Cluster Data Source. Also removes duplicate struct declarations from the data source and test.
2017-02-01 09:51:26 -05:00
Paul Stack ef08adeb65 provider/aws: Fix panic in aws_rds_cluster missing parameter error (#11600)
message

Fixes: #11568

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster_missingUserNameCausesError'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/01 12:11:14 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_missingUserNameCausesError -timeout 120m
=== RUN   TestAccAWSRDSCluster_missingUserNameCausesError
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (3.22s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	3.243s
```

The error message for a required parameter being missing has a wrong parameter baked into it. Therefore, when the error message tried to fire, it was throwing a panic. Added a test to make sure that we know the condition still fires and with a correct message
2017-02-01 14:42:00 +00:00
Jake Champlin 5566edd86e Merge pull request #11558 from hashicorp/feat/data_aws_ecs_cluster2
provider/aws: add aws_ecs_cluster datasource
2017-02-01 09:33:57 -05:00
Darren White 4cbd006268 Don't ignore VM power on errors. This prevents Terraform from hanging indefinitely for the VM to power on. (#11604) 2017-02-01 14:31:40 +00:00
Paul Stack 50fe7e1bb0 provider/aws: aws_route53_record import error processing (#11603)
Fixes: #11549

When a user passes the wrong argument to a route53_record import, they
got a crash. This was because we expected the ID to parse correctly. The
crash looked like this:

```
% terraform import aws_route53_record.import1 mike.westredd.com
aws_route53_record.import1: Importing from ID "mike.westredd.com"...
aws_route53_record.import1: Import complete!
  Imported aws_route53_record (ID: mike.westredd.com)
aws_route53_record.import1: Refreshing state... (ID: mike.westredd.com)
Error importing: 1 error(s) occurred:

* aws_route53_record.import1: unexpected EOF
panic: runtime error: index out of range
```

Rather than throwing a panic to the user, we should present them with a more useful message that tells them what the error is:

```
% terraform import aws_route53_record.import mike.westredd.com
aws_route53_record.import: Importing from ID "mike.westredd.com"...
aws_route53_record.import: Import complete!
  Imported aws_route53_record (ID: mike.westredd.com)
aws_route53_record.import: Refreshing state... (ID: mike.westredd.com)
Error importing: 1 error(s) occurred:

* aws_route53_record.import: Error Importing aws_route_53 record. Please make sure the record ID is in the form ZONEID_RECORDNAME_TYPE (i.e. Z4KAPRWWNC7JR_dev_A
```

At least they can work out what the problem is in this case
2017-02-01 14:15:08 +00:00
Raphaël Pinson a3bfc5e8b3 rancher_stack: Only read compose when catalog_id is empty (#11593) 2017-02-01 12:33:23 +00:00
KOJIMA Kazunori 427b0042bb provider/aws: Add sensitive attribute in master_password (#11584) 2017-02-01 11:10:51 +00:00
Raphael Randschau acb55ecc1b provider/aws: code review feedback 2017-02-01 09:32:19 +01:00
Evan Brown 860019048d providers/google: No default root user for SQL
Cloud SQL Gen 2 instances come with a default 'root'@'%' user on
creation. This change automatically deletes that user after creation. A
Terraform user must use the google_sql_user to create a user with
appropriate host and password.
2017-01-31 22:21:11 -08:00
James Bardin e0325d9b8f fix race with multiple calls to cmd.Wait()
There was still a race around the local-exec Command, where we were
calling Wait in 2 places which you can't do.
2017-01-31 18:07:26 -05:00
Raphael Randschau 1e847c2148
provider/aws: avoid ecs cluster name collisions 2017-01-31 23:40:31 +01:00
Jake Champlin 039701fa51 Merge pull request #11580 from hashicorp/b-fix-panic-data-azs
provider/aws: Fix panic from AZs Data Source Test
2017-01-31 16:06:08 -05:00
Jake Champlin 421b25cacf
provider/aws: Fix panic from AZs Data Source Test
The `aws_availability_zones` data source test was panicking. This fixes both tests

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAvailabilityZones'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/31 15:47:39 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAvailabilityZones -timeout 120m
=== RUN   TestAccAWSAvailabilityZones_basic
--- PASS: TestAccAWSAvailabilityZones_basic (12.56s)
=== RUN   TestAccAWSAvailabilityZones_stateFilter
--- PASS: TestAccAWSAvailabilityZones_stateFilter (13.59s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    26.187s
```
2017-01-31 15:54:17 -05:00
clint shryock 0e5f08e87d change vpc test name to isolate it 2017-01-31 14:50:21 -06:00
Jake Champlin e81231035c Merge pull request #11579 from hashicorp/b-fix-beanstalk-tests
provider/aws: Fix ElasticBeanstalk Acceptance Tests
2017-01-31 15:28:37 -05:00
Gauthier Wallet 4da1451971 Added Step Function resources (State Machine & Activity) (#11420)
* Added Step Function Activity & Step Function State Machine

* Added SFN State Machine documentation

* Added aws_sfn_activity & documentation

* Allowed import of sfn resources

* Added more checks on tests, fixed documentation

* Handled the update case of a SFN function (might be already deleting)

* Removed the State Machine import test file

* Fixed the eventual consistency of the read after delete for SFN functions
2017-01-31 20:17:38 +00:00
Jake Champlin 3541b9254e
provider/aws: Fix ElasticBeanstalk Acceptance Tests
Fixes all the currently failing ElasticBeanstalk Acceptance Tests

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSBeanstalkEnv'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/31 12:47:39 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSBeanstalkEnv -timeout 120m
=== RUN   TestAccAWSBeanstalkEnv_basic
--- PASS: TestAccAWSBeanstalkEnv_basic (383.73s)
=== RUN   TestAccAWSBeanstalkEnv_tier
--- PASS: TestAccAWSBeanstalkEnv_tier (629.41s)
=== RUN   TestAccAWSBeanstalkEnv_outputs
--- PASS: TestAccAWSBeanstalkEnv_outputs (374.11s)
=== RUN   TestAccAWSBeanstalkEnv_cname_prefix
--- PASS: TestAccAWSBeanstalkEnv_cname_prefix (429.19s)
=== RUN   TestAccAWSBeanstalkEnv_config
--- PASS: TestAccAWSBeanstalkEnv_config (512.37s)
=== RUN   TestAccAWSBeanstalkEnv_resource
--- PASS: TestAccAWSBeanstalkEnv_resource (358.39s)
=== RUN   TestAccAWSBeanstalkEnv_vpc
--- PASS: TestAccAWSBeanstalkEnv_vpc (479.72s)
=== RUN   TestAccAWSBeanstalkEnv_template_change
--- PASS: TestAccAWSBeanstalkEnv_template_change (792.78s)
=== RUN   TestAccAWSBeanstalkEnv_basic_settings_update
--- PASS: TestAccAWSBeanstalkEnv_basic_settings_update (616.77s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    4576.505s
```
2017-01-31 15:16:22 -05:00
Clint 3cb8557d54 Merge pull request #11565 from hashicorp/b-aws-ecs-service-type-case
provider/aws: Fix issue with ECS Placement Strat. and type casing
2017-01-31 12:16:17 -06:00
clint shryock 7e9bfda31a provider/aws: Fix issue with ECS Placement Strat. and type casing
The API asks you to send lower case values, but returns uppercase ones.
Here we lowercase the returned API values.

There is no migration here because the field in question is nested in a
set, so the hash will change regardless. Anyone using this feature now
has it broken anyway.
2017-01-31 11:33:16 -06:00
Naoto Yokoyama e2b3ee5fbf provider/aws: add `aws_ecs_task_definition` datasource (#8509) 2017-01-31 17:28:11 +00:00
Jake Champlin ab9c94e331 Merge pull request #11563 from hashicorp/b-fix-instance-data-source-acctests
provider/aws: Fix aws instance data source acceptance tests
2017-01-31 12:25:00 -05:00
Jake Champlin f7d9e0b168
provider/aws: Fix aws instance data source acceptance tests
Fixes 2 acceptance tests for the `aws_instance` data source

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstanceDataSource_SecurityGroups'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/31 12:12:15 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstanceDataSource_SecurityGroups -timeout 120m
=== RUN   TestAccAWSInstanceDataSource_SecurityGroups
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (119.14s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    119.172s
```

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstanceDataSource_tags'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/31 12:15:42 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstanceDataSource_tags -timeout 120m
=== RUN   TestAccAWSInstanceDataSource_tags
--- PASS: TestAccAWSInstanceDataSource_tags (118.87s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    118.900s
```
2017-01-31 12:19:25 -05:00