UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

146 lines 6.92 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.OauthClient = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Represents an OAuth Client. Used to access Google Cloud resources on behalf of a * Workforce Identity Federation user by using OAuth 2.0 Protocol to obtain an access * token from Google Cloud. * * To get more information about OauthClient, see: * * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.oauthClients) * * How-to Guides * * [Managing OAuth clients](https://cloud.google.com/iam/docs/workforce-manage-oauth-app#manage-clients) * * ## Example Usage * * ### Iam Oauth Client Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.iam.OauthClient("example", { * oauthClientId: "example-client-id", * displayName: "Display Name of OAuth client", * description: "A sample OAuth client", * location: "global", * disabled: false, * allowedGrantTypes: ["AUTHORIZATION_CODE_GRANT"], * allowedRedirectUris: ["https://www.example.com"], * allowedScopes: ["https://www.googleapis.com/auth/cloud-platform"], * clientType: "CONFIDENTIAL_CLIENT", * }); * ``` * * ## Import * * OauthClient can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/oauthClients/{{oauth_client_id}}` * * * `{{project}}/{{location}}/{{oauth_client_id}}` * * * `{{location}}/{{oauth_client_id}}` * * When using the `pulumi import` command, OauthClient can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:iam/oauthClient:OauthClient default projects/{{project}}/locations/{{location}}/oauthClients/{{oauth_client_id}} * ``` * * ```sh * $ pulumi import gcp:iam/oauthClient:OauthClient default {{project}}/{{location}}/{{oauth_client_id}} * ``` * * ```sh * $ pulumi import gcp:iam/oauthClient:OauthClient default {{location}}/{{oauth_client_id}} * ``` */ class OauthClient extends pulumi.CustomResource { /** * Get an existing OauthClient 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 OauthClient(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of OauthClient. 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'] === OauthClient.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedGrantTypes"] = state ? state.allowedGrantTypes : undefined; resourceInputs["allowedRedirectUris"] = state ? state.allowedRedirectUris : undefined; resourceInputs["allowedScopes"] = state ? state.allowedScopes : undefined; resourceInputs["clientId"] = state ? state.clientId : undefined; resourceInputs["clientType"] = state ? state.clientType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["expireTime"] = state ? state.expireTime : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["oauthClientId"] = state ? state.oauthClientId : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["state"] = state ? state.state : undefined; } else { const args = argsOrState; if ((!args || args.allowedGrantTypes === undefined) && !opts.urn) { throw new Error("Missing required property 'allowedGrantTypes'"); } if ((!args || args.allowedRedirectUris === undefined) && !opts.urn) { throw new Error("Missing required property 'allowedRedirectUris'"); } if ((!args || args.allowedScopes === undefined) && !opts.urn) { throw new Error("Missing required property 'allowedScopes'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.oauthClientId === undefined) && !opts.urn) { throw new Error("Missing required property 'oauthClientId'"); } resourceInputs["allowedGrantTypes"] = args ? args.allowedGrantTypes : undefined; resourceInputs["allowedRedirectUris"] = args ? args.allowedRedirectUris : undefined; resourceInputs["allowedScopes"] = args ? args.allowedScopes : undefined; resourceInputs["clientType"] = args ? args.clientType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["oauthClientId"] = args ? args.oauthClientId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["clientId"] = undefined /*out*/; resourceInputs["expireTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(OauthClient.__pulumiType, name, resourceInputs, opts); } } exports.OauthClient = OauthClient; /** @internal */ OauthClient.__pulumiType = 'gcp:iam/oauthClient:OauthClient'; //# sourceMappingURL=oauthClient.js.map