@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
248 lines (247 loc) • 7.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* Use this data source to query detailed information of snat entries
* ## 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,
* });
* const fooGateway = new volcengine.nat.Gateway("fooGateway", {
* vpcId: fooVpc.id,
* subnetId: fooSubnet.id,
* spec: "Small",
* natGatewayName: "acc-test-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: fooGateway.id,
* instanceType: "Nat",
* });
* const foo1 = new volcengine.nat.SnatEntry("foo1", {
* snatEntryName: "acc-test-snat-entry",
* natGatewayId: fooGateway.id,
* eipId: fooAddress.id,
* sourceCidr: "172.16.0.0/24",
* }, {
* dependsOn: [fooAssociate],
* });
* const foo2 = new volcengine.nat.SnatEntry("foo2", {
* snatEntryName: "acc-test-snat-entry",
* natGatewayId: fooGateway.id,
* eipId: fooAddress.id,
* sourceCidr: "172.16.0.0/16",
* }, {
* dependsOn: [fooAssociate],
* });
* const fooSnatEntries = volcengine.nat.getSnatEntriesOutput({
* ids: [
* foo1.id,
* foo2.id,
* ],
* });
* ```
*/
/** @deprecated volcengine.nat.SnatEntries has been deprecated in favor of volcengine.nat.getSnatEntries */
export declare function snatEntries(args?: SnatEntriesArgs, opts?: pulumi.InvokeOptions): Promise<SnatEntriesResult>;
/**
* A collection of arguments for invoking SnatEntries.
*/
export interface SnatEntriesArgs {
/**
* An id of the public ip address used by the SNAT entry.
*/
eipId?: string;
/**
* A list of SNAT entry ids.
*/
ids?: string[];
/**
* An id of the nat gateway to which the entry belongs.
*/
natGatewayId?: string;
/**
* File name where to save data source results.
*/
outputFile?: string;
/**
* A name of SNAT entry.
*/
snatEntryName?: string;
/**
* The SourceCidr of SNAT entry.
*/
sourceCidr?: string;
/**
* An id of the subnet that is required to access the Internet.
*/
subnetId?: string;
}
/**
* A collection of values returned by SnatEntries.
*/
export interface SnatEntriesResult {
/**
* The id of the public ip address used by the SNAT entry.
*/
readonly eipId?: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly ids?: string[];
/**
* The id of the nat gateway to which the entry belongs.
*/
readonly natGatewayId?: string;
readonly outputFile?: string;
/**
* The collection of snat entries.
*/
readonly snatEntries: outputs.nat.SnatEntriesSnatEntry[];
/**
* The name of the SNAT entry.
*/
readonly snatEntryName?: string;
/**
* The SourceCidr of the SNAT entry.
*/
readonly sourceCidr?: string;
/**
* The id of the subnet that is required to access the internet.
*/
readonly subnetId?: string;
/**
* The total count of snat entries query.
*/
readonly totalCount: number;
}
/**
* Use this data source to query detailed information of snat entries
* ## 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,
* });
* const fooGateway = new volcengine.nat.Gateway("fooGateway", {
* vpcId: fooVpc.id,
* subnetId: fooSubnet.id,
* spec: "Small",
* natGatewayName: "acc-test-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: fooGateway.id,
* instanceType: "Nat",
* });
* const foo1 = new volcengine.nat.SnatEntry("foo1", {
* snatEntryName: "acc-test-snat-entry",
* natGatewayId: fooGateway.id,
* eipId: fooAddress.id,
* sourceCidr: "172.16.0.0/24",
* }, {
* dependsOn: [fooAssociate],
* });
* const foo2 = new volcengine.nat.SnatEntry("foo2", {
* snatEntryName: "acc-test-snat-entry",
* natGatewayId: fooGateway.id,
* eipId: fooAddress.id,
* sourceCidr: "172.16.0.0/16",
* }, {
* dependsOn: [fooAssociate],
* });
* const fooSnatEntries = volcengine.nat.getSnatEntriesOutput({
* ids: [
* foo1.id,
* foo2.id,
* ],
* });
* ```
*/
/** @deprecated volcengine.nat.SnatEntries has been deprecated in favor of volcengine.nat.getSnatEntries */
export declare function snatEntriesOutput(args?: SnatEntriesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<SnatEntriesResult>;
/**
* A collection of arguments for invoking SnatEntries.
*/
export interface SnatEntriesOutputArgs {
/**
* An id of the public ip address used by the SNAT entry.
*/
eipId?: pulumi.Input<string>;
/**
* A list of SNAT entry ids.
*/
ids?: pulumi.Input<pulumi.Input<string>[]>;
/**
* An id of the nat gateway to which the entry belongs.
*/
natGatewayId?: pulumi.Input<string>;
/**
* File name where to save data source results.
*/
outputFile?: pulumi.Input<string>;
/**
* A name of SNAT entry.
*/
snatEntryName?: pulumi.Input<string>;
/**
* The SourceCidr of SNAT entry.
*/
sourceCidr?: pulumi.Input<string>;
/**
* An id of the subnet that is required to access the Internet.
*/
subnetId?: pulumi.Input<string>;
}