UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

146 lines 7.5 kB
"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.OauthProvider = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage iam oauth provider * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.iam.OauthProvider("foo", { * authorizeTemplate: "${authEndpoint}?client_id=${clientId}&scope=${scope}&response_type=code&state=12345", * authorizeUrl: "https://example.com/authorize", * clientId: "test_client_id", * clientSecret: "", * description: "acc-test", * identityMapType: 1, * idpIdentityKey: "username", * oauthProviderName: "acc-test-oauth", * scope: "openid", * ssoType: 2, * status: 1, * tokenUrl: "https://example.com/access_token", * userInfoUrl: "https://example.com/user_info", * }); * ``` * * ## Import * * IamOAuthProvider can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:iam/oauthProvider:OauthProvider default oidc_provider_name * ``` */ class OauthProvider extends pulumi.CustomResource { /** * Get an existing OauthProvider 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 OauthProvider(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of OauthProvider. 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'] === OauthProvider.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorizeTemplate"] = state ? state.authorizeTemplate : undefined; resourceInputs["authorizeUrl"] = state ? state.authorizeUrl : undefined; resourceInputs["clientId"] = state ? state.clientId : undefined; resourceInputs["clientSecret"] = state ? state.clientSecret : undefined; resourceInputs["createDate"] = state ? state.createDate : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["identityMapType"] = state ? state.identityMapType : undefined; resourceInputs["idpIdentityKey"] = state ? state.idpIdentityKey : undefined; resourceInputs["oauthProviderName"] = state ? state.oauthProviderName : undefined; resourceInputs["providerId"] = state ? state.providerId : undefined; resourceInputs["scope"] = state ? state.scope : undefined; resourceInputs["ssoType"] = state ? state.ssoType : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tokenUrl"] = state ? state.tokenUrl : undefined; resourceInputs["trn"] = state ? state.trn : undefined; resourceInputs["updateDate"] = state ? state.updateDate : undefined; resourceInputs["userInfoUrl"] = state ? state.userInfoUrl : undefined; } else { const args = argsOrState; if ((!args || args.authorizeTemplate === undefined) && !opts.urn) { throw new Error("Missing required property 'authorizeTemplate'"); } if ((!args || args.authorizeUrl === undefined) && !opts.urn) { throw new Error("Missing required property 'authorizeUrl'"); } if ((!args || args.clientId === undefined) && !opts.urn) { throw new Error("Missing required property 'clientId'"); } if ((!args || args.clientSecret === undefined) && !opts.urn) { throw new Error("Missing required property 'clientSecret'"); } if ((!args || args.identityMapType === undefined) && !opts.urn) { throw new Error("Missing required property 'identityMapType'"); } if ((!args || args.idpIdentityKey === undefined) && !opts.urn) { throw new Error("Missing required property 'idpIdentityKey'"); } if ((!args || args.oauthProviderName === undefined) && !opts.urn) { throw new Error("Missing required property 'oauthProviderName'"); } if ((!args || args.ssoType === undefined) && !opts.urn) { throw new Error("Missing required property 'ssoType'"); } if ((!args || args.tokenUrl === undefined) && !opts.urn) { throw new Error("Missing required property 'tokenUrl'"); } if ((!args || args.userInfoUrl === undefined) && !opts.urn) { throw new Error("Missing required property 'userInfoUrl'"); } resourceInputs["authorizeTemplate"] = args ? args.authorizeTemplate : undefined; resourceInputs["authorizeUrl"] = args ? args.authorizeUrl : undefined; resourceInputs["clientId"] = args ? args.clientId : undefined; resourceInputs["clientSecret"] = (args === null || args === void 0 ? void 0 : args.clientSecret) ? pulumi.secret(args.clientSecret) : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["identityMapType"] = args ? args.identityMapType : undefined; resourceInputs["idpIdentityKey"] = args ? args.idpIdentityKey : undefined; resourceInputs["oauthProviderName"] = args ? args.oauthProviderName : undefined; resourceInputs["scope"] = args ? args.scope : undefined; resourceInputs["ssoType"] = args ? args.ssoType : undefined; resourceInputs["status"] = args ? args.status : undefined; resourceInputs["tokenUrl"] = args ? args.tokenUrl : undefined; resourceInputs["userInfoUrl"] = args ? args.userInfoUrl : undefined; resourceInputs["createDate"] = undefined /*out*/; resourceInputs["providerId"] = undefined /*out*/; resourceInputs["trn"] = undefined /*out*/; resourceInputs["updateDate"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["clientSecret"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(OauthProvider.__pulumiType, name, resourceInputs, opts); } } exports.OauthProvider = OauthProvider; /** @internal */ OauthProvider.__pulumiType = 'volcengine:iam/oauthProvider:OauthProvider'; //# sourceMappingURL=oauthProvider.js.map