"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApigUpstreamSource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage apig upstream source
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const foo1 = new volcengine.vpc.Subnet("foo1", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const foo2 = new volcengine.vpc.Subnet("foo2", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.1.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[1]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooApigGateway = new volcengine.apig.ApigGateway("fooApigGateway", {
 *     type: "standard",
 *     comments: "acc-test",
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 *     networkSpec: {
 *         vpcId: fooVpc.id,
 *         subnetIds: [
 *             foo1.id,
 *             foo2.id,
 *         ],
 *     },
 *     resourceSpec: {
 *         replicas: 2,
 *         instanceSpecCode: "1c2g",
 *         clbSpecCode: "small_1",
 *         publicNetworkBillingType: "bandwidth",
 *         publicNetworkBandwidth: 1,
 *         networkType: {
 *             enablePublicNetwork: true,
 *             enablePrivateNetwork: true,
 *         },
 *     },
 *     logSpec: {
 *         enable: true,
 *         projectId: "d3cb87c0-faeb-4074-b1ee-9bd747865a76",
 *         topicId: "d339482e-d86d-4bd8-a9bb-f270417f00a1",
 *     },
 *     monitorSpec: {
 *         enable: true,
 *         workspaceId: "4ed1caf3-279d-4c5f-8301-87ea38e92ffc",
 *     },
 * });
 * const fooApigGatewayService = new volcengine.apig.ApigGatewayService("fooApigGatewayService", {
 *     gatewayId: fooApigGateway.id,
 *     serviceName: "acc-test-apig-service",
 *     comments: "acc-test",
 *     protocols: [
 *         "HTTP",
 *         "HTTPS",
 *     ],
 *     authSpec: {
 *         enable: false,
 *     },
 * });
 * const foo_nacos = new volcengine.apig.ApigUpstreamSource("foo-nacos", {
 *     gatewayId: fooApigGateway.id,
 *     comments: "acc-test-nacos",
 *     sourceType: "Nacos",
 *     sourceSpec: {
 *         nacosSource: {
 *             nacosId: "nd197ls631meck48imm7g",
 *             authConfig: {
 *                 basic: {
 *                     username: "nacos",
 *                     password: "******",
 *                 },
 *             },
 *         },
 *     },
 * });
 * const foo_k8s = new volcengine.apig.ApigUpstreamSource("foo-k8s", {
 *     gatewayId: fooApigGateway.id,
 *     comments: "acc-test-k8s",
 *     sourceType: "K8S",
 *     sourceSpec: {
 *         k8sSource: {
 *             clusterId: "cd197sac4mpmnruh7um80",
 *         },
 *     },
 *     ingressSettings: [{
 *         enableIngress: true,
 *         updateStatus: true,
 *         ingressClasses: ["test"],
 *         watchNamespaces: ["default"],
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * ApigUpstreamSource can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:apig/apigUpstreamSource:ApigUpstreamSource default resource_id
 * ```
 */
class ApigUpstreamSource extends pulumi.CustomResource {
    /**
     * Get an existing ApigUpstreamSource 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 ApigUpstreamSource(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ApigUpstreamSource.  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'] === ApigUpstreamSource.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["comments"] = state ? state.comments : undefined;
            resourceInputs["gatewayId"] = state ? state.gatewayId : undefined;
            resourceInputs["ingressSettings"] = state ? state.ingressSettings : undefined;
            resourceInputs["sourceSpec"] = state ? state.sourceSpec : undefined;
            resourceInputs["sourceType"] = state ? state.sourceType : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.gatewayId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'gatewayId'");
            }
            if ((!args || args.sourceSpec === undefined) && !opts.urn) {
                throw new Error("Missing required property 'sourceSpec'");
            }
            if ((!args || args.sourceType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'sourceType'");
            }
            resourceInputs["comments"] = args ? args.comments : undefined;
            resourceInputs["gatewayId"] = args ? args.gatewayId : undefined;
            resourceInputs["ingressSettings"] = args ? args.ingressSettings : undefined;
            resourceInputs["sourceSpec"] = args ? args.sourceSpec : undefined;
            resourceInputs["sourceType"] = args ? args.sourceType : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ApigUpstreamSource.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ApigUpstreamSource = ApigUpstreamSource;
/** @internal */
ApigUpstreamSource.__pulumiType = 'volcengine:apig/apigUpstreamSource:ApigUpstreamSource';
//# sourceMappingURL=apigUpstreamSource.js.map