@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
162 lines • 5.23 kB
JavaScript
"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.getSnatEntriesOutput = exports.getSnatEntries = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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,
* ],
* });
* ```
*/
function getSnatEntries(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("volcengine:nat/getSnatEntries:getSnatEntries", {
"eipId": args.eipId,
"ids": args.ids,
"natGatewayId": args.natGatewayId,
"outputFile": args.outputFile,
"snatEntryName": args.snatEntryName,
"sourceCidr": args.sourceCidr,
"subnetId": args.subnetId,
}, opts);
}
exports.getSnatEntries = getSnatEntries;
/**
* 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,
* ],
* });
* ```
*/
function getSnatEntriesOutput(args, opts) {
return pulumi.output(args).apply((a) => getSnatEntries(a, opts));
}
exports.getSnatEntriesOutput = getSnatEntriesOutput;
//# sourceMappingURL=getSnatEntries.js.map