All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.rds.EventSubscription Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.60.0-alpha.1731982519
Show newest version
// *** 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 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> 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> 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 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> 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> tagsAll; /** * @return A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * * @param name The _unique_ name of the resulting resource. */ public EventSubscription(java.lang.String name) { this(name, EventSubscriptionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public EventSubscription(java.lang.String name, EventSubscriptionArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public EventSubscription(java.lang.String name, EventSubscriptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:rds/eventSubscription:EventSubscription", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private EventSubscription(java.lang.String name, Output id, @Nullable EventSubscriptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:rds/eventSubscription:EventSubscription", name, state, makeResourceOptions(options, id), false); } private static EventSubscriptionArgs makeArgs(EventSubscriptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? EventSubscriptionArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static EventSubscription get(java.lang.String name, Output id, @Nullable EventSubscriptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new EventSubscription(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy