"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedCertificate = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * 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
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 *
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const example = azure.dns.getZoneOutput({
 *     name: "mydomain.com",
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const examplePlan = new azure.appservice.Plan("example", {
 *     name: "example-plan",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     kind: "Linux",
 *     reserved: true,
 *     sku: {
 *         tier: "Basic",
 *         size: "B1",
 *     },
 * });
 * const exampleAppService = new azure.appservice.AppService("example", {
 *     name: "example-app",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     appServicePlanId: examplePlan.id,
 * });
 * const exampleTxtRecord = new azure.dns.TxtRecord("example", {
 *     name: "asuid.mycustomhost.contoso.com",
 *     zoneName: example.apply(example => example.name),
 *     resourceGroupName: example.apply(example => example.resourceGroupName),
 *     ttl: 300,
 *     records: [{
 *         value: exampleAppService.customDomainVerificationId,
 *     }],
 * });
 * const exampleCNameRecord = new azure.dns.CNameRecord("example", {
 *     name: "example-adcr",
 *     zoneName: example.apply(example => example.name),
 *     resourceGroupName: example.apply(example => example.resourceGroupName),
 *     ttl: 300,
 *     record: exampleAppService.defaultSiteHostname,
 * });
 * const exampleCustomHostnameBinding = new azure.appservice.CustomHostnameBinding("example", {
 *     hostname: std.joinOutput({
 *         separator: ".",
 *         input: [
 *             exampleCNameRecord.name,
 *             exampleCNameRecord.zoneName,
 *         ],
 *     }).apply(invoke => invoke.result),
 *     appServiceName: exampleAppService.name,
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const exampleManagedCertificate = new azure.appservice.ManagedCertificate("example", {customHostnameBindingId: exampleCustomHostnameBinding.id});
 * const exampleCertificateBinding = new azure.appservice.CertificateBinding("example", {
 *     hostnameBindingId: exampleCustomHostnameBinding.id,
 *     certificateId: exampleManagedCertificate.id,
 *     sslState: "SniEnabled",
 * });
 * ```
 *
 * ## 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
 * ```
 */
class ManagedCertificate extends pulumi.CustomResource {
    /**
     * Get an existing ManagedCertificate 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ManagedCertificate(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:appservice/managedCertificate:ManagedCertificate';
    /**
     * Returns true if the given object is an instance of ManagedCertificate.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ManagedCertificate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["canonicalName"] = state?.canonicalName;
            resourceInputs["customHostnameBindingId"] = state?.customHostnameBindingId;
            resourceInputs["expirationDate"] = state?.expirationDate;
            resourceInputs["friendlyName"] = state?.friendlyName;
            resourceInputs["hostNames"] = state?.hostNames;
            resourceInputs["issueDate"] = state?.issueDate;
            resourceInputs["issuer"] = state?.issuer;
            resourceInputs["subjectName"] = state?.subjectName;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["thumbprint"] = state?.thumbprint;
        }
        else {
            const args = argsOrState;
            if (args?.customHostnameBindingId === undefined && !opts.urn) {
                throw new Error("Missing required property 'customHostnameBindingId'");
            }
            resourceInputs["customHostnameBindingId"] = args?.customHostnameBindingId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["canonicalName"] = undefined /*out*/;
            resourceInputs["expirationDate"] = undefined /*out*/;
            resourceInputs["friendlyName"] = undefined /*out*/;
            resourceInputs["hostNames"] = undefined /*out*/;
            resourceInputs["issueDate"] = undefined /*out*/;
            resourceInputs["issuer"] = undefined /*out*/;
            resourceInputs["subjectName"] = undefined /*out*/;
            resourceInputs["thumbprint"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ManagedCertificate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedCertificate = ManagedCertificate;
//# sourceMappingURL=managedCertificate.js.map