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

com.pulumi.azure.eventhub.Subscription Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
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.azure.eventhub;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.eventhub.SubscriptionArgs;
import com.pulumi.azure.eventhub.inputs.SubscriptionState;
import com.pulumi.azure.eventhub.outputs.SubscriptionClientScopedSubscription;
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.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a ServiceBus Subscription.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.servicebus.Namespace;
 * import com.pulumi.azure.servicebus.NamespaceArgs;
 * import com.pulumi.azure.servicebus.Topic;
 * import com.pulumi.azure.servicebus.TopicArgs;
 * import com.pulumi.azure.servicebus.Subscription;
 * import com.pulumi.azure.servicebus.SubscriptionArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("tfex-servicebus-subscription")
 *             .location("West Europe")
 *             .build());
 * 
 *         var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
 *             .name("tfex-servicebus-namespace")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("Standard")
 *             .tags(Map.of("source", "example"))
 *             .build());
 * 
 *         var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
 *             .name("tfex_servicebus_topic")
 *             .namespaceId(exampleNamespace.id())
 *             .partitioningEnabled(true)
 *             .build());
 * 
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("tfex_servicebus_subscription")
 *             .topicId(exampleTopic.id())
 *             .maxDeliveryCount(1)
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Service Bus Subscriptions can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:eventhub/subscription:Subscription example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ServiceBus/namespaces/sbns1/topics/sntopic1/subscriptions/sbsub1 * ``` * * @deprecated * azure.eventhub.Subscription has been deprecated in favor of azure.servicebus.Subscription * */ @Deprecated /* azure.eventhub.Subscription has been deprecated in favor of azure.servicebus.Subscription */ @ResourceType(type="azure:eventhub/subscription:Subscription") public class Subscription extends com.pulumi.resources.CustomResource { /** * The idle interval after which the topic is automatically deleted as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). The minimum duration is `5` minutes or `PT5M`. Defaults to `P10675199DT2H48M5.4775807S`. * */ @Export(name="autoDeleteOnIdle", refs={String.class}, tree="[0]") private Output autoDeleteOnIdle; /** * @return The idle interval after which the topic is automatically deleted as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). The minimum duration is `5` minutes or `PT5M`. Defaults to `P10675199DT2H48M5.4775807S`. * */ public Output> autoDeleteOnIdle() { return Codegen.optional(this.autoDeleteOnIdle); } /** * Boolean flag which controls whether the Subscription supports batched operations. * */ @Export(name="batchedOperationsEnabled", refs={Boolean.class}, tree="[0]") private Output batchedOperationsEnabled; /** * @return Boolean flag which controls whether the Subscription supports batched operations. * */ public Output> batchedOperationsEnabled() { return Codegen.optional(this.batchedOperationsEnabled); } /** * A `client_scoped_subscription` block as defined below. * */ @Export(name="clientScopedSubscription", refs={SubscriptionClientScopedSubscription.class}, tree="[0]") private Output clientScopedSubscription; /** * @return A `client_scoped_subscription` block as defined below. * */ public Output> clientScopedSubscription() { return Codegen.optional(this.clientScopedSubscription); } /** * whether the subscription is scoped to a client id. Defaults to `false`. * * > **NOTE:** Client Scoped Subscription can only be used for JMS subscription (Java Message Service). * */ @Export(name="clientScopedSubscriptionEnabled", refs={Boolean.class}, tree="[0]") private Output clientScopedSubscriptionEnabled; /** * @return whether the subscription is scoped to a client id. Defaults to `false`. * * > **NOTE:** Client Scoped Subscription can only be used for JMS subscription (Java Message Service). * */ public Output> clientScopedSubscriptionEnabled() { return Codegen.optional(this.clientScopedSubscriptionEnabled); } /** * Boolean flag which controls whether the Subscription has dead letter support on filter evaluation exceptions. Defaults to `true`. * */ @Export(name="deadLetteringOnFilterEvaluationError", refs={Boolean.class}, tree="[0]") private Output deadLetteringOnFilterEvaluationError; /** * @return Boolean flag which controls whether the Subscription has dead letter support on filter evaluation exceptions. Defaults to `true`. * */ public Output> deadLetteringOnFilterEvaluationError() { return Codegen.optional(this.deadLetteringOnFilterEvaluationError); } /** * Boolean flag which controls whether the Subscription has dead letter support when a message expires. * */ @Export(name="deadLetteringOnMessageExpiration", refs={Boolean.class}, tree="[0]") private Output deadLetteringOnMessageExpiration; /** * @return Boolean flag which controls whether the Subscription has dead letter support when a message expires. * */ public Output> deadLetteringOnMessageExpiration() { return Codegen.optional(this.deadLetteringOnMessageExpiration); } /** * The Default message timespan to live as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the value used when TimeToLive is not set on a message itself. Defaults to `P10675199DT2H48M5.4775807S`. * */ @Export(name="defaultMessageTtl", refs={String.class}, tree="[0]") private Output defaultMessageTtl; /** * @return The Default message timespan to live as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the value used when TimeToLive is not set on a message itself. Defaults to `P10675199DT2H48M5.4775807S`. * */ public Output> defaultMessageTtl() { return Codegen.optional(this.defaultMessageTtl); } /** * The name of a Queue or Topic to automatically forward Dead Letter messages to. * */ @Export(name="forwardDeadLetteredMessagesTo", refs={String.class}, tree="[0]") private Output forwardDeadLetteredMessagesTo; /** * @return The name of a Queue or Topic to automatically forward Dead Letter messages to. * */ public Output> forwardDeadLetteredMessagesTo() { return Codegen.optional(this.forwardDeadLetteredMessagesTo); } /** * The name of a Queue or Topic to automatically forward messages to. * */ @Export(name="forwardTo", refs={String.class}, tree="[0]") private Output forwardTo; /** * @return The name of a Queue or Topic to automatically forward messages to. * */ public Output> forwardTo() { return Codegen.optional(this.forwardTo); } /** * The lock duration for the subscription as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). The default value is `1` minute or `P0DT0H1M0S` . The maximum value is `5` minutes or `P0DT0H5M0S` . Defaults to `PT1M`. * */ @Export(name="lockDuration", refs={String.class}, tree="[0]") private Output lockDuration; /** * @return The lock duration for the subscription as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). The default value is `1` minute or `P0DT0H1M0S` . The maximum value is `5` minutes or `P0DT0H5M0S` . Defaults to `PT1M`. * */ public Output> lockDuration() { return Codegen.optional(this.lockDuration); } /** * The maximum number of deliveries. * */ @Export(name="maxDeliveryCount", refs={Integer.class}, tree="[0]") private Output maxDeliveryCount; /** * @return The maximum number of deliveries. * */ public Output maxDeliveryCount() { return this.maxDeliveryCount; } /** * Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Specifies the name of the ServiceBus Subscription resource. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * Boolean flag which controls whether this Subscription supports the concept of a session. Changing this forces a new resource to be created. * */ @Export(name="requiresSession", refs={Boolean.class}, tree="[0]") private Output requiresSession; /** * @return Boolean flag which controls whether this Subscription supports the concept of a session. Changing this forces a new resource to be created. * */ public Output> requiresSession() { return Codegen.optional(this.requiresSession); } /** * The status of the Subscription. Possible values are `Active`,`ReceiveDisabled`, or `Disabled`. Defaults to `Active`. * */ @Export(name="status", refs={String.class}, tree="[0]") private Output status; /** * @return The status of the Subscription. Possible values are `Active`,`ReceiveDisabled`, or `Disabled`. Defaults to `Active`. * */ public Output> status() { return Codegen.optional(this.status); } /** * The ID of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created. * */ @Export(name="topicId", refs={String.class}, tree="[0]") private Output topicId; /** * @return The ID of the ServiceBus Topic to create this Subscription in. Changing this forces a new resource to be created. * */ public Output topicId() { return this.topicId; } /** * * @param name The _unique_ name of the resulting resource. */ public Subscription(java.lang.String name) { this(name, SubscriptionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Subscription(java.lang.String name, SubscriptionArgs 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 Subscription(java.lang.String name, SubscriptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:eventhub/subscription:Subscription", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Subscription(java.lang.String name, Output id, @Nullable SubscriptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:eventhub/subscription:Subscription", name, state, makeResourceOptions(options, id), false); } private static SubscriptionArgs makeArgs(SubscriptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? SubscriptionArgs.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 Subscription get(java.lang.String name, Output id, @Nullable SubscriptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Subscription(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy