Commit Graph

5309 Commits

Author SHA1 Message Date
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
stack72 df8ca94093
provider/aws: aws_db_option_group flattenOptions failing due to missing
values

Fixes #8332

Not all option_group parameters have values. For example, when you
enable the MariaDB option_group, some of the settings have empty values
(see screenshot)

This PR adds a safety net on reading those values back to the statefile

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBOptionGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 13:55:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBOptionGroup_ -timeout 120m
=== RUN   TestAccAWSDBOptionGroup_importBasic
--- PASS: TestAccAWSDBOptionGroup_importBasic (20.12s)
=== RUN   TestAccAWSDBOptionGroup_basic
--- PASS: TestAccAWSDBOptionGroup_basic (18.45s)
=== RUN   TestAccAWSDBOptionGroup_basicDestroyWithInstance
--- PASS: TestAccAWSDBOptionGroup_basicDestroyWithInstance (597.90s)
=== RUN   TestAccAWSDBOptionGroup_OptionSettings
--- PASS: TestAccAWSDBOptionGroup_OptionSettings (33.27s)
=== RUN   TestAccAWSDBOptionGroup_sqlServerOptionsUpdate
--- PASS: TestAccAWSDBOptionGroup_sqlServerOptionsUpdate (33.39s)
=== RUN   TestAccAWSDBOptionGroup_multipleOptions
--- PASS: TestAccAWSDBOptionGroup_multipleOptions (19.87s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    723.037s
```
2016-09-28 11:06:40 +01:00
Paul Stack bf5039311b Merge pull request #9049 from hashicorp/b-aws-r53-record-delete
provider/aws: guard against aws_route53_record delete panic
2016-09-28 11:02:03 +01:00
clint shryock 2c7d4faf53 provider/google: remove debug spew statement 2016-09-27 17:06:41 -05:00
Paul Stack f6ff349d6d Merge pull request #8971 from BedeGaming/azurerm-sdk-4
provider/azurerm: update Azure SDK
2016-09-27 18:58:08 +01:00
Paul Stack 1cf9f41510 Merge pull request #9038 from kwilczynski/feature/error-reporting-aws_vpc_peering_connection
provider/aws: Make sure that VPC Peering Connection in a failed state returns an error.
2016-09-27 17:56:54 +01:00
Joe Topjian 1e85d21dc4 Merge pull request #8948 from jfpucheu/PATCH_8735
Correct Proxy setting for openstack provider: issue 8735
2016-09-27 09:21:33 -04:00
Paul Stack 3840ff0f40 Merge pull request #8947 from dagnello/vsphere-vm-disks-detach
vSphere: Adding 'detach_unknown_disks_on_delete' flag for VM resource
2016-09-27 08:56:58 +01:00
Davide Agnello dfe1cacc9e Adding 'detach_unknown_disks_on_delete' flag for VM resource
Optional, defaults to false.  If true, will detach disks not managed by
Terraform VM resource prior to VM deletion.

Issue: #8945
2016-09-26 18:16:02 -07:00
Paul Stack bdb915693b Merge pull request #9060 from TimeIncOSS/b-aws-aurora-encryption
provider/aws: Make encryption in Aurora instances computed-only
2016-09-26 19:44:36 +01:00
Radek Simko de03308b73
provider/aws: Make encryption in Aurora instances computed-only 2016-09-26 17:23:16 +01:00
stack72 054f46b1f9
provider/aws: Refresh AWS EIP association from state when not found
Fixes #6758

We used to throw an error when this was the case - we should refresh
from state so the association can be recreated

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEIPAssociation_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 16:42:37 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEIPAssociation_ -timeout 120m
=== RUN   TestAccAWSEIPAssociation_basic
--- PASS: TestAccAWSEIPAssociation_basic (272.92s)
=== RUN   TestAccAWSEIPAssociation_disappears
--- PASS: TestAccAWSEIPAssociation_disappears (119.62s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws392.559s
```
2016-09-26 16:50:51 +01:00
Paul Stack a77d55c919 Merge pull request #8806 from optimisticanshul/8793-snapshot-identifier
Changing snapshot_identifier on aws_db_instance resource should force…
2016-09-26 12:01:47 +01:00
stack72 a367f3550f
provider/aws: guard against aws_route53_record delete panic
Fixes #9025

We were assuming there would always be a changeInfo record and then
dereferencing the ID. This wasn't always the case (As noted in #9025)
where it was a delete rather than a delete / create action

```
% 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/26 11:26:43 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 (114.99s)
=== RUN   TestAccAWSRoute53Record_basic_fqdn
--- PASS: TestAccAWSRoute53Record_basic_fqdn (126.64s)
=== RUN   TestAccAWSRoute53Record_txtSupport
--- PASS: TestAccAWSRoute53Record_txtSupport (113.25s)
=== RUN   TestAccAWSRoute53Record_spfSupport
--- PASS: TestAccAWSRoute53Record_spfSupport (112.89s)
=== RUN   TestAccAWSRoute53Record_generatesSuffix
--- PASS: TestAccAWSRoute53Record_generatesSuffix (113.29s)
=== RUN   TestAccAWSRoute53Record_wildcard
--- PASS: TestAccAWSRoute53Record_wildcard (163.05s)
=== RUN   TestAccAWSRoute53Record_failover
--- PASS: TestAccAWSRoute53Record_failover (121.15s)
=== RUN   TestAccAWSRoute53Record_weighted_basic
--- PASS: TestAccAWSRoute53Record_weighted_basic (117.06s)
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (116.97s)
=== RUN   TestAccAWSRoute53Record_s3_alias
--- PASS: TestAccAWSRoute53Record_s3_alias (138.79s)
=== RUN   TestAccAWSRoute53Record_weighted_alias
--- PASS: TestAccAWSRoute53Record_weighted_alias (241.48s)
=== RUN   TestAccAWSRoute53Record_geolocation_basic
--- PASS: TestAccAWSRoute53Record_geolocation_basic (132.51s)
=== RUN   TestAccAWSRoute53Record_latency_basic
--- PASS: TestAccAWSRoute53Record_latency_basic (121.29s)
=== RUN   TestAccAWSRoute53Record_TypeChange
--- PASS: TestAccAWSRoute53Record_TypeChange (189.31s)
=== RUN   TestAccAWSRoute53Record_empty
--- PASS: TestAccAWSRoute53Record_empty (127.31s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
2050.012s
```
2016-09-26 11:27:56 +01:00
Paul Stack 01cef1a63c Merge pull request #9029 from hashicorp/b-cloudwatch-dimensions-read
provider/aws: Fix reading dimensions on cloudwatch alarms
2016-09-26 09:29:27 +01:00
Krzysztof Wilczynski a2a2de5db2
Add test to check for failed state of the VPC Peering Connection.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-26 09:17:24 +01:00
Krzysztof Wilczynski a58650c980
Make sure that VPC Peering Connection in a failed state returns an error.
This commit adds simple logic which allows for a VPC Peering Connection
that is in a failed state (e.g. due to an overlapping IP address ranges,
etc.), to report such failed state as an error, rather then waiting for
the time out to occur.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-25 15:50:08 +01:00
Evan Brown 0edb68ef5a Merge pull request #8977 from sl1pm4t/b-gcs-storage-class
provider/google: Add support for GCS StorageClass
2016-09-24 21:13:17 -07:00
Martin Atkins 804d714ff6 Restore tls_cert_request to being a managed resource
In c244e5a6 this resource was converted to a data source, but that was
a mistake since data sources are expected to produce stable results on
each run, and yet certificate requests contain a random nonce as part of
the signature.

Additionally, using the data source as a managed resource through the
provided compatibility shim was not actually working, since "Read" was
trying to parse the private key out of a SHA1 hash of the key, which is
what we place in state due to the StateFunc on that attribute.

By restoring this we restore Terraform's ability to produce all of the
parts of a basic PKI/CA, which is useful for creating dev environments
and bootstrapping PKI for production environments.
2016-09-24 12:22:07 -07:00
Krzysztof Wilczynski 5af8c8080a
Fix. Handle missing AMI name when matching against image name.
This commit fixes the issues where in a very rare cases the Amazon Machine
Image (AMI) would not have an image name set causing regular expression match
to fail with a nil pointer dereference. Also, the logic of if-else statements
was simplified (reduced branching since return is used a lot).

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-24 14:34:00 +01:00
Paul Stack 979af97b52 Merge pull request #9031 from kjmkznr/b-aws-s3-lifecycle
provider/aws: Fix failed remove S3 lifecycle_rule
2016-09-24 10:26:18 +01:00
Alexander Ekdahl d2861be48e Corrected Seoul S3 Website Endpoint 2016-09-24 17:43:58 +09:00
Alexander Ekdahl ec1ee7f2be Corrected Seoul S3 Website Endpoint Test 2016-09-24 17:42:52 +09:00
Kazunori Kojima 71f721cd3e
provider/aws: Fix failed remove S3 lifecycle_rule 2016-09-24 16:56:25 +09:00
Paul Hinze 2449b45087
provider/aws: Fix reading dimensions on cloudwatch alarms
They're structs that need to be unrolled and d.Set was silently failing
on them before. This enhances the basic test to cover the change.
2016-09-23 18:26:04 -05:00
Chris Marchesi 5af63c233e
provider/aws: Add query_string_cache_keys to aws_cloudfront_distribution
Looks like AWS updated their API and now our tests are failing
because QueryStringCacheKeys was not included in the distribution
configuration.

This adds support for specifying query string cache keys in the
CloudFront distribution configuration, which ensures that only a subset
of query string keys are actually cached when forwarding query strings,
possibly improving performance.
2016-09-23 13:11:05 +01:00
Chris Marchesi c2b44217dd
provider/aws: Require CloudFront S3 origin origin_access_identity
This fixes an issue where an empty s3_origin_config could be supplied to
aws_cloudfront_distribution, "correctly" setting an empty default value.
Unfortunately the rest of the CloudFront structure helper functions are
not equipped to deal with this kind of scenario, and TF produces
spurious diffs upon future runs.

This removes the default and makes origin_access_identity required when
specifying s3_origin_config.

Note that it has always been intended behaviour that if someone does not
want to use an origin access identity, that s3_origin_config should not
be specified at all. This behaviour still works, as should be evident by
the (still) passing tests.

Fixes hashicorp/terraform#7930.
2016-09-23 13:10:50 +01:00
Chris Marchesi ec2b345ed0
provider/aws: Enable aws_cloudfront_distribution HTTP/2
Added http_version to aws_cloudfront_distribution, which allows
selection of the maximum HTTP version to use in the distribution.
Defaults to http2.

Fixes hashicorp/terraform#8730.
2016-09-23 13:10:33 +01:00
stack72 cea685099e
Merge branch 'elasticache-cluster-import' of https://github.com/AMeng/terraform into AMeng-elasticache-cluster-import 2016-09-23 10:04:57 +01:00
Clint b7ad602993 provider/aws: Fix importing of EIP by IP address (#8970)
* provider/aws: Fix importing of EIP by IP address

EIPs are meant to be imported by their allocation id, however, importing
by their EIP *appears* to work because this API actually accepts IP
lookup, despite the documentation asking for the allocation id.

This PR does:

- update docs on how to import EIPs
- fix case if user imported by IP, to switch to using the alloc id for
the resource id

I chose not to document that looking up by IP is a method of import,
because the AWS  API docs do not explicitly say that looking up by IP is
OK, so I'd rather people not do it if it's not documented to stay that
way.

Alternatively, we could parse the resource ID and reject it (remove from
state with error/warning) if it doesn't match the `eipalloc-*` format,
but I thought this was a bit better UX.

* fix issue with swapping IDs on EC2 Classic

* update docs

* update comment
2016-09-22 21:53:21 -05:00
Clint becdfef87b provider/aws: Wait for Spot Fleet to drain before removing from state (#8938)
* provider/aws: Wait for Spot Fleet to drain before removing from state

Ensures the spot fleet is drained before reporting successful destroy
and moving on

* remove unreachable code

* hack to sleep and test regression/leak

* fix broken english in warning
2016-09-22 15:22:27 -05:00
Paul Stack ecabebf5e6 Merge pull request #8989 from hashicorp/b-aws-alb-protocol-change-forcenew
provider/aws: VPC ID, Port, Protocol and Name change on aws_alb_target_group will ForceNew resource
2016-09-22 20:57:36 +01:00
Paul Stack 5cc4f17189 Merge pull request #8992 from kwilczynski/feature/check-error-aws_cloudformation_stack
provider/aws: Handle JSON parsing error in the ReadFunc for various JSON documents.
2016-09-22 17:28:24 +01:00
Krzysztof Wilczynski 828a8f4729
provider/aws: Handle JSON parsing error in the ReadFunc for various JSON documents.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 17:21:27 +01:00
stack72 9fbbc343e9
provider/aws: VPC ID, Port, Protocol and Name change on
aws_alb_target_group will ForceNew resource

Fixes #8741

The modify-target-group doesn't allow changes to name, port, protocol or
vpc_id - therefore, they should all be ForceNew: true

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/22 16:04:29 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSALBTargetGroup_ -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (50.66s)
=== RUN   TestAccAWSALBTargetGroup_changeNameForceNew
--- PASS: TestAccAWSALBTargetGroup_changeNameForceNew (84.48s)
=== RUN   TestAccAWSALBTargetGroup_changeProtocolForceNew
--- PASS: TestAccAWSALBTargetGroup_changeProtocolForceNew (95.89s)
=== RUN   TestAccAWSALBTargetGroup_changePortForceNew
--- PASS: TestAccAWSALBTargetGroup_changePortForceNew (85.77s)
=== RUN   TestAccAWSALBTargetGroup_changeVpcForceNew
--- PASS: TestAccAWSALBTargetGroup_changeVpcForceNew (85.00s)
=== RUN   TestAccAWSALBTargetGroup_tags
--- PASS: TestAccAWSALBTargetGroup_tags (88.11s)
=== RUN   TestAccAWSALBTargetGroup_updateHealthCheck
--- PASS: TestAccAWSALBTargetGroup_updateHealthCheck (82.15s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    572.083s
```
2016-09-22 17:12:39 +01:00
Krzysztof Wilczynski c115d69d88
Allow buildPutRuleInputStruct helper function to return an error.
This commits allows for the helper function to return an error which
would bubble up from e.g. JSON parsing, etc.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 15:37:12 +01:00
stack72 0867ed4961
provider/librato: Randomize the test case names as dangling resources were causing failures 2016-09-22 12:43:06 +01:00
Anthony Stanton 1d329c8927
provider/librato: Fixes for various integer type casting bugs
Fixes #8968
2016-09-22 12:42:54 +01:00
Anthony Stanton cfe7979692
provider/librator: Always send required attributes on update
Fixes #8966
2016-09-22 12:42:19 +01:00
Peter McAtominey 9fb9b67381 provider/azurerm: update Azure SDK
Based off master v4
2016-09-22 10:15:57 +01:00
Paul Stack 27a89ff405 Merge pull request #8671 from hashicorp/f-aws-firehose-cloudwatch
provider/aws: Add support for `cloudwatch_logging_options` to AWS Kinesis Firehose Delivery Streams
2016-09-22 10:01:44 +01:00
Paul Stack b2c7787380 Merge pull request #8907 from kwilczynski/feature/json-validation-data_source_aws_cloudformation_stack
provider/aws: Update aws_cloudformation_stack data source with new helper function.
2016-09-22 09:31:51 +01:00
Paul Stack 076fd93eb8 Merge pull request #8908 from kwilczynski/feature/json-validation-aws_s3_bucket
provider/aws: Add JSON validation to the aws_s3_bucket resource.
2016-09-22 09:30:38 +01:00
Paul Stack 283843241c Merge pull request #8906 from kwilczynski/feature/json-validation-aws_vpc_endpoint
[WIP]  provider/aws: Add JSON validation to the aws_vpc_endpoint resource.
2016-09-22 09:28:12 +01:00
Paul Stack f13e020376 Merge pull request #8898 from kwilczynski/feature/json-validation-aws_elasticsearch_domain
provider/aws: Add JSON validation to the aws_elasticsearch_domain resource.
2016-09-22 09:27:15 +01:00
Paul Stack c5afc1ad03 Merge pull request #8900 from kwilczynski/feature/json-validation-aws_kms_key
provider/aws: Add JSON validation to the aws_kms_key resource.
2016-09-22 09:26:12 +01:00
Krzysztof Wilczynski 8f689812d1
Handle JSON parsing error in the ReadFunc for the policy document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 09:02:46 +01:00
Krzysztof Wilczynski 6c27f175b5
Add JSON validation to the aws_sns_topic resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

This commit also removes unnecessary code from the StateFunc function,
and reduces it so that it only uses the normalizeJsonString helper.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 09:01:15 +01:00
Krzysztof Wilczynski 15d33c7fa4
Handle JSON parsing error in the ReadFunc for the policy document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:56:21 +01:00
Paul Stack a9dce86bf2 Merge pull request #8976 from kwilczynski/feature/check-error-aws_glacier_vault
provider/aws: Handle JSON parsing error in the ReadFunc for the access policy document.
2016-09-22 08:53:57 +01:00
Krzysztof Wilczynski dd1d41ddce
Handle JSON parsing error in the ReadFunc for the access policies document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:51:16 +01:00
Krzysztof Wilczynski d71ff1e122
Add JSON validation to the aws_elasticsearch_domain resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:50:00 +01:00
Paul Stack ab17d02faa Merge pull request #8978 from kwilczynski/feature/check-error-aws_cloudwatch_event_rule
provider/aws: Handle JSON parsing error in the ReadFunc for the event pattern document.
2016-09-22 08:47:40 +01:00
Krzysztof Wilczynski 0d68f6545d
Add JSON validation to the aws_kms_key resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:46:25 +01:00
Krzysztof Wilczynski 125e175186
Handle JSON parsing error in the ReadFunc for the policy document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:39:55 +01:00
Otto Jongerius 7d1df7ab16 provider/bitbucket: Remove unnecessary casts. 2016-09-22 17:35:03 +10:00
Krzysztof Wilczynski 749e6ba893
Handle JSON parsing error in the ReadFunc for the template body document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:34:41 +01:00
Krzysztof Wilczynski 604de4007a
Handle JSON parsing error in the ReadFunc for the event pattern document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:32:59 +01:00
Krzysztof Wilczynski f1d3b21fd2
Update aws_cloudformation_stack data source with new helper function.
This commit adds support for new helper function which is used to
normalise JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:27:19 +01:00
Krzysztof Wilczynski a35695a804
Add JSON validation to the aws_s3_bucket resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 08:20:59 +01:00
Krzysztof Wilczynski ff4671030e
Handle JSON parsing error in the ReadFunc for the access policy document.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-22 00:23:38 +01:00
Jay Wallace 947816958b Merge pull request #8975 from mootpt/protocol-fix
Allow use of protocol numbers for ah and esp
2016-09-21 14:40:14 -07:00
clint shryock 61d795ed44 tidy up tests 2016-09-21 16:12:56 -05:00
Matt Morrison c28c9ef459 Add support for GCS StorageClass
Fixes: #7417
2016-09-22 07:46:35 +12:00
Jay Wallace 45da08c67f
Allow use of protocol numbers for ah and esp 2016-09-21 11:52:23 -07:00
stack72 a2970e631c
Merge branch 'cwood/bitbucket-provider' of https://github.com/cwood/terraform into cwood-cwood/bitbucket-provider 2016-09-21 19:35:58 +01:00
Krzysztof Wilczynski 7596991303
Add JSON validation to the aws_vpc_endpoint resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-21 19:21:12 +01:00
Paul Stack 773cfc8e8e Merge pull request #8903 from kwilczynski/feature/json-validation-aws_sns_topic_policy
provider/aws: Add JSON validation to the aws_sns_topic_policy resource.
2016-09-21 09:31:08 +01:00
Paul Stack 5753cbea64 Merge pull request #8901 from kwilczynski/feature/json-validation-aws_s3_bucket_policy
provider/aws: Add JSON validation to the aws_s3_bucket_policy resource.
2016-09-21 09:26:50 +01:00
Paul Stack 32e5a452c2 Merge pull request #8905 from kwilczynski/feature/json-validation-aws_sqs_queue_policy
provider/aws: Add JSON validation to the aws_sqs_queue_policy resource.
2016-09-21 09:20:58 +01:00
Paul Stack 3ad4056113 Merge pull request #8904 from kwilczynski/feature/json-validation-aws_sqs_queue
provider/aws: Add JSON validation to the aws_sqs_queue resource.
2016-09-21 09:14:41 +01:00
Jean-François Pucheu c084b7d522 Correct Proxy setting for openstack provider: issue 8735 2016-09-20 20:53:56 +02:00
stack72 87f632cb92
provider/aws: `aws_elasticache_cluster` acceptance test for
`cluster_address`
2016-09-20 17:29:57 +01:00
stack72 10cddc8153
Merge branch 'aws_elasticache_cluster_address' of https://github.com/A-Gordon/terraform into A-Gordon-aws_elasticache_cluster_address 2016-09-20 17:09:11 +01:00
Paul Stack e9e1896ad4 Merge pull request #8775 from TimeIncOSS/f-aws-api-gateway-client-cert
provider/aws: Add API Gateway Client Certificate
2016-09-20 16:52:01 +01:00
A-Gordon de8b02e6e5 Added a cluster_address attribute to aws elasticache.
Added the cluster address as a separate attribute to the configuration endpoint. When using the configuration endpoint in conjunction with route 53 it was appending the cluster address with the port and invalidating the route 53 record.
2016-09-20 14:27:53 +01:00
Paul Stack 2c69a2bf93 Merge pull request #8909 from kwilczynski/feature/json-parsing-error-azurerm
provider/azurerm: Add normalizeJsonString and validateJsonString functions.
2016-09-20 12:53:07 +01:00
James Nugent c777827cb8 Merge pull request #8915 from TimeIncOSS/b-aws-s3-policy-fix
provider/aws: Make it possible to remove S3 bucket policy
2016-09-20 13:29:58 +02:00
Krzysztof Wilczynski 9ef9956ee2 provider/aws: Add JSON validation to the aws_cloudwatch_event_rule resource. (#8897)
* Add JSON validation to the aws_cloudwatch_event_rule resource.

This commit adds support for new helper function which is used to
normalise and validate JSON string. Also adds new validation function
to wrap around the aforementioned helper.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Re-factor validation function.

This commit changes the logic of the function so that it would check length of
the normalised JSON string over the given string, plus short-circuit early
should JSON would not be valid.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-19 23:47:17 +01:00
Radek Simko f17fdc76fa
provider/aws: Import S3 bucket policy as a separate resource 2016-09-19 08:28:45 +01:00
Radek Simko 59a7a5ca27
provider/aws: Only read S3 bucket policy if it's set 2016-09-18 22:35:07 +01:00
Radek Simko 18bd206c38
provider/aws: Make s3_bucket.policy not Computed 2016-09-18 20:58:36 +01:00
Radek Simko 1c3258d629
provider/aws: Fix s3_bucket test for empty policy 2016-09-18 20:57:50 +01:00
Krzysztof Wilczynski 056d53e1fe Add JSON validation to the aws_glacier_vault resource. (#8899)
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-18 14:26:28 +01:00
Krzysztof Wilczynski bad81299c1 Add JSON validation to the aws_cloudformation_stack resource. (#8896)
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-18 13:37:21 +01:00
Krzysztof Wilczynski e999ae77ba
Add normalizeJsonString and validateJsonString functions.
This commit adds ValidateFunc to the policy attribute so that JSON parsing
errors can be caught early. Generally, when there is a ValidateFunc set for the
attribute, one can safely assume that before any of the creation and/or update
of the existing resource would happen it would have to succeed validation. Also
adds support for new helper function which is used to normalise JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:34:50 +01:00
Krzysztof Wilczynski 80f799f69b
Add JSON validation to the aws_sqs_queue_policy resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:14:02 +01:00
Krzysztof Wilczynski 538327b61f
Add JSON validation to the aws_sqs_queue resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:13:14 +01:00
Krzysztof Wilczynski 3b1b4fb571
Add JSON validation to the aws_sns_topic_policy resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:12:35 +01:00
Krzysztof Wilczynski 6a02bf2983
Add JSON validation to the aws_s3_bucket_policy resource.
This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 23:10:22 +01:00
Krzysztof Wilczynski 5697a52b4f [WIP] provider/aws: Add normalizeJsonString and validateJsonString functions. (#8028)
* Add normalizeJsonString and validateJsonString functions.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Add unit test for the normalizeJsonString helper function.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Fix. Remove incrrect format string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Remove surplus type assertion.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Add unit test for the validateJsonStringhelper function.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Remove surplus whitespaces.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-17 19:50:38 +01:00
Clint 69f44a04e9 provider/aws: Add reader_endpoint RDS Clusters (supersedes #8878) (#8884)
* provider/aws: Add support for Aurora ReaderEndpoint

* provider/aws: Add reader_endpoint to the schema, document, test
2016-09-16 16:45:04 +01:00
Krzysztof Wilczynski 1eed5ddbe0 Fix. Correct a typo in the error message. (#8882)
This comment corrects a simple typo in the error message issued when the
credentials are not working and/or do not offer access to AzureRM, etc.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-16 16:09:20 +01:00
Clint 79bb2e8a87 provider/aws: Add Default Security Group Resource (#8861)
* Docs for default security group
* overrides of default behavior
* add special disclaimer
* update to support classic environments
2016-09-15 13:59:20 -05:00
Clint adea7563e5 provider/aws: Fix issue updating Elastic Beanstalk Environment variables (#8848)
* provider/aws: failing test case for updating env vars

* provider/aws: Fix issue with updating Elastic Beanstalk env vars
2016-09-15 13:30:12 -05:00
Sander van Harmelen 968472a63e Support recreating clients and configuring Chef Vaults (#8577)
Fixes #3605 and adds the functionality suggested in PR #7440.

This PR is using a different appraoch that (IMHO) feels cleaner and (even more important) adds support for Windows at the same time.
2016-09-15 14:20:18 +02:00
James Nugent a65b0cce7c provider/aws: Fix pointer fmt as string
Fixes #8839.
2016-09-14 20:14:41 +01:00
James Nugent 9d51ebd0aa provider/aws: Expose ARN suffix on ALB (#8833)
When creating a CloudWatch Metric for an Application Load Balancer it is
neccessary to use the suffix of the ARN as the reference to the load
balancer. This commit exposes that as an attribute on the `aws_alb`
resource to prevent the need to use regular expression substitution to
make the reference.

Fixes #8808.
2016-09-14 15:50:10 +01:00
Sven Walter 459e618c44 provider/aws: Retry resourceAwsLaunchConfigurationCreate if instance profile hasn't propagated (#8813) 2016-09-13 13:07:43 -05:00
Anshul Sharma 75e358ab85 Vendored WAF (#8785)
* Vendored WAF

* WAF with tag 1.4.7
2016-09-13 07:32:42 +01:00
Anshul Sharma 0e93a964b2 Changing snapshot_identifier on aws_db_instance resource should force a rebuild 2016-09-13 07:39:15 +05:30
stack72 da6c754345
Merge branch 'master' of github.com:hashicorp/terraform 2016-09-12 17:53:46 +01:00
stack72 0fe822e822
provider/azurerm: Removing the diagnostics part of the test from the azurerm virtual machine unattended acceptance test 2016-09-12 17:52:54 +01:00
stack72 971b08f320
Merge conflict resolution of virtual_machine.html.markdown in AzureRM 2016-09-12 11:13:24 +01:00
Paul Stack 44bc70971d Merge pull request #8673 from hashicorp/f-aws-alb-generated-name
provider/aws: Allow `aws_alb` to have the name auto-generated
2016-09-12 11:04:47 +01:00
stack72 ef9aa6baaf
Merge branch 'optimisticanshul-6973-codecommit-trigger' 2016-09-12 10:55:37 +01:00
stack72 116d70dccb
provider/aws: Removal of test for changes as it forces a new resource 2016-09-12 10:54:15 +01:00
stack72 229f2698ce
Merge branch '6973-codecommit-trigger' of https://github.com/optimisticanshul/terraform into optimisticanshul-6973-codecommit-trigger 2016-09-12 10:44:32 +01:00
stack72 20ad3e0b2f
provider/aws: Allow `aws_alb` to have the name auto-generated
In order to satisify scenarios where a lifecycle is block is used, we
would need the AWS ALB name field to be autogenerated. WE follow the
same work as AWS ELB, we prefix it with `tl-lb-`

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALB_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/08 12:43:40 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALB_ -timeout
120m
=== RUN   TestAccAWSALB_basic
--- PASS: TestAccAWSALB_basic (79.81s)
=== RUN   TestAccAWSALB_generatedName
--- PASS: TestAccAWSALB_generatedName (93.81s)
=== RUN   TestAccAWSALB_namePrefix
--- PASS: TestAccAWSALB_namePrefix (73.48s)
=== RUN   TestAccAWSALB_tags
--- PASS: TestAccAWSALB_tags (181.32s)
=== RUN   TestAccAWSALB_noSecurityGroup
--- PASS: TestAccAWSALB_noSecurityGroup (66.03s)
=== RUN   TestAccAWSALB_accesslogs
--- PASS: TestAccAWSALB_accesslogs (130.82s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    625.285s
```
2016-09-12 10:38:13 +01:00
Radek Simko 46d5d51ad6
provider/aws: Add API Gateway Client Certificate 2016-09-12 10:09:47 +01:00
Paul Stack 6cf1fdf980 Merge pull request #8675 from hashicorp/b-aws-kms-key-policy
provider/aws: Support Policy DiffSuppression in `aws_kms_key` policy
2016-09-12 09:50:09 +01:00
Anshul Sharma 2d57e71c01 Remove Unused Log From CodeCommit Trigger Test 2016-09-12 14:15:53 +05:30
stack72 806c000dbb
provider/aws: Support Policy DiffSuppression in `aws_kms_key` policy
Fixes #7495

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSKmsKey_policy'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/06 10:44:20 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSKmsKey_policy
-timeout 120m
=== RUN   TestAccAWSKmsKey_importBasic
--- PASS: TestAccAWSKmsKey_importBasic (166.19s)
=== RUN   TestAccAWSKmsKey_basic
--- PASS: TestAccAWSKmsKey_basic (215.33s)
=== RUN   TestAccAWSKmsKey_policy
--- PASS: TestAccAWSKmsKey_policy (116.81s)
=== RUN   TestAccAWSKmsKey_isEnabled
--- PASS: TestAccAWSKmsKey_isEnabled (1008.31s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1689.957s
```
2016-09-12 09:44:07 +01:00
Paul Stack 578e0eb04d Merge pull request #8780 from TimeIncOSS/f-aws-misspell
provider/aws: Fix misspelled words
2016-09-12 09:41:13 +01:00
Sander van Harmelen d2d27923df provider/cloudstack: fix vpc renaming (#8784)
* fixed vpc rename bug

* Tweak the suggested fix

There was an assertion error in the fix, and after discussing we felt it was better to split the two changes to make them independant.
2016-09-12 10:30:45 +02:00
Anshul Sharma 7150bafb84 Remove Region Condition From CodeCommit Repo Resource (#8778) 2016-09-12 07:30:46 +01:00
Radek Simko 2ad84a51df
provider/aws: Fix misspelled words 2016-09-12 07:23:34 +01:00
Anshul Sharma 497063af3e Added Codecommit Trigger 2016-09-12 10:17:04 +05:30
Paul Stack f993b726b0 provider/aws: `aws_db_instance` unexpected state when configurating (#8707)
enhanced monitoring

Fixes #8699

When configuring enhanced monitoring, a user got the following error:

```
* aws_db_instance.db: unexpected state 'configuring-enhanced-monitoring',
wanted target '[available]'``

We have added this to the list of pending states we have when creating
and updating an RDS instance
2016-09-11 19:29:23 +01:00
Steve Hoeksema 1d04cdb9bc Export AWS ELB service account ARN (#8700) 2016-09-11 19:13:58 +01:00
Colin Wood 49f0c2e917 Add acceptence test for default reviews and hook 2016-09-09 12:09:07 -07:00
Steve Hoeksema 0cf330000e Don't import fmt 2016-09-09 09:00:48 +12:00
Colin Wood 9e85fdbd1d Initial acceptence test for hooks 2016-09-08 12:57:12 -07:00
Colin Wood 60351421da Test delition of repository 2016-09-08 12:42:40 -07:00
Colin Wood 32b5493e57 Initial Acceptence test for repository 2016-09-08 12:27:29 -07:00
Radek Simko 3e3043adf4
provider/aws: Prevent crash on account ID validation 2016-09-08 11:46:18 +01:00
Steve Hoeksema e65be3d256 Format with tabs, add missing comma 2016-09-08 15:51:31 +12:00
Steve Hoeksema 55ac68e0a2 Fix formatting 2016-09-08 10:58:13 +12:00
stack72 d81cbdb4fb
provider/aws: Add support for `cloudwatch_logging_options` to AWS
Kinesis Firehose Delivery Streams

Fixes #7152

Adding support for CloudWatch Logging to Firehose as per the
instructions here -
http://docs.aws.amazon.com/firehose/latest/dev/monitoring-with-cloudwatch-logs.html

```

```
2016-09-07 23:29:08 +01:00
Evan Brown 262661a05f providers/google: Add documentation for google_iam_policy resource 2016-09-07 13:35:33 -07:00
Evan Brown bb7b8c875e providers/google: Add acceptance tests for Project IAM 2016-09-07 13:35:33 -07:00
Evan Brown 8520cd7fe4 providers/google: Allow IAM policy removal from project 2016-09-07 13:35:33 -07:00
Evan Brown 4cdb064e16 WIP: providers/google: Support IAM permissions for GCP projects
This change adds a data source to allow declaring IAM policies, as well as a
new resource to represent an existing GCP project. The project resource may
reference an IAM policy, allowing a user to set project-wide permissions.
2016-09-07 13:35:33 -07:00
Paul Stack 91ade752a0 Merge pull request #8689 from erutherford/master
adding missing failed states for the NAT Gateways
2016-09-07 10:04:07 +01:00
Paul Stack de53db01b9 Merge pull request #8653 from TimeIncOSS/f-aws-lambda-publish
provider/aws: Support 'publish' attribute in lambda_function
2016-09-07 09:32:01 +01:00
Steve Hoeksema 74587baa4a Add AWS Billing & Cost Management service account
This adds a very simple data source for the AWS Billing account ID magic number.

Used to allow AWS to dump detailed billing reports into an S3 bucket you control.

http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2
2016-09-07 17:43:45 +12:00
Eric Rutherford 2cca48a829
switch to go way of checking for key existence so that go doesn't crash when the value doesn't exist 2016-09-06 20:57:10 -05:00
Eric Rutherford 04c2d40e57
commit after running make fmt 2016-09-06 14:56:56 -05:00
Eric Rutherford 91f6f2a143
moving to using a map to clean up the error check 2016-09-06 14:54:17 -05:00
Eric Rutherford 7a6b04dfa2
adding missing failed states for the NAT Gateways 2016-09-06 12:25:42 -05:00
Paul Stack 3869bebec8 Merge pull request #8672 from hashicorp/b-aws-es-delete-timeout
provider/aws: Bump `aws_elasticsearch_domain` timeout values
2016-09-06 14:27:58 +01:00
Paul Stack fd541a41de Merge pull request #8661 from nicolai86/fix/scaleway-security-groups
provider/scaleway: fix security_group_rule identification
2016-09-06 13:41:43 +01:00
stack72 ad4e580a03
provider/aws: Bump `aws_elasticsearch_domain` timeout values
Fixes #8541

The Update timeout and delete timeouts were a little short. Bumped them
to 60 mins and 90 mins respectively. I have been on the receiving of the
timeout for the Delete function
2016-09-06 08:52:07 +01:00
James Nugent 44af0d60df provider/postgres: Fix acceptance tests
```
› PGSSLMODE=disable PGHOST=localhost PGUSER=postgres make testacc \
	TEST=./builtin/providers/postgresql
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/05 15:39:23 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/postgresql -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccPostgresqlDatabase_Basic
--- PASS: TestAccPostgresqlDatabase_Basic (0.53s)
=== RUN   TestAccPostgresqlDatabase_DefaultOwner
--- PASS: TestAccPostgresqlDatabase_DefaultOwner (0.51s)
=== RUN   TestAccPostgresqlRole_Basic
--- PASS: TestAccPostgresqlRole_Basic (0.11s)
PASS
ok     	github.com/hashicorp/terraform/builtin/providers/postgresql    	1.160s
```
2016-09-05 15:39:57 -07:00
James Nugent 34a17d3b46 provider/postgres: Correct casing -> PostgreSQL 2016-09-05 15:04:48 -07:00
James Nugent 006ab910b8 provider/postgres: Use standard environment vars
Previously the provider accepted non-standard environment variables. We
now accept the standard PGHOST/PGUSER/PGPASSWORD variables that psql
uses in addition the older ones.
2016-09-05 15:04:08 -07:00
James Nugent 260179543a provider/postgres: Clean up definitions and errors
This commit brings the Postgres provider up to "new" standards for error
wrapping and nested structure definitions.
2016-09-05 14:46:40 -07:00
Paul Hinze 0db012fcf1
provider/azurerm: Remove editorialization from comment 2016-09-05 15:03:58 -05:00
Evan Brown bfc30b4b89 providers/google: Fix VPN Tunnel acceptance test
This fix changes acceptance tests for VPN tunnel to use the correct ports (UDP
500 and 4500). It also changes the documentation to demonstrate using these
port single ports in a `port_range` field.
2016-09-05 12:34:40 -07:00