EventSubscription

Provides a DB event subscription resource.

Attributes

The following additional atttributes are provided:

  • id - The name of the RDS event notification subscription
  • arn - The Amazon Resource Name of the RDS event notification subscription
  • customer_aws_id - The AWS customer account associated with the RDS event notification subscription

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultInstance = new Aws.Rds.Instance("defaultInstance", new Aws.Rds.InstanceArgs
        {
            AllocatedStorage = 10,
            DbSubnetGroupName = "my_database_subnet_group",
            Engine = "mysql",
            EngineVersion = "5.6.17",
            InstanceClass = "db.t2.micro",
            Name = "mydb",
            ParameterGroupName = "default.mysql5.6",
            Password = "bar",
            Username = "foo",
        });
        var defaultTopic = new Aws.Sns.Topic("defaultTopic", new Aws.Sns.TopicArgs
        {
        });
        var defaultEventSubscription = new Aws.Rds.EventSubscription("defaultEventSubscription", new Aws.Rds.EventSubscriptionArgs
        {
            EventCategories = 
            {
                "availability",
                "deletion",
                "failover",
                "failure",
                "low storage",
                "maintenance",
                "notification",
                "read replica",
                "recovery",
                "restoration",
            },
            SnsTopic = defaultTopic.Arn,
            SourceIds = 
            {
                defaultInstance.Id,
            },
            SourceType = "db-instance",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/rds"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/sns"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        defaultInstance, err := rds.NewInstance(ctx, "defaultInstance", &rds.InstanceArgs{
            AllocatedStorage:   pulumi.Int(10),
            DbSubnetGroupName:  pulumi.String("my_database_subnet_group"),
            Engine:             pulumi.String("mysql"),
            EngineVersion:      pulumi.String("5.6.17"),
            InstanceClass:      pulumi.String("db.t2.micro"),
            Name:               pulumi.String("mydb"),
            ParameterGroupName: pulumi.String("default.mysql5.6"),
            Password:           pulumi.String("bar"),
            Username:           pulumi.String("foo"),
        })
        if err != nil {
            return err
        }
        defaultTopic, err := sns.NewTopic(ctx, "defaultTopic", nil)
        if err != nil {
            return err
        }
        _, err = rds.NewEventSubscription(ctx, "defaultEventSubscription", &rds.EventSubscriptionArgs{
            EventCategories: pulumi.StringArray{
                pulumi.String("availability"),
                pulumi.String("deletion"),
                pulumi.String("failover"),
                pulumi.String("failure"),
                pulumi.String("low storage"),
                pulumi.String("maintenance"),
                pulumi.String("notification"),
                pulumi.String("read replica"),
                pulumi.String("recovery"),
                pulumi.String("restoration"),
            },
            SnsTopic: defaultTopic.Arn,
            SourceIds: pulumi.StringArray{
                defaultInstance.ID(),
            },
            SourceType: pulumi.String("db-instance"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

default_instance = aws.rds.Instance("defaultInstance",
    allocated_storage=10,
    db_subnet_group_name="my_database_subnet_group",
    engine="mysql",
    engine_version="5.6.17",
    instance_class="db.t2.micro",
    name="mydb",
    parameter_group_name="default.mysql5.6",
    password="bar",
    username="foo")
default_topic = aws.sns.Topic("defaultTopic")
default_event_subscription = aws.rds.EventSubscription("defaultEventSubscription",
    event_categories=[
        "availability",
        "deletion",
        "failover",
        "failure",
        "low storage",
        "maintenance",
        "notification",
        "read replica",
        "recovery",
        "restoration",
    ],
    sns_topic=default_topic.arn,
    source_ids=[default_instance.id],
    source_type="db-instance")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultInstance = new aws.rds.Instance("default", {
    allocatedStorage: 10,
    dbSubnetGroupName: "my_database_subnet_group",
    engine: "mysql",
    engineVersion: "5.6.17",
    instanceClass: "db.t2.micro",
    name: "mydb",
    parameterGroupName: "default.mysql5.6",
    password: "bar",
    username: "foo",
});
const defaultTopic = new aws.sns.Topic("default", {});
const defaultEventSubscription = new aws.rds.EventSubscription("default", {
    eventCategories: [
        "availability",
        "deletion",
        "failover",
        "failure",
        "low storage",
        "maintenance",
        "notification",
        "read replica",
        "recovery",
        "restoration",
    ],
    snsTopic: defaultTopic.arn,
    sourceIds: [defaultInstance.id],
    sourceType: "db-instance",
});

Create a EventSubscription Resource

def EventSubscription(resource_name, opts=None, enabled=None, event_categories=None, name=None, name_prefix=None, sns_topic=None, source_ids=None, source_type=None, tags=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

EventSubscription Resource Properties

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

Inputs

The EventSubscription resource accepts the following input properties:

SnsTopic string

The SNS topic to send events to.

Enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

EventCategories List<string>

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

Name string

The name of the DB event subscription. By default generated by this provider.

NamePrefix string

The name of the DB event subscription. Conflicts with name.

SourceIds List<string>

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

SourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

SnsTopic string

The SNS topic to send events to.

Enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

EventCategories []string

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

Name string

The name of the DB event subscription. By default generated by this provider.

NamePrefix string

The name of the DB event subscription. Conflicts with name.

SourceIds []string

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

SourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

Tags map[string]string

A map of tags to assign to the resource.

snsTopic string

The SNS topic to send events to.

enabled boolean

A boolean flag to enable/disable the subscription. Defaults to true.

eventCategories string[]

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

name string

The name of the DB event subscription. By default generated by this provider.

namePrefix string

The name of the DB event subscription. Conflicts with name.

sourceIds string[]

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

sourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

tags {[key: string]: string}

A map of tags to assign to the resource.

sns_topic str

The SNS topic to send events to.

enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

event_categories List[str]

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

name str

The name of the DB event subscription. By default generated by this provider.

name_prefix str

The name of the DB event subscription. Conflicts with name.

source_ids List[str]

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

source_type str

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

tags Dict[str, str]

A map of tags to assign to the resource.

Outputs

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

Arn string
CustomerAwsId string
Id string
The provider-assigned unique ID for this managed resource.
Arn string
CustomerAwsId string
Id string
The provider-assigned unique ID for this managed resource.
arn string
customerAwsId string
id string
The provider-assigned unique ID for this managed resource.
arn str
customer_aws_id str
id str
The provider-assigned unique ID for this managed resource.

Look up an 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
static get(resource_name, id, opts=None, arn=None, customer_aws_id=None, enabled=None, event_categories=None, name=None, name_prefix=None, sns_topic=None, source_ids=None, source_type=None, tags=None, __props__=None);
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)
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.

The following state arguments are supported:

Arn string
CustomerAwsId string
Enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

EventCategories List<string>

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

Name string

The name of the DB event subscription. By default generated by this provider.

NamePrefix string

The name of the DB event subscription. Conflicts with name.

SnsTopic string

The SNS topic to send events to.

SourceIds List<string>

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

SourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Arn string
CustomerAwsId string
Enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

EventCategories []string

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

Name string

The name of the DB event subscription. By default generated by this provider.

NamePrefix string

The name of the DB event subscription. Conflicts with name.

SnsTopic string

The SNS topic to send events to.

SourceIds []string

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

SourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

Tags map[string]string

A map of tags to assign to the resource.

arn string
customerAwsId string
enabled boolean

A boolean flag to enable/disable the subscription. Defaults to true.

eventCategories string[]

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

name string

The name of the DB event subscription. By default generated by this provider.

namePrefix string

The name of the DB event subscription. Conflicts with name.

snsTopic string

The SNS topic to send events to.

sourceIds string[]

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

sourceType string

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

tags {[key: string]: string}

A map of tags to assign to the resource.

arn str
customer_aws_id str
enabled bool

A boolean flag to enable/disable the subscription. Defaults to true.

event_categories List[str]

A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html or run aws rds describe-event-categories.

name str

The name of the DB event subscription. By default generated by this provider.

name_prefix str

The name of the DB event subscription. Conflicts with name.

sns_topic str

The SNS topic to send events to.

source_ids List[str]

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a source_type must also be specified.

source_type str

The type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot. If not set, all sources will be subscribed to.

tags Dict[str, str]

A map of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.