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

com.pulumi.azure.cosmosdb.MongoRoleDefinition Maven / Gradle / Ivy

// *** 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.cosmosdb;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.cosmosdb.MongoRoleDefinitionArgs;
import com.pulumi.azure.cosmosdb.inputs.MongoRoleDefinitionState;
import com.pulumi.azure.cosmosdb.outputs.MongoRoleDefinitionPrivilege;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Cosmos DB Mongo Role Definition.
 * 
 * ## 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.cosmosdb.Account;
 * import com.pulumi.azure.cosmosdb.AccountArgs;
 * import com.pulumi.azure.cosmosdb.inputs.AccountCapabilityArgs;
 * import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
 * import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
 * import com.pulumi.azure.cosmosdb.MongoDatabase;
 * import com.pulumi.azure.cosmosdb.MongoDatabaseArgs;
 * import com.pulumi.azure.cosmosdb.MongoRoleDefinition;
 * import com.pulumi.azure.cosmosdb.MongoRoleDefinitionArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 * 
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("example-ca")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .offerType("Standard")
 *             .kind("MongoDB")
 *             .capabilities(            
 *                 AccountCapabilityArgs.builder()
 *                     .name("EnableMongo")
 *                     .build(),
 *                 AccountCapabilityArgs.builder()
 *                     .name("EnableMongoRoleBasedAccessControl")
 *                     .build())
 *             .consistencyPolicy(AccountConsistencyPolicyArgs.builder()
 *                 .consistencyLevel("Strong")
 *                 .build())
 *             .geoLocations(AccountGeoLocationArgs.builder()
 *                 .location(example.location())
 *                 .failoverPriority(0)
 *                 .build())
 *             .build());
 * 
 *         var exampleMongoDatabase = new MongoDatabase("exampleMongoDatabase", MongoDatabaseArgs.builder()
 *             .name("example-mongodb")
 *             .resourceGroupName(exampleAccount.resourceGroupName())
 *             .accountName(exampleAccount.name())
 *             .build());
 * 
 *         var exampleMongoRoleDefinition = new MongoRoleDefinition("exampleMongoRoleDefinition", MongoRoleDefinitionArgs.builder()
 *             .cosmosMongoDatabaseId(exampleMongoDatabase.id())
 *             .roleName("example-roledefinition")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbRoleDefinitions/dbname1.rolename1 * ``` * */ @ResourceType(type="azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition") public class MongoRoleDefinition extends com.pulumi.resources.CustomResource { /** * The resource ID of the Mongo DB. Changing this forces a new resource to be created. * */ @Export(name="cosmosMongoDatabaseId", refs={String.class}, tree="[0]") private Output cosmosMongoDatabaseId; /** * @return The resource ID of the Mongo DB. Changing this forces a new resource to be created. * */ public Output cosmosMongoDatabaseId() { return this.cosmosMongoDatabaseId; } /** * A list of Mongo Roles which are inherited to the Mongo Role Definition. * * > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmos_mongo_database_id`. * */ @Export(name="inheritedRoleNames", refs={List.class,String.class}, tree="[0,1]") private Output> inheritedRoleNames; /** * @return A list of Mongo Roles which are inherited to the Mongo Role Definition. * * > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmos_mongo_database_id`. * */ public Output>> inheritedRoleNames() { return Codegen.optional(this.inheritedRoleNames); } /** * A `privilege` block as defined below. * */ @Export(name="privileges", refs={List.class,MongoRoleDefinitionPrivilege.class}, tree="[0,1]") private Output> privileges; /** * @return A `privilege` block as defined below. * */ public Output>> privileges() { return Codegen.optional(this.privileges); } /** * The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created. * */ @Export(name="roleName", refs={String.class}, tree="[0]") private Output roleName; /** * @return The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created. * */ public Output roleName() { return this.roleName; } /** * * @param name The _unique_ name of the resulting resource. */ public MongoRoleDefinition(java.lang.String name) { this(name, MongoRoleDefinitionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public MongoRoleDefinition(java.lang.String name, MongoRoleDefinitionArgs 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 MongoRoleDefinition(java.lang.String name, MongoRoleDefinitionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private MongoRoleDefinition(java.lang.String name, Output id, @Nullable MongoRoleDefinitionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition", name, state, makeResourceOptions(options, id), false); } private static MongoRoleDefinitionArgs makeArgs(MongoRoleDefinitionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? MongoRoleDefinitionArgs.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 MongoRoleDefinition get(java.lang.String name, Output id, @Nullable MongoRoleDefinitionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new MongoRoleDefinition(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy