Skip to content

FriendsOfTerraform/aws-eventbridge-bus

Repository files navigation

EventBridge Event Bus Module

This module will build and configure an EventBridge event bus and rules.

This repository is a READ-ONLY sub-tree split. See https://github.com/FriendsOfTerraform/modules to create issues or submit pull requests.

Table of Contents

Example Usage

Basic Usage

module "basic_usage" {
  source = "github.com/FriendsOfTerraform/aws-eventbridge-bus.git?ref=v1.0.0"

  name = "demo-bus"

  # manages multiple rules
  rules = {
    # the key of the map is the rule's name
    test-lambda = {
      event_pattern = jsonencode({
        source      = ["aws.workspaces"]
        detail-type = ["WorkSpaces Access"]
      })

      targets = [
        {
          arn          = "arn:aws:lambda:us-east-1:111122223333:function:psin-test:1"
          iam_role_arn = "arn:aws:iam::111122223333:role/test-event-bus"
        }
      ]
    }

    test-http = {
      event_pattern = jsonencode({
        source      = ["aws.workspaces"]
        detail-type = ["WorkSpaces Access"]
      })

      targets = [
        {
          arn          = "arn:aws:events:us-east-1:111122223333:api-destination/demo-api/abcdef0-1111-2222-87fd-868af648a706"
          iam_role_arn = "arn:aws:iam::111122223333:role/test-event-bus"
        }
      ]
    }
  }
}

Argument Reference

