1. Packages
  2. AWS
  3. API Docs
  4. dms
  5. EventSubscription
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.dms.EventSubscription

Explore with Pulumi AI

Provides a DMS (Data Migration Service) event subscription resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.dms.EventSubscription("example", {
    enabled: true,
    eventCategories: [
        "creation",
        "failure",
    ],
    name: "my-favorite-event-subscription",
    snsTopicArn: exampleAwsSnsTopic.arn,
    sourceIds: [exampleAwsDmsReplicationTask.replicationTaskId],
    sourceType: "replication-task",
    tags: {
        Name: "example",
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.dms.EventSubscription("example",
    enabled=True,
    event_categories=[
        "creation",
        "failure",
    ],
    name="my-favorite-event-subscription",
    sns_topic_arn=example_aws_sns_topic["arn"],
    source_ids=[example_aws_dms_replication_task["replicationTaskId"]],
    source_type="replication-task",
    tags={
        "Name": "example",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dms.NewEventSubscription(ctx, "example", &dms.EventSubscriptionArgs{
			Enabled: pulumi.Bool(true),
			EventCategories: pulumi.StringArray{
				pulumi.String("creation"),
				pulumi.String("failure"),
			},
			Name:        pulumi.String("my-favorite-event-subscription"),
			SnsTopicArn: pulumi.Any(exampleAwsSnsTopic.Arn),
			SourceIds: pulumi.StringArray{
				exampleAwsDmsReplicationTask.ReplicationTaskId,
			},
			SourceType: pulumi.String("replication-task"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("example"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Dms.EventSubscription("example", new()
    {
        Enabled = true,
        EventCategories = new[]
        {
            "creation",
            "failure",
        },
        Name = "my-favorite-event-subscription",
        SnsTopicArn = exampleAwsSnsTopic.Arn,
        SourceIds = new[]
        {
            exampleAwsDmsReplicationTask.ReplicationTaskId,
        },
        SourceType = "replication-task",
        Tags = 
        {
            { "Name", "example" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.dms.EventSubscription;
import com.pulumi.aws.dms.EventSubscriptionArgs;
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 example = new EventSubscription("example", EventSubscriptionArgs.builder()
            .enabled(true)
            .eventCategories(            
                "creation",
                "failure")
            .name("my-favorite-event-subscription")
            .snsTopicArn(exampleAwsSnsTopic.arn())
            .sourceIds(exampleAwsDmsReplicationTask.replicationTaskId())
            .sourceType("replication-task")
            .tags(Map.of("Name", "example"))
            .build());

    }
}
Copy
resources:
  example:
    type: aws:dms:EventSubscription
    properties:
      enabled: true
      eventCategories:
        - creation
        - failure
      name: my-favorite-event-subscription
      snsTopicArn: ${exampleAwsSnsTopic.arn}
      sourceIds:
        - ${exampleAwsDmsReplicationTask.replicationTaskId}
      sourceType: replication-task
      tags:
        Name: example
Copy

Create EventSubscription Resource

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

Constructor syntax

new EventSubscription(name: string, args: EventSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def EventSubscription(resource_name: str,
                      args: EventSubscriptionArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def EventSubscription(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      event_categories: Optional[Sequence[str]] = None,
                      sns_topic_arn: Optional[str] = None,
                      source_type: Optional[str] = None,
                      enabled: Optional[bool] = None,
                      name: Optional[str] = None,
                      source_ids: Optional[Sequence[str]] = None,
                      tags: Optional[Mapping[str, str]] = None)
func NewEventSubscription(ctx *Context, name string, args EventSubscriptionArgs, opts ...ResourceOption) (*EventSubscription, error)
public EventSubscription(string name, EventSubscriptionArgs args, CustomResourceOptions? opts = null)
public EventSubscription(String name, EventSubscriptionArgs args)
public EventSubscription(String name, EventSubscriptionArgs args, CustomResourceOptions options)
type: aws:dms:EventSubscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EventSubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EventSubscriptionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EventSubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EventSubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EventSubscriptionArgs
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 eventSubscriptionResource = new Aws.Dms.EventSubscription("eventSubscriptionResource", new()
{
    EventCategories = new[]
    {
        "string",
    },
    SnsTopicArn = "string",
    SourceType = "string",
    Enabled = false,
    Name = "string",
    SourceIds = new[]
    {
        "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := dms.NewEventSubscription(ctx, "eventSubscriptionResource", &dms.EventSubscriptionArgs{
	EventCategories: pulumi.StringArray{
		pulumi.String("string"),
	},
	SnsTopicArn: pulumi.String("string"),
	SourceType:  pulumi.String("string"),
	Enabled:     pulumi.Bool(false),
	Name:        pulumi.String("string"),
	SourceIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var eventSubscriptionResource = new EventSubscription("eventSubscriptionResource", EventSubscriptionArgs.builder()
    .eventCategories("string")
    .snsTopicArn("string")
    .sourceType("string")
    .enabled(false)
    .name("string")
    .sourceIds("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
event_subscription_resource = aws.dms.EventSubscription("eventSubscriptionResource",
    event_categories=["string"],
    sns_topic_arn="string",
    source_type="string",
    enabled=False,
    name="string",
    source_ids=["string"],
    tags={
        "string": "string",
    })
Copy
const eventSubscriptionResource = new aws.dms.EventSubscription("eventSubscriptionResource", {
    eventCategories: ["string"],
    snsTopicArn: "string",
    sourceType: "string",
    enabled: false,
    name: "string",
    sourceIds: ["string"],
    tags: {
        string: "string",
    },
});
Copy
type: aws:dms:EventSubscription
properties:
    enabled: false
    eventCategories:
        - string
    name: string
    snsTopicArn: string
    sourceIds:
        - string
    sourceType: string
    tags:
        string: string
Copy

EventSubscription 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 EventSubscription resource accepts the following input properties:

EventCategories This property is required. List<string>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
SnsTopicArn This property is required. string
SNS topic arn to send events on.
SourceType
This property is required.
Changes to this property will trigger replacement.
string
Type of source for events. Valid values: replication-instance or replication-task
Enabled bool
Whether the event subscription should be enabled.
Name Changes to this property will trigger replacement. string
Name of event subscription.
SourceIds Changes to this property will trigger replacement. List<string>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
Tags Dictionary<string, string>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
EventCategories This property is required. []string
List of event categories to listen for, see DescribeEventCategories for a canonical list.
SnsTopicArn This property is required. string
SNS topic arn to send events on.
SourceType
This property is required.
Changes to this property will trigger replacement.
string
Type of source for events. Valid values: replication-instance or replication-task
Enabled bool
Whether the event subscription should be enabled.
Name Changes to this property will trigger replacement. string
Name of event subscription.
SourceIds Changes to this property will trigger replacement. []string
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
Tags map[string]string
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
eventCategories This property is required. List<String>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
snsTopicArn This property is required. String
SNS topic arn to send events on.
sourceType
This property is required.
Changes to this property will trigger replacement.
String
Type of source for events. Valid values: replication-instance or replication-task
enabled Boolean
Whether the event subscription should be enabled.
name Changes to this property will trigger replacement. String
Name of event subscription.
sourceIds Changes to this property will trigger replacement. List<String>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
tags Map<String,String>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
eventCategories This property is required. string[]
List of event categories to listen for, see DescribeEventCategories for a canonical list.
snsTopicArn This property is required. string
SNS topic arn to send events on.
sourceType
This property is required.
Changes to this property will trigger replacement.
string
Type of source for events. Valid values: replication-instance or replication-task
enabled boolean
Whether the event subscription should be enabled.
name Changes to this property will trigger replacement. string
Name of event subscription.
sourceIds Changes to this property will trigger replacement. string[]
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
tags {[key: string]: string}
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
event_categories This property is required. Sequence[str]
List of event categories to listen for, see DescribeEventCategories for a canonical list.
sns_topic_arn This property is required. str
SNS topic arn to send events on.
source_type
This property is required.
Changes to this property will trigger replacement.
str
Type of source for events. Valid values: replication-instance or replication-task
enabled bool
Whether the event subscription should be enabled.
name Changes to this property will trigger replacement. str
Name of event subscription.
source_ids Changes to this property will trigger replacement. Sequence[str]
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
tags Mapping[str, str]
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
eventCategories This property is required. List<String>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
snsTopicArn This property is required. String
SNS topic arn to send events on.
sourceType
This property is required.
Changes to this property will trigger replacement.
String
Type of source for events. Valid values: replication-instance or replication-task
enabled Boolean
Whether the event subscription should be enabled.
name Changes to this property will trigger replacement. String
Name of event subscription.
sourceIds Changes to this property will trigger replacement. List<String>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
tags Map<String>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

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

Arn string
Amazon Resource Name (ARN) of the DMS Event Subscription.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
Amazon Resource Name (ARN) of the DMS Event Subscription.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
Amazon Resource Name (ARN) of the DMS Event Subscription.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
Amazon Resource Name (ARN) of the DMS Event Subscription.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
Amazon Resource Name (ARN) of the DMS Event Subscription.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
Amazon Resource Name (ARN) of the DMS Event Subscription.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing EventSubscription Resource

Get an existing EventSubscription 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?: EventSubscriptionState, opts?: CustomResourceOptions): EventSubscription
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        enabled: Optional[bool] = None,
        event_categories: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        sns_topic_arn: Optional[str] = None,
        source_ids: Optional[Sequence[str]] = None,
        source_type: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> EventSubscription
func GetEventSubscription(ctx *Context, name string, id IDInput, state *EventSubscriptionState, opts ...ResourceOption) (*EventSubscription, error)
public static EventSubscription Get(string name, Input<string> id, EventSubscriptionState? state, CustomResourceOptions? opts = null)
public static EventSubscription get(String name, Output<String> id, EventSubscriptionState state, CustomResourceOptions options)
resources:  _:    type: aws:dms:EventSubscription    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Amazon Resource Name (ARN) of the DMS Event Subscription.
Enabled bool
Whether the event subscription should be enabled.
EventCategories List<string>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
Name Changes to this property will trigger replacement. string
Name of event subscription.
SnsTopicArn string
SNS topic arn to send events on.
SourceIds Changes to this property will trigger replacement. List<string>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
SourceType Changes to this property will trigger replacement. string
Type of source for events. Valid values: replication-instance or replication-task
Tags Dictionary<string, string>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
Amazon Resource Name (ARN) of the DMS Event Subscription.
Enabled bool
Whether the event subscription should be enabled.
EventCategories []string
List of event categories to listen for, see DescribeEventCategories for a canonical list.
Name Changes to this property will trigger replacement. string
Name of event subscription.
SnsTopicArn string
SNS topic arn to send events on.
SourceIds Changes to this property will trigger replacement. []string
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
SourceType Changes to this property will trigger replacement. string
Type of source for events. Valid values: replication-instance or replication-task
Tags map[string]string
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
Amazon Resource Name (ARN) of the DMS Event Subscription.
enabled Boolean
Whether the event subscription should be enabled.
eventCategories List<String>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
name Changes to this property will trigger replacement. String
Name of event subscription.
snsTopicArn String
SNS topic arn to send events on.
sourceIds Changes to this property will trigger replacement. List<String>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
sourceType Changes to this property will trigger replacement. String
Type of source for events. Valid values: replication-instance or replication-task
tags Map<String,String>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
Amazon Resource Name (ARN) of the DMS Event Subscription.
enabled boolean
Whether the event subscription should be enabled.
eventCategories string[]
List of event categories to listen for, see DescribeEventCategories for a canonical list.
name Changes to this property will trigger replacement. string
Name of event subscription.
snsTopicArn string
SNS topic arn to send events on.
sourceIds Changes to this property will trigger replacement. string[]
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
sourceType Changes to this property will trigger replacement. string
Type of source for events. Valid values: replication-instance or replication-task
tags {[key: string]: string}
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
Amazon Resource Name (ARN) of the DMS Event Subscription.
enabled bool
Whether the event subscription should be enabled.
event_categories Sequence[str]
List of event categories to listen for, see DescribeEventCategories for a canonical list.
name Changes to this property will trigger replacement. str
Name of event subscription.
sns_topic_arn str
SNS topic arn to send events on.
source_ids Changes to this property will trigger replacement. Sequence[str]
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
source_type Changes to this property will trigger replacement. str
Type of source for events. Valid values: replication-instance or replication-task
tags Mapping[str, str]
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
Amazon Resource Name (ARN) of the DMS Event Subscription.
enabled Boolean
Whether the event subscription should be enabled.
eventCategories List<String>
List of event categories to listen for, see DescribeEventCategories for a canonical list.
name Changes to this property will trigger replacement. String
Name of event subscription.
snsTopicArn String
SNS topic arn to send events on.
sourceIds Changes to this property will trigger replacement. List<String>
Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
sourceType Changes to this property will trigger replacement. String
Type of source for events. Valid values: replication-instance or replication-task
tags Map<String>
Map of resource tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Import

Using pulumi import, import event subscriptions using the name. For example:

$ pulumi import aws:dms/eventSubscription:EventSubscription test my-awesome-event-subscription
Copy

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.