Merge branch 'main' into feat/HTTPBackend

main
sundowndev 2021-03-16 17:10:54 +01:00
commit 78a2316fd8
4 changed files with 48 additions and 39 deletions

View File

@ -2,18 +2,19 @@
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/aws" {
version = "3.27.0"
version = "3.32.0"
hashes = [
"h1:ccxtk7jAtmBPvAEXswOEYJcyp5jTD9QlQeg8GEzYmxQ=",
"zh:2986eb5a1ffbb0336c6390aad533b62efc832aa8aa5460d523e1f2daa4f42f79",
"zh:825317cdb80860833125a856c0befc877cba22d41c631c5a7ca22400693d4356",
"zh:a47aad668cc74058f508c56c5407cd715dbb9b6389aa68d37543e897895db43f",
"zh:c0011502d0eb4637918127c3987a8cc07a015ea00f74f4956fd111c736286a4d",
"zh:d5088ab51043bb2239132f4ed3760292b6aa4f7296232e4b8017f8c5c34f051a",
"zh:d893658e983eb17a23a8124c79a910cc729cb1d751d5509b8e756101c828ad91",
"zh:dcc4384ee79ea9492c87eb01e664f7f6b1f1d156471476f30b28336c9d9a4aec",
"zh:e4abfaf013f31791cd029af7b6f989f73e3efca28fe2917057b428d051c4085f",
"zh:f2a4d9446d23afe2a42421e7d5f902d34451fb31b7787b5e3aef95c08fec5ced",
"zh:f54a6af10b077db9dc11556c27f59ba5c60e1b2ba96fe3aa9cd90d8c67d980f6",
"h1:l8jJYQ4bPEbNwZUoHYmeR1woajPzJSX5hPCLWuRVFwc=",
"zh:04e4f700c21b1f58e7603638160bd5ad3b85519c35dc75bada3e52b164d06d3e",
"zh:09f2338404d4b2d4dcb29781ac59a6955d935745e896d4ee661d83cac8d7c677",
"zh:16bdf96d8139268766921d5b891b865f67936190dc302283ba50b94e42510ec5",
"zh:1f0eb671390ee41ddf22faf22d00da636e57164214a37c77f7d3fb1f19ea9cce",
"zh:3703b0ba118887cb558085f4b7e732e4e374f455221fcf724bada6f71bd25d55",
"zh:a344b8b1d0c541abcfc3a5bd22aa28d1a07aff416db753d53219158a86e956cc",
"zh:a4798f3bf4ecbdfcd2ea72061e54053423a47f48812749b2cc7dc8dcf8a11eb4",
"zh:aeb5c18afe26388748289f2a3819c7c9210cb669efe01b3e28bf542c51c83bd7",
"zh:b0a3f5940f76dbd3ea9699f98f9cabc443c210c06f30caeb792e5843b7550cc1",
"zh:baa2854e3fbf3df9653a5e6a0f1093a018dad39312346426f4bcefc2ebfd74cc",
"zh:e305b3d227f2013ddd7cf22f2cfa4603a55187c8eddd07f980350a828b67ce49",
]
}

View File

