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

com.pulumi.azure.appservice.ManagedCertificate 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.appservice;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appservice.ManagedCertificateArgs;
import com.pulumi.azure.appservice.inputs.ManagedCertificateState;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * This certificate can be used to secure custom domains on App Services (Windows and Linux) hosted on an App Service Plan of Basic and above (free and shared tiers are not supported).
 * 
 * > NOTE: A certificate is valid for six months, and about a month before the certificate’s expiration date, App Services renews/rotates the certificate. This is managed by Azure and doesn't require this resource to be changed or reprovisioned. It will change the `thumbprint` computed attribute the next time the resource is refreshed after rotation occurs, so keep that in mind if you have any dependencies on this attribute directly.
 * 
 * ## 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.dns.DnsFunctions;
 * import com.pulumi.azure.dns.inputs.GetZoneArgs;
 * import com.pulumi.azure.appservice.Plan;
 * import com.pulumi.azure.appservice.PlanArgs;
 * import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
 * import com.pulumi.azure.appservice.AppService;
 * import com.pulumi.azure.appservice.AppServiceArgs;
 * import com.pulumi.azure.dns.TxtRecord;
 * import com.pulumi.azure.dns.TxtRecordArgs;
 * import com.pulumi.azure.dns.inputs.TxtRecordRecordArgs;
 * import com.pulumi.azure.dns.CNameRecord;
 * import com.pulumi.azure.dns.CNameRecordArgs;
 * import com.pulumi.azure.appservice.CustomHostnameBinding;
 * import com.pulumi.azure.appservice.CustomHostnameBindingArgs;
 * import com.pulumi.azure.appservice.ManagedCertificate;
 * import com.pulumi.azure.appservice.ManagedCertificateArgs;
 * import com.pulumi.azure.appservice.CertificateBinding;
 * import com.pulumi.azure.appservice.CertificateBindingArgs;
 * 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 * 
 *         final var example = DnsFunctions.getZone(GetZoneArgs.builder()
 *             .name("mydomain.com")
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var examplePlan = new Plan("examplePlan", PlanArgs.builder()
 *             .name("example-plan")
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .kind("Linux")
 *             .reserved(true)
 *             .sku(PlanSkuArgs.builder()
 *                 .tier("Basic")
 *                 .size("B1")
 *                 .build())
 *             .build());
 * 
 *         var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
 *             .name("example-app")
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .appServicePlanId(examplePlan.id())
 *             .build());
 * 
 *         var exampleTxtRecord = new TxtRecord("exampleTxtRecord", TxtRecordArgs.builder()
 *             .name("asuid.mycustomhost.contoso.com")
 *             .zoneName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.name())))
 *             .resourceGroupName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.resourceGroupName())))
 *             .ttl(300)
 *             .records(TxtRecordRecordArgs.builder()
 *                 .value(exampleAppService.customDomainVerificationId())
 *                 .build())
 *             .build());
 * 
 *         var exampleCNameRecord = new CNameRecord("exampleCNameRecord", CNameRecordArgs.builder()
 *             .name("example-adcr")
 *             .zoneName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.name())))
 *             .resourceGroupName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.resourceGroupName())))
 *             .ttl(300)
 *             .record(exampleAppService.defaultSiteHostname())
 *             .build());
 * 
 *         var exampleCustomHostnameBinding = new CustomHostnameBinding("exampleCustomHostnameBinding", CustomHostnameBindingArgs.builder()
 *             .hostname(StdFunctions.join().applyValue(invoke -> invoke.result()))
 *             .appServiceName(exampleAppService.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleManagedCertificate = new ManagedCertificate("exampleManagedCertificate", ManagedCertificateArgs.builder()
 *             .customHostnameBindingId(exampleCustomHostnameBinding.id())
 *             .build());
 * 
 *         var exampleCertificateBinding = new CertificateBinding("exampleCertificateBinding", CertificateBindingArgs.builder()
 *             .hostnameBindingId(exampleCustomHostnameBinding.id())
 *             .certificateId(exampleManagedCertificate.id())
 *             .sslState("SniEnabled")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * App Service Managed Certificates can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:appservice/managedCertificate:ManagedCertificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Web/certificates/customhost.contoso.com * ``` * */ @ResourceType(type="azure:appservice/managedCertificate:ManagedCertificate") public class ManagedCertificate extends com.pulumi.resources.CustomResource { /** * The Canonical Name of the Certificate. * */ @Export(name="canonicalName", refs={String.class}, tree="[0]") private Output canonicalName; /** * @return The Canonical Name of the Certificate. * */ public Output canonicalName() { return this.canonicalName; } /** * The ID of the App Service Custom Hostname Binding for the Certificate. Changing this forces a new App Service Managed Certificate to be created. * */ @Export(name="customHostnameBindingId", refs={String.class}, tree="[0]") private Output customHostnameBindingId; /** * @return The ID of the App Service Custom Hostname Binding for the Certificate. Changing this forces a new App Service Managed Certificate to be created. * */ public Output customHostnameBindingId() { return this.customHostnameBindingId; } /** * The expiration date of the Certificate. * */ @Export(name="expirationDate", refs={String.class}, tree="[0]") private Output expirationDate; /** * @return The expiration date of the Certificate. * */ public Output expirationDate() { return this.expirationDate; } /** * The friendly name of the Certificate. * */ @Export(name="friendlyName", refs={String.class}, tree="[0]") private Output friendlyName; /** * @return The friendly name of the Certificate. * */ public Output friendlyName() { return this.friendlyName; } /** * The list of Host Names for the Certificate. * */ @Export(name="hostNames", refs={List.class,String.class}, tree="[0,1]") private Output> hostNames; /** * @return The list of Host Names for the Certificate. * */ public Output> hostNames() { return this.hostNames; } /** * The Start date for the Certificate. * */ @Export(name="issueDate", refs={String.class}, tree="[0]") private Output issueDate; /** * @return The Start date for the Certificate. * */ public Output issueDate() { return this.issueDate; } /** * The issuer of the Certificate. * */ @Export(name="issuer", refs={String.class}, tree="[0]") private Output issuer; /** * @return The issuer of the Certificate. * */ public Output issuer() { return this.issuer; } /** * The Subject Name for the Certificate. * */ @Export(name="subjectName", refs={String.class}, tree="[0]") private Output subjectName; /** * @return The Subject Name for the Certificate. * */ public Output subjectName() { return this.subjectName; } /** * A mapping of tags which should be assigned to the App Service Managed Certificate. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags which should be assigned to the App Service Managed Certificate. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * The Certificate Thumbprint. * */ @Export(name="thumbprint", refs={String.class}, tree="[0]") private Output thumbprint; /** * @return The Certificate Thumbprint. * */ public Output thumbprint() { return this.thumbprint; } /** * * @param name The _unique_ name of the resulting resource. */ public ManagedCertificate(java.lang.String name) { this(name, ManagedCertificateArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ManagedCertificate(java.lang.String name, ManagedCertificateArgs 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 ManagedCertificate(java.lang.String name, ManagedCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/managedCertificate:ManagedCertificate", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ManagedCertificate(java.lang.String name, Output id, @Nullable ManagedCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/managedCertificate:ManagedCertificate", name, state, makeResourceOptions(options, id), false); } private static ManagedCertificateArgs makeArgs(ManagedCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ManagedCertificateArgs.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 ManagedCertificate get(java.lang.String name, Output id, @Nullable ManagedCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ManagedCertificate(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy