1. Packages
  2. AWS
  3. API Docs
  4. cloudwatch
  5. EventArchive
AWS v7.4.0 published on Wednesday, Aug 13, 2025 by Pulumi

aws.cloudwatch.EventArchive

Explore with Pulumi AI

aws logo
AWS v7.4.0 published on Wednesday, Aug 13, 2025 by Pulumi

    Provides an EventBridge event archive resource.

    Note: EventBridge was formerly known as CloudWatch Events. The functionality is identical.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const order = new aws.cloudwatch.EventBus("order", {name: "orders"});
    const orderEventArchive = new aws.cloudwatch.EventArchive("order", {
        name: "order-archive",
        eventSourceArn: order.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    order = aws.cloudwatch.EventBus("order", name="orders")
    order_event_archive = aws.cloudwatch.EventArchive("order",
        name="order-archive",
        event_source_arn=order.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		order, err := cloudwatch.NewEventBus(ctx, "order", &cloudwatch.EventBusArgs{
    			Name: pulumi.String("orders"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudwatch.NewEventArchive(ctx, "order", &cloudwatch.EventArchiveArgs{
    			Name:           pulumi.String("order-archive"),
    			EventSourceArn: order.Arn,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var order = new Aws.CloudWatch.EventBus("order", new()
        {
            Name = "orders",
        });
    
        var orderEventArchive = new Aws.CloudWatch.EventArchive("order", new()
        {
            Name = "order-archive",
            EventSourceArn = order.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudwatch.EventBus;
    import com.pulumi.aws.cloudwatch.EventBusArgs;
    import com.pulumi.aws.cloudwatch.EventArchive;
    import com.pulumi.aws.cloudwatch.EventArchiveArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var order = new EventBus("order", EventBusArgs.builder()
                .name("orders")
                .build());
    
            var orderEventArchive = new EventArchive("orderEventArchive", EventArchiveArgs.builder()
                .name("order-archive")
                .eventSourceArn(order.arn())
                .build());
    
        }
    }
    
    resources:
      order:
        type: aws:cloudwatch:EventBus
        properties:
          name: orders
      orderEventArchive:
        type: aws:cloudwatch:EventArchive
        name: order
        properties:
          name: order-archive
          eventSourceArn: ${order.arn}
    

    Optional Arguments

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const order = new aws.cloudwatch.EventBus("order", {name: "orders"});
    const orderEventArchive = new aws.cloudwatch.EventArchive("order", {
        name: "order-archive",
        description: "Archived events from order service",
        eventSourceArn: order.arn,
        retentionDays: 7,
        eventPattern: JSON.stringify({
            source: ["company.team.order"],
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    order = aws.cloudwatch.EventBus("order", name="orders")
    order_event_archive = aws.cloudwatch.EventArchive("order",
        name="order-archive",
        description="Archived events from order service",
        event_source_arn=order.arn,
        retention_days=7,
        event_pattern=json.dumps({
            "source": ["company.team.order"],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		order, err := cloudwatch.NewEventBus(ctx, "order", &cloudwatch.EventBusArgs{
    			Name: pulumi.String("orders"),
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"source": []string{
    				"company.team.order",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = cloudwatch.NewEventArchive(ctx, "order", &cloudwatch.EventArchiveArgs{
    			Name:           pulumi.String("order-archive"),
    			Description:    pulumi.String("Archived events from order service"),
    			EventSourceArn: order.Arn,
    			RetentionDays:  pulumi.Int(7),
    			EventPattern:   pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var order = new Aws.CloudWatch.EventBus("order", new()
        {
            Name = "orders",
        });
    
        var orderEventArchive = new Aws.CloudWatch.EventArchive("order", new()
        {
            Name = "order-archive",
            Description = "Archived events from order service",
            EventSourceArn = order.Arn,
            RetentionDays = 7,
            EventPattern = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["source"] = new[]
                {
                    "company.team.order",
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudwatch.EventBus;
    import com.pulumi.aws.cloudwatch.EventBusArgs;
    import com.pulumi.aws.cloudwatch.EventArchive;
    import com.pulumi.aws.cloudwatch.EventArchiveArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var order = new EventBus("order", EventBusArgs.builder()
                .name("orders")
                .build());
    
            var orderEventArchive = new EventArchive("orderEventArchive", EventArchiveArgs.builder()
                .name("order-archive")
                .description("Archived events from order service")
                .eventSourceArn(order.arn())
                .retentionDays(7)
                .eventPattern(serializeJson(
                    jsonObject(
                        jsonProperty("source", jsonArray("company.team.order"))
                    )))
                .build());
    
        }
    }
    
    resources:
      order:
        type: aws:cloudwatch:EventBus
        properties:
          name: orders
      orderEventArchive:
        type: aws:cloudwatch:EventArchive
        name: order
        properties:
          name: order-archive
          description: Archived events from order service
          eventSourceArn: ${order.arn}
          retentionDays: 7
          eventPattern:
            fn::toJSON:
              source:
                - company.team.order
    

    CMK Encryption

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const currentGetPartition = aws.getPartition({});
    const example = new aws.cloudwatch.EventBus("example", {name: "example"});
    const exampleKey = new aws.kms.Key("example", {
        deletionWindowInDays: 7,
        policy: pulumi.jsonStringify({
            Version: "2012-10-17",
            Id: "key-policy-example",
            Statement: [
                {
                    Sid: "Enable IAM User Permissions",
                    Effect: "Allow",
                    Principal: {
                        AWS: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:iam::${current.accountId}:root`),
                    },
                    Action: "kms:*",
                    Resource: "*",
                },
                {
                    Sid: "Allow describing of the key",
                    Effect: "Allow",
                    Principal: {
                        Service: "events.amazonaws.com",
                    },
                    Action: ["kms:DescribeKey"],
                    Resource: "*",
                },
                {
                    Sid: "Allow use of the key",
                    Effect: "Allow",
                    Principal: {
                        Service: "events.amazonaws.com",
                    },
                    Action: [
                        "kms:GenerateDataKey",
                        "kms:Decrypt",
                        "kms:ReEncrypt*",
                    ],
                    Resource: "*",
                    Condition: {
                        StringEquals: {
                            "kms:EncryptionContext:aws:events:event-bus:arn": example.arn,
                        },
                    },
                },
            ],
        }),
        tags: {
            EventBridgeApiDestinations: "true",
        },
    });
    const exampleEventArchive = new aws.cloudwatch.EventArchive("example", {
        name: "example",
        eventSourceArn: example.arn,
        kmsKeyIdentifier: exampleKey.id,
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    current_get_partition = aws.get_partition()
    example = aws.cloudwatch.EventBus("example", name="example")
    example_key = aws.kms.Key("example",
        deletion_window_in_days=7,
        policy=pulumi.Output.json_dumps({
            "Version": "2012-10-17",
            "Id": "key-policy-example",
            "Statement": [
                {
                    "Sid": "Enable IAM User Permissions",
                    "Effect": "Allow",
                    "Principal": {
                        "AWS": f"arn:{current_get_partition.partition}:iam::{current.account_id}:root",
                    },
                    "Action": "kms:*",
                    "Resource": "*",
                },
                {
                    "Sid": "Allow describing of the key",
                    "Effect": "Allow",
                    "Principal": {
                        "Service": "events.amazonaws.com",
                    },
                    "Action": ["kms:DescribeKey"],
                    "Resource": "*",
                },
                {
                    "Sid": "Allow use of the key",
                    "Effect": "Allow",
                    "Principal": {
                        "Service": "events.amazonaws.com",
                    },
                    "Action": [
                        "kms:GenerateDataKey",
                        "kms:Decrypt",
                        "kms:ReEncrypt*",
                    ],
                    "Resource": "*",
                    "Condition": {
                        "StringEquals": {
                            "kms:EncryptionContext:aws:events:event-bus:arn": example.arn,
                        },
                    },
                },
            ],
        }),
        tags={
            "EventBridgeApiDestinations": "true",
        })
    example_event_archive = aws.cloudwatch.EventArchive("example",
        name="example",
        event_source_arn=example.arn,
        kms_key_identifier=example_key.id)
    
    package main
    
    import (
    	"encoding/json"
    	"fmt"
    
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		currentGetPartition, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := cloudwatch.NewEventBus(ctx, "example", &cloudwatch.EventBusArgs{
    			Name: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleKey, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
    			DeletionWindowInDays: pulumi.Int(7),
    			Policy: example.Arn.ApplyT(func(arn string) (pulumi.String, error) {
    				var _zero pulumi.String
    				tmpJSON0, err := json.Marshal(map[string]interface{}{
    					"Version": "2012-10-17",
    					"Id":      "key-policy-example",
    					"Statement": []interface{}{
    						map[string]interface{}{
    							"Sid":    "Enable IAM User Permissions",
    							"Effect": "Allow",
    							"Principal": map[string]interface{}{
    								"AWS": fmt.Sprintf("arn:%v:iam::%v:root", currentGetPartition.Partition, current.AccountId),
    							},
    							"Action":   "kms:*",
    							"Resource": "*",
    						},
    						map[string]interface{}{
    							"Sid":    "Allow describing of the key",
    							"Effect": "Allow",
    							"Principal": map[string]interface{}{
    								"Service": "events.amazonaws.com",
    							},
    							"Action": []string{
    								"kms:DescribeKey",
    							},
    							"Resource": "*",
    						},
    						map[string]interface{}{
    							"Sid":    "Allow use of the key",
    							"Effect": "Allow",
    							"Principal": map[string]interface{}{
    								"Service": "events.amazonaws.com",
    							},
    							"Action": []string{
    								"kms:GenerateDataKey",
    								"kms:Decrypt",
    								"kms:ReEncrypt*",
    							},
    							"Resource": "*",
    							"Condition": map[string]interface{}{
    								"StringEquals": map[string]interface{}{
    									"kms:EncryptionContext:aws:events:event-bus:arn": arn,
    								},
    							},
    						},
    					},
    				})
    				if err != nil {
    					return _zero, err
    				}
    				json0 := string(tmpJSON0)
    				return pulumi.String(json0), nil
    			}).(pulumi.StringOutput),
    			Tags: pulumi.StringMap{
    				"EventBridgeApiDestinations": pulumi.String("true"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudwatch.NewEventArchive(ctx, "example", &cloudwatch.EventArchiveArgs{
    			Name:             pulumi.String("example"),
    			EventSourceArn:   example.Arn,
    			KmsKeyIdentifier: exampleKey.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var currentGetPartition = Aws.GetPartition.Invoke();
    
        var example = new Aws.CloudWatch.EventBus("example", new()
        {
            Name = "example",
        });
    
        var exampleKey = new Aws.Kms.Key("example", new()
        {
            DeletionWindowInDays = 7,
            Policy = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["Version"] = "2012-10-17",
                ["Id"] = "key-policy-example",
                ["Statement"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "Enable IAM User Permissions",
                        ["Effect"] = "Allow",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["AWS"] = Output.Tuple(currentGetPartition, current).Apply(values =>
                            {
                                var currentGetPartition = values.Item1;
                                var current = values.Item2;
                                return $"arn:{currentGetPartition.Apply(getPartitionResult => getPartitionResult.Partition)}:iam::{current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId)}:root";
                            }),
                        },
                        ["Action"] = "kms:*",
                        ["Resource"] = "*",
                    },
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "Allow describing of the key",
                        ["Effect"] = "Allow",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["Service"] = "events.amazonaws.com",
                        },
                        ["Action"] = new[]
                        {
                            "kms:DescribeKey",
                        },
                        ["Resource"] = "*",
                    },
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "Allow use of the key",
                        ["Effect"] = "Allow",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["Service"] = "events.amazonaws.com",
                        },
                        ["Action"] = new[]
                        {
                            "kms:GenerateDataKey",
                            "kms:Decrypt",
                            "kms:ReEncrypt*",
                        },
                        ["Resource"] = "*",
                        ["Condition"] = new Dictionary<string, object?>
                        {
                            ["StringEquals"] = new Dictionary<string, object?>
                            {
                                ["kms:EncryptionContext:aws:events:event-bus:arn"] = example.Arn,
                            },
                        },
                    },
                },
            })),
            Tags = 
            {
                { "EventBridgeApiDestinations", "true" },
            },
        });
    
        var exampleEventArchive = new Aws.CloudWatch.EventArchive("example", new()
        {
            Name = "example",
            EventSourceArn = example.Arn,
            KmsKeyIdentifier = exampleKey.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetPartitionArgs;
    import com.pulumi.aws.cloudwatch.EventBus;
    import com.pulumi.aws.cloudwatch.EventBusArgs;
    import com.pulumi.aws.kms.Key;
    import com.pulumi.aws.kms.KeyArgs;
    import com.pulumi.aws.cloudwatch.EventArchive;
    import com.pulumi.aws.cloudwatch.EventArchiveArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var current = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
                .build());
    
            final var currentGetPartition = AwsFunctions.getPartition(GetPartitionArgs.builder()
                .build());
    
            var example = new EventBus("example", EventBusArgs.builder()
                .name("example")
                .build());
    
            var exampleKey = new Key("exampleKey", KeyArgs.builder()
                .deletionWindowInDays(7)
                .policy(example.arn().applyValue(_arn -> serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Id", "key-policy-example"),
                        jsonProperty("Statement", jsonArray(
                            jsonObject(
                                jsonProperty("Sid", "Enable IAM User Permissions"),
                                jsonProperty("Effect", "Allow"),
                                jsonProperty("Principal", jsonObject(
                                    jsonProperty("AWS", String.format("arn:%s:iam::%s:root", currentGetPartition.partition(),current.accountId()))
                                )),
                                jsonProperty("Action", "kms:*"),
                                jsonProperty("Resource", "*")
                            ), 
                            jsonObject(
                                jsonProperty("Sid", "Allow describing of the key"),
                                jsonProperty("Effect", "Allow"),
                                jsonProperty("Principal", jsonObject(
                                    jsonProperty("Service", "events.amazonaws.com")
                                )),
                                jsonProperty("Action", jsonArray("kms:DescribeKey")),
                                jsonProperty("Resource", "*")
                            ), 
                            jsonObject(
                                jsonProperty("Sid", "Allow use of the key"),
                                jsonProperty("Effect", "Allow"),
                                jsonProperty("Principal", jsonObject(
                                    jsonProperty("Service", "events.amazonaws.com")
                                )),
                                jsonProperty("Action", jsonArray(
                                    "kms:GenerateDataKey", 
                                    "kms:Decrypt", 
                                    "kms:ReEncrypt*"
                                )),
                                jsonProperty("Resource", "*"),
                                jsonProperty("Condition", jsonObject(
                                    jsonProperty("StringEquals", jsonObject(
                                        jsonProperty("kms:EncryptionContext:aws:events:event-bus:arn", _arn)
                                    ))
                                ))
                            )
                        ))
                    ))))
                .tags(Map.of("EventBridgeApiDestinations", "true"))
                .build());
    
            var exampleEventArchive = new EventArchive("exampleEventArchive", EventArchiveArgs.builder()
                .name("example")
                .eventSourceArn(example.arn())
                .kmsKeyIdentifier(exampleKey.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudwatch:EventBus
        properties:
          name: example
      exampleKey:
        type: aws:kms:Key
        name: example
        properties:
          deletionWindowInDays: 7
          policy:
            fn::toJSON:
              Version: 2012-10-17
              Id: key-policy-example
              Statement:
                - Sid: Enable IAM User Permissions
                  Effect: Allow
                  Principal:
                    AWS: arn:${currentGetPartition.partition}:iam::${current.accountId}:root
                  Action: kms:*
                  Resource: '*'
                - Sid: Allow describing of the key
                  Effect: Allow
                  Principal:
                    Service: events.amazonaws.com
                  Action:
                    - kms:DescribeKey
                  Resource: '*'
                - Sid: Allow use of the key
                  Effect: Allow
                  Principal:
                    Service: events.amazonaws.com
                  Action:
                    - kms:GenerateDataKey
                    - kms:Decrypt
                    - kms:ReEncrypt*
                  Resource: '*'
                  Condition:
                    StringEquals:
                      kms:EncryptionContext:aws:events:event-bus:arn: ${example.arn}
          tags:
            EventBridgeApiDestinations: 'true'
      exampleEventArchive:
        type: aws:cloudwatch:EventArchive
        name: example
        properties:
          name: example
          eventSourceArn: ${example.arn}
          kmsKeyIdentifier: ${exampleKey.id}
    variables:
      current:
        fn::invoke:
          function: aws:getCallerIdentity
          arguments: {}
      currentGetPartition:
        fn::invoke:
          function: aws:getPartition
          arguments: {}
    

    Create EventArchive Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EventArchive(name: string, args: EventArchiveArgs, opts?: CustomResourceOptions);
    @overload
    def EventArchive(resource_name: str,
                     args: EventArchiveArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def EventArchive(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     event_source_arn: Optional[str] = None,
                     description: Optional[str] = None,
                     event_pattern: Optional[str] = None,
                     kms_key_identifier: Optional[str] = None,
                     name: Optional[str] = None,
                     region: Optional[str] = None,
                     retention_days: Optional[int] = None)
    func NewEventArchive(ctx *Context, name string, args EventArchiveArgs, opts ...ResourceOption) (*EventArchive, error)
    public EventArchive(string name, EventArchiveArgs args, CustomResourceOptions? opts = null)
    public EventArchive(String name, EventArchiveArgs args)
    public EventArchive(String name, EventArchiveArgs args, CustomResourceOptions options)
    
    type: aws:cloudwatch:EventArchive
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args EventArchiveArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args EventArchiveArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args EventArchiveArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EventArchiveArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EventArchiveArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var eventArchiveResource = new Aws.CloudWatch.EventArchive("eventArchiveResource", new()
    {
        EventSourceArn = "string",
        Description = "string",
        EventPattern = "string",
        KmsKeyIdentifier = "string",
        Name = "string",
        Region = "string",
        RetentionDays = 0,
    });
    
    example, err := cloudwatch.NewEventArchive(ctx, "eventArchiveResource", &cloudwatch.EventArchiveArgs{
    	EventSourceArn:   pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	EventPattern:     pulumi.String("string"),
    	KmsKeyIdentifier: pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	Region:           pulumi.String("string"),
    	RetentionDays:    pulumi.Int(0),
    })
    
    var eventArchiveResource = new EventArchive("eventArchiveResource", EventArchiveArgs.builder()
        .eventSourceArn("string")
        .description("string")
        .eventPattern("string")
        .kmsKeyIdentifier("string")
        .name("string")
        .region("string")
        .retentionDays(0)
        .build());
    
    event_archive_resource = aws.cloudwatch.EventArchive("eventArchiveResource",
        event_source_arn="string",
        description="string",
        event_pattern="string",
        kms_key_identifier="string",
        name="string",
        region="string",
        retention_days=0)
    
    const eventArchiveResource = new aws.cloudwatch.EventArchive("eventArchiveResource", {
        eventSourceArn: "string",
        description: "string",
        eventPattern: "string",
        kmsKeyIdentifier: "string",
        name: "string",
        region: "string",
        retentionDays: 0,
    });
    
    type: aws:cloudwatch:EventArchive
    properties:
        description: string
        eventPattern: string
        eventSourceArn: string
        kmsKeyIdentifier: string
        name: string
        region: string
        retentionDays: 0
    

    EventArchive Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The EventArchive resource accepts the following input properties:

    EventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    Description string
    Description for the archive.
    EventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    KmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    Name string
    Name of the archive. The archive name cannot exceed 48 characters.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RetentionDays int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    EventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    Description string
    Description for the archive.
    EventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    KmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    Name string
    Name of the archive. The archive name cannot exceed 48 characters.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RetentionDays int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    eventSourceArn String
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    description String
    Description for the archive.
    eventPattern String
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    kmsKeyIdentifier String
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name String
    Name of the archive. The archive name cannot exceed 48 characters.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays Integer
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    eventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    description string
    Description for the archive.
    eventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    kmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name string
    Name of the archive. The archive name cannot exceed 48 characters.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays number
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    event_source_arn str
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    description str
    Description for the archive.
    event_pattern str
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    kms_key_identifier str
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name str
    Name of the archive. The archive name cannot exceed 48 characters.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retention_days int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    eventSourceArn String
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    description String
    Description for the archive.
    eventPattern String
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    kmsKeyIdentifier String
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name String
    Name of the archive. The archive name cannot exceed 48 characters.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays Number
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EventArchive resource produces the following output properties:

    Arn string
    ARN of the archive.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    ARN of the archive.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    ARN of the archive.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    ARN of the archive.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    ARN of the archive.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    ARN of the archive.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EventArchive Resource

    Get an existing EventArchive resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: EventArchiveState, opts?: CustomResourceOptions): EventArchive
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            description: Optional[str] = None,
            event_pattern: Optional[str] = None,
            event_source_arn: Optional[str] = None,
            kms_key_identifier: Optional[str] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            retention_days: Optional[int] = None) -> EventArchive
    func GetEventArchive(ctx *Context, name string, id IDInput, state *EventArchiveState, opts ...ResourceOption) (*EventArchive, error)
    public static EventArchive Get(string name, Input<string> id, EventArchiveState? state, CustomResourceOptions? opts = null)
    public static EventArchive get(String name, Output<String> id, EventArchiveState state, CustomResourceOptions options)
    resources:  _:    type: aws:cloudwatch:EventArchive    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    ARN of the archive.
    Description string
    Description for the archive.
    EventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    EventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    KmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    Name string
    Name of the archive. The archive name cannot exceed 48 characters.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RetentionDays int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    Arn string
    ARN of the archive.
    Description string
    Description for the archive.
    EventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    EventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    KmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    Name string
    Name of the archive. The archive name cannot exceed 48 characters.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RetentionDays int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    arn String
    ARN of the archive.
    description String
    Description for the archive.
    eventPattern String
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    eventSourceArn String
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    kmsKeyIdentifier String
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name String
    Name of the archive. The archive name cannot exceed 48 characters.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays Integer
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    arn string
    ARN of the archive.
    description string
    Description for the archive.
    eventPattern string
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    eventSourceArn string
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    kmsKeyIdentifier string
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name string
    Name of the archive. The archive name cannot exceed 48 characters.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays number
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    arn str
    ARN of the archive.
    description str
    Description for the archive.
    event_pattern str
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    event_source_arn str
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    kms_key_identifier str
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name str
    Name of the archive. The archive name cannot exceed 48 characters.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retention_days int
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.
    arn String
    ARN of the archive.
    description String
    Description for the archive.
    eventPattern String
    Event pattern to use to filter events sent to the archive. By default, it attempts to archive every event received in the event_source_arn.
    eventSourceArn String
    ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
    kmsKeyIdentifier String
    Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
    name String
    Name of the archive. The archive name cannot exceed 48 characters.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    retentionDays Number
    The maximum number of days to retain events in the new event archive. By default, it archives indefinitely.

    Import

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

    $ pulumi import aws:cloudwatch/eventArchive:EventArchive imported_event_archive order-archive
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.4.0 published on Wednesday, Aug 13, 2025 by Pulumi