Commit Graph

34 Commits

Author SHA1 Message Date
Gauthier Wallet c44afc4179 provider/aws: Fix DynamoDB issues about GSIs indexes (#13256)
* provider/aws: Fixed DynamoDB GSI update when using multiple indexes

* provider/aws: Fixed DynamoDB GSI set hash function

* Added DynamoDB table state migration
2017-04-07 10:13:00 -05:00
Jake Champlin dacc765a5e
update casing for dynamoDb 2017-02-02 09:20:33 -05: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
Clint 740b8bb9cb provider/aws: Run errcheck in tests (#8579)
* provider/aws: Add errcheck to Makefile, error on unchecked errors

* more exceptions

* updates for errcheck to pass

* reformat and spilt out the ignore statements

* narrow down ignores

* fix typo, only ignore Close and Write, instead of close or write
2016-09-02 09:24:17 -05: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
stack72 68d035bc50 provider/aws: Change to `aws_dynamodb_table` hash_key forces a new
resource

We had a line on the Update func that said:

```
Hash key can only be specified at creation, you cannot modify it.
```

The resource has now been changed to ForceNew on the hashkey

```
aws_dynamodb_table.demo-user-table: Refreshing state... (ID: Users)
aws_dynamodb_table.demo-user-table: Destroying...
aws_dynamodb_table.demo-user-table: Destruction complete
aws_dynamodb_table.demo-user-table: Creating...
aws_dynamodb_table.demo-user-table: Creation complete
```
2016-05-24 11:39:55 +01:00
Paul Hinze 108ccf0007 builtin: Refactor resource.Retry to clarify return
Change the `RetryFunc` from a plain `error` return type to a
specialized `RetryError` which must decide whether it is
retryable or not.

Add `RetryableError` / `NonRetryableError` factory functions that
callers are meant to use to build up these errors.

This makes it eminently clear whether or not a given error is
retryable from inside the client code.

Goal here is to _not_ change any behavior, simply reflect the
existing behavior with the new, clearer, API.
2016-03-09 17:37:56 -06:00
stack72 0ce4aed52a provider/aws: Enable DynamoDB Table to output `stream_arm` when streams
are enabled
2016-02-23 15:40:41 +00:00
stack72 9c17e5d3e8 DynamoDB Table now refreshes the state when NotFoundException occurs 2016-02-01 21:55:10 +00:00
Radek Simko 2edc25e868 Merge pull request #4431 from TimeIncOSS/f-aws-validators
provider/aws: Add validation for ECR repository name
2016-01-06 16:43:50 +00:00
clint shryock dd3a2aa4e9 provider/aws: Dynamo DB test/destroy updates 2016-01-04 16:57:31 -06:00
Radek Simko a367886eaf provider/aws: Separate existing validate functions 2015-12-23 15:11:45 +01:00
stack72 244a75504e More gofmt errors I'm afraid 2015-12-19 16:42:10 +00:00
James Nugent 8e538b68ec Fix errors with gofmt compliance 2015-12-17 12:35:19 -05:00
stack72 8b79881dea Adding a validation function for the DynamoDb Table StreamViewType 2015-12-08 20:58:06 +00:00
stack72 d46348c233 Adding support for AWS DynamoDB Table for StreamSpecifications 2015-12-08 14:07:11 +00:00
Clint 2f94e575ef Merge pull request #3300 from Runscope/fix-dynamodb-gsi-bug
provider/aws: fix bug with reading GSIs from dynamodb
2015-10-15 10:04:33 -05:00
stack72 7af484c8f6 Changing the DynamoDb Create to do a Read at the end 2015-10-14 19:16:58 +01:00
stack72 6d2fee9c28 After the DynamoDB table is created, the ARN wasn't being set 2015-10-14 18:06:09 +01:00
Garrett Heel 127c1aef61 provider/aws: fix bug with reading GSIs from dynamodb 2015-10-13 14:14:58 -07:00
Panagiotis Moustafellos e4845f75cc removed extra parentheses 2015-10-08 15:48:04 +03:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Clint Shryock a1a78bd482 provider/aws: Add ARN to Dynamo schema 2015-08-05 14:43:26 -05:00
Calvin French-Owen cb2d90a7d9 provider/aws: Add arn attribute for DynamoDB tables
This commit exports the `arn` as well as the `id`, since IAM
roles require the full resource name rather than just the table
name. I'd even be in favor or having `arn` as the `id` since the
<region, tablename> pair is the uniqueness constraint, but this
will keep backwards compatibility:

http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html
2015-08-03 14:10:18 -07:00
Clint Shryock 579ccbefea provider/aws: Update source to comply with upstream breaking change 2015-07-28 15:29:46 -05:00
Clint de5df6f378 Merge pull request #2462 from johnewart/dynamodb_throttle
dynamodb - Support backing off a bit when throttling / limit-exceeded exceptions happen
2015-06-25 12:29:09 -05:00
John Ewart fd98cae9cc Increment attemptCount when a LimitExceededException occurs 2015-06-24 07:36:14 -07:00
John Ewart 7718cd194c Support backing off a bit when throttling / limit-exceeded exceptions happen 2015-06-24 07:25:00 -07:00
Joshua Semar 7948aa720e dynamodb - only require nonkey attributes on INCLUDE 2015-06-23 23:50:29 -05:00
John Ewart 4e219b3bad Fixes support for changing just the read / write capacity of a GSI 2015-06-15 17:05:50 -07:00
John Ewart 320e4b222c Change sleep time for DynamoDB table waits from 3 seconds to 5 seconds 2015-06-08 16:04:22 -07:00
John Ewart f458521be9 Remove request for attribute changes 2015-06-08 16:02:20 -07:00
John Ewart 4784eff9ca Fix AWS SDK imports 2015-06-03 17:12:41 -07:00
John Ewart 34e9e31377 Adding DynamoDB resource 2015-06-03 17:05:02 -07:00