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 access_token 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.

Example Usage

Exporting An Email

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var me = Output.Create(Gcp.Organizations.GetClientOpenIdUserInfo.InvokeAsync());
        this.My_email = me.Apply(me => me.Email);
    }

    [Output("my-email")]
    public Output<string> My_email { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		me, err := organizations.GetClientOpenIdUserInfo(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("my-email", me.Email)
		return nil
	})
}
import pulumi
import pulumi_gcp as gcp

me = gcp.organizations.get_client_open_id_user_info()
pulumi.export("my-email", me.email)
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const me = gcp.organizations.getClientOpenIdUserInfo({});
export const my_email = me.then(me => me.email);

Using getClientOpenIdUserInfo

function getClientOpenIdUserInfo(opts?: InvokeOptions): Promise<GetClientOpenIdUserInfoResult>
def get_client_open_id_user_info(opts: Optional[InvokeOptions] = None) -> GetClientOpenIdUserInfoResult
func GetClientOpenIdUserInfo(ctx *Context, opts ...InvokeOption) (*GetClientOpenIdUserInfoResult, error)

Note: This function is named GetClientOpenIdUserInfo in the Go SDK.

public static class GetClientOpenIdUserInfo {
    public static Task<GetClientOpenIdUserInfoResult> InvokeAsync(InvokeOptions? opts = null)
}

getClientOpenIdUserInfo Result

The following output properties are available:

Email string
The email of the account used by the provider to authenticate with GCP.
Id string
The provider-assigned unique ID for this managed resource.
Email string
The email of the account used by the provider to authenticate with GCP.
Id string
The provider-assigned unique ID for this managed resource.
email string
The email of the account used by the provider to authenticate with GCP.
id string
The provider-assigned unique ID for this managed resource.
email str
The email of the account used by the provider to authenticate with GCP.
id str
The provider-assigned unique ID for this managed resource.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.