ServiceAccountFunctions

Functions

Link copied to clipboard

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

suspend fun getAccount(argument: suspend GetAccountPlainArgsBuilder.() -> Unit): GetAccountResult
suspend fun getAccount(accountId: String, project: String? = null): GetAccountResult
Link copied to clipboard

This data source provides a google oauth2 access_token for a different service account than the one initially running the script. For more information see the official documentation as well as iamcredentials.generateAccessToken()

suspend fun getAccountAccessToken(delegates: List<String>? = null, lifetime: String? = null, scopes: List<String>, targetServiceAccount: String): GetAccountAccessTokenResult
Link copied to clipboard

This data source provides a Google OpenID Connect (oidc) id_token. Tokens issued from this data source are typically used to call external services that accept OIDC tokens for authentication (e.g. Google Cloud Run). For more information see OpenID Connect.

suspend fun getAccountIdToken(delegates: List<String>? = null, includeEmail: Boolean? = null, targetAudience: String, targetServiceAccount: String? = null): GetAccountIdTokenResult
Link copied to clipboard

This data source provides a self-signed JWT. Tokens issued from this data source are typically used to call external services that accept JWTs for authentication.

suspend fun getAccountJwt(delegates: List<String>? = null, expiresIn: Int? = null, payload: String, targetServiceAccount: String): GetAccountJwtResult
Link copied to clipboard

Get service account public key. For more information, see the official documentation and API.

suspend fun getAccountKey(name: String, project: String? = null, publicKeyType: String? = null): GetAccountKeyResult
Link copied to clipboard

Retrieves the current IAM policy data for a service account.

suspend fun getIamPolicy(serviceAccountId: String): GetIamPolicyResult