UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

214 lines 9.87 kB
"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.Alb = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage alb * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = volcengine.alb.getZones({}); * const vpcIpv6 = new volcengine.vpc.Vpc("vpcIpv6", { * vpcName: "acc-test-vpc-ipv6", * cidrBlock: "172.16.0.0/16", * enableIpv6: true, * }); * const subnetIpv61 = new volcengine.vpc.Subnet("subnetIpv61", { * subnetName: "acc-test-subnet-ipv6-1", * cidrBlock: "172.16.1.0/24", * zoneId: foo.then(foo => foo.zones?.[0]?.id), * vpcId: vpcIpv6.id, * ipv6CidrBlock: 1, * }); * const subnetIpv62 = new volcengine.vpc.Subnet("subnetIpv62", { * subnetName: "acc-test-subnet-ipv6-2", * cidrBlock: "172.16.2.0/24", * zoneId: foo.then(foo => foo.zones?.[1]?.id), * vpcId: vpcIpv6.id, * ipv6CidrBlock: 2, * }); * const ipv6Gateway = new volcengine.vpc.Ipv6Gateway("ipv6Gateway", {vpcId: vpcIpv6.id}); * const alb_private = new volcengine.alb.Alb("alb-private", { * addressIpVersion: "IPv4", * type: "private", * loadBalancerName: "acc-test-alb-private", * description: "acc-test", * subnetIds: [ * subnetIpv61.id, * subnetIpv62.id, * ], * projectName: "default", * deleteProtection: "off", * tags: [{ * key: "k1", * value: "v1", * }], * }); * const alb_public = new volcengine.alb.Alb("alb-public", { * addressIpVersion: "DualStack", * type: "public", * loadBalancerName: "acc-test-alb-public", * description: "acc-test", * subnetIds: [ * subnetIpv61.id, * subnetIpv62.id, * ], * projectName: "default", * deleteProtection: "off", * modificationProtectionStatus: "NonProtection", * modificationProtectionReason: "Test modification protection", * loadBalancerEdition: "Basic", * eipBillingConfig: { * isp: "BGP", * eipBillingType: "PostPaidByBandwidth", * bandwidth: 1, * }, * ipv6EipBillingConfig: { * isp: "BGP", * billingType: "PostPaidByBandwidth", * bandwidth: 1, * }, * tags: [{ * key: "k1", * value: "v1", * }], * }, { * dependsOn: [ipv6Gateway], * }); * // CLone ALB instance * const alb_cloned = new volcengine.alb.Alb("alb-cloned", { * sourceLoadBalancerId: alb_private.id, * loadBalancerName: "acc-test-alb-cloned", * description: "cloned from alb-private", * subnetIds: [subnetIpv61.id], * type: "private", * projectName: "default", * }); * // Example of ALB network type change, private -> public * const alb_type_change = new volcengine.alb.Alb("alb-type-change", { * loadBalancerName: "acc-test-alb-type-change", * description: "will change to public type", * subnetIds: [ * subnetIpv61.id, * subnetIpv62.id, * ], * type: "public", * projectName: "default", * allocationIds: [ * "eip-iinpy4k1rytc74o8curgocd7", * "eip-iinpy4k1rytc74o8curgocd8", * ], * }); * ``` * * ## Import * * Alb can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:alb/alb:Alb default resource_id * ``` */ class Alb extends pulumi.CustomResource { /** * Get an existing Alb 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 Alb(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Alb. 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'] === Alb.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["addressIpVersion"] = state ? state.addressIpVersion : undefined; resourceInputs["allocationIds"] = state ? state.allocationIds : undefined; resourceInputs["deleteProtection"] = state ? state.deleteProtection : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dnsName"] = state ? state.dnsName : undefined; resourceInputs["eipBillingConfig"] = state ? state.eipBillingConfig : undefined; resourceInputs["globalAccelerator"] = state ? state.globalAccelerator : undefined; resourceInputs["ipv6EipBillingConfig"] = state ? state.ipv6EipBillingConfig : undefined; resourceInputs["loadBalancerEdition"] = state ? state.loadBalancerEdition : undefined; resourceInputs["loadBalancerName"] = state ? state.loadBalancerName : undefined; resourceInputs["localAddresses"] = state ? state.localAddresses : undefined; resourceInputs["modificationProtectionReason"] = state ? state.modificationProtectionReason : undefined; resourceInputs["modificationProtectionStatus"] = state ? state.modificationProtectionStatus : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["proxyProtocolEnabled"] = state ? state.proxyProtocolEnabled : undefined; resourceInputs["sourceLoadBalancerId"] = state ? state.sourceLoadBalancerId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; resourceInputs["wafInstanceId"] = state ? state.wafInstanceId : undefined; resourceInputs["wafProtectedDomain"] = state ? state.wafProtectedDomain : undefined; resourceInputs["wafProtectionEnabled"] = state ? state.wafProtectionEnabled : undefined; resourceInputs["zoneMappings"] = state ? state.zoneMappings : undefined; } else { const args = argsOrState; if ((!args || args.subnetIds === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetIds'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["addressIpVersion"] = args ? args.addressIpVersion : undefined; resourceInputs["allocationIds"] = args ? args.allocationIds : undefined; resourceInputs["deleteProtection"] = args ? args.deleteProtection : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["eipBillingConfig"] = args ? args.eipBillingConfig : undefined; resourceInputs["globalAccelerator"] = args ? args.globalAccelerator : undefined; resourceInputs["ipv6EipBillingConfig"] = args ? args.ipv6EipBillingConfig : undefined; resourceInputs["loadBalancerEdition"] = args ? args.loadBalancerEdition : undefined; resourceInputs["loadBalancerName"] = args ? args.loadBalancerName : undefined; resourceInputs["modificationProtectionReason"] = args ? args.modificationProtectionReason : undefined; resourceInputs["modificationProtectionStatus"] = args ? args.modificationProtectionStatus : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["proxyProtocolEnabled"] = args ? args.proxyProtocolEnabled : undefined; resourceInputs["sourceLoadBalancerId"] = args ? args.sourceLoadBalancerId : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["wafInstanceId"] = args ? args.wafInstanceId : undefined; resourceInputs["wafProtectedDomain"] = args ? args.wafProtectedDomain : undefined; resourceInputs["wafProtectionEnabled"] = args ? args.wafProtectionEnabled : undefined; resourceInputs["dnsName"] = undefined /*out*/; resourceInputs["localAddresses"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["vpcId"] = undefined /*out*/; resourceInputs["zoneMappings"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Alb.__pulumiType, name, resourceInputs, opts); } } exports.Alb = Alb; /** @internal */ Alb.__pulumiType = 'volcengine:alb/alb:Alb'; //# sourceMappingURL=alb.js.map