terraform-aws-modules EventBridge

repository·master·Indexed 41 days ago

https://github.com/terraform-aws-modules/terraform-aws-eventbridge

A comprehensive Terraform module for managing AWS EventBridge resources, including buses, rules, targets, archives, schedules, and API destinations. Requires Terraform >= 1.5.7 and AWS provider >= 6.28.

Tokens
19.6K
Snippets
20
Records
42
Agent score
94%

What's inside terraform-aws-eventbridge

  1. How to attach additional IAM policies to Step Functions

    master

    When using EventBridge with Step Functions, you may need to attach additional IAM policies to the role used by the target. The module supports 5 ways to do this:

    1. policy_json: A single JSON string or heredoc (requires attach_policy_json = true).
    2. policy_jsons: A list of JSON strings or heredocs (requires attach_policy_jsons = true).
    3. policy: The ARN of an existing IAM policy (requires attach_policy = true).
    4. policies: A list of ARNs of existing IAM policies (requires attach_policies = true).
    5. policy_statements: A map of maps defining IAM statements that will be generated into a policy (requires attach_policy_statements = true).
  2. Deploy the API Gateway Event Source example

    master

    This example demonstrates how to configure an EventBridge resource setup that includes an API Gateway and an SQS queue to act as an event source.

    To deploy this configuration, run the following commands in your terminal:

    $ terraform init
    $ terraform plan
    $ terraform apply

    Warning: This example creates resources that may incur costs. Ensure you run terraform destroy when you no longer need these resources to avoid unnecessary charges.

  3. Deploy EventBridge Scheduler with Schedule Groups and Lambda

    master

    This example demonstrates how to configure AWS EventBridge Scheduler resources to trigger an AWS Lambda function using Schedule Groups. It utilizes the terraform-aws-modules/lambda/aws module to manage the target function and the core terraform-aws-eventbridge module for the scheduler configuration.

    Requirements

    • Terraform: >= 1.5.7
    • AWS Provider: >= 6.28
    • Null Provider: >= 2.0
    • Random Provider: >= 3.0

    Deployment Steps

    To deploy this configuration, run the following commands in your terminal:

    $ terraform init
    $ terraform plan
    $ terraform apply
    WARNING

    This example may create resources that incur costs. Run terraform destroy to clean up resources when they are no longer needed.

  4. Run the EventBridge ECS & Scheduled Events Example

    master

    This example demonstrates how to configure EventBridge resources alongside an ECS service. To deploy this configuration, use the standard Terraform workflow.

    Warning: This example may create resources that incur AWS costs. Ensure you run terraform destroy to clean up resources when they are no longer needed.

    $ terraform init
    $ terraform plan
    $ terraform apply
  5. Run the EventBridge Lambda & Scheduled Events example

    master

    This example demonstrates how to configure EventBridge resources alongside an AWS Lambda service. It sets up a scheduled event that triggers a Lambda function.

    To deploy this example, use the standard Terraform workflow. Note that this configuration creates resources that may incur AWS costs; ensure you run terraform destroy when finished.

    $ terraform init
    $ terraform plan
    $ terraform apply
  6. Run the EventBridge Complete Example

    master

    This example demonstrates a comprehensive EventBridge configuration that integrates with several other AWS services, including SQS queues, Kinesis streams, and DynamoDB tables.

    Warning: This example creates real AWS resources that may incur costs. Ensure you run terraform destroy when you are finished with the demonstration.

    $ terraform init
    $ terraform plan
    $ terraform apply