UNPKG

@pulumi/kong

Version:

A Pulumi package for creating and managing Kong resources.

96 lines 3.97 kB
"use strict"; // *** 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.ConsumerJwtAuth = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## # kong.ConsumerJwtAuth * * Consumer jwt auth is a resource that allows you to configure the jwt auth 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 jwtPlugin = new kong.Plugin("jwt_plugin", { * name: "jwt", * configJson: `\x09{ * \x09\x09"claims_to_verify": ["exp"] * \x09} * `, * }); * const consumerJwtConfig = new kong.ConsumerJwtAuth("consumer_jwt_config", { * consumerId: myConsumer.id, * algorithm: "HS256", * key: "my_key", * rsaPublicKey: "foo", * secret: "my_secret", * }); * ``` */ class ConsumerJwtAuth extends pulumi.CustomResource { /** * Get an existing ConsumerJwtAuth 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 ConsumerJwtAuth(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ConsumerJwtAuth. 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'] === ConsumerJwtAuth.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["algorithm"] = state ? state.algorithm : undefined; resourceInputs["consumerId"] = state ? state.consumerId : undefined; resourceInputs["key"] = state ? state.key : undefined; resourceInputs["rsaPublicKey"] = state ? state.rsaPublicKey : undefined; resourceInputs["secret"] = state ? state.secret : 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.rsaPublicKey === undefined) && !opts.urn) { throw new Error("Missing required property 'rsaPublicKey'"); } resourceInputs["algorithm"] = args ? args.algorithm : undefined; resourceInputs["consumerId"] = args ? args.consumerId : undefined; resourceInputs["key"] = args ? args.key : undefined; resourceInputs["rsaPublicKey"] = args ? args.rsaPublicKey : undefined; resourceInputs["secret"] = args ? args.secret : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ConsumerJwtAuth.__pulumiType, name, resourceInputs, opts); } } exports.ConsumerJwtAuth = ConsumerJwtAuth; /** @internal */ ConsumerJwtAuth.__pulumiType = 'kong:index/consumerJwtAuth:ConsumerJwtAuth'; //# sourceMappingURL=consumerJwtAuth.js.map