UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

273 lines (272 loc) 10.3 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * ## 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, * }); * // create internet nat gateway and snat entry and dnat entry * const internetNatGateway = new volcengine.nat.Gateway("internetNatGateway", { * vpcId: fooVpc.id, * subnetId: fooSubnet.id, * spec: "Small", * natGatewayName: "acc-test-internet_ng", * description: "acc-test", * billingType: "PostPaid", * projectName: "default", * tags: [{ * key: "k1", * value: "v1", * }], * }); * const fooAddress = new volcengine.eip.Address("fooAddress", { * description: "acc-test", * bandwidth: 1, * billingType: "PostPaidByBandwidth", * isp: "BGP", * }); * const fooAssociate = new volcengine.eip.Associate("fooAssociate", { * allocationId: fooAddress.id, * instanceId: internetNatGateway.id, * instanceType: "Nat", * }); * const fooSnatEntry = new volcengine.nat.SnatEntry("fooSnatEntry", { * snatEntryName: "acc-test-snat-entry", * natGatewayId: internetNatGateway.id, * eipId: fooAddress.id, * sourceCidr: "172.16.0.0/24", * }, { * dependsOn: [fooAssociate], * }); * const fooDnatEntry = new volcengine.nat.DnatEntry("fooDnatEntry", { * dnatEntryName: "acc-test-dnat-entry", * externalIp: fooAddress.eipAddress, * externalPort: "80", * internalIp: "172.16.0.10", * internalPort: "80", * natGatewayId: internetNatGateway.id, * protocol: "tcp", * }, { * dependsOn: [fooAssociate], * }); * // create intranet nat gateway and snat entry and dnat entry * const intranetNatGateway = new volcengine.nat.Gateway("intranetNatGateway", { * vpcId: fooVpc.id, * subnetId: fooSubnet.id, * natGatewayName: "acc-test-intranet_ng", * description: "acc-test", * networkType: "intranet", * billingType: "PostPaidByUsage", * projectName: "default", * tags: [{ * key: "k1", * value: "v1", * }], * }); * const fooIp = new volcengine.nat.Ip("fooIp", { * natGatewayId: intranetNatGateway.id, * natIpName: "acc-test-nat-ip", * natIpDescription: "acc-test", * natIp: "172.16.0.3", * }); * const foo_intranetSnatEntry = new volcengine.nat.SnatEntry("foo-intranetSnatEntry", { * snatEntryName: "acc-test-snat-entry-intranet", * natGatewayId: intranetNatGateway.id, * natIpId: fooIp.id, * sourceCidr: "172.16.0.0/24", * }); * const foo_intranetDnatEntry = new volcengine.nat.DnatEntry("foo-intranetDnatEntry", { * natGatewayId: intranetNatGateway.id, * dnatEntryName: "acc-test-dnat-entry-intranet", * protocol: "tcp", * internalIp: "172.16.0.5", * internalPort: "82", * externalIp: fooIp.natIp, * externalPort: "87", * }); * ``` * * ## Import * * NatGateway can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:nat/gateway:Gateway default ngw-vv3t043k05sm**** * ``` */ export declare class Gateway extends pulumi.CustomResource { /** * Get an existing Gateway 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: string, id: pulumi.Input<pulumi.ID>, state?: GatewayState, opts?: pulumi.CustomResourceOptions): Gateway; /** * Returns true if the given object is an instance of Gateway. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Gateway; /** * The billing type of the NatGateway, the value is `PostPaid` or `PrePaid` or `PostPaidByUsage`. Default value is `PostPaid`. * When the `networkType` is `intranet`, the billing type must be `PostPaidByUsage`. */ readonly billingType: pulumi.Output<string | undefined>; /** * The description of the NatGateway. */ readonly description: pulumi.Output<string | undefined>; /** * The name of the NatGateway. */ readonly natGatewayName: pulumi.Output<string | undefined>; /** * The network type of the NatGateway. Valid values are `internet` and `intranet`. Default value is `internet`. */ readonly networkType: pulumi.Output<string | undefined>; /** * The period of the NatGateway, the valid value range in 1~9 or 12 or 24 or 36. Default value is 12. The period unit defaults to `Month`.This field is only effective when creating a PrePaid NatGateway. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ readonly period: pulumi.Output<number | undefined>; /** * The ProjectName of the NatGateway. */ readonly projectName: pulumi.Output<string>; /** * The specification of the NatGateway. Optional choice contains `Small`(default), `Medium`, `Large` or leave blank. * When the `billingType` is `PostPaidByUsage`, this field should not be specified. */ readonly spec: pulumi.Output<string>; /** * The ID of the Subnet. */ readonly subnetId: pulumi.Output<string>; /** * Tags. */ readonly tags: pulumi.Output<outputs.nat.GatewayTag[] | undefined>; /** * The ID of the VPC. */ readonly vpcId: pulumi.Output<string>; /** * Create a Gateway resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: GatewayArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Gateway resources. */ export interface GatewayState { /** * The billing type of the NatGateway, the value is `PostPaid` or `PrePaid` or `PostPaidByUsage`. Default value is `PostPaid`. * When the `networkType` is `intranet`, the billing type must be `PostPaidByUsage`. */ billingType?: pulumi.Input<string>; /** * The description of the NatGateway. */ description?: pulumi.Input<string>; /** * The name of the NatGateway. */ natGatewayName?: pulumi.Input<string>; /** * The network type of the NatGateway. Valid values are `internet` and `intranet`. Default value is `internet`. */ networkType?: pulumi.Input<string>; /** * The period of the NatGateway, the valid value range in 1~9 or 12 or 24 or 36. Default value is 12. The period unit defaults to `Month`.This field is only effective when creating a PrePaid NatGateway. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ period?: pulumi.Input<number>; /** * The ProjectName of the NatGateway. */ projectName?: pulumi.Input<string>; /** * The specification of the NatGateway. Optional choice contains `Small`(default), `Medium`, `Large` or leave blank. * When the `billingType` is `PostPaidByUsage`, this field should not be specified. */ spec?: pulumi.Input<string>; /** * The ID of the Subnet. */ subnetId?: pulumi.Input<string>; /** * Tags. */ tags?: pulumi.Input<pulumi.Input<inputs.nat.GatewayTag>[]>; /** * The ID of the VPC. */ vpcId?: pulumi.Input<string>; } /** * The set of arguments for constructing a Gateway resource. */ export interface GatewayArgs { /** * The billing type of the NatGateway, the value is `PostPaid` or `PrePaid` or `PostPaidByUsage`. Default value is `PostPaid`. * When the `networkType` is `intranet`, the billing type must be `PostPaidByUsage`. */ billingType?: pulumi.Input<string>; /** * The description of the NatGateway. */ description?: pulumi.Input<string>; /** * The name of the NatGateway. */ natGatewayName?: pulumi.Input<string>; /** * The network type of the NatGateway. Valid values are `internet` and `intranet`. Default value is `internet`. */ networkType?: pulumi.Input<string>; /** * The period of the NatGateway, the valid value range in 1~9 or 12 or 24 or 36. Default value is 12. The period unit defaults to `Month`.This field is only effective when creating a PrePaid NatGateway. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ period?: pulumi.Input<number>; /** * The ProjectName of the NatGateway. */ projectName?: pulumi.Input<string>; /** * The specification of the NatGateway. Optional choice contains `Small`(default), `Medium`, `Large` or leave blank. * When the `billingType` is `PostPaidByUsage`, this field should not be specified. */ spec?: pulumi.Input<string>; /** * The ID of the Subnet. */ subnetId: pulumi.Input<string>; /** * Tags. */ tags?: pulumi.Input<pulumi.Input<inputs.nat.GatewayTag>[]>; /** * The ID of the VPC. */ vpcId: pulumi.Input<string>; }