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

com.pulumi.azure.webpubsub.CustomDomain 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.webpubsub;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.webpubsub.CustomDomainArgs;
import com.pulumi.azure.webpubsub.inputs.CustomDomainState;
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 javax.annotation.Nullable;

/**
 * Manages an Azure Web PubSub Custom Domain.
 * 
 * ## 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.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.webpubsub.Service;
 * import com.pulumi.azure.webpubsub.ServiceArgs;
 * import com.pulumi.azure.webpubsub.inputs.ServiceIdentityArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
 * import com.pulumi.azure.keyvault.Certificate;
 * import com.pulumi.azure.keyvault.CertificateArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificateArgs;
 * import com.pulumi.azure.webpubsub.CustomCertificate;
 * import com.pulumi.azure.webpubsub.CustomCertificateArgs;
 * import com.pulumi.azure.webpubsub.CustomDomain;
 * import com.pulumi.azure.webpubsub.CustomDomainArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 * 
 *         var exampleService = new Service("exampleService", ServiceArgs.builder()
 *             .name("example-webpubsub")
 *             .location(testAzurermResourceGroup.location())
 *             .resourceGroupName(testAzurermResourceGroup.name())
 *             .sku(Map.ofEntries(
 *                 Map.entry("name", "Premium_P1"),
 *                 Map.entry("capacity", 1)
 *             ))
 *             .identity(ServiceIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 * 
 *         var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
 *             .name("examplekeyvault")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .skuName("premium")
 *             .accessPolicies(            
 *                 KeyVaultAccessPolicyArgs.builder()
 *                     .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *                     .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
 *                     .certificatePermissions(                    
 *                         "Create",
 *                         "Get",
 *                         "List")
 *                     .secretPermissions(                    
 *                         "Get",
 *                         "List")
 *                     .build(),
 *                 KeyVaultAccessPolicyArgs.builder()
 *                     .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *                     .objectId(testAzurermWebPubsub.identity()[0].principalId())
 *                     .certificatePermissions(                    
 *                         "Create",
 *                         "Get",
 *                         "List")
 *                     .secretPermissions(                    
 *                         "Get",
 *                         "List")
 *                     .build())
 *             .build());
 * 
 *         var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
 *             .name("imported-cert")
 *             .keyVaultId(exampleKeyVault.id())
 *             .certificate(CertificateCertificateArgs.builder()
 *                 .contents(StdFunctions.filebase64(Filebase64Args.builder()
 *                     .input("certificate-to-import.pfx")
 *                     .build()).result())
 *                 .password("")
 *                 .build())
 *             .build());
 * 
 *         var test = new CustomCertificate("test", CustomCertificateArgs.builder()
 *             .name("example-cert")
 *             .webPubsubId(exampleService.id())
 *             .customCertificateId(exampleCertificate.id())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(exampleAzurermKeyVaultAccessPolicy)
 *                 .build());
 * 
 *         var testCustomDomain = new CustomDomain("testCustomDomain", CustomDomainArgs.builder()
 *             .name("example-domain")
 *             .domainName("tftest.com")
 *             .webPubsubId(testAzurermWebPubsub.id())
 *             .webPubsubCustomCertificateId(test.id())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Custom Domain for a Web PubSub service can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:webpubsub/customDomain:CustomDomain example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/webpubsub1/customDomains/customDomain1 * ``` * */ @ResourceType(type="azure:webpubsub/customDomain:CustomDomain") public class CustomDomain extends com.pulumi.resources.CustomResource { /** * Specifies the custom domain name of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * * > **NOTE:** Please ensure the custom domain name is included in the Subject Alternative Names of the selected Web PubSub Custom Certificate. * */ @Export(name="domainName", refs={String.class}, tree="[0]") private Output domainName; /** * @return Specifies the custom domain name of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * * > **NOTE:** Please ensure the custom domain name is included in the Subject Alternative Names of the selected Web PubSub Custom Certificate. * */ public Output domainName() { return this.domainName; } /** * Specifies the name of the Web PubSub Custom Domain. 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 Web PubSub Custom Domain. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * Specifies the Web PubSub Custom Certificate ID of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * */ @Export(name="webPubsubCustomCertificateId", refs={String.class}, tree="[0]") private Output webPubsubCustomCertificateId; /** * @return Specifies the Web PubSub Custom Certificate ID of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * */ public Output webPubsubCustomCertificateId() { return this.webPubsubCustomCertificateId; } /** * Specifies the Web PubSub ID of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * */ @Export(name="webPubsubId", refs={String.class}, tree="[0]") private Output webPubsubId; /** * @return Specifies the Web PubSub ID of the Web PubSub Custom Domain. Changing this forces a new resource to be created. * */ public Output webPubsubId() { return this.webPubsubId; } /** * * @param name The _unique_ name of the resulting resource. */ public CustomDomain(java.lang.String name) { this(name, CustomDomainArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public CustomDomain(java.lang.String name, CustomDomainArgs 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 CustomDomain(java.lang.String name, CustomDomainArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:webpubsub/customDomain:CustomDomain", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private CustomDomain(java.lang.String name, Output id, @Nullable CustomDomainState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:webpubsub/customDomain:CustomDomain", name, state, makeResourceOptions(options, id), false); } private static CustomDomainArgs makeArgs(CustomDomainArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? CustomDomainArgs.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 CustomDomain get(java.lang.String name, Output id, @Nullable CustomDomainState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new CustomDomain(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy