-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Terraform seems not to support multiple attributes in a DynamoDB key schema #556
Comments
Why should we declare schema in terraform? Dynamodb is schemaless, it doesn't matter. |
@thiagonache, It's not about general schema. The key schema defines, which attributes are part of the primary key.
|
gotcha... combination of range key + hash key. I haven't notice that.... |
does it not work for you? |
Hi @jgryszko Were you able to replicate @thiagonache 's configuration and confirm whether it works? Thanks! :) |
@Ninir I think you can have multiple range keys in a schema, but range_key is for a single value. |
while correct, it isn't required to define the scheme, the option should exist and the documentation suggests that it is possible |
I still see this issue while using Terraform v0.11.8 |
Likewise, with the following configuration
I'm getting
|
Hey folks, Circling back to that one, let me offer a few answers:
@MarkVLK regarding your issue, this is expected: the fields that are not included in the primary key can't be set as non-key schema fields. Look at the example from the Terraform documentation: there are 3 attributes defined, 2 are for the main primary key, the last one is for the global index. @jgryszko the code I see as of today is including both the hash and range keys. I will now close this issue. Please comment if you think there still is an issue. |
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! |
This issue was originally opened by @jgryszko as hashicorp/terraform#12229. It was migrated here as part of the provider split. The original body of the issue is below.
Hi,
It looks like multiple attributes are not supported for dynamodb key schema so far.
Looking at the source, only hash_key is included in the key schema.
resource_aws_dynamodb_table.go:
Are there plans to change this in near future?
Best,
Janusz
The text was updated successfully, but these errors were encountered: