@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
119 lines • 5.85 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.KafkaTrigger = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage vefaas kafka trigger
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.vefaas.KafkaTrigger("foo", {
* functionId: "35ybaxxx",
* mqInstanceId: "kafka-cnngmbeq10mcxxxx",
* topicName: "topic",
* kafkaCredentials: {
* password: "Waxxxxxx",
* username: "test-1",
* mechanism: "PLAIN",
* },
* batchSize: 100,
* description: "modify",
* });
* ```
*
* ## Import
*
* VefaasKafkaTrigger can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:vefaas/kafkaTrigger:KafkaTrigger default resource_id
* ```
*/
class KafkaTrigger extends pulumi.CustomResource {
/**
* Get an existing KafkaTrigger 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 KafkaTrigger(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of KafkaTrigger. 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'] === KafkaTrigger.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["batchFlushDurationMilliseconds"] = state ? state.batchFlushDurationMilliseconds : undefined;
resourceInputs["batchSize"] = state ? state.batchSize : undefined;
resourceInputs["consumerGroup"] = state ? state.consumerGroup : undefined;
resourceInputs["creationTime"] = state ? state.creationTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["functionId"] = state ? state.functionId : undefined;
resourceInputs["kafkaCredentials"] = state ? state.kafkaCredentials : undefined;
resourceInputs["lastUpdateTime"] = state ? state.lastUpdateTime : undefined;
resourceInputs["maximumRetryAttempts"] = state ? state.maximumRetryAttempts : undefined;
resourceInputs["mqInstanceId"] = state ? state.mqInstanceId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["startingPosition"] = state ? state.startingPosition : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["topicName"] = state ? state.topicName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.functionId === undefined) && !opts.urn) {
throw new Error("Missing required property 'functionId'");
}
if ((!args || args.kafkaCredentials === undefined) && !opts.urn) {
throw new Error("Missing required property 'kafkaCredentials'");
}
if ((!args || args.mqInstanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'mqInstanceId'");
}
if ((!args || args.topicName === undefined) && !opts.urn) {
throw new Error("Missing required property 'topicName'");
}
resourceInputs["batchFlushDurationMilliseconds"] = args ? args.batchFlushDurationMilliseconds : undefined;
resourceInputs["batchSize"] = args ? args.batchSize : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["functionId"] = args ? args.functionId : undefined;
resourceInputs["kafkaCredentials"] = args ? args.kafkaCredentials : undefined;
resourceInputs["maximumRetryAttempts"] = args ? args.maximumRetryAttempts : undefined;
resourceInputs["mqInstanceId"] = args ? args.mqInstanceId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["startingPosition"] = args ? args.startingPosition : undefined;
resourceInputs["topicName"] = args ? args.topicName : undefined;
resourceInputs["consumerGroup"] = undefined /*out*/;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["lastUpdateTime"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(KafkaTrigger.__pulumiType, name, resourceInputs, opts);
}
}
exports.KafkaTrigger = KafkaTrigger;
/** @internal */
KafkaTrigger.__pulumiType = 'volcengine:vefaas/kafkaTrigger:KafkaTrigger';
//# sourceMappingURL=kafkaTrigger.js.map