1. Packages
  2. AWS Classic
  3. API Docs
  4. dms
  5. EventSubscription

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

aws.dms.EventSubscription

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

    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",
        },
    });
    
    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",
        })
    
    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
    	})
    }
    
    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" },
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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 string
    The unique name of the resource.
    args EventSubscriptionArgs
    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 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 string
    The unique name of the resource.
    args EventSubscriptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EventSubscriptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EventSubscriptionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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" },
        },
    });
    
    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"),
    	},
    })
    
    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());
    
    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",
        })
    
    const eventSubscriptionResource = new aws.dms.EventSubscription("eventSubscriptionResource", {
        eventCategories: ["string"],
        snsTopicArn: "string",
        sourceType: "string",
        enabled: false,
        name: "string",
        sourceIds: ["string"],
        tags: {
            string: "string",
        },
    });
    
    type: aws:dms:EventSubscription
    properties:
        enabled: false
        eventCategories:
            - string
        name: string
        snsTopicArn: string
        sourceIds:
            - string
        sourceType: string
        tags:
            string: string
    

    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

    The EventSubscription resource accepts the following input properties:

    EventCategories List<string>
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    SnsTopicArn string
    SNS topic arn to send events on.
    SourceType string
    Type of source for events. Valid values: replication-instance or replication-task
    Enabled bool
    Whether the event subscription should be enabled.
    Name string
    Name of event subscription.
    SourceIds 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 []string
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    SnsTopicArn string
    SNS topic arn to send events on.
    SourceType string
    Type of source for events. Valid values: replication-instance or replication-task
    Enabled bool
    Whether the event subscription should be enabled.
    Name string
    Name of event subscription.
    SourceIds []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 List<String>
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    snsTopicArn String
    SNS topic arn to send events on.
    sourceType String
    Type of source for events. Valid values: replication-instance or replication-task
    enabled Boolean
    Whether the event subscription should be enabled.
    name String
    Name of event subscription.
    sourceIds 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 string[]
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    snsTopicArn string
    SNS topic arn to send events on.
    sourceType string
    Type of source for events. Valid values: replication-instance or replication-task
    enabled boolean
    Whether the event subscription should be enabled.
    name string
    Name of event subscription.
    sourceIds 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 Sequence[str]
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    sns_topic_arn str
    SNS topic arn to send events on.
    source_type str
    Type of source for events. Valid values: replication-instance or replication-task
    enabled bool
    Whether the event subscription should be enabled.
    name str
    Name of event subscription.
    source_ids 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 List<String>
    List of event categories to listen for, see DescribeEventCategories for a canonical list.
    snsTopicArn String
    SNS topic arn to send events on.
    sourceType String
    Type of source for events. Valid values: replication-instance or replication-task
    enabled Boolean
    Whether the event subscription should be enabled.
    name String
    Name of event subscription.
    sourceIds 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)
    Resource lookup is not supported in YAML
    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
    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 string
    Name of event subscription.
    SnsTopicArn string
    SNS topic arn to send events on.
    SourceIds List<string>
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    SourceType 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 string
    Name of event subscription.
    SnsTopicArn string
    SNS topic arn to send events on.
    SourceIds []string
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    SourceType 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 String
    Name of event subscription.
    snsTopicArn String
    SNS topic arn to send events on.
    sourceIds List<String>
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    sourceType 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 string
    Name of event subscription.
    snsTopicArn string
    SNS topic arn to send events on.
    sourceIds string[]
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    sourceType 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 str
    Name of event subscription.
    sns_topic_arn str
    SNS topic arn to send events on.
    source_ids Sequence[str]
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    source_type 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 String
    Name of event subscription.
    snsTopicArn String
    SNS topic arn to send events on.
    sourceIds List<String>
    Ids of sources to listen to. If you don't specify a value, notifications are provided for all sources.
    sourceType 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
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi