Resource: aws_cloudwatch_event_archive

Provides an EventBridge event archive resource.

Example Usage

resource "aws_cloudwatch_event_bus" "order" {
  name = "orders"
}

resource "aws_cloudwatch_event_archive" "order" {
  name             = "order-archive"
  event_source_arn = aws_cloudwatch_event_bus.order.arn
}

Example all optional arguments

resource "aws_cloudwatch_event_bus" "order" {
  name = "orders"
}

resource "aws_cloudwatch_event_archive" "order" {
  name             = "order-archive"
  description      = "Archived events from order service"
  event_source_arn = aws_cloudwatch_event_bus.order.arn
  retention_days   = 7
  event_pattern = jsonencode({
    source = ["company.team.order"]
  })
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import an EventBridge archive using the name. For example:

import {
  to = aws_cloudwatch_event_archive.imported_event_archive.test
  id = "order-archive"
}

Using terraform import, import an EventBridge archive using the name. For example:

% terraform import aws_cloudwatch_event_archive.imported_event_archive order-archive