awscc_pipes_pipe (Resource)

Definition of AWS::Pipes::Pipe Resource Type

Example Usage

Basic Usage

Create a pipe with SQS queues as the source and destination:

data "aws_caller_identity" "example" {}

resource "awscc_sqs_queue" "source" {}

resource "awscc_sqs_queue" "target" {}

resource "awscc_iam_role" "example" {
  assume_role_policy_document = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Action = "sts:AssumeRole"
        Effect = "Allow"
        Principal = {
          Service = "pipes.amazonaws.com"
        }
        Condition = {
          StringEquals = {
            "aws:SourceAccount" = data.aws_caller_identity.example.account_id
          }
        }
      },
    ]
  })
  policies = [{
    policy_name = "SQSAccess"
    policy_document = jsonencode({
      Version = "2012-10-17"
      Statement = [
        {
          Action = [
            "sqs:DeleteMessage",
            "sqs:GetQueueAttributes",
            "sqs:ReceiveMessage",
          ],
          Effect = "Allow",
          Resource = [
            awscc_sqs_queue.source.arn
          ]
        },
        {
          Action = [
            "sqs:SendMessage",
          ],
          Effect = "Allow",
          Resource = [
            awscc_sqs_queue.target.arn
          ]
        },
      ]
    })
  }]
}

resource "awscc_pipes_pipe" "example" {
  name     = "example-pipe"
  role_arn = awscc_iam_role.example.arn
  source   = awscc_sqs_queue.source.arn
  target   = awscc_sqs_queue.target.arn
  tags = {
    "Modified by" = "AWSCC"
  }
}

Pipe with Enrichment

Create a pipe with enrichment:

data "aws_iam_role" "example" {
  name = "awscc_example"
}

data "aws_cloudwatch_event_connection" "example" {
  name = "awscc-example"
}

resource "awscc_sqs_queue" "source" {}

resource "awscc_sqs_queue" "target" {}

resource "awscc_events_api_destination" "example" {
  connection_arn      = data.aws_cloudwatch_event_connection.example.arn
  http_method         = "GET"
  invocation_endpoint = "https://example.com"
}

resource "awscc_pipes_pipe" "example" {
  name       = "example-pipe"
  role_arn   = data.aws_iam_role.example.arn
  source     = awscc_sqs_queue.source.arn
  target     = awscc_sqs_queue.target.arn
  enrichment = awscc_events_api_destination.example.arn
  enrichment_parameters = {
    http_parameters = {
      path_parameter_values = ["example-path-param"]
      header_parameters = {
        "example-header"        = "example-value"
        "second-example-header" = "second-example-value"
      }
      query_string_parameteres = {
        "example-query-string"        = "example-value"
        "second-example-query-string" = "second-example-value"
      }
    }
  }
}

Pipe with Source and Target Parameters

Create a pipe with source filtering and custom parameters for source and target locations:

data "aws_iam_role" "example" {
  name = "awscc_example"
}

resource "awscc_sqs_queue" "source" {
  fifo_queue = true
}

resource "awscc_sqs_queue" "target" {
  fifo_queue = true
}

resource "awscc_pipes_pipe" "example" {
  name     = "example-pipe"
  role_arn = data.aws_iam_role.example.arn
  source   = awscc_sqs_queue.source.arn
  target   = awscc_sqs_queue.target.arn
  source_parameters = {
    filter_criteria = {
      filters = [{
        pattern = jsonencode({
          source = ["event-source"]
        })
      }]
    }
    sqs_queue_parameters = {
      batch_size = 1
    }
  }
  target_parameters = {
    sqs_queue_parameters = {
      message_deduplication_id = "example-dedupe"
      message_group_id         = "example-group"
    }
  }
}

Schema

Required

Optional

Read-Only

Nested Schema for enrichment_parameters

Optional:

Nested Schema for enrichment_parameters.http_parameters

Optional:

Nested Schema for log_configuration

Optional:

Nested Schema for log_configuration.cloudwatch_logs_log_destination

Optional:

Nested Schema for log_configuration.firehose_log_destination

Optional:

Nested Schema for log_configuration.s3_log_destination

Optional:

Nested Schema for source_parameters

Optional:

Nested Schema for source_parameters.active_mq_broker_parameters