@ -2,8 +2,12 @@ provider "aws" {
region = "us-east-1"
}
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "GameScores"
locals {
timestamp = formatdate("YYYYMMDDhhmmss", timestamp())
}
resource "aws_dynamodb_table" "simple-dynamo-test" {
name = "simple-dynamo-test-${local.timestamp}"
billing_mode = "PROVISIONED"
read_capacity = 20
write_capacity = 20
@ -46,8 +50,8 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" {
}
}
resource "aws_dynamodb_table" "example" {
name = "example"
resource "aws_dynamodb_table" "global-dynamo-test" {
name = "global-dynamo-test-${local.timestamp}"
hash_key = "TestTableHashKey"
billing_mode = "PAY_PER_REQUEST"
stream_enabled = true

View File

@ -2,19 +2,19 @@
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/aws" {
version = "3.30.0"
version = "3.32.0"
hashes = [
"h1:z9kdXY2A/+dIZrPy9hNlg/B5I/AuETQsp0jz9EgprIQ=",
"zh:01f562a6a31fe46a8ca74804f360e3452b26f71abc549ce1f0ab5a8af2484cdf",
"zh:25bacc5ed725051f0ab1f7d575e45c901e5b8e1d50da4156a31dda92b2b7e481",
"zh:349b79979d9169db614d8ebd1bc2e0caeb7a38dc816e261b8b2b4b5204615519",
"zh:5e41446acc54c6fc15e82c3fa14b72174b30eba81e0711ede297e5620c55a628",
"zh:68ad98f6d612bdc35a65d48950abc8e75c69decb49db28258ce8eeb5458586b7",
"zh:704603d65e8bac17d203b57c2db142c3134a91076e1b4a31c40f75eb3257dde8",
"zh:a362c700032b2db047d16007d52f28b3f216d32671b6b355d23bdaa082c66a4b",
"zh:bd197797b41268de3c93cad02b7c655dc0c4d8661abb37544ca049e6b1eccae6",
"zh:deb12ef0e3396a71d485977ddc14b695775f7937097ebf2b2f53ed348a4365e7",
"zh:ec8a7d0f02738f290107d39bf401d68ddce82a95cd9d998003f7e04b3a196411",
"zh:ffcc43b6c5e7f26c55e2a8c539d7370fca8042722400a3e06bdce4240bd7088a",
"h1:l8jJYQ4bPEbNwZUoHYmeR1woajPzJSX5hPCLWuRVFwc=",
"zh:04e4f700c21b1f58e7603638160bd5ad3b85519c35dc75bada3e52b164d06d3e",
"zh:09f2338404d4b2d4dcb29781ac59a6955d935745e896d4ee661d83cac8d7c677",
"zh:16bdf96d8139268766921d5b891b865f67936190dc302283ba50b94e42510ec5",
"zh:1f0eb671390ee41ddf22faf22d00da636e57164214a37c77f7d3fb1f19ea9cce",
"zh:3703b0ba118887cb558085f4b7e732e4e374f455221fcf724bada6f71bd25d55",
"zh:a344b8b1d0c541abcfc3a5bd22aa28d1a07aff416db753d53219158a86e956cc",
"zh:a4798f3bf4ecbdfcd2ea72061e54053423a47f48812749b2cc7dc8dcf8a11eb4",
"zh:aeb5c18afe26388748289f2a3819c7c9210cb669efe01b3e28bf542c51c83bd7",
"zh:b0a3f5940f76dbd3ea9699f98f9cabc443c210c06f30caeb792e5843b7550cc1",
"zh:baa2854e3fbf3df9653a5e6a0f1093a018dad39312346426f4bcefc2ebfd74cc",
"zh:e305b3d227f2013ddd7cf22f2cfa4603a55187c8eddd07f980350a828b67ce49",
]
}

View File

@ -2,8 +2,12 @@ provider "aws" {
region = "us-east-1"
}
locals {
timestamp = formatdate("YYYYMMDDhhmmss", timestamp())
}
resource "aws_sqs_queue" "queue1" {
name = "queue1"
name = "queue1-${local.timestamp}"
delay_seconds = 90
max_message_size = 2048
message_retention_seconds = 86400
@ -11,15 +15,15 @@ resource "aws_sqs_queue" "queue1" {
}
resource "aws_sqs_queue" "queue2" {
name = "queue2"
name = "queue2-${local.timestamp}"
delay_seconds = 90
max_message_size = 2048
message_retention_seconds = 86400
receive_wait_time_seconds = 10
}
resource "aws_dynamodb_table" "example" {
name = "example"
resource "aws_dynamodb_table" "dynamo-event-source-mapping-test" {
name = "event-source-mapping-test-${local.timestamp}"
hash_key = "TestTableHashKey"
billing_mode = "PAY_PER_REQUEST"
stream_enabled = true
@ -32,7 +36,7 @@ resource "aws_dynamodb_table" "example" {
}
resource "aws_iam_role" "iam_for_lambda" {
name = "iam_for_lambda"
name = "iam_for_lambda-${local.timestamp}"
assume_role_policy = <<EOF
{
@ -52,7 +56,7 @@ EOF
}
resource "aws_iam_policy" "policy" {
name = "policy"
name = "policy-${local.timestamp}"
policy = <<EOF
{
@ -78,14 +82,14 @@ EOF
}
resource "aws_iam_policy_attachment" "policy_attachment" {
name = "attachment"
name = "event-source-mapping-test-attachment-${local.timestamp}"
roles = [aws_iam_role.iam_for_lambda.name]
policy_arn = aws_iam_policy.policy.arn
}
resource "aws_lambda_function" "test_lambda" {
filename = "function.zip"
function_name = "lambda_function_name"
function_name = "event-source-mapping-test-lambda-${local.timestamp}"
role = aws_iam_role.iam_for_lambda.arn
handler = "exports.test"
runtime = "nodejs12.x"
@ -112,7 +116,7 @@ resource "aws_lambda_event_source_mapping" "sqs2" {
}
resource "aws_lambda_event_source_mapping" "dynamo" {
event_source_arn = aws_dynamodb_table.example.stream_arn
event_source_arn = aws_dynamodb_table.dynamo-event-source-mapping-test.stream_arn
function_name = aws_lambda_function.test_lambda.arn
starting_position = "LATEST"
}
}