"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.CertificateBinding = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an App Service Certificate Binding.
 *
 * ## 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: "webapp",
 *     location: "West Europe",
 * });
 * const examplePlan = new azure.appservice.Plan("example", {
 *     name: "appserviceplan",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     sku: {
 *         tier: "Premium",
 *         size: "P1",
 *     },
 * });
 * const exampleAppService = new azure.appservice.AppService("example", {
 *     name: "mywebapp",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     appServicePlanId: examplePlan.id,
 * });
 * const example = azure.dns.getZoneOutput({
 *     name: "example.com",
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const exampleCNameRecord = new azure.dns.CNameRecord("example", {
 *     name: "www",
 *     zoneName: example.apply(example => example.name),
 *     resourceGroupName: example.apply(example => example.resourceGroupName),
 *     ttl: 300,
 *     record: exampleAppService.defaultSiteHostname,
 * });
 * const exampleTxtRecord = new azure.dns.TxtRecord("example", {
 *     name: pulumi.interpolate`asuid.${exampleCNameRecord.name}`,
 *     zoneName: example.apply(example => example.name),
 *     resourceGroupName: example.apply(example => example.resourceGroupName),
 *     ttl: 300,
 *     records: [{
 *         value: exampleAppService.customDomainVerificationId,
 *     }],
 * });
 * const exampleCustomHostnameBinding = new azure.appservice.CustomHostnameBinding("example", {
 *     hostname: std.trimOutput({
 *         input: exampleCNameRecord.fqdn,
 *         cutset: ".",
 *     }).apply(invoke => invoke.result),
 *     appServiceName: exampleAppService.name,
 *     resourceGroupName: exampleResourceGroup.name,
 * }, {
 *     dependsOn: [exampleTxtRecord],
 * });
 * 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 Certificate Bindings can be imported using the `hostnameBindingId` and the `appServiceCertificateId` , e.g.
 *
 * ```sh
 * $ pulumi import azure:appservice/certificateBinding:CertificateBinding example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/hostNameBindings/mywebsite.com|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/certificates/mywebsite.com"
 * ```
 */
class CertificateBinding extends pulumi.CustomResource {
    /**
     * Get an existing CertificateBinding 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 CertificateBinding(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:appservice/certificateBinding:CertificateBinding';
    /**
     * Returns true if the given object is an instance of CertificateBinding.  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'] === CertificateBinding.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["appServiceName"] = state?.appServiceName;
            resourceInputs["certificateId"] = state?.certificateId;
            resourceInputs["hostname"] = state?.hostname;
            resourceInputs["hostnameBindingId"] = state?.hostnameBindingId;
            resourceInputs["sslState"] = state?.sslState;
            resourceInputs["thumbprint"] = state?.thumbprint;
        }
        else {
            const args = argsOrState;
            if (args?.certificateId === undefined && !opts.urn) {
                throw new Error("Missing required property 'certificateId'");
            }
            if (args?.hostnameBindingId === undefined && !opts.urn) {
                throw new Error("Missing required property 'hostnameBindingId'");
            }
            if (args?.sslState === undefined && !opts.urn) {
                throw new Error("Missing required property 'sslState'");
            }
            resourceInputs["certificateId"] = args?.certificateId;
            resourceInputs["hostnameBindingId"] = args?.hostnameBindingId;
            resourceInputs["sslState"] = args?.sslState;
            resourceInputs["appServiceName"] = undefined /*out*/;
            resourceInputs["hostname"] = undefined /*out*/;
            resourceInputs["thumbprint"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CertificateBinding.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CertificateBinding = CertificateBinding;
//# sourceMappingURL=certificateBinding.js.map