Required:

Optional:

Nested Schema for source_parameters.active_mq_broker_parameters.credentials

Optional:

Nested Schema for source_parameters.dynamo_db_stream_parameters

Required:

Optional:

Nested Schema for source_parameters.dynamo_db_stream_parameters.dead_letter_config

Optional:

Nested Schema for source_parameters.filter_criteria

Optional:

Nested Schema for source_parameters.filter_criteria.filters

Optional:

Nested Schema for source_parameters.kinesis_stream_parameters

Required:

Optional:

Nested Schema for source_parameters.kinesis_stream_parameters.dead_letter_config

Optional:

Nested Schema for source_parameters.managed_streaming_kafka_parameters

Required:

Optional:

Nested Schema for source_parameters.managed_streaming_kafka_parameters.credentials

Optional:

Nested Schema for source_parameters.rabbit_mq_broker_parameters

Required:

Optional:

Nested Schema for source_parameters.rabbit_mq_broker_parameters.credentials

Optional:

Nested Schema for source_parameters.self_managed_kafka_parameters

Required:

Optional:

Nested Schema for source_parameters.self_managed_kafka_parameters.credentials

Optional:

Nested Schema for source_parameters.self_managed_kafka_parameters.vpc

Optional:

Nested Schema for source_parameters.sqs_queue_parameters

Optional:

Nested Schema for target_parameters

Optional:

Nested Schema for target_parameters.batch_job_parameters

Required:

Optional:

Nested Schema for target_parameters.batch_job_parameters.array_properties

Optional:

Nested Schema for target_parameters.batch_job_parameters.container_overrides

Optional:

Nested Schema for target_parameters.batch_job_parameters.container_overrides.environment

Optional:

Nested Schema for target_parameters.batch_job_parameters.container_overrides.resource_requirements

Required:

Nested Schema for target_parameters.batch_job_parameters.depends_on

Optional:

Nested Schema for target_parameters.batch_job_parameters.retry_strategy

Optional:

Nested Schema for target_parameters.cloudwatch_logs_parameters

Optional:

Nested Schema for target_parameters.ecs_task_parameters

Required:

Optional:

Nested Schema for target_parameters.ecs_task_parameters.capacity_provider_strategy

Required:

Optional:

Nested Schema for target_parameters.ecs_task_parameters.network_configuration

Optional:

Nested Schema for target_parameters.ecs_task_parameters.network_configuration.awsvpc_configuration

Required:

Optional:

Nested Schema for target_parameters.ecs_task_parameters.overrides

Optional:

Nested Schema for target_parameters.ecs_task_parameters.overrides.container_overrides

Optional:

Nested Schema for target_parameters.ecs_task_parameters.overrides.task_role_arn.environment

Optional:

Nested Schema for target_parameters.ecs_task_parameters.overrides.task_role_arn.environment_files

Required:

Nested Schema for target_parameters.ecs_task_parameters.overrides.task_role_arn.resource_requirements

Required:

Nested Schema for target_parameters.ecs_task_parameters.overrides.ephemeral_storage

Optional:

Nested Schema for target_parameters.ecs_task_parameters.overrides.inference_accelerator_overrides

Optional:

Nested Schema for target_parameters.ecs_task_parameters.placement_constraints

Optional:

Nested Schema for target_parameters.ecs_task_parameters.placement_strategy

Optional:

Nested Schema for target_parameters.ecs_task_parameters.tags

Required:

Nested Schema for target_parameters.event_bridge_event_bus_parameters

Optional:

Nested Schema for target_parameters.http_parameters

Optional:

Nested Schema for target_parameters.kinesis_stream_parameters

Required:

Nested Schema for target_parameters.lambda_function_parameters

Optional:

Nested Schema for target_parameters.redshift_data_parameters

Required:

Optional:

Nested Schema for target_parameters.sage_maker_pipeline_parameters

Optional:

Nested Schema for target_parameters.sage_maker_pipeline_parameters.pipeline_parameter_list

Required:

Nested Schema for target_parameters.sqs_queue_parameters

Optional:

Nested Schema for target_parameters.step_function_state_machine_parameters

Optional:

Import

Import is supported using the following syntax:

$ terraform import awscc_pipes_pipe.example <resource ID>