UNPKG

@pulumi/aws

Version:

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

163 lines 5.25 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.TargetGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS VPC Lattice Target Group. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.vpclattice.TargetGroup("example", { * name: "example", * type: "INSTANCE", * config: { * vpcIdentifier: exampleAwsVpc.id, * port: 443, * protocol: "HTTPS", * }, * }); * ``` * * ### Basic usage with Health check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.vpclattice.TargetGroup("example", { * name: "example", * type: "IP", * config: { * vpcIdentifier: exampleAwsVpc.id, * ipAddressType: "IPV4", * port: 443, * protocol: "HTTPS", * protocolVersion: "HTTP1", * healthCheck: { * enabled: true, * healthCheckIntervalSeconds: 20, * healthCheckTimeoutSeconds: 10, * healthyThresholdCount: 7, * unhealthyThresholdCount: 3, * matcher: { * value: "200-299", * }, * path: "/instance", * port: 80, * protocol: "HTTP", * protocolVersion: "HTTP1", * }, * }, * }); * ``` * * ### ALB * * If the type is ALB, `healthCheck` block is not supported. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.vpclattice.TargetGroup("example", { * name: "example", * type: "ALB", * config: { * vpcIdentifier: exampleAwsVpc.id, * port: 443, * protocol: "HTTPS", * protocolVersion: "HTTP1", * }, * }); * ``` * * ### Lambda * * If the type is Lambda, `config` block is not supported. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.vpclattice.TargetGroup("example", { * name: "example", * type: "LAMBDA", * }); * ``` * * ## Import * * Using `pulumi import`, import VPC Lattice Target Group using the `id`. For example: * * ```sh * $ pulumi import aws:vpclattice/targetGroup:TargetGroup example tg-0c11d4dc16ed96bdb * ``` */ class TargetGroup extends pulumi.CustomResource { /** * Get an existing TargetGroup 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 TargetGroup(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of TargetGroup. 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'] === TargetGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["config"] = state?.config; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["config"] = args?.config; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["type"] = args?.type; resourceInputs["arn"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TargetGroup.__pulumiType, name, resourceInputs, opts); } } exports.TargetGroup = TargetGroup; /** @internal */ TargetGroup.__pulumiType = 'aws:vpclattice/targetGroup:TargetGroup'; //# sourceMappingURL=targetGroup.js.map