Skip to content

Commit

Permalink
✨ convert created_at to string
Browse files Browse the repository at this point in the history
  • Loading branch information
tonystrawberry committed Nov 3, 2023
1 parent 006bb69 commit bf5d1f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lambda/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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 }
Expand Down
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bf5d1f6

Please sign in to comment.