@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
167 lines • 6.9 kB
JavaScript
;
// *** 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",
* eipBillingConfig: {
* isp: "BGP",
* eipBillingType: "PostPaidByBandwidth",
* bandwidth: 1,
* },
* ipv6EipBillingConfig: {
* isp: "BGP",
* billingType: "PostPaidByBandwidth",
* bandwidth: 1,
* },
* tags: [{
* key: "k1",
* value: "v1",
* }],
* }, {
* dependsOn: [ipv6Gateway],
* });
* ```
*
* ## 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["deleteProtection"] = state ? state.deleteProtection : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["eipBillingConfig"] = state ? state.eipBillingConfig : undefined;
resourceInputs["ipv6EipBillingConfig"] = state ? state.ipv6EipBillingConfig : undefined;
resourceInputs["loadBalancerName"] = state ? state.loadBalancerName : undefined;
resourceInputs["localAddresses"] = state ? state.localAddresses : undefined;
resourceInputs["projectName"] = state ? state.projectName : 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["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["deleteProtection"] = args ? args.deleteProtection : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["eipBillingConfig"] = args ? args.eipBillingConfig : undefined;
resourceInputs["ipv6EipBillingConfig"] = args ? args.ipv6EipBillingConfig : undefined;
resourceInputs["loadBalancerName"] = args ? args.loadBalancerName : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : 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