UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

74 lines 3.44 kB
"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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Tag = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an individual Autoscaling Group (ASG) tag. This resource should only be used in cases where ASGs are created outside the provider (e.g., ASGs implicitly created by EKS Node Groups). * * > **NOTE:** This tagging resource should not be combined with the resource for managing the parent resource. For example, using `aws.autoscaling.Group` and `aws.autoscaling.Tag` to manage tags of the same ASG will cause a perpetual difference where the `aws.autoscaling.Group` resource will try to remove the tag being added by the `aws.autoscaling.Tag` resource. * * > **NOTE:** This tagging resource does not use the provider `ignoreTags` configuration. * * ## Import * * Using `pulumi import`, import `aws_autoscaling_group_tag` using the ASG name and key, separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:autoscaling/tag:Tag example asg-example,k8s.io/cluster-autoscaler/node-template/label/eks.amazonaws.com/capacityType * ``` */ class Tag extends pulumi.CustomResource { /** * Get an existing Tag 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 Tag(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Tag. 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'] === Tag.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoscalingGroupName"] = state?.autoscalingGroupName; resourceInputs["region"] = state?.region; resourceInputs["tag"] = state?.tag; } else { const args = argsOrState; if (args?.autoscalingGroupName === undefined && !opts.urn) { throw new Error("Missing required property 'autoscalingGroupName'"); } if (args?.tag === undefined && !opts.urn) { throw new Error("Missing required property 'tag'"); } resourceInputs["autoscalingGroupName"] = args?.autoscalingGroupName; resourceInputs["region"] = args?.region; resourceInputs["tag"] = args?.tag; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Tag.__pulumiType, name, resourceInputs, opts); } } exports.Tag = Tag; /** @internal */ Tag.__pulumiType = 'aws:autoscaling/tag:Tag'; //# sourceMappingURL=tag.js.map