Skip to content

Commit

Permalink
Added code necessary to create table for GitHub activity in dynamoDB (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
klai95 authored Mar 8, 2023
1 parent f9b9896 commit 80b506e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .happy/terraform/modules/ecs-stack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ module install_dynamodb_table {
tags = var.tags
}

module github_dynamodb_table {
source = "../dynamo"
table_name = "${local.custom_stack_name}-github-activity"
hash_key = "plugin_name"
range_key = "type_identifier"
attributes = [
{
name = "plugin_name"
type = "S"
},
{
name = "type_identifier"
type = "S"
}
]
autoscaling_enabled = var.env == "dev" ? false : true
create_table = true
tags = var.tags
}

module backend_lambda {
source = "../lambda-container"
function_name = local.backend_function_name
Expand Down Expand Up @@ -281,7 +301,10 @@ data aws_iam_policy_document backend_policy {
"dynamodb:Query",
]

resources = [module.install_dynamodb_table.table_arn]
resources = [
module.install_dynamodb_table.table_arn,
module.github_dynamodb_table.table_arn,
]
}

statement {
Expand Down

0 comments on commit 80b506e

Please sign in to comment.