com.pulumi.azure.servicebus.NamespaceAuthorizationRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
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.
// *** 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.servicebus;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.servicebus.NamespaceAuthorizationRuleArgs;
import com.pulumi.azure.servicebus.inputs.NamespaceAuthorizationRuleState;
import com.pulumi.core.Alias;
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.Optional;
import javax.annotation.Nullable;
/**
* Manages a ServiceBus Namespace authorization Rule within a ServiceBus.
*
* ## 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.NamespaceAuthorizationRule;
* import com.pulumi.azure.servicebus.NamespaceAuthorizationRuleArgs;
* 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("my-servicebus")
* .location("West US")
* .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 exampleNamespaceAuthorizationRule = new NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", NamespaceAuthorizationRuleArgs.builder()
* .name("examplerule")
* .namespaceId(exampleNamespace.id())
* .listen(true)
* .send(true)
* .manage(false)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:servicebus/namespaceAuthorizationRule:NamespaceAuthorizationRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/namespace1/authorizationRules/rule1
* ```
*
*/
@ResourceType(type="azure:servicebus/namespaceAuthorizationRule:NamespaceAuthorizationRule")
public class NamespaceAuthorizationRule extends com.pulumi.resources.CustomResource {
/**
* Grants listen access to this this Authorization Rule. Defaults to `false`.
*
*/
@Export(name="listen", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> listen;
/**
* @return Grants listen access to this this Authorization Rule. Defaults to `false`.
*
*/
public Output> listen() {
return Codegen.optional(this.listen);
}
/**
* Grants manage access to this this Authorization Rule. When this property is `true` - both `listen` and `send` must be too. Defaults to `false`.
*
*/
@Export(name="manage", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> manage;
/**
* @return Grants manage access to this this Authorization Rule. When this property is `true` - both `listen` and `send` must be too. Defaults to `false`.
*
*/
public Output> manage() {
return Codegen.optional(this.manage);
}
/**
* Specifies the name of the ServiceBus Namespace Authorization Rule 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 Namespace Authorization Rule resource. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* Specifies the ID of the ServiceBus Namespace. Changing this forces a new resource to be created.
*
* > **NOTE** At least one of the 3 permissions below needs to be set.
*
*/
@Export(name="namespaceId", refs={String.class}, tree="[0]")
private Output namespaceId;
/**
* @return Specifies the ID of the ServiceBus Namespace. Changing this forces a new resource to be created.
*
* > **NOTE** At least one of the 3 permissions below needs to be set.
*
*/
public Output namespaceId() {
return this.namespaceId;
}
/**
* The Primary Connection String for the ServiceBus Namespace authorization Rule.
*
*/
@Export(name="primaryConnectionString", refs={String.class}, tree="[0]")
private Output primaryConnectionString;
/**
* @return The Primary Connection String for the ServiceBus Namespace authorization Rule.
*
*/
public Output primaryConnectionString() {
return this.primaryConnectionString;
}
/**
* The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
*
*/
@Export(name="primaryConnectionStringAlias", refs={String.class}, tree="[0]")
private Output primaryConnectionStringAlias;
/**
* @return The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
*
*/
public Output primaryConnectionStringAlias() {
return this.primaryConnectionStringAlias;
}
/**
* The Primary Key for the ServiceBus Namespace authorization Rule.
*
*/
@Export(name="primaryKey", refs={String.class}, tree="[0]")
private Output primaryKey;
/**
* @return The Primary Key for the ServiceBus Namespace authorization Rule.
*
*/
public Output primaryKey() {
return this.primaryKey;
}
/**
* The Secondary Connection String for the ServiceBus Namespace authorization Rule.
*
*/
@Export(name="secondaryConnectionString", refs={String.class}, tree="[0]")
private Output secondaryConnectionString;
/**
* @return The Secondary Connection String for the ServiceBus Namespace authorization Rule.
*
*/
public Output secondaryConnectionString() {
return this.secondaryConnectionString;
}
/**
* The alias Secondary Connection String for the ServiceBus Namespace
*
*/
@Export(name="secondaryConnectionStringAlias", refs={String.class}, tree="[0]")
private Output secondaryConnectionStringAlias;
/**
* @return The alias Secondary Connection String for the ServiceBus Namespace
*
*/
public Output secondaryConnectionStringAlias() {
return this.secondaryConnectionStringAlias;
}
/**
* The Secondary Key for the ServiceBus Namespace authorization Rule.
*
*/
@Export(name="secondaryKey", refs={String.class}, tree="[0]")
private Output secondaryKey;
/**
* @return The Secondary Key for the ServiceBus Namespace authorization Rule.
*
*/
public Output secondaryKey() {
return this.secondaryKey;
}
/**
* Grants send access to this this Authorization Rule. Defaults to `false`.
*
*/
@Export(name="send", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> send;
/**
* @return Grants send access to this this Authorization Rule. Defaults to `false`.
*
*/
public Output> send() {
return Codegen.optional(this.send);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public NamespaceAuthorizationRule(java.lang.String name) {
this(name, NamespaceAuthorizationRuleArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public NamespaceAuthorizationRule(java.lang.String name, NamespaceAuthorizationRuleArgs 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 NamespaceAuthorizationRule(java.lang.String name, NamespaceAuthorizationRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:servicebus/namespaceAuthorizationRule:NamespaceAuthorizationRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private NamespaceAuthorizationRule(java.lang.String name, Output id, @Nullable NamespaceAuthorizationRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:servicebus/namespaceAuthorizationRule:NamespaceAuthorizationRule", name, state, makeResourceOptions(options, id), false);
}
private static NamespaceAuthorizationRuleArgs makeArgs(NamespaceAuthorizationRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? NamespaceAuthorizationRuleArgs.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())
.aliases(List.of(
Output.of(Alias.builder().type("azure:eventhub/namespaceAuthorizationRule:NamespaceAuthorizationRule").build())
))
.additionalSecretOutputs(List.of(
"primaryConnectionString",
"primaryConnectionStringAlias",
"primaryKey",
"secondaryConnectionString",
"secondaryConnectionStringAlias",
"secondaryKey"
))
.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 NamespaceAuthorizationRule get(java.lang.String name, Output id, @Nullable NamespaceAuthorizationRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new NamespaceAuthorizationRule(name, id, state, options);
}
}