Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_dynamodb_table: Work around tagging limitation in dynamodb-local #6149

Merged
merged 2 commits into from
Oct 14, 2018
Merged

aws_dynamodb_table: Work around tagging limitation in dynamodb-local #6149

merged 2 commits into from
Oct 14, 2018

Conversation

stefansundin
Copy link
Contributor

Changes proposed in this pull request:

  • Support tagging limitation in dynamodb-local.

I have yet to try more complicated things with dynamodb-local.

Here's how I use dynamodb-local:

docker run -p 8000:8000 amazon/dynamodb-local

Terraform:

provider "aws" {
  endpoints {
    dynamodb = "http://localhost:8000"
  }
}

resource "aws_dynamodb_table" "basic-dynamodb-table" {
  # ...
}

This would fail with:

* aws_dynamodb_table.basic-dynamodb-table: aws_dynamodb_table.basic-dynamodb-table: Error reading tags from dynamodb resource: UnknownOperationException: Tagging is not currently supported in DynamoDB Local.
	status code: 400, request id: d2dabf86-9643-4cc5-b601-f473573c6506
* data.aws_dynamodb_table.movies: 1 error(s) occurred:

I don't think there is a need to work around setting tags at this time. In Terraform 0.12 that can probably be easily done with the new if statement.

This problem is referenced in this issue (but also other problems): #1059

P.S. Can you please take a second look at some of my other PRs?

Thank you!!

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/dynamodb Issues and PRs that pertain to the dynamodb service. labels Oct 13, 2018
@stefansundin stefansundin changed the title Work around tagging limitation in dynamodb-local aws_dynamodb_table: Work around tagging limitation in dynamodb-local Oct 13, 2018

// Do not fail when interfacing with dynamodb-local
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using isAWSErr if applicable (requires knowing the value of awserr.Error.Code()).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 14, 2018
@bflad bflad added this to the v1.41.0 milestone Oct 14, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, @stefansundin, thanks! 🚀

--- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (1.66s)
--- PASS: TestAccAWSDynamoDbTable_tags (38.77s)
--- PASS: TestAccAWSDynamoDbTable_importTimeToLive (69.31s)
--- PASS: TestAccAWSDynamoDbTable_importTags (97.33s)
--- PASS: TestAccAWSDynamoDbTable_basic (109.78s)
--- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (1.40s)
--- PASS: TestAccAWSDynamoDbTable_streamSpecification (125.43s)
--- PASS: TestAccAWSDynamoDbTable_importBasic (140.33s)
--- PASS: TestAccAWSDynamoDbTable_encryption (40.15s)
--- PASS: TestAccAWSDynamoDbTable_ttl (132.50s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (204.47s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (185.93s)
--- PASS: TestAccAWSDynamoDbTable_extended (229.43s)
--- PASS: TestAccAWSDynamoDbTable_enablePitr (293.28s)
--- PASS: TestAccAWSDynamoDbTable_attributeUpdate (426.47s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (530.16s)

@bflad bflad merged commit 9165cb1 into hashicorp:master Oct 14, 2018
bflad added a commit that referenced this pull request Oct 14, 2018
@stefansundin
Copy link
Contributor Author

Thanks for the quick merge @bflad. Can you check on my other PRs that I linked above? :)

I think at least the first one can be merged, but the other two I need help on.

@bflad
Copy link
Contributor

bflad commented Oct 18, 2018

@stefansundin left a comment on #4488, I'm not sure when I'll have time to properly review #5728, and #5812 might be able to get in when all the other work associated with cutting version 2.0.0 is getting merged in.

This has been released in version 1.41.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants