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

Seems like general reference complex variable doesn't work #5

Closed
archenroot opened this issue Sep 24, 2019 · 4 comments
Closed

Seems like general reference complex variable doesn't work #5

archenroot opened this issue Sep 24, 2019 · 4 comments

Comments

@archenroot
Copy link

I go to dynamodb module only to validate (as I had lots of issues finally :-)), there is definitely one AWS related bug in terraform at moment:
hashicorp/terraform#21330

It requires to define in main.tf to have:

provider "aws" {
  region = "${var.region}"
}

and define default via variables.tf

The real issue here is the reference to complex types:

local_secondary_index       = "${var.dynamodb_table_local_secondary_index[count.index]}"
global_secondary_index      = "${var.dynamodb_table_secondary_index[count.index]}"
ttl                         = "${var.dynamodb_table_ttl[count.index]}"

I get:

rror: Unsupported argument

  on main.tf line 19, in resource "aws_dynamodb_table" "table":
  19:   local_secondary_index  = "${var.dynamodb_table_local_secondary_index[count.index]}"

An argument named "local_secondary_index" is not expected here. Did you mean
to define a block of type "local_secondary_index"?


Error: Unsupported argument

  on main.tf line 20, in resource "aws_dynamodb_table" "table":
  20:   global_secondary_index = "${var.dynamodb_table_secondary_index[count.index]}"

An argument named "global_secondary_index" is not expected here. Did you mean
to define a block of type "global_secondary_index"?


Error: Unsupported argument

  on main.tf line 21, in resource "aws_dynamodb_table" "table":
  21:   ttl                    = "${var.dynamodb_table_ttl[count.index]}"
@archenroot
Copy link
Author

@crisboarna - I think the issue is related to my specific v of Terraform 0.12.8...

@crisboarna
Copy link
Owner

Not sure what is the precise issue you are having but they may also be related to HCL 0.12 changes. You could either try using Terraform 0.11.x or try doing terraform 0.12upgrade to convert it all to 0.12 HCL. PR welcome ;)

@archenroot
Copy link
Author

@crisboarna - yeah in general I fixed all issues, so will push them as PR

@crisboarna
Copy link
Owner

Added updates for Terraform 0.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants