com.pulumi.aws.rds.EventSubscription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.rds;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.rds.EventSubscriptionArgs;
import com.pulumi.aws.rds.inputs.EventSubscriptionState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides a DB event subscription resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.rds.Instance;
* import com.pulumi.aws.rds.InstanceArgs;
* import com.pulumi.aws.sns.Topic;
* import com.pulumi.aws.sns.TopicArgs;
* import com.pulumi.aws.rds.EventSubscription;
* import com.pulumi.aws.rds.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 default_ = new Instance("default", InstanceArgs.builder()
* .allocatedStorage(10)
* .engine("mysql")
* .engineVersion("5.6.17")
* .instanceClass("db.t2.micro")
* .dbName("mydb")
* .username("foo")
* .password("bar")
* .dbSubnetGroupName("my_database_subnet_group")
* .parameterGroupName("default.mysql5.6")
* .build());
*
* var defaultTopic = new Topic("defaultTopic", TopicArgs.builder()
* .name("rds-events")
* .build());
*
* var defaultEventSubscription = new EventSubscription("defaultEventSubscription", EventSubscriptionArgs.builder()
* .name("rds-event-sub")
* .snsTopic(defaultTopic.arn())
* .sourceType("db-instance")
* .sourceIds(default_.identifier())
* .eventCategories(
* "availability",
* "deletion",
* "failover",
* "failure",
* "low storage",
* "maintenance",
* "notification",
* "read replica",
* "recovery",
* "restoration")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import DB Event Subscriptions using the `name`. For example:
*
* ```sh
* $ pulumi import aws:rds/eventSubscription:EventSubscription default rds-event-sub
* ```
*
*/
@ResourceType(type="aws:rds/eventSubscription:EventSubscription")
public class EventSubscription extends com.pulumi.resources.CustomResource {
/**
* The Amazon Resource Name of the RDS event notification subscription
*
*/
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
/**
* @return The Amazon Resource Name of the RDS event notification subscription
*
*/
public Output arn() {
return this.arn;
}
/**
* The AWS customer account associated with the RDS event notification subscription
*
*/
@Export(name="customerAwsId", refs={String.class}, tree="[0]")
private Output customerAwsId;
/**
* @return The AWS customer account associated with the RDS event notification subscription
*
*/
public Output customerAwsId() {
return this.customerAwsId;
}
/**
* A boolean flag to enable/disable the subscription. Defaults to true.
*
*/
@Export(name="enabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enabled;
/**
* @return A boolean flag to enable/disable the subscription. Defaults to true.
*
*/
public Output> enabled() {
return Codegen.optional(this.enabled);
}
/**
* 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`.
*
*/
@Export(name="eventCategories", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> eventCategories;
/**
* @return 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`.
*
*/
public Output>> eventCategories() {
return Codegen.optional(this.eventCategories);
}
/**
* The name of the DB event subscription. By default generated by this provider.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the DB event subscription. By default generated by this provider.
*
*/
public Output name() {
return this.name;
}
/**
* The name of the DB event subscription. Conflicts with `name`.
*
*/
@Export(name="namePrefix", refs={String.class}, tree="[0]")
private Output namePrefix;
/**
* @return The name of the DB event subscription. Conflicts with `name`.
*
*/
public Output namePrefix() {
return this.namePrefix;
}
/**
* The SNS topic to send events to.
*
*/
@Export(name="snsTopic", refs={String.class}, tree="[0]")
private Output snsTopic;
/**
* @return The SNS topic to send events to.
*
*/
public Output snsTopic() {
return this.snsTopic;
}
/**
* 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.
*
*/
@Export(name="sourceIds", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> sourceIds;
/**
* @return 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.
*
*/
public Output>> sourceIds() {
return Codegen.optional(this.sourceIds);
}
/**
* 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`, `db-cluster-snapshot`, or `db-proxy`. If not set, all sources will be subscribed to.
*
*/
@Export(name="sourceType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceType;
/**
* @return 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`, `db-cluster-snapshot`, or `db-proxy`. If not set, all sources will be subscribed to.
*
*/
public Output> sourceType() {
return Codegen.optional(this.sourceType);
}
/**
* A map of 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.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A map of 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.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
* @deprecated
* Please use `tags` instead.
*
*/
@Deprecated /* Please use `tags` instead. */
@Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy