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

[WIP] resource/aws_dynamodb_table: Use just the name to determine hashcode of GSI #1240

Closed
wants to merge 1 commit into from

Conversation

mcwqy9
Copy link
Contributor

@mcwqy9 mcwqy9 commented Jul 25, 2017

I'm trying to make changes to DynamoDB GSI capacity ignorable. This is likely the wrong approach. #CunninghamsLaw. I picked up the idea from something that was removed in hashicorp/terraform#13256.

The catch-22 with this approach is if something is not included in calculating the return value of the Set function then when you change said thing it's not updated. I just wanted it to not change the resource address so that I can use ignore_changes. For people that do want to control their GSI's capacity in terraform, a change should still be applicable.

Even if I wanted to hardcode something nasty like ignore_changes = ["global_secondary_index.3291674533.read_capacity"], I can't because "3291674533" is calculated based, in part, on the read_capacity.

Other ideas:

  1. Modify ignore_changes to accept the right kind of wildcard to support this case
  2. Are GSIs a bad fit for the type TypeSet, given their mutability? Would it be better to split GSIs out into their own resource?

Closes #671

@bflad
Copy link
Contributor

bflad commented Jul 25, 2017

Maybe a new dynamodb index resource might be more composable for your situation? This would be similar to portions of S3 configuration which work better with separate resources rather than trying to make everything work in one.

@mcwqy9
Copy link
Contributor Author

mcwqy9 commented Jul 26, 2017

I think I need an education on what sorts of things ought to be their own resource, and which ought to be an Set attribute of another resource.
Is there a way to have only a few fields in that set's schema be used to identify uniqueness, while still allowing changes to all fields trigger an update?

To ask an even broader question: Is it even supported to have arguments of type schema.TypeSet that are partially mutable?

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Jul 27, 2017
@radeksimko radeksimko added the upstream-terraform Addresses functionality related to the Terraform core binary. label Sep 28, 2017
@radeksimko radeksimko added the size/XS Managed by automation to categorize the size of a PR. label Nov 15, 2017
@mfinelli
Copy link

@mcwqy9 thanks for your work on this! any update on getting this merged in?

@radeksimko radeksimko added the service/dynamodb Issues and PRs that pertain to the dynamodb service. label Jan 12, 2018
@radeksimko radeksimko changed the title [WIP] Use just the name to determine hashcode of dynamodb GSI [WIP] resource/aws_dynamodb_table: Use just the name to determine hashcode of GSI Jan 16, 2018
@aeschright aeschright requested a review from a team June 25, 2019 18:44
@bflad
Copy link
Contributor

bflad commented Jun 26, 2019

Hi folks 👋 Unfortunately, due to the way that TypeSet attributes operate in the current Terraform Provider SDK, the Set hash must include all elements of the underlying arguments, otherwise Terraform cannot see differences in them to perform updates or force resource recreation. Rather than leaving an unactionable pull request open, I'm going to go ahead and close this. Please feel free to continue/track design discussions in the originating issue.

@bflad bflad closed this Jun 26, 2019
@ghost
Copy link

ghost commented Nov 3, 2019

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 Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/XS Managed by automation to categorize the size of a PR. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No method to ignore changes in DynamoDB GSI
4 participants