gcp.serviceAccount.getAccount

Explore with Pulumi AI

Get the service account from a project. For more information see the official API documentation.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var objectViewer = Gcp.ServiceAccount.GetAccount.Invoke(new()
    {
        AccountId = "object-viewer",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/serviceAccount"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := serviceAccount.GetAccount(ctx, &serviceaccount.GetAccountArgs{
			AccountId: "object-viewer",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceAccount.ServiceAccountFunctions;
import com.pulumi.gcp.serviceAccount.inputs.GetAccountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var objectViewer = ServiceAccountFunctions.getAccount(GetAccountArgs.builder()
            .accountId("object-viewer")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

object_viewer = gcp.serviceAccount.get_account(account_id="object-viewer")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const objectViewer = gcp.serviceAccount.getAccount({
    accountId: "object-viewer",
});
variables:
  objectViewer:
    fn::invoke:
      Function: gcp:serviceAccount:getAccount
      Arguments:
        accountId: object-viewer

Using getAccount

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAccount(args: GetAccountArgs, opts?: InvokeOptions): Promise<GetAccountResult>
function getAccountOutput(args: GetAccountOutputArgs, opts?: InvokeOptions): Output<GetAccountResult>
def get_account(account_id: Optional[str] = None,
                project: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetAccountResult
def get_account_output(account_id: Optional[pulumi.Input[str]] = None,
                project: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetAccountResult]
func GetAccount(ctx *Context, args *GetAccountArgs, opts ...InvokeOption) (*GetAccountResult, error)
func GetAccountOutput(ctx *Context, args *GetAccountOutputArgs, opts ...InvokeOption) GetAccountResultOutput

> Note: This function is named GetAccount in the Go SDK.

public static class GetAccount 
{
    public static Task<GetAccountResult> InvokeAsync(GetAccountArgs args, InvokeOptions? opts = null)
    public static Output<GetAccountResult> Invoke(GetAccountInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:serviceAccount/getAccount:getAccount
  arguments:
    # arguments dictionary

The following arguments are supported:

AccountId string

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

Project string

The ID of the project that the service account is present in. Defaults to the provider project configuration.

AccountId string

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

Project string

The ID of the project that the service account is present in. Defaults to the provider project configuration.

accountId String

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

project String

The ID of the project that the service account is present in. Defaults to the provider project configuration.

accountId string

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

project string

The ID of the project that the service account is present in. Defaults to the provider project configuration.

account_id str

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

project str

The ID of the project that the service account is present in. Defaults to the provider project configuration.

accountId String

The Google service account ID. This be one of:

  • The name of the service account within the project (e.g. my-service)

  • The fully-qualified path to a service account resource (e.g. projects/my-project/serviceAccounts/...)

  • The email address of the service account (e.g. my-service@my-project.iam.gserviceaccount.com)

project String

The ID of the project that the service account is present in. Defaults to the provider project configuration.

getAccount Result

The following output properties are available:

AccountId string
DisplayName string

The display name for the service account.

Email string

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

Id string

The provider-assigned unique ID for this managed resource.

Member string

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

Name string

The fully-qualified name of the service account.

UniqueId string

The unique id of the service account.

Project string
AccountId string
DisplayName string

The display name for the service account.

Email string

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

Id string

The provider-assigned unique ID for this managed resource.

Member string

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

Name string

The fully-qualified name of the service account.

UniqueId string

The unique id of the service account.

Project string
accountId String
displayName String

The display name for the service account.

email String

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

id String

The provider-assigned unique ID for this managed resource.

member String

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

name String

The fully-qualified name of the service account.

uniqueId String

The unique id of the service account.

project String
accountId string
displayName string

The display name for the service account.

email string

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

id string

The provider-assigned unique ID for this managed resource.

member string

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

name string

The fully-qualified name of the service account.

uniqueId string

The unique id of the service account.

project string
account_id str
display_name str

The display name for the service account.

email str

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

id str

The provider-assigned unique ID for this managed resource.

member str

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

name str

The fully-qualified name of the service account.

unique_id str

The unique id of the service account.

project str
accountId String
displayName String

The display name for the service account.

email String

The e-mail address of the service account. This value should be referenced from any gcp.organizations.getIAMPolicy data sources that would grant the service account privileges.

id String

The provider-assigned unique ID for this managed resource.

member String

The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions.

name String

The fully-qualified name of the service account.

uniqueId String

The unique id of the service account.

project String

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.