Commit Graph

2731 Commits

Author SHA1 Message Date
clint shryock f0021e1f03 provider/aws: Seperate out TestAccAWSDBInstance_iops_update into it's own run
This will seperate the TestAccAWSDBInstance_iops_update test into it's own
namespace for testing by itself in Travis
2016-07-27 11:07:37 -05:00
James Bardin 735e425daa Merge pull request #7831 from hashicorp/jbardin/unused-vars
Remove unused variables
2016-07-27 11:55:57 -04:00
Paul Stack 8ed549c3b5 provider/aws: Don't delete Lambda function from state on initial call of (#7829)
the Read func

Fixes #7782

Lambda functions are eventually consistent :( Therefore, when we move
from the Create func to the Read func, there is a chance that the Lambda
hasn't replicated yet and we could therefore find that it doesn't exist
and delete it as follows:

```
params := &lambda.GetFunctionInput{
        FunctionName: aws.String(d.Get("function_name").(string)),

}

    getFunctionOutput, err := conn.GetFunction(params)
    if err != nil {
            if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" {
                        d.SetId("")
                                    return nil

            }
                    return err

    }
```

This PR uses `d.IsNewResource()` to check if the Read is being called
after a Create and therefore, won't delete the lambda if not found. This
should allow the lambda to replicate

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSLambdaFunction_'
=> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSLambdaFunction_ -timeout 120m
=== RUN   TestAccAWSLambdaFunction_importLocalFile
--- PASS: TestAccAWSLambdaFunction_importLocalFile (36.64s)
=== RUN   TestAccAWSLambdaFunction_importLocalFile_VPC
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (45.17s)
=== RUN   TestAccAWSLambdaFunction_importS3
--- PASS: TestAccAWSLambdaFunction_importS3 (40.88s)
=== RUN   TestAccAWSLambdaFunction_basic
--- PASS: TestAccAWSLambdaFunction_basic (44.77s)
=== RUN   TestAccAWSLambdaFunction_VPC
--- PASS: TestAccAWSLambdaFunction_VPC (44.13s)
=== RUN   TestAccAWSLambdaFunction_s3
--- PASS: TestAccAWSLambdaFunction_s3 (43.62s)
=== RUN   TestAccAWSLambdaFunction_localUpdate
--- PASS: TestAccAWSLambdaFunction_localUpdate (33.49s)
=== RUN   TestAccAWSLambdaFunction_localUpdate_nameOnly
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (51.83s)
=== RUN   TestAccAWSLambdaFunction_s3Update
--- PASS: TestAccAWSLambdaFunction_s3Update (106.49s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    447.055s
```

Thanks to @radeksimko for pointing out `d.IsNewResource()`
2016-07-27 16:47:25 +01:00
James Bardin 142f689f96 Remove unused variables
These variables weren't used, but the compiler misses them since they
are captured in a closure.
2016-07-27 11:42:21 -04:00
stack72 4e1d54ad51
provider/aws: Change the resource name expected as part of sqs queue import test 2016-07-26 21:59:21 +01:00
stack72 3a1f2e6fe9
Merge branch 'master' into b-aws-sqs-defaults 2016-07-26 21:51:48 +01:00
Clint ff9ad3cc40 provider/aws: Fix issue updating ElasticBeanstalk Environment templates (#7811)
* provider/aws: Fix issue removing templates from ElasticBeanstalk

* regression test
2016-07-26 15:04:03 -05:00
clint shryock 348f6bad50 provider/aws: Apply defaults to SQS Queues 2016-07-26 14:53:45 -05:00
clint shryock 6a42717f55 update sqs test to fail on reverting to defaults 2016-07-26 14:41:54 -05:00
clint shryock 0e6ff77433 provider/aws: Restore Defaults to SQS Queues 2016-07-26 10:30:52 -05:00
clint shryock 5050d4555c provider/aws: ignore force_destroy on AWSUser Import test 2016-07-26 09:56:50 -05:00
stack72 63db19f564
Merge branch 'master' of github.com:hashicorp/terraform 2016-07-26 10:43:42 +01:00
stack72 76aea014cc
provider/aws: Making some slight changes to the tests in resources 2016-07-26 10:43:14 +01:00
Andreas Skarmutsos Lindh 1f400671c8
added applicationautoscaling from aws-sdk-go
using: `govendor add
github.com/aws/aws-sdk-go/service/applicationautoscaling@v1.2.5`

introduce a retry for scalable target creation

Due to possible inconsistencies in IAM, let's retry creation of the scalable target before we fail.

Added IAM role as part of acceptance test
2016-07-26 10:43:09 +01:00
Andreas Skarmutsos Lindh cc912c39e5
AWS Application AutoScaling
Initial work on two new resource types:
* `aws_appautoscaling_target`
* `aws_appautoscaling_policy`

Fix acc tests
2016-07-26 10:43:06 +01:00
Andy Chan ba10720e5d Adding passthrough behavior for API Gateway integration (#7801) 2016-07-26 09:38:51 +01:00
Zachary Salzbank afb06f907f providers/aws: expose network interface id (#6751)
Expose the network interface ID that is created with a new instance.

This can be useful when associating an existing elastic IP to the
default interface on an instance that has multiple network interfaces.
2016-07-25 19:52:40 +01:00
Jonathan McCall 3c702f2d75 Ignore missing ENI attachment when trying to detach (#7185) 2016-07-25 18:48:33 +01:00
Paul Stack 31b8cde45c provider/aws: Support Import `aws_dynamodb_table` (#7352)
There were some changes required to the Read func to get this working.
The initial set of tests showed the following:

```
testing.go:255: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.

        (map[string]string) {
        }

        (map[string]string) (len=8) {
         (string) (len=8) "hash_key": (string) (len=16) "TestTableHashKey",
         (string) (len=23) "local_secondary_index.#": (string) (len=1) "1",
         (string) (len=36) "local_secondary_index.884610231.name": (string) (len=12) "TestTableLSI",
         (string) (len=52) "local_secondary_index.884610231.non_key_attributes.#": (string) (len=1) "0",
         (string) (len=47) "local_secondary_index.884610231.projection_type": (string) (len=3) "ALL",
         (string) (len=41) "local_secondary_index.884610231.range_key": (string) (len=15) "TestLSIRangeKey",
         (string) (len=4) "name": (string) (len=38) "TerraformTestTable-2710929679033484576",
         (string) (len=9) "range_key": (string) (len=17) "TestTableRangeKey"
        }
```

On investigation, this was telling me that `hash_key`, `range_key`, `name` and `local_secondary_index` were not being set on the Read func

When they were being set, all looks as expected:

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDynamoDbTable_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDynamoDbTable_ -timeout 120m
=== RUN   TestAccAWSDynamoDbTable_importBasic
--- PASS: TestAccAWSDynamoDbTable_importBasic (20.39s)
=== RUN   TestAccAWSDynamoDbTable_basic
--- PASS: TestAccAWSDynamoDbTable_basic (39.99s)
=== RUN   TestAccAWSDynamoDbTable_streamSpecification
--- PASS: TestAccAWSDynamoDbTable_streamSpecification (50.44s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	110.841s
```
2016-07-25 15:31:00 +01:00
Partha Dutta 7de54533f9 Support greater than twenty db parameters (#7364)
* aws_db_parameter_group: Support more than 20 parameters in a single update

* create test to prove greater than 20 database parameters can be processed

* update test to prove updating greater than 20 database parameters can be processed

* Issues with certain key value database parameters

Cannot create a passing test for database parameters "innodb_file_per_table" and "binlog_format"
It seems that these parameters can be created and tested successfully
BUT after the "parameter group" has been destroyed, it then makes a "DescribeDBParameterGroups" call
This fails with a 404 error...makes sense since the group does not exist

Have very little understanding of how the test framework works, so am struggling to debug

Currently commented out to have a passing test

* reorder create database parameter group dataset

* reorder update database parameter group dataset

* typo: excede => exceed

* add one extra database parameter; now it is 41 in total

* added test for additonal database parameter added in previous commit

* remove commented out database parameters from test
2016-07-25 13:25:36 +01:00
Brian Menges 17b16f543e Ignore IOPS on non io1 AWS devices (#7783)
- Already ignoring IOPS on ebs attached non-io1 devices; extended to root_block_device
- Added warning captured from #4146 / [../blob/master/builtin/providers/aws/resource_aws_ebs_volume.go#L104](resource_aws_ebs_volume.go#L104)
- Added test when setting IOPS to 330 (11GiB * 30 = 330) on GP2 root device results in AWS reported 100 IOPS (successfully ignored input)
2016-07-25 12:32:24 +01:00
David Tolnay ad62f09061 provider/aws: Delete access keys before deleting IAM user (#7766)
* provider/aws: Delete access keys before deleting IAM user

* provider/aws: Put IAM key removal behind force_destroy option

* provider/aws: Move all access key deletion under force_destroy

* Add iam_user force_destroy to website

* provider/aws: Improve clarity of looping over pages in delete IAM user
2016-07-25 08:15:03 +01:00
Paul Stack 8c88038647 provider/aws: `aws_redshift_cluster` `number_of_nodes` was having the (#7771)
wrong value set to state

we used `len(ClusterNodes)` rather than NumberOfNodes :)

This was picked up by the nightly tests! <3
2016-07-22 18:14:30 +01:00
clint shryock c4e6c14fec provider/aws: Restore lost client.simpledbconn initialization
It once was lost but now is found!
2016-07-22 10:33:30 -05:00
James Bardin 2712328d5a Merge pull request #7756 from hashicorp/jbardin/tf-atlas-version
core: send version info to atlas
2016-07-22 10:56:43 -04:00
stack72 2340d576b1
provider/aws: Rename the ECS Container Data Source test 2016-07-22 13:49:06 +01:00
stack72 fcbaf3eea6
Merge branch 'feature/data-source-ecs' of https://github.com/nicolai86/terraform into nicolai86-feature/data-source-ecs 2016-07-22 13:43:18 +01: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
Brad Sickles 732b8d3b6e Implementing aws_ami_launch_permission. (#7365) 2016-07-21 23:08:32 +01:00
Paul Hinze 261043fd1a Merge pull request #7523 from hashicorp/f-aws-beanstalk-env-poll-timing
provider/aws: Beanstalk environments, bump the minimum timeout between API calls
2016-07-21 16:43:21 -05:00
James Bardin f66d1a10a4 Add VersionString
We conditionally format version with VersionPrerelease in a number of
places. Add a package-level function where we can unify the version
format. Replace most of version formatting in terraform, but leave th
few instances set from the top-level package to make sure we don't break
anything before release.
2016-07-21 16:43:49 -04:00
Paul Stack eb314ee520 provider/aws: Set `storage_encrypted` to state in (#7751)
`aws_rds_cluster_instance`

The Import test showed that there was no setting of the
`storage_encrypted` value back to state on the Read func.

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSClusterInstance_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRDSClusterInstance_importBasic -timeout 120m
=== RUN   TestAccAWSRDSClusterInstance_importBasic
--- PASS: TestAccAWSRDSClusterInstance_importBasic (754.30s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    754.411s
```
2016-07-21 14:16:13 -05:00
stack72 399f1c20e0
provider/aws: Rename the Basic Import test for CloudFront distributions 2016-07-21 12:41:01 +01:00
stack72 c9a53c20ba
Merge branch 'rossd/cloudfront_import' of https://github.com/dropbox/terraform into dropbox-rossd/cloudfront_import 2016-07-21 10:31:35 +01:00
Paul Hinze df5d2c9a63 provider/aws: pull iamconn setup earlier (#7734)
Fixes problem introduced in re-arrangement of config
2016-07-21 00:38:14 +01:00
Jan Schumann ecb4b5aada providers/aws: Opsworks permission resource (#6304)
* add opsworks permission resource

* add docs

* remove permission from state if the permission object could not be found

* remove nil validate function. validation is done in schema.Resource.

* add id to the list of exported values

* renge over permission to check that we have found got the correct one

* removed comment

* removed set id

* fix unknown region us-east-1c

* add user_profile resource

* add docs

* add default value
2016-07-21 00:29:33 +01:00
Paul Stack a2c5b31490 provider/aws: Support kms_key_id for `aws_rds_cluster` (#7662)
* provider/aws: Support kms_key_id for `aws_rds_cluster`

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_
-timeout 120m
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (127.57s)
=== RUN   TestAccAWSRDSCluster_kmsKey
--- PASS: TestAccAWSRDSCluster_kmsKey (323.72s)
=== RUN   TestAccAWSRDSCluster_encrypted
--- PASS: TestAccAWSRDSCluster_encrypted (173.25s)
=== RUN   TestAccAWSRDSCluster_backupsUpdate
--- PASS: TestAccAWSRDSCluster_backupsUpdate (264.07s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    888.638s
```

* provider/aws: Add KMS Key ID to `aws_rds_cluster_instance`

```

```
2016-07-20 23:52:34 +01:00
Paul Hinze 4078221957 provider/aws: Clean up aws config path a bit (#7672)
Rearrange client setup, and remove the extraneous log lines we make per
connection. There's no need to log one line per API client - we're just
setting up structs for most of them.

Since this collapses the file down quite a bit, switch to alphabetized
client setup, since previously there wasn't much of an order to things.
2016-07-20 23:49:57 +01:00
Ross Delinger 6ef7f9cd4d Add import support to CloudFront Distributions.
* Import support and acceptance tests for import support have been added.
* geo_restriction.location is now guarnteed to be in sorted order (was
causing a failure in the test)
2016-07-20 15:25:06 -07:00
Clint 4d126aaf6f provider/aws: Fix regression in Security Group Rules with self reference (#7706)
* provider/aws: Failing test for #7670

* provider/aws: Fix security group rule regression with self (#7670)
2016-07-20 15:47:10 -05:00
Paul Stack b4fa54e3c0 provider/aws: Support Import `aws_rds_cluster` (#7366)
```
make testacc TEST=./builtin/providers/aws
TESTARGS='-run=TestAccAWSRDSCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRDSCluster_importBasic -timeout 120m
=== RUN   TestAccAWSRDSCluster_importBasic
--- FAIL: TestAccAWSRDSCluster_importBasic (122.71s)
    testing.go:255: Step 1 error: ImportStateVerify attributes not
    equivalent. Difference is shown below. Top is actual, bottom is
    expected.

    (map[string]string) {

    }

(map[string]string) (len=1) {
         (string) (len=19) "skip_final_snapshot": (string) (len=4) "true"

}

FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/aws    122.733s
make: *** [testacc] Error 1
```
2016-07-20 19:53:37 +01:00
Paul Stack 7879450cf3 provider/aws: Fix the import of `aws_redshift_cluster` breaking (#7677)
`skip_final_snapshot`

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRedshiftCluster_importBasic -timeout 120m
=== RUN   TestAccAWSRedshiftCluster_importBasic
--- PASS: TestAccAWSRedshiftCluster_importBasic (641.87s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    641.888s
```
2016-07-20 19:38:44 +01:00
Paul Stack 5cd1b6624a provider/aws: Support Tags on `aws_rds_cluster` (#7695)
Fixes #7692

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_
-timeout 120m
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (160.77s)
=== RUN   TestAccAWSRDSCluster_updateTags
--- PASS: TestAccAWSRDSCluster_updateTags (329.20s)
=== RUN   TestAccAWSRDSCluster_encrypted
--- PASS: TestAccAWSRDSCluster_encrypted (227.29s)
=== RUN   TestAccAWSRDSCluster_backupsUpdate
--- PASS: TestAccAWSRDSCluster_backupsUpdate (196.92s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    914.199s
```
2016-07-20 19:37:26 +01:00
Paul Stack ee9114bcc4 provider/aws: Fix bug with Updating `aws_autoscaling_group` (#7698)
`enabled_metrics`

Fixes #7693

The metrics_granularity parameter was not being passed to the
`EnableMetricsCollection` when we were calling it from the Update func.
this was causing the API call to silently fail and not update the
metrics for collection - unfortunately the enabled_metrics were still
being added to the state :(

By passing the granularity, we now get the correct metrics for
collection

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoScalingGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSAutoScalingGroup_ -timeout 120m
=== RUN   TestAccAWSAutoScalingGroup_importBasic
--- PASS: TestAccAWSAutoScalingGroup_importBasic (166.86s)
=== RUN   TestAccAWSAutoScalingGroup_basic
--- PASS: TestAccAWSAutoScalingGroup_basic (240.23s)
=== RUN   TestAccAWSAutoScalingGroup_autoGeneratedName
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (50.29s)
=== RUN   TestAccAWSAutoScalingGroup_terminationPolicies
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (79.93s)
=== RUN   TestAccAWSAutoScalingGroup_tags
--- PASS: TestAccAWSAutoScalingGroup_tags (270.79s)
=== RUN   TestAccAWSAutoScalingGroup_VpcUpdates
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (77.76s)
=== RUN   TestAccAWSAutoScalingGroup_WithLoadBalancer
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (400.67s)
=== RUN   TestAccAWSAutoScalingGroup_withPlacementGroup
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (134.39s)
=== RUN   TestAccAWSAutoScalingGroup_enablingMetrics
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (305.32s)
=== RUN   TestAccAWSAutoScalingGroup_withMetrics
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (48.56s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1774.819s
```
2016-07-20 19:36:45 +01:00
Paul Stack 0edf83008c provider/aws: Support `task_role_arn` on `aws_ecs_task_definition` (#7653)
Fixes #7633
2016-07-20 17:00:57 +01:00
Paul Hinze 62ec69a66a Merge pull request #7669 from kwilczynski/fix/aws-network-acl-rule
Fix icmp_type and icmp_code in aws_network_acl_rule.
2016-07-19 09:27:42 -05:00
avichalbadaya 7369c1c9f4 Allowing ap-south-1 (Mumbai) as valid AWS region (#7688)
* Update website_endpoint_url_test.go

Allow ap-south-1 (Mumbai) as valid region

* Update hosted_zones.go

Allowing ap-south-1 (Mumbai) as valid region

* Update website_endpoint_url_test.go

reformatting

* Update hosted_zones.go

reformatting

* Update resource_aws_s3_bucket.go

making changes for ap-south-1 (Mumbai) region
2016-07-19 09:01:49 +01:00
Paul Stack 565733398d provider/aws: Support Import of `aws_cloudwatch_metric_alarm` (#7687)
```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudWatchMetricAlarm_ -timeout 120m
=== RUN   TestAccAWSCloudWatchMetricAlarm_importBasic
--- PASS: TestAccAWSCloudWatchMetricAlarm_importBasic (17.82s)
=== RUN   TestAccAWSCloudWatchMetricAlarm_basic
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (17.11s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    34.957s
```
2016-07-19 05:52:02 +02:00
Radek Simko 37b6ab4507 provider/aws: Bump rds_cluster timeout to 15 mins (#7604) 2016-07-18 14:39:51 +01:00
stack72 a04e336ef9
Merge branch 'master' of github.com:hashicorp/terraform 2016-07-18 13:34:17 +01:00