Commit Graph

132 Commits

Author SHA1 Message Date
clint shryock dede6f7302 provider/aws: Reformat and detect drift for Lambda VPC, environment 2016-11-21 17:10:32 -06:00
Paul Stack b3fad6a68c provider/aws: Addition of suspended_processes to aws_autoscaling_group (#10096)
Fixes #8954

Addition of the support of autoScaling group suspended_processes
2016-11-21 17:02:20 +02:00
jmasseo 77ca7001a8 removing toLower from flattenElastiCacheParameters - aws_elasticache_parameter_group parameters can be case sensitive (#9820) 2016-11-09 11:34:00 +00:00
Paul Stack b6718de299 Merge pull request #9010 from hashicorp/aws-elasticache-cluster-import
Aws elasticache cluster import
2016-09-28 19:49:42 +01:00
stack72 b02a5c47ec
provider/aws: Support Import of aws_elasticache_cluster
Initial tests were failing as follows:

```
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- FAIL: TestAccAWSElasticacheCluster_importBasic (362.66s)
        testing.go:265: Step 1 error: ImportStateVerify attributes not
        equivalent. Difference is shown below. Top is actual, bottom is
        expected.

        (map[string]string) {

        }

(map[string]string) (len=2) {
             (string) (len=20) "parameter_group_name": (string) (len=20)
             "default.memcached1.4",
                             (string) (len=22) "security_group_names.#":
                             (string) (len=1) "0"

}

FAIL
exit status 1
```

The import of ElastiCache clusters helped to point out 3 things:

1. Currently, we were trying to set the parameter_group_name as follows:

```
d.Set("parameter_group_name", c.CacheParameterGroup)
```

Unfortunately, c.CacheParameterGroup is a struct not a string. This was
causing the test import failure. So this had to be replaced as follows:

```
if c.CacheParameterGroup != nil {
      d.Set("parameter_group_name", c.CacheParameterGroup.CacheParameterGroupName)
}
```

2. We were trying to set the security_group_names as follows:

```
d.Set("security_group_names", c.CacheSecurityGroups)
```

The CacheSecurityGroups was actually a []* so had to be changed to work
as follows:

```
if len(c.CacheSecurityGroups) > 0 {
            d.Set("security_group_names",
            flattenElastiCacheSecurityGroupNames(c.CacheSecurityGroups))

}
```

3. We were trying to set the security_group_ids as follows:

```
d.Set("security_group_ids", c.SecurityGroups)
```

This is another []* and needs to be changed as follows:

```
if len(c.SecurityGroups) > 0 {
            d.Set("security_group_ids",
            flattenElastiCacheSecurityGroupIds(c.SecurityGroups))

}
```

This then allows the import test to pass as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 10:59:01 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_importBasic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- PASS: TestAccAWSElasticacheCluster_importBasic (351.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    351.981s
```

As a final test, I ran the basic ElastiCache cluster creation to make
sure all passed as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 11:05:51 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_basic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_basic
--- PASS: TestAccAWSElasticacheCluster_basic (809.25s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    809.267s
```
2016-09-28 12:29:20 +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
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
Radek Simko 2ad84a51df
provider/aws: Fix misspelled words 2016-09-12 07:23:34 +01:00
Radek Simko a3c21d6c3b
provider/aws: Add cloudformation_stack data source 2016-09-03 11:33:59 +01:00
stack72 3c71783d07
provider/aws: Set `apply_method` to state in `aws_db_parameter_group`
Fixes #8593

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBParameterGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/01 13:04:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBParameterGroup_ -timeout 120m
=== RUN   TestAccAWSDBParameterGroup_importBasic
--- PASS: TestAccAWSDBParameterGroup_importBasic (27.03s)
=== RUN   TestAccAWSDBParameterGroup_limit
--- PASS: TestAccAWSDBParameterGroup_limit (48.54s)
=== RUN   TestAccAWSDBParameterGroup_basic
--- PASS: TestAccAWSDBParameterGroup_basic (46.29s)
=== RUN   TestAccAWSDBParameterGroup_Only
--- PASS: TestAccAWSDBParameterGroup_Only (23.57s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    145.445s
```
2016-09-02 08:26:46 +01:00
Anshul Sharma f034638026 Enable/Disbale Option For ELB Access logs 2016-08-24 14:37:47 +05:30
Radek Simko 070942df0f provider/aws: Add support for ECS svc - LB target group (#8190) 2016-08-23 11:19:43 -05:00
Raphael Randschau 66a14cb3b7 provider/aws: Re-implement api gateway parameter handling (#7794)
* provider/aws: Re-implement api gateway parameter handling

this PR cleans up some left overs from PR #4295, namely the parameter handling.

now that GH-2143 is finally closed this PR does away with the ugly
`request_parameters_in_json` and `response_parameters_in_json` hack.

* Add deprecation message and conflictsWith settings

following @radeksimko s advice, keeping the old code around with a deprecation
warning.

this should be cleaned up in a few releases

* provider/aws: fix missing append operation

* provider/aws: mark old parameters clearly as deprecated

* provider/aws work around #8104

following @radeksimko s lead

* provider/aws fix cnp error
2016-08-11 11:49:58 +01:00
Mosley, Franklin 6d7933b41a Added tests for expandPolicyAttributes/flattenPolicyAttributes 2016-08-09 15:29:50 -07:00
Mosley, Franklin a6de088375 Add new resource aws_lb_ssl_negotiation_policy
Added new resource to create an AWS ELB SSL negotiation policy, and an
acceptance test.
2016-08-09 15:29:13 -07:00
Chris Broglie 2505b2e35f Add support for Kinesis streams shard-level metrics (#7684)
* Add support for Kinesis streams shard-level metrics

* Add test case for flattenKinesisShardLevelMetrics

* Document new shard_level_metrics field
2016-07-21 23:37:58 +01:00
clint shryock edd67547bc remove debug statements 2016-07-11 15:12:15 -06:00
stack72 ceeab2ad12 provider/aws: Support Import for `aws_api_gateway_key`
Previously, the `stage_key` were not being set back to state in the Read
func. Changing this means the tests now run as follows:

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAPIGatewayApiKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSAPIGatewayApiKey_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayApiKey_importBasic
--- PASS: TestAccAWSAPIGatewayApiKey_importBasic (42.42s)
=== RUN   TestAccAWSAPIGatewayApiKey_basic
--- PASS: TestAccAWSAPIGatewayApiKey_basic (42.11s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    84.549s
```
2016-07-11 15:11:30 -06:00
Clint 17931c7099 Merge pull request #7511 from hashicorp/pr-7319
provider/aws: AWS prefix lists to enable security group egress to a VPC Endpoint (supersedes #7319)
2016-07-07 12:10:10 -05:00
Clint 6367bade03 Merge pull request #6851 from TeaBough/master
provider/aws: Handled case when instanceId is absent in network interfaces
2016-07-01 09:42:35 -05:00
stevehorsfield 03c2c4408f Add support for 'prefix_list_ids' to AWS VPC security group rules
Prefix list IDs are used when allowing egress to an AWS VPC Endpoint.

See http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html#vpc-endpoints-routing
2016-06-30 15:48:27 -07:00
James Bardin 5c1b625c84 Add support for Amazon Elastic Transcoder
- Add resources for elastic transcoder pipelines and presets
2016-06-07 16:07:08 -04:00
Thibault Vigouroux efdee645bf Handled case when instanceId is absent in network interfaces 2016-05-24 15:52:38 +02:00
clint shryock 23340d3c84 provider/aws: Fix crash in ElastiCache param group 2016-05-16 12:20:06 -05:00
Kraig Amador dc4dd764e6 Adding option_settings to aws_db_option_group 2016-05-09 12:40:38 -07:00
stack72 8dc123fd94 Scaffold the AWS DB Option Group resource
Change the AWS DB Instance to now include the DB Option Group param. Adds a test to prove that it works

Add acceptance tests for the AWS DB Option Group work. This ensures that Options can be added and updated

Documentation for the AWS DB Option resource
2016-05-08 20:18:53 +01:00
Greg Thole ebfc701265 provider/aws: AWS API Gateway request parameters json (#6501)
* Update docs with new parameters

* Add request parameters as JSON

* Update function name and error statements
2016-05-05 21:14:51 +01:00
Josh Taylor 983da213af provider/aws: add response parameters support to api gateway (#6344)
* provider/aws: Add support for response parameters aws_api_gateway_integration_response and aws_api_gateway_method response.

* fix spacing

* fix spacing

* gofmt

* add update test; add docs; add reimplement TODO; add field read

* resolve conflict

* fix expandAPIGatewayMethodResponse error handling
2016-05-04 11:56:18 +01:00
Radek Simko e3ade6a784 provider/aws: Add support for api_gateway_account (#6321) 2016-04-27 13:08:59 +01:00
Chris Marchesi a38ccbe074 CloudFront distribution and origin access identity support (#5221)
* CloudFront implementation v3

* Update tests

* Refactor - new resource: aws_cloudfront_distribution

 * Includes a complete re-write of the old aws_cloudfront_web_distribution
   resource to bring it to feature parity with API and CloudFormation.
 * Also includes the aws_cloudfront_origin_access_identity resource to generate
   origin access identities for use with S3.
2016-04-14 14:55:11 -05:00
David Harris c3a6cf0620 provider/aws: Adding outputs for elastic_beanstalk_environment resource.
refs #5798
2016-04-01 13:58:09 -06:00
Christopher Tiwald 305a450239 aws_autoscaling_policy: Add support for StepScaling policies.
Unlike SimpleScaling policies, StepScaling policies require one or more
"steps", which are interval ranges in which a tracked metric can lie.
Policies can then execute scaling adjustments wedded to these steps.

This commit also adds a slew of additional policy attributes which are
only applicable to step policies.
2016-03-24 16:35:54 -04:00
Radek Simko 3bfcd47238 provider/aws: Add support for CloudWatch Log Metric Filter 2016-03-15 15:01:20 +00:00
Clint 239b3e4f5f Merge pull request #5533 from hashicorp/pr-5184
provider/aws: Fix EC2 Classic SG Rule issue
2016-03-10 08:56:29 -06:00
James Nugent 7436cf7f89 Merge pull request #5376 from stack72/b-aws-ELBListner
provider/aws: Fixes the use of Uppercase chars in ELB Listeners
2016-03-09 23:18:56 +00:00
clint shryock f96ec46681 update comments 2016-03-09 15:50:01 -06:00
clint shryock 23c42cd6cf Add test for flattenSecurityGroups 2016-03-09 15:00:30 -06:00
ephemeralsnow 54cb5ffe00 provider/aws: Fix EC2 Classic SG Rule issue
Fixes an issue where security groups would fail to update after applying an
initial security_group, because we were improperly saving the id of the group
and not the name (EC2 Classic only).

This is a PR combining https://github.com/hashicorp/terraform/pull/4983 and
https://github.com/hashicorp/terraform/pull/5184 . It's majority
@ephemeralsnow's work.
2016-03-09 09:51:41 -06:00
Raphael Randschau 6430fca7f6 Add aws_api_gateway_deployment resource 2016-03-05 23:21:58 +01:00
Raphael Randschau 91f5206f8d Add aws_api_gateway_method_response resource 2016-03-05 23:21:41 +01:00
stack72 4fc1391303 Scaffold the AWS Autoscaling Group Metrics Collection 2016-02-29 19:24:30 +00:00
stack72 ffbb59a73e provider/aws: Fixes the use of Uppercase chars in ELB Listeners 2016-02-29 18:04:47 +00:00
Maxime Bury f92b2b7c58 Also ignore empty VPC config after all 2016-02-23 12:56:46 -08:00
Maxime Bury 288ba868e4 Harden things around VPC config 2016-02-18 13:45:32 -08:00
Maxime Bury f0f3c430a8 Generalize fix to ignore empty VPC config 2016-02-17 21:45:13 -05:00
Maxime Bury eb2aaef016 VpcId can be nil in the wild 2016-02-17 20:06:18 -05:00
vince rosso 3baabb0186 VPC config support in Lambda functions
fixes #5105
2016-02-16 10:43:51 -08:00
Trevor Pounds 57a9048510 Consolidate duplicate list/set type conversions. 2016-02-11 00:48:58 -08:00
Clint 7f6624e926 Merge pull request #3862 from stack72/aws-redshift
provider/aws: AWS Redshift
2016-01-13 16:52:47 -06:00
Clint 921f6eb806 Merge pull request #4388 from jszwedko/add-support-for-aws-directory-service-microsoft-active-directory
Add support for creating Managed Microsoft Active Directory and Directory Connectors in AWS
2016-01-13 13:39:29 -06:00