@pulumi/kong
Version:
A Pulumi package for creating and managing Kong resources.
91 lines • 3.4 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsumerAcl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # kong.ConsumerAcl
*
* Consumer ACL is a resource that allows you to configure the acl plugin for a consumer.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kong from "@pulumi/kong";
*
* const myConsumer = new kong.Consumer("my_consumer", {
* username: "User1",
* customId: "123",
* });
* const aclPlugin = new kong.Plugin("acl_plugin", {
* name: "acl",
* configJson: `\x09{
* \x09\x09"allow": ["group1", "group2"]
* \x09}
* `,
* });
* const consumerAcl = new kong.ConsumerAcl("consumer_acl", {
* consumerId: myConsumer.id,
* group: "group2",
* tags: [
* "myTag",
* "otherTag",
* ],
* });
* ```
*/
class ConsumerAcl extends pulumi.CustomResource {
/**
* Get an existing ConsumerAcl 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 ConsumerAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ConsumerAcl. 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'] === ConsumerAcl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["consumerId"] = state ? state.consumerId : undefined;
resourceInputs["group"] = state ? state.group : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
if ((!args || args.consumerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'consumerId'");
}
if ((!args || args.group === undefined) && !opts.urn) {
throw new Error("Missing required property 'group'");
}
resourceInputs["consumerId"] = args ? args.consumerId : undefined;
resourceInputs["group"] = args ? args.group : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConsumerAcl.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConsumerAcl = ConsumerAcl;
/** @internal */
ConsumerAcl.__pulumiType = 'kong:index/consumerAcl:ConsumerAcl';
//# sourceMappingURL=consumerAcl.js.map