# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 4.0" } } required_version = ">= 1.0.0" } provider "aws" { profile = "default" region = "us-east-1" } data "aws_caller_identity" "current" {} data "aws_region" "current" {} data "archive_file" "lambda_zip_file" { type = "zip" source_file = "${path.module}/src/app.py" output_path = "${path.module}/lambda.zip" } resource "aws_sqs_queue" "sqs_lambda_demo_queue" { name = "sqs-lambda-demo-${data.aws_caller_identity.current.account_id}" } # Role to execute lambda resource "aws_iam_role" "sqs_lambda_demo_functionrole" { name = "sqs_lambda_demo_functionrole" assume_role_policy = <