1

I am trying to write a terraform script that creates an eventbridge pipe that reads from a dynamodb stream and directly puts it in an event bus. The end goal is to be able to invoke a rule. However, in the console I always see the pipe fail. I have no idea how to monitor the pipe to see what is wrong. The configuration is as follows:

data "aws_iam_policy_document" "pipe_policy" {
  statement {
    sid    = ""
    effect = "Allow"
    principals {
      identifiers = ["pipes.amazonaws.com"]
      type        = "Service"
    }
    actions = ["sts:AssumeRole"]
  }
}

resource "aws_iam_role" "eventbridge_dynamodb_role" {
  name = "eventbridge_dynamodb_role"

  managed_policy_arns = [
    "arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess",
    "arn:aws:iam::aws:policy/AmazonEventBridgeFullAccess"
  ]

  assume_role_policy = data.aws_iam_policy_document.pipe_policy.json
}

# Create custom event bus
resource "aws_cloudwatch_event_bus" "example_event_bus" {
  name = "example_event_bus"
}

resource "awscc_pipes_pipe" "pipe" {
  name     = "pipe-customer-request"
  role_arn = aws_iam_role.eventbridge_dynamodb_role.arn

  source = aws_dynamodb_table.example_table.stream_arn

  source_parameters = {
    dynamo_db_stream_parameters = {
      starting_position = "LATEST"
      batch_size = 1
    }
  }

  target = aws_cloudwatch_event_bus.example_event_bus.arn
}

In the monitoring dashboard this is all I see:

Monitoring

0 Answers0