@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
76 lines • 2.98 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.getClientOpenIdUserInfoOutput = exports.getClientOpenIdUserInfo = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Get OpenID userinfo about the credentials used with the Google provider,
* specifically the email.
*
* This datasource enables you to export the email of the account you've
* authenticated the provider with; this can be used alongside
* `data.google_client_config`'s `accessToken` to perform OpenID Connect
* authentication with GKE and configure an RBAC role for the email used.
*
* > This resource will only work as expected if the provider is configured to
* use the `https://www.googleapis.com/auth/userinfo.email` scope! You will
* receive an error otherwise. The provider uses this scope by default.
*
* ## Example Usage
*
* ### Exporting An Email
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* export = async () => {
* const me = await gcp.organizations.getClientOpenIdUserInfo({});
* return {
* "my-email": me.email,
* };
* }
* ```
*/
function getClientOpenIdUserInfo(opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("gcp:organizations/getClientOpenIdUserInfo:getClientOpenIdUserInfo", {}, opts);
}
exports.getClientOpenIdUserInfo = getClientOpenIdUserInfo;
/**
* Get OpenID userinfo about the credentials used with the Google provider,
* specifically the email.
*
* This datasource enables you to export the email of the account you've
* authenticated the provider with; this can be used alongside
* `data.google_client_config`'s `accessToken` to perform OpenID Connect
* authentication with GKE and configure an RBAC role for the email used.
*
* > This resource will only work as expected if the provider is configured to
* use the `https://www.googleapis.com/auth/userinfo.email` scope! You will
* receive an error otherwise. The provider uses this scope by default.
*
* ## Example Usage
*
* ### Exporting An Email
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* export = async () => {
* const me = await gcp.organizations.getClientOpenIdUserInfo({});
* return {
* "my-email": me.email,
* };
* }
* ```
*/
function getClientOpenIdUserInfoOutput(opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("gcp:organizations/getClientOpenIdUserInfo:getClientOpenIdUserInfo", {}, opts);
}
exports.getClientOpenIdUserInfoOutput = getClientOpenIdUserInfoOutput;
//# sourceMappingURL=getClientOpenIdUserInfo.js.map