terraform

Number of deleted messages is twice as many as received messages

Number of deleted messages is twice as many as received messages Question: I created SQS service with terraform resource "aws_sqs_queue" "ses_queue" { name = "ses_queue" message_retention_seconds = 86400 receive_wait_time_seconds = 1 visibility_timeout_seconds = 15 } resource "aws_lambda_event_source_mapping" "send_email_message" { event_source_arn = aws_sqs_queue.ses_queue.arn function_name = aws_lambda_function.send_email_message.function_name batch_size = 5 } I am sending emails using lambda …

Total answers: 2

S3 Upload Invoke Lambda Fails – Cross Account Access

S3 Upload Invoke Lambda Fails – Cross Account Access Question: I have a lambda that triggers off an S3 bucket upload (it basically converts a PDF to a dataframe and writes it to a different s3 bucket). Both of these belong to AWS account A. I would like to allow cross-account s3 access to trigger …

Total answers: 3

AWS CLI Can List S3 Bucket But Access Denied For Python Lambda

AWS CLI Can List S3 Bucket But Access Denied For Python Lambda Question: I’ve used terraform to setup infra for an s3 bucket and my containerised lambda. I want to trigger the lambda to list the items in my s3 bucket. When I run the aws cli it’s fine: aws s3 ls returns 2022-11-08 23:04:19 …

Total answers: 2

Bigquery dataset using pub/sub subscription

Bigquery dataset using pub/sub subscription Question: Trying to create a dataset using pub/sub subscription message. https://cloud.google.com/pubsub/docs/bigquery. This one provides how to write message to the table, but how can I create a dataset using the message. For example – if I have this is test1 in my subscription, then I should be able to take …

Total answers: 1

Why do I get "Error: handler and runtime must be set when PackageType is Zip" when deploying a Lambda function using Terraform?

Why do I get "Error: handler and runtime must be set when PackageType is Zip" when deploying a Lambda function using Terraform? Question: I have defined a Lambda function with Terraform like this: resource "aws_lambda_function" "this" { filename = "${path.module}/src/existing-files-lambda.zip" function_name = "ingest-existing-files-lambda" role = aws_iam_role.lambda.arn runtime = "python3.9" timeout = 900 environment { variables …

Total answers: 3

Edit Terraform configuration files programmatically with Python

Edit Terraform configuration files programmatically with Python Question: I am trying to edit Terraform configuration files with Python. I am parsing Terraform files (.tf) using python hcl2 library which returns a python dictionary. I want to add new key/value pairs or change some values in the dictionary. Directly writing to the file is not a …

Total answers: 2