diff --git a/lambda/app.rb b/lambda/app.rb index be9ed32..e069833 100644 --- a/lambda/app.rb +++ b/lambda/app.rb @@ -42,7 +42,6 @@ def self.process(event:, context:) # Parse the JSON response json_data = JSON.parse(response.body) - puts "[#process] Parsed response from Unsplash API: #{json_data}" results = json_data["results"] results.each do |result| @@ -109,10 +108,10 @@ def self.process(event:, context:) 'url' => url, 's3_key' => "lgtm/#{id}.jpg", 'keyword' => event['keyword'], - 'created_at' => Time.now.to_i + 'status' => "processed", + 'created_at' => Time.now.to_i.to_s } }) - end { "success": true } diff --git a/main.tf b/main.tf index a1951f3..6929eba 100644 --- a/main.tf +++ b/main.tf @@ -61,6 +61,11 @@ resource "aws_iam_policy" "aws_iam_policy" { EOF } +resource "aws_iam_role_policy_attachment" "aws_iam_role_policy_attachment" { + role = aws_iam_role.aws_iam_role.name + policy_arn = aws_iam_policy.aws_iam_policy.arn +} + resource "aws_dynamodb_table" "aws_dynamodb_table" { name = "lgtm-tonystrawberry-codes" billing_mode = "PAY_PER_REQUEST"