I have a resource like this repo/dynamo/main.tf
:
resource "aws_dynamodb_table" "infra_locks" {
name = "infra-locks"
billing_mode = "PAY_PER_REQUEST"
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
}
And I refer above file as a module follow github repo
Tf file where I refer to above file repo/example/main.tf
:
provider "aws" {
region = var.region
}
module "dynamodb_table" {
source = "../dynamodb_table"
name = "my-table"
}
I have terraform init
success but fail when run terraform plan
Error: Unsupported argument
on main.tf line 14, in module "dynamodb_table":
14: name = "my-table"
An argument named "name" is not expected here.
How can i fix this? Tks in advance
"../dynamodb_table"
? Currently you reference a local module, does that module have aname
variable? – luk2302Initializing modules... - dynamo_table in ../dynamo Initializing the backend... Initializing provider plugins... - Reusing previous version of hashicorp/aws from the dependency lock file - Using previously-installed hashicorp/aws v3.34.0 Terraform has been successfully initialized!
– Tho Quachdynamodb_table
have aname
variable? The answer probably is: no. – luk2302