-
Notifications
You must be signed in to change notification settings - Fork 2
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
initial deployment #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start! It's pretty much there, but let's get some default values in there using optional()
, and fix up the test.
tests/create_all/main.tf
Outdated
module "state_bucket" { | ||
source = "git::https://github.com/plus3it/terraform-aws-tardigrade-s3-bucket.git?ref=5.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't testing this module at all. It's just invoking the remote s3 module. Every test config should, at least once, invoke this module using a local relative path... source = "../../"
2283036
to
946f0b7
Compare
main.tf
Outdated
resource "aws_dynamodb_table" "this" { | ||
name = var.backend_config.dynamodb_table.name | ||
deletion_protection_enabled = var.backend_config.dynamodb_table.deletion_protection_enabled | ||
billing_mode = var.backend_config.dynamodb_table.billing_mode | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some research and figured out the error. There are a couple more arguments that are required by the CreateTable API. Not sure why the terraform resource doesn't enforce this directly. Try this:
resource "aws_dynamodb_table" "this" { | |
name = var.backend_config.dynamodb_table.name | |
deletion_protection_enabled = var.backend_config.dynamodb_table.deletion_protection_enabled | |
billing_mode = var.backend_config.dynamodb_table.billing_mode | |
} | |
resource "aws_dynamodb_table" "this" { | |
name = var.backend_config.dynamodb_table.name | |
deletion_protection_enabled = var.backend_config.dynamodb_table.deletion_protection_enabled | |
billing_mode = var.backend_config.dynamodb_table.billing_mode | |
hash_key = "LockID" | |
attribute { | |
name = "LockID" | |
type = "S" | |
} | |
} |
main.tf
Outdated
name = var.backend_config.dynamodb_table.name | ||
deletion_protection_enabled = var.backend_config.dynamodb_table.deletion_protection_enabled | ||
billing_mode = var.backend_config.dynamodb_table.billing_mode | ||
hash_key = "backend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value here is critical. It must be LockID
.
hash_key = "backend" | |
hash_key = "LockID" |
main.tf
Outdated
hash_key = "backend" | ||
|
||
attribute { | ||
name = "backend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same...
name = "backend" | |
name = "LockID" |
No description provided.