Closed rmkbow closed 5 years ago
thanks @rmkbow for reporting this.
we'll look into it, but for now you probably could use attributes = "${var.attributes}". The attributes are added to
namespace-stage-nameso it becomes
namespace-stage-name-attribute1-attrubute2-....
terraform-aws-dynamodb-autoscaleruses the same
label` module, which will take care of joinung the provided attributes.
One of the attribute could be a region name for example.
Attributes would also change the table name but the table name needs to be the same for each region for global tables 🤔
@rmkbow thanks again, I understand what you said. Before we get time to update the module, you can do the following:
enable_autoscaler
to "false"
https://github.com/cloudposse/terraform-aws-dynamodb/blob/master/variables.tf#L105terraform-aws-dynamodb-autoscaler
or as many as you need in top-level module
https://github.com/cloudposse/terraform-aws-dynamodb/blob/master/main.tf#L82Everything that the autoscaler needs are the outputs from the dynamodb module
dynamodb_table_name = "${aws_dynamodb_table.default.id}"
dynamodb_table_arn = "${aws_dynamodb_table.default.arn}"
dynamodb_indexes = ["${null_resource.global_secondary_index_names.*.triggers.name}"]
https://github.com/cloudposse/terraform-aws-dynamodb/blob/master/outputs.tf
That's a good workaround :) I didn't think about using the autoscaler separately 👍
@rmkbow will close this for now. please reopen if needed
This mostly affects the autoscaler module but I was using it through this module.
I'm calling the module with two different region providers and get error similar to this:
I've gotten around this by locally by overriding the name parameter for the autoscaling section https://github.com/cloudposse/terraform-aws-dynamodb/blob/master/main.tf#L87
I'm doing this so I can create a aws_dynamodb_global_table resource that has the same table name in multiple regions. It appears this name parameter goes to the label module and is only used for the iam related resources in the autoscaler module.
My idea unfortunately breaks backwards compatibility since it would force destroy/create the iam resources so I haven't submitted a PR. Any other suggestions?
Could also have an iam name suffix or prefix parameter that the enduser could pass in themselves like I can put in a suffix of
us-east-1
for the autoscaler name