Commit Graph

5948 Commits

Author SHA1 Message Date
Sean Chittenden 4570460f4e
Audit all call sites where `fmt.Errorf()` was being used and switch to errwrap. 2016-12-27 15:50:25 -08:00
Sean Chittenden 9ab60ecc7b
Add an Exists function for each resource type. Also add a provider RWMutex.
Some of the checks didn't support concurrent updates.  This should
improve the reliability of the provider.
2016-12-27 15:50:25 -08:00
James Nugent 15e58310bd provider/postgres: Ignore temporary Postgres data 2016-12-27 15:13:27 -06:00
James Nugent 97420f523c provider/postgres: Allow brew installed postgresql
This commit modifies the GNUmakefile used for starting PostgreSQL for
testing purposes to prefer the version installed via Homebrew, followed
by the version installed via MacPorts. POSTGRES, PSQL and INITDB may be
overriden as Make variables if neither of these package management
systems is in use.
2016-12-27 15:10:20 -06:00
Sean Chittenden 73be4bc21f
Remove old docs. Update docs and code to support the PUBLIC role. 2016-12-26 07:00:03 -08:00
Sean Chittenden c3a3ddc0f5
Return an empty string if no value was provided.
This restores the original behavior of the initial patch.
2016-12-25 15:26:54 -08:00
Sean Chittenden 7d19fcae25
Improve a bit more upon work done in #10922 and only return a quoted
string if there is whitespace present.

Aesthetics.  What can I say.
2016-12-25 06:19:14 -08:00
Sean Chittenden d92a3caedf
Before revoking a privilege from a schema, check to ensure role exists. 2016-12-25 06:13:34 -08:00
Sean Chittenden 6c91676c40
Comment out the role that gets dropped before the schema's policies are
applied.

This is only a problem when the ROLE is removed before the revokation of
the schema's policies on the doomed PostgreSQL ROLE.  Comment out the
tests for now to get unit tests to pass.  Using hard-coded values that
exist outside of the Terraform unit test work.
2016-12-25 06:13:34 -08:00
Sean Chittenden ed7511e004
Add a small note re: needing `-test.parallel=1` when running PG tests. 2016-12-25 06:13:33 -08:00
Sean Chittenden 38928b91ba
Update the postgresql_schema resource to accept policies.
It is now possible to begin specifying DCL for schemas.
2016-12-25 06:13:33 -08:00
Sean Chittenden 897609878f
Automatically perform a `REASSIGN OWNED` and `DROP OWNED BY` when
removing a PostgreSQL role.

Add manual overrides if this isn't the desired behavior, but it should
universally be the desired outcome except when a ROLE name is reused
across multiple databases in the same PostgreSQL cluster, in which case
the `skip_drop_role` is necessary for all but the last PostgreSQL
provider.
2016-12-25 06:13:33 -08:00
Sean Chittenden 6e200c98d0
Use the right verb for errors. 2016-12-25 06:13:33 -08:00
Sean Chittenden ebc81727da
Add the postgresql_schema_policy resource. This is a WIP due to
issues with cycles when an object is destroyed.
2016-12-25 06:13:33 -08:00
Sean Chittenden de6dcbd8cd
Add the `owner` attribute to the `postgresql_schema` resource. 2016-12-25 06:13:32 -08:00
Sean Chittenden 1d60e9ab04
Clean up the description on postgresql_database.owner. 2016-12-25 06:13:32 -08:00
Sean Chittenden d673a0b532
Properly escape DSN parameters. 2016-12-25 05:53:12 -08:00
Sean Chittenden 0ae84bb0a8
Merge branch 'postgres-dsn-quote' of github.com:idubinskiy/terraform into idubinskiy-postgres-dsn-quote 2016-12-25 05:43:19 -08:00
Martin Atkins 6ad1e596dd provider/archive: Test that archive_file hashes seem plausible
We just check these for syntax rather than exact value because the
underlying archive library is free to evolve its exact encoding over time
as long as the result is semantically equivalent, and we don't want these
tests to break when we build on different versions of Go.
2016-12-24 11:52:17 -08:00
Martin Atkins ea93b91a80 Merge #10851: archive_file md5 hash attribute 2016-12-24 11:39:28 -08:00
Alexander bac59eb531 provider/pagerduty Add delete support to pagerduty_service_integration (#10891)
* Vendor update

* Add delete support

* Update documentation
2016-12-24 14:43:06 +00:00
Igor Dubinskiy 56a1ea9012 provider/postgresql: Quote connection string parameters 2016-12-23 10:09:32 -08:00
Mike Tougeron 61fec06f51 Add the archive file's MD5 to the output 2016-12-19 18:39:38 -08:00
Clint 7998c3be92 Merge pull request #8622 from optimisticanshul/8604-snapshot-rds-password
Update rds password if provided while creating from snapshot
2016-12-19 13:59:48 -06:00
Peter McAtominey b4e0b8a9f5 provider/azurerm: fix network_interface.ip_configuration has for load balancers (#10834)
The subsets for backend address pools and inbound nat rules weren't being hashed
properly as part of the ip_configuration hash which caused multiple
ip_configurations to be expanded and sent to the API with conflicting names

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMNetworkInterface -timeout 120m
=== RUN   TestAccAzureRMNetworkInterface_basic
--- PASS: TestAccAzureRMNetworkInterface_basic (160.24s)
=== RUN   TestAccAzureRMNetworkInterface_disappears
--- PASS: TestAccAzureRMNetworkInterface_disappears (157.00s)
=== RUN   TestAccAzureRMNetworkInterface_enableIPForwarding
--- PASS: TestAccAzureRMNetworkInterface_enableIPForwarding (156.86s)
=== RUN   TestAccAzureRMNetworkInterface_multipleLoadBalancers
--- PASS: TestAccAzureRMNetworkInterface_multipleLoadBalancers (185.87s)
=== RUN   TestAccAzureRMNetworkInterface_withTags
--- PASS: TestAccAzureRMNetworkInterface_withTags (1212.92s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1872.960s
2016-12-19 13:21:51 +00:00
Joe Topjian 504407c1cb provider/openstack: Block Device Tests and Docs (#10830)
This commit adds some basic tests for block device functionality. It also
expands the existing block device documentation as well references the
new "volume attach" resources for further block storage functionality.
2016-12-19 10:29:37 +00:00
Joe Topjian 7843a5c6e6 provider/openstack: Handle Volume Creation Errors (#10821)
This commit makes the openstack_blockstorage_volume resources better able
to handle volume creation errors upon resource creation. The cause of this
change is because there could be some storage backend error that happens
during storage provisioning that won't manifest in an "err" but will set
the volume's status to "error". We now check for a status of "error" and
propagate the error up the stack.
2016-12-18 22:38:55 +00:00
Paul Stack 1ff623a790 provider/aws: Support updating of aws_db_instance db_subnet_group_name (#10818)
Fixes: #10811

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_subnetGroup'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/18 12:52:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDBInstance_subnetGroup -timeout 120m
=== RUN   TestAccAWSDBInstance_subnetGroup
--- PASS: TestAccAWSDBInstance_subnetGroup (992.05s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	992.073s
```
2016-12-18 14:35:24 +00:00
Tom Harvey 776e76f6ce provider/azurerm: Redis Cache (#10184)
* Implementing Redis Cache

* Properties should never be nil

* Updating the SDK to 7.0.1

* Redis Cache updated for SDK 7.0.1

* Fixing the max memory validation tests

* Cleaning up

* Adding tests for Standard with Tags

* Int's -> Strings for the moment

* Making the RedisConfiguration object mandatory

* Only parse out redis configuration values if they're set

* Updating the RedisConfiguration object to be required in the documentaqtion

* Adding Tags to the Standard tests / importing excluding the redisConfiguration

* Removing support for import for Redis Cache for now

* Removed a scaling test
2016-12-18 14:23:29 +00:00
Kit Ewbank ca183126c8 Add 'aws_iam_account_alias' data source. (#10804) 2016-12-18 14:17:19 +00:00
Christoph Blecker b7faae4bac Use node_version during google_container_cluster creation (#10817) 2016-12-18 13:50:46 +00:00
Harry Hull 2ebbf598cb Add aws verification checks to opsworks acceptance tests (#10813)
* Verify with aws api in opsworks resource acceptance tests
Fixes #6202

* Minor fix to resource_aws_opsworks_application_test.go
2016-12-18 11:55:40 +00:00
Alexander 471299c4ae provider/pagerduty pagerduty_schedule - support for start_day_of_week (schedule restriction) (#10069)
* Adding support for start_day_of_week (schedule restriction)

* Vendor update

* Update schedule tests
2016-12-18 11:23:00 +00:00
Michael Kuzmin 7a59971777 provider/docker: fix regression, cert_path stop working (#10754) (#10801) 2016-12-17 12:41:08 +00:00
James Bardin 4f625af3fd Merge pull request #10787 from hashicorp/jbardin/inteprolate-list-of-maps
Inteprolate list of maps
2016-12-16 16:41:36 -05:00
clint shryock 42efeb66db add missing runtime 2016-12-16 11:36:19 -06:00
clint shryock 45a7cc5afd more randomiztion for lambda tests 2016-12-16 10:42:37 -06:00
James Bardin d1d6907640 Add a provider test for a list of maps
Interpolation of a map from a list of maps was not working. Add a
provider example test to cover this.
2016-12-16 10:36:26 -05:00
Ninir f96e45ba56 provider/aws: Deprecated aws_lambda_function nodejs runtime in favor of nodejs4.3 (#9724)
* provider/aws/lambda: Deprecated nodejs in favor of nodejs4.3

* Removed redundant type declarations in composite literals

* Added validation tests
2016-12-16 12:24:45 +00:00
Ivan Fuyivara 4d4ec6c0d1 provider/aws: Support for SES Configuration sets and Event Destinations (#10735)
* adding configuration set

* adding event destination

* adding test, all tests passing

* adding doccumentation
2016-12-16 11:46:39 +00:00
stack72 8efa37f7ff
Merge branch 'api_gateway_binary_media_types' of https://github.com/jmettes/terraform into jmettes-api_gateway_binary_media_types 2016-12-16 11:16:04 +00:00
Clint 7711952423 Merge pull request #9837 from Ninir/redshift_cluster_password
provider/aws: Redshift Cluster: Fix for master_username & password
2016-12-15 21:28:36 -06:00
Jonathan Mettes 0e6b2a4f9f Add support for binary media type to AWS API Gateway 2016-12-16 02:14:29 +00:00
Clint 75010e9112 Merge pull request #10771 from hashicorp/b-aws-test-fixes
provider/aws: More randomization so our tests can run in parallel
2016-12-15 16:36:37 -06:00
clint shryock 8d2e61e88d provider/aws: More randomization so our tests can run in parallel 2016-12-15 16:33:10 -06:00
Dan Thagard 82ef4b678d Drop alias from state file if missing from lambda. (#10759)
* Drop alias from state file if missing from lambda.

This commit fixes an issue where if you remove a AWS Lambda, the corresponding alias for that Lambda is also deleted.

* Added missing imports.

* Removed non-local reference to constant.
2016-12-15 15:33:38 -06:00
Clint 8371d3faab Merge pull request #10763 from Ninir/d-aws-source-ami-owners
provider/aws: Fixed the data source ami enforcing non-nil values
2016-12-15 14:35:29 -06:00
Paul Tyng 3dfe5a47f1
provider/newrelic: Add new provider for New Relic 2016-12-15 19:14:59 +00:00
Ninir a8a37b8f84 provider/aws: Fixed the data source ami enforcing non-nil values 2016-12-15 19:18:57 +01:00
Joseph Anthony Pasquale Holsten d783e831f8 ultradns providers and improvements (#9788)
* vendor: update github.com/Ensighten/udnssdk to v1.2.1

* ultradns_tcpool: add

* ultradns.baseurl: set default

* ultradns.record: cleanup test

* ultradns_record: extract common, cleanup

* ultradns: extract common

* ultradns_dirpool: add

* ultradns_dirpool: fix rdata.ip_info.ips to be idempotent

* ultradns_tcpool: add doc

* ultradns_dirpool: fix rdata.geo_codes.codes to be idempotent

* ultradns_dirpool: add doc

* ultradns: cleanup testing

* ultradns_record: rename resource

* ultradns: log username from config, not client

udnssdk.Client is being refactored to use x/oauth2, so don't assume we
can access Username from it

* ultradns_probe_ping: add

* ultradns_probe_http: add

* doc: add ultradns_probe_ping

* doc: add ultradns_probe_http

* ultradns_record: remove duplication from error messages

* doc: cleanup typos in ultradns

* ultradns_probe_ping: add test for pool-level probe

* Clean documentation

* ultradns: pull makeSetFromStrings() up to common.go

* ultradns_dirpool: log hashIPInfoIPs

Log the key and generated hashcode used to index ip_info.ips into a set.

* ultradns: simplify hashLimits()

Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.

Also changes log level to a more approriate DEBUG.

* ultradns_tcpool: convert rdata to schema.Set

RData blocks have the "host" attribute as their primary key, so it is
used by hashRdatas() to create the hashcode.

Tests are updated to use the new hashcode indexes instead of natural
numbers.

* ultradns_probe_http: convert agents to schema.Set

Also pull the makeSetFromStrings() helper up to common.go

* ultradns: pull hashRdatas() up to common

* ultradns_dirpool: convert rdata to schema.Set

Fixes TF-66

* ultradns_dirpool.conflict_resolve: fix default from response

UltraDNS REST API User Guide claims that "Directional Pool
Profile Fields" have a "conflictResolve" field which "If not
specified, defaults to GEO."
https://portal.ultradns.com/static/docs/REST-API_User_Guide.pdf

But UltraDNS does not actually return a conflictResolve
attribute when it has been updated to "GEO".

We could fix it in udnssdk, but that would require either:
* hide the response by coercing "" to "GEO" for everyone
* use a pointer to allow checking for nil (requires all
users to change if they fix this)

An ideal solution would be to have the UltraDNS API respond
with this attribute for every dirpool's rdata.

So at the risk of foolish consistency in the sdk, we're
going to solve it where it's visible to the user:
by checking and overriding the parsing. I'm sorry.

* ultradns_record: convert rdata to set

UltraDNS does not store the ordering of rdata elements, so we need a way
to identify if changes have been made even it the order changes.
A perfect job for schema.Set.

* ultradns_record: parse double-encoded answers for TXT records

* ultradns: simplify hashLimits()

Limits blocks only have the "name" attribute as their primary key, so
hashLimits() needn't use a buffer to concatenate.

* ultradns_dirpool.description: validate

* ultradns_dirpool.rdata: doc need for set

* ultradns_dirpool.conflict_resolve: validate
2016-12-15 16:28:34 +00:00