@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
148 lines • 7.02 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.FlowLog = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage flow log
* ## 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",
* projectName: "default",
* });
* 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 fooFlowLog = new volcengine.vpc.FlowLog("fooFlowLog", {
* flowLogName: "acc-test-flow-log",
* description: "acc-test",
* resourceType: "subnet",
* resourceId: fooSubnet.id,
* trafficType: "All",
* logProjectName: "acc-test-project",
* logTopicName: "acc-test-topic",
* aggregationInterval: 10,
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* ```
*
* ## Import
*
* FlowLog can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:vpc/flowLog:FlowLog default resource_id
* ```
*/
class FlowLog extends pulumi.CustomResource {
/**
* Get an existing FlowLog 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 FlowLog(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FlowLog. 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'] === FlowLog.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aggregationInterval"] = state ? state.aggregationInterval : undefined;
resourceInputs["businessStatus"] = state ? state.businessStatus : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["flowLogName"] = state ? state.flowLogName : undefined;
resourceInputs["lockReason"] = state ? state.lockReason : undefined;
resourceInputs["logProjectId"] = state ? state.logProjectId : undefined;
resourceInputs["logProjectName"] = state ? state.logProjectName : undefined;
resourceInputs["logTopicId"] = state ? state.logTopicId : undefined;
resourceInputs["logTopicName"] = state ? state.logTopicName : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["resourceId"] = state ? state.resourceId : undefined;
resourceInputs["resourceType"] = state ? state.resourceType : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["trafficType"] = state ? state.trafficType : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.aggregationInterval === undefined) && !opts.urn) {
throw new Error("Missing required property 'aggregationInterval'");
}
if ((!args || args.flowLogName === undefined) && !opts.urn) {
throw new Error("Missing required property 'flowLogName'");
}
if ((!args || args.logProjectName === undefined) && !opts.urn) {
throw new Error("Missing required property 'logProjectName'");
}
if ((!args || args.logTopicName === undefined) && !opts.urn) {
throw new Error("Missing required property 'logTopicName'");
}
if ((!args || args.resourceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'resourceId'");
}
if ((!args || args.resourceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'resourceType'");
}
if ((!args || args.trafficType === undefined) && !opts.urn) {
throw new Error("Missing required property 'trafficType'");
}
resourceInputs["aggregationInterval"] = args ? args.aggregationInterval : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["flowLogName"] = args ? args.flowLogName : undefined;
resourceInputs["logProjectName"] = args ? args.logProjectName : undefined;
resourceInputs["logTopicName"] = args ? args.logTopicName : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["resourceId"] = args ? args.resourceId : undefined;
resourceInputs["resourceType"] = args ? args.resourceType : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["trafficType"] = args ? args.trafficType : undefined;
resourceInputs["businessStatus"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["lockReason"] = undefined /*out*/;
resourceInputs["logProjectId"] = undefined /*out*/;
resourceInputs["logTopicId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FlowLog.__pulumiType, name, resourceInputs, opts);
}
}
exports.FlowLog = FlowLog;
/** @internal */
FlowLog.__pulumiType = 'volcengine:vpc/flowLog:FlowLog';
//# sourceMappingURL=flowLog.js.map