ContainerSolutions / terraform-examples

Simple and idiomatic examples of various Terraform functions and features.
https://containersolutions.github.io/terraform-examples/
159 stars 51 forks source link

Create empty dynamodb table for AWS #79

Closed choilmto closed 3 years ago

choilmto commented 3 years ago

Upon merging, I can add another module for creating an item in the table.

ttarczynski commented 3 years ago

Check format complained about aligning the = signs:

You can also check this manually (beware that it will automatically apply a fix to your code too):

./bin/check_format.sh
Terraform fmt failed
aws/aws_dynamodb/table/main.tf
--- old/aws/aws_dynamodb/table/main.tf
+++ new/aws/aws_dynamodb/table/main.tf
@@ -31,9 +31,9 @@
 # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table#argument-reference
 resource "aws_dynamodb_table" "changeme_aws_dynamodb_table" {
   # Explanation: the table's name, which needs to be unique to a region
-  name           = "changeme_table_name"
+  name = "changeme_table_name"
   # Explanation: the number of read units for the table
-  read_capacity  = 10
+  read_capacity = 10
   # Explanation: the number of write units for the table
   write_capacity = 10
   hash_key       = var.changeme_hash_key

I'll try to fix this here.

ttarczynski commented 3 years ago

I've added a formatting fix: https://github.com/ContainerSolutions/terraform-examples/pull/79/commits/e8756893250fb8c270a6cde78951c341f9319278

Will run the CI on integration (once it's free) and merge.

ttarczynski commented 3 years ago

@ianmiell could you please add the needed AWS role? (probably "dynamodb:*" should do the trick)


AWS permissions are missing for: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-east-1:684157722011:table/changeme_table_name