"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.ScalingConfigurationAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage scaling configuration attachment
 * ## 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 fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
 *     securityGroupName: "acc-test-security-group",
 *     vpcId: fooVpc.id,
 * });
 * const fooImages = volcengine.ecs.getImages({
 *     osType: "Linux",
 *     visibility: "public",
 *     instanceTypeId: "ecs.g1.large",
 * });
 * const fooScalingGroup = new volcengine.autoscaling.ScalingGroup("fooScalingGroup", {
 *     scalingGroupName: "acc-test-scaling-group",
 *     subnetIds: [fooSubnet.id],
 *     multiAzPolicy: "BALANCE",
 *     desireInstanceNumber: 0,
 *     minInstanceNumber: 0,
 *     maxInstanceNumber: 1,
 *     instanceTerminatePolicy: "OldestInstance",
 *     defaultCooldown: 10,
 * });
 * const fooScalingConfiguration = new volcengine.autoscaling.ScalingConfiguration("fooScalingConfiguration", {
 *     imageId: fooImages.then(fooImages => fooImages.images?.[0]?.imageId),
 *     instanceName: "acc-test-instance",
 *     instanceTypes: ["ecs.g1.large"],
 *     password: "93f0cb0614Aab12",
 *     scalingConfigurationName: "acc-test-scaling-config",
 *     scalingGroupId: fooScalingGroup.id,
 *     securityGroupIds: [fooSecurityGroup.id],
 *     volumes: [{
 *         volumeType: "ESSD_PL0",
 *         size: 50,
 *         deleteWithInstance: true,
 *     }],
 * });
 * const fooScalingConfigurationAttachment = new volcengine.autoscaling.ScalingConfigurationAttachment("fooScalingConfigurationAttachment", {scalingConfigurationId: fooScalingConfiguration.id});
 * ```
 *
 * ## Import
 *
 * Scaling Configuration attachment can be imported using the scaling_configuration_id e.g.
 * The launch template and scaling configuration cannot take effect at the same time.
 *
 * ```sh
 * $ pulumi import volcengine:autoscaling/scalingConfigurationAttachment:ScalingConfigurationAttachment default enable:scc-ybrurj4uw6gh9zecj327
 * ```
 */
class ScalingConfigurationAttachment extends pulumi.CustomResource {
    /**
     * Get an existing ScalingConfigurationAttachment 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 ScalingConfigurationAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ScalingConfigurationAttachment.  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'] === ScalingConfigurationAttachment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["scalingConfigurationId"] = state ? state.scalingConfigurationId : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.scalingConfigurationId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'scalingConfigurationId'");
            }
            resourceInputs["scalingConfigurationId"] = args ? args.scalingConfigurationId : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ScalingConfigurationAttachment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ScalingConfigurationAttachment = ScalingConfigurationAttachment;
/** @internal */
ScalingConfigurationAttachment.__pulumiType = 'volcengine:autoscaling/scalingConfigurationAttachment:ScalingConfigurationAttachment';
//# sourceMappingURL=scalingConfigurationAttachment.js.map