"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.ApplicationSecurityGroupAssociation = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an association between Private Endpoint and Application Security Group.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const current = azure.core.getSubscription({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-PEASGAsso",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "examplevnet",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     addressSpaces: ["10.5.0.0/16"],
 * });
 * const service = new azure.network.Subnet("service", {
 *     name: "examplenetservice",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.5.1.0/24"],
 *     enforcePrivateLinkServiceNetworkPolicies: true,
 * });
 * const endpoint = new azure.network.Subnet("endpoint", {
 *     name: "examplenetendpoint",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.5.2.0/24"],
 *     enforcePrivateLinkEndpointNetworkPolicies: true,
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "examplepip",
 *     sku: "Standard",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 * });
 * const exampleLoadBalancer = new azure.lb.LoadBalancer("example", {
 *     name: "examplelb",
 *     sku: "Standard",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     frontendIpConfigurations: [{
 *         name: examplePublicIp.name,
 *         publicIpAddressId: examplePublicIp.id,
 *     }],
 * });
 * const exampleLinkService = new azure.privatedns.LinkService("example", {
 *     name: "examplePLS",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     autoApprovalSubscriptionIds: [current.then(current => current.subscriptionId)],
 *     visibilitySubscriptionIds: [current.then(current => current.subscriptionId)],
 *     natIpConfigurations: [{
 *         name: "primaryIpConfiguration",
 *         primary: true,
 *         subnetId: service.id,
 *     }],
 *     loadBalancerFrontendIpConfigurationIds: [exampleLoadBalancer.frontendIpConfigurations.apply(frontendIpConfigurations => frontendIpConfigurations?.[0]?.id)],
 * });
 * const exampleEndpoint = new azure.privatelink.Endpoint("example", {
 *     name: "example-privatelink",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     subnetId: endpoint.id,
 *     privateServiceConnection: {
 *         name: exampleLinkService.name,
 *         isManualConnection: false,
 *         privateConnectionResourceId: exampleLinkService.id,
 *     },
 * });
 * const exampleApplicationSecurityGroup = new azure.network.ApplicationSecurityGroup("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleApplicationSecurityGroupAssociation = new azure.privatelink.ApplicationSecurityGroupAssociation("example", {
 *     privateEndpointId: exampleEndpoint.id,
 *     applicationSecurityGroupId: exampleApplicationSecurityGroup.id,
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:privatelink/applicationSecurityGroupAssociation:ApplicationSecurityGroupAssociation association1 "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/privateEndpoints/endpoints1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/applicationSecurityGroups/securityGroup1",
 * ```
 *
 * > **Note:** This ID is specific to Terraform - and is of the format `{privateEndpointId}|{applicationSecurityGroupId}`.
 */
class ApplicationSecurityGroupAssociation extends pulumi.CustomResource {
    /**
     * Get an existing ApplicationSecurityGroupAssociation 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 ApplicationSecurityGroupAssociation(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:privatelink/applicationSecurityGroupAssociation:ApplicationSecurityGroupAssociation';
    /**
     * Returns true if the given object is an instance of ApplicationSecurityGroupAssociation.  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'] === ApplicationSecurityGroupAssociation.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationSecurityGroupId"] = state?.applicationSecurityGroupId;
            resourceInputs["privateEndpointId"] = state?.privateEndpointId;
        }
        else {
            const args = argsOrState;
            if (args?.applicationSecurityGroupId === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationSecurityGroupId'");
            }
            if (args?.privateEndpointId === undefined && !opts.urn) {
                throw new Error("Missing required property 'privateEndpointId'");
            }
            resourceInputs["applicationSecurityGroupId"] = args?.applicationSecurityGroupId;
            resourceInputs["privateEndpointId"] = args?.privateEndpointId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ApplicationSecurityGroupAssociation.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ApplicationSecurityGroupAssociation = ApplicationSecurityGroupAssociation;
//# sourceMappingURL=applicationSecurityGroupAssociation.js.map