Mandatory

  • (string) name [since v1.0.0]

    The name of the event bus

  • (map(object)) rules [since v1.0.0]

    Manage multiple rules for the bus. Please see example

    • (string) event_pattern [since v1.0.0]

      Specify the event pattern that this rule will be triggered when an event matching the pattern occurs

    • (list(object)) targets [since v1.0.0]

      Specify up to 5 targets to send the event to when the rule is triggered

      • (string) arn [since v1.0.0]

        The Amazon Resource Name (ARN) of the target

      • (object) configure_target_input = null [since v1.0.0]

        Customize the text from an event before EventBridge passes the event to the target of a rule. Can only define only one of the following: constant, input_transformer. If this is not specified, the original event will be sent to the target

        • (string) constant = null [since v1.0.0]

          The JSON document to be sent to the target instead of the original event

        • (object) input_transformer = null [since v1.0.0]

          Specify how to change some of the event text before passing it to the target. One or more JSON paths are extracted from the event text and used in a template that you provide. Refer to this documentation for more information

          • (map(string)) input_paths [since v1.0.0]

            Key-value pairs that is used to define variables. You use JSON path to reference items in your event and store those values in variables. For instance, you could create an Input Path to reference values in the event.

          • (string) template [since v1.0.0]

            The Input Template is a template for the information you want to pass to your target. You can create a template that passes either a string or JSON to the target.

      • (string) iam_role_arn = null [since v1.0.0]

        An execution role that EventBridge uses to send events to the target

      • (object) ecs_target_config = null [since v1.0.0]

        Configuration options for ECS target

        • (string) task_definition_arn [since v1.0.0]

          The ARN of the task definition to use to create new ECS task

        • (map(string)) additional_tags = {} [since v1.0.0]

          Additional tags for the ECS task

        • (map(object)) capacity_provider_strategy = {} [since v1.0.0]

          The capacity provider strategy to use for the task. Mutually exclusive to launch_type

          • (number) weight [since v1.0.0]

            The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.

          • (number) base = null [since v1.0.0]

            The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined.

        • (number) count = 1 [since v1.0.0]

          The number of tasks to be created

        • (bool) enable_execute_command = false [since v1.0.0]

          Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.

        • (bool) enable_managed_tags = true [since v1.0.0]

          Specifies whether to enable Amazon ECS managed tags for the task.

        • (string) launch_type = null [since v1.0.0]

          Specifies the launch type on which your task is running. Valid values: "EC2", "EXTERNAL", "FARGATE". Mutually exclusive to capacity_provider_strategy

        • (object) network_config [since v1.0.0]

          Configures networking options for the ECS task

          • (list(string)) security_group_ids [since v1.0.0]

            A list of security groups associated with the task

          • (list(string)) subnet_ids [since v1.0.0]

            A list of subnets the ECS task may be created on

          • (bool) auto_assign_public_ip = false [since v1.0.0]

            Assign a public IP address to the ENI (Fargate launch type only).

        • (string) platform_version = "LATEST" [since v1.0.0]

          Specifies the platform version for the task. This is used only if launch_type = "FARGATE". For more information about valid platform versions, see AWS Fargate Platform Versions.

        • (bool) propagate_tags_from_task_definition = false [since v1.0.0]

          Specifies whether to propagate the tags from the task definition to the task.

      • (object) http_target_config = null [since v1.0.0]

        Configuration options for HTTP and api gateway target

        • (map(string)) header_parameters = null [since v1.0.0]

          A map of HTTP headers to add to the request.

        • (map(string)) query_string_parameters = null [since v1.0.0]

          A map of query string parameters that are appended to the invoked endpoint.

      • (object) redshift_target_config = null [since v1.0.0]

        Configuration options for Redshift target

        • (string) database_name [since v1.0.0]

          The name of the database

        • (string) database_user = null [since v1.0.0]

          The database user name

        • (string) secret_manager_arn [since v1.0.0]

          The ARN of the secret that enables access to the database.

        • (string) sql_statement = null [since v1.0.0]

          The SQL statement text to run.

        • (bool) with_event = false [since v1.0.0]

          Indicates whether to send an event back to EventBridge after the SQL statement runs.

      • (object) retry_policy = {} [since v1.0.0]

        Configures retry policy and dead-letter queue

        • (number) maximum_age_of_event = 86400 [since v1.0.0]

          The age in seconds to continue to make retry attempts.

        • (number) retry_attempts = 185 [since v1.0.0]

          The maximum number of retry attempts to make before the request fails

        • (string) dead_letter_queue = null [since v1.0.0]

          The ARN of the SQS queue specified as the target for the dead-letter queue.

  • (map(object)) origins [since v1.0.0]

    Map of origins for this distribution. Please see example

    • (number) connection_attempts = 3 [since v1.0.0]

      The number of times that CloudFront attempts to connect to the origin. Valid values: 1 - 3

    • (number) connection_timeout = 10 [since v1.0.0]

      The number of seconds that CloudFront waits for a response from the origin, from 1 - 10

    • (map(string)) custom_headers = {} [since v1.0.0]

      Map of headers that CloudFront includes in all requests that it sends to your origin

    • (string) origin_path = null [since v1.0.0]

      Specify a URL path to append to the origin domain name for origin requests

    • (object) custom_origin_config = null [since v1.0.0]

      Configurations for [Cloudfront custom origins][cloudfront-origins]

      • (number) http_port = 80 [since v1.0.0]

        Specify the origin's HTTP port

      • (number) https_port = 443 [since v1.0.0]

        Specify the origin's HTTPS port

      • (number) keep_alive_timeout = 5 [since v1.0.0]

        The number of seconds that CloudFront maintains an idle connection with the origin, from 1 - 60

      • (string) minimum_ssl_protocol = "TLSv1.2" [since v1.0.0]

        The minimum SSL protocol that CloudFront uses with the origin. Valid values: "TLSv1.2", "TLSv1.1", "TLSv1", "SSLv3"

      • (string) protocol_policy = "https-only" [since v1.0.0]

        The origin protocol policy determines the protocol (HTTP or HTTPS) that you want CloudFront to use when connecting to the origin. Valid values: "http-only", "https-only", "match-viewer"

      • (number) response_timeout = 30 [since v1.0.0]

        The number of seconds that CloudFront waits for a response from the origin, from 1 - 60

    • (object) enable_origin_shield = null [since v1.0.0]

      [Origin shield][cloudfront-origin-shield] is an additional caching layer that can help reduce the load on your origin and help protect its availability

      • (string) region [since v1.0.0]

        Specify the origin shield region

    • (object) s3_origin_config = null [since v1.0.0]

      Configurations for [S3 origins][cloudfront-origins]

      • (object) origin_access [since v1.0.0]

        You can limit the access to your origin to only authenticated requests from CloudFront. We recommend using origin access control (OAC) in favor of origin access identity (OAI) for its wider range of features, including support of S3 buckets in all AWS Regions.

        • (string) origin_access_control_id = null [since v1.0.0]

          The ID of the origin access control to be associated to this origin. Mutually exclusive to origin_access_identity

        • (string) origin_access_identity = null [since v1.0.0]

          The ID of the origin access identity to be associated to this origin. Mutually exclusive to origin_access_control_id

Optional

  • (map(string)) additional_tags = {} [since v1.0.0]

    Additional tags for the event bus

  • (map(string)) additional_tags_all = {} [since v1.0.0]

    Additional tags for all resources deployed with this module

  • (string) description = null [since v1.0.0]

    The description of the event bus

  • (string) kms_key_arn = null [since v1.0.0]

    The AWS KMS customer managed key for EventBridge to use for encryption. If not specified, the AWS default key will be used.

  • (string) policy = null [since v1.0.0]

    Specify the JSON document for the event bus' resource-based policy

Outputs

  • (string) event_bus_arn [since v1.0.0]

    ARN of the event bus

  • (string) event_bus_id [since v1.0.0]

    Name of the event bus

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages