com.pulumi.gcp.appengine.kotlin.AppengineFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.appengine.kotlin
import com.pulumi.gcp.appengine.AppengineFunctions.getDefaultServiceAccountPlain
import com.pulumi.gcp.appengine.kotlin.inputs.GetDefaultServiceAccountPlainArgs
import com.pulumi.gcp.appengine.kotlin.inputs.GetDefaultServiceAccountPlainArgsBuilder
import com.pulumi.gcp.appengine.kotlin.outputs.GetDefaultServiceAccountResult
import com.pulumi.gcp.appengine.kotlin.outputs.GetDefaultServiceAccountResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object AppengineFunctions {
/**
* Use this data source to retrieve the default App Engine service account for the specified project.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const default = gcp.appengine.getDefaultServiceAccount({});
* export const defaultAccount = _default.then(_default => _default.email);
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.appengine.get_default_service_account()
* pulumi.export("defaultAccount", default.email)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = Gcp.AppEngine.GetDefaultServiceAccount.Invoke();
* return new Dictionary
* {
* ["defaultAccount"] = @default.Apply(@default => @default.Apply(getDefaultServiceAccountResult => getDefaultServiceAccountResult.Email)),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/appengine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _default, err := appengine.GetDefaultServiceAccount(ctx, nil, nil)
* if err != nil {
* return err
* }
* ctx.Export("defaultAccount", _default.Email)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.appengine.AppengineFunctions;
* import com.pulumi.gcp.appengine.inputs.GetDefaultServiceAccountArgs;
* 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 default = AppengineFunctions.getDefaultServiceAccount();
* ctx.export("defaultAccount", default_.email());
* }
* }
* ```
* ```yaml
* variables:
* default:
* fn::invoke:
* Function: gcp:appengine:getDefaultServiceAccount
* Arguments: {}
* outputs:
* defaultAccount: ${default.email}
* ```
*
* @param argument A collection of arguments for invoking getDefaultServiceAccount.
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(argument: GetDefaultServiceAccountPlainArgs): GetDefaultServiceAccountResult =
toKotlin(getDefaultServiceAccountPlain(argument.toJava()).await())
/**
* @see [getDefaultServiceAccount].
* @param project The project ID. If it is not provided, the provider project is used.
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(project: String? = null): GetDefaultServiceAccountResult {
val argument = GetDefaultServiceAccountPlainArgs(
project = project,
)
return toKotlin(getDefaultServiceAccountPlain(argument.toJava()).await())
}
/**
* @see [getDefaultServiceAccount].
* @param argument Builder for [com.pulumi.gcp.appengine.kotlin.inputs.GetDefaultServiceAccountPlainArgs].
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(argument: suspend GetDefaultServiceAccountPlainArgsBuilder.() -> Unit): GetDefaultServiceAccountResult {
val builder = GetDefaultServiceAccountPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getDefaultServiceAccountPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy