com.pulumi.gcp.cloudrunv2.kotlin.Cloudrunv2Functions.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.cloudrunv2.kotlin
import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions.getJobIamPolicyPlain
import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions.getJobPlain
import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions.getServiceIamPolicyPlain
import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions.getServicePlain
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobIamPolicyPlainArgs
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobIamPolicyPlainArgsBuilder
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobPlainArgs
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobPlainArgsBuilder
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServiceIamPolicyPlainArgs
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServiceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServicePlainArgs
import com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServicePlainArgsBuilder
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetJobIamPolicyResult
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetJobResult
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetServiceIamPolicyResult
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetServiceResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetJobIamPolicyResult.Companion.toKotlin as getJobIamPolicyResultToKotlin
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetJobResult.Companion.toKotlin as getJobResultToKotlin
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetServiceIamPolicyResult.Companion.toKotlin as getServiceIamPolicyResultToKotlin
import com.pulumi.gcp.cloudrunv2.kotlin.outputs.GetServiceResult.Companion.toKotlin as getServiceResultToKotlin
public object Cloudrunv2Functions {
/**
* Get information about a Google Cloud Run v2 Job. For more information see
* the [official documentation](https://cloud.google.com/run/docs/)
* and [API](https://cloud.google.com/run/docs/apis).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myJob = gcp.cloudrunv2.getJob({
* name: "my-job",
* location: "us-central1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_job = gcp.cloudrunv2.get_job(name="my-job",
* location="us-central1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myJob = Gcp.CloudRunV2.GetJob.Invoke(new()
* {
* Name = "my-job",
* Location = "us-central1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudrunv2.LookupJob(ctx, &cloudrunv2.LookupJobArgs{
* Name: "my-job",
* Location: pulumi.StringRef("us-central1"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions;
* import com.pulumi.gcp.cloudrunv2.inputs.GetJobArgs;
* 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 myJob = Cloudrunv2Functions.getJob(GetJobArgs.builder()
* .name("my-job")
* .location("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* myJob:
* fn::invoke:
* Function: gcp:cloudrunv2:getJob
* Arguments:
* name: my-job
* location: us-central1
* ```
*
* @param argument A collection of arguments for invoking getJob.
* @return A collection of values returned by getJob.
*/
public suspend fun getJob(argument: GetJobPlainArgs): GetJobResult =
getJobResultToKotlin(getJobPlain(argument.toJava()).await())
/**
* @see [getJob].
* @param location The location of the instance. eg us-central1
* - - -
* @param name The name of the Cloud Run v2 Job.
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getJob.
*/
public suspend fun getJob(
location: String? = null,
name: String,
project: String? = null,
): GetJobResult {
val argument = GetJobPlainArgs(
location = location,
name = name,
project = project,
)
return getJobResultToKotlin(getJobPlain(argument.toJava()).await())
}
/**
* @see [getJob].
* @param argument Builder for [com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobPlainArgs].
* @return A collection of values returned by getJob.
*/
public suspend fun getJob(argument: suspend GetJobPlainArgsBuilder.() -> Unit): GetJobResult {
val builder = GetJobPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getJobResultToKotlin(getJobPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for job
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.cloudrunv2.getJobIamPolicy({
* project: _default.project,
* location: _default.location,
* name: _default.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.cloudrunv2.get_job_iam_policy(project=default["project"],
* location=default["location"],
* name=default["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.CloudRunV2.GetJobIamPolicy.Invoke(new()
* {
* Project = @default.Project,
* Location = @default.Location,
* Name = @default.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudrunv2.LookupJobIamPolicy(ctx, &cloudrunv2.LookupJobIamPolicyArgs{
* Project: pulumi.StringRef(_default.Project),
* Location: pulumi.StringRef(_default.Location),
* Name: _default.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions;
* import com.pulumi.gcp.cloudrunv2.inputs.GetJobIamPolicyArgs;
* 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 policy = Cloudrunv2Functions.getJobIamPolicy(GetJobIamPolicyArgs.builder()
* .project(default_.project())
* .location(default_.location())
* .name(default_.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:cloudrunv2:getJobIamPolicy
* Arguments:
* project: ${default.project}
* location: ${default.location}
* name: ${default.name}
* ```
*
* @param argument A collection of arguments for invoking getJobIamPolicy.
* @return A collection of values returned by getJobIamPolicy.
*/
public suspend fun getJobIamPolicy(argument: GetJobIamPolicyPlainArgs): GetJobIamPolicyResult =
getJobIamPolicyResultToKotlin(getJobIamPolicyPlain(argument.toJava()).await())
/**
* @see [getJobIamPolicy].
* @param location The location of the cloud run job Used to find the parent resource to bind the IAM policy to
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getJobIamPolicy.
*/
public suspend fun getJobIamPolicy(
location: String? = null,
name: String,
project: String? = null,
): GetJobIamPolicyResult {
val argument = GetJobIamPolicyPlainArgs(
location = location,
name = name,
project = project,
)
return getJobIamPolicyResultToKotlin(getJobIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getJobIamPolicy].
* @param argument Builder for [com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetJobIamPolicyPlainArgs].
* @return A collection of values returned by getJobIamPolicy.
*/
public suspend fun getJobIamPolicy(argument: suspend GetJobIamPolicyPlainArgsBuilder.() -> Unit): GetJobIamPolicyResult {
val builder = GetJobIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getJobIamPolicyResultToKotlin(getJobIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Cloud Run v2 Service. For more information see
* the [official documentation](https://cloud.google.com/run/docs/)
* and [API](https://cloud.google.com/run/docs/apis).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myService = gcp.cloudrunv2.getService({
* name: "my-service",
* location: "us-central1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_service = gcp.cloudrunv2.get_service(name="my-service",
* location="us-central1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myService = Gcp.CloudRunV2.GetService.Invoke(new()
* {
* Name = "my-service",
* Location = "us-central1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudrunv2.LookupService(ctx, &cloudrunv2.LookupServiceArgs{
* Name: "my-service",
* Location: pulumi.StringRef("us-central1"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions;
* import com.pulumi.gcp.cloudrunv2.inputs.GetServiceArgs;
* 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 myService = Cloudrunv2Functions.getService(GetServiceArgs.builder()
* .name("my-service")
* .location("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* myService:
* fn::invoke:
* Function: gcp:cloudrunv2:getService
* Arguments:
* name: my-service
* location: us-central1
* ```
*
* @param argument A collection of arguments for invoking getService.
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: GetServicePlainArgs): GetServiceResult =
getServiceResultToKotlin(getServicePlain(argument.toJava()).await())
/**
* @see [getService].
* @param location The location of the instance. eg us-central1
* - - -
* @param name The name of the Cloud Run v2 Service.
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getService.
*/
public suspend fun getService(
location: String? = null,
name: String,
project: String? = null,
): GetServiceResult {
val argument = GetServicePlainArgs(
location = location,
name = name,
project = project,
)
return getServiceResultToKotlin(getServicePlain(argument.toJava()).await())
}
/**
* @see [getService].
* @param argument Builder for [com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServicePlainArgs].
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: suspend GetServicePlainArgsBuilder.() -> Unit): GetServiceResult {
val builder = GetServicePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getServiceResultToKotlin(getServicePlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for service
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.cloudrunv2.getServiceIamPolicy({
* project: _default.project,
* location: _default.location,
* name: _default.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.cloudrunv2.get_service_iam_policy(project=default["project"],
* location=default["location"],
* name=default["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.CloudRunV2.GetServiceIamPolicy.Invoke(new()
* {
* Project = @default.Project,
* Location = @default.Location,
* Name = @default.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudrunv2.LookupServiceIamPolicy(ctx, &cloudrunv2.LookupServiceIamPolicyArgs{
* Project: pulumi.StringRef(_default.Project),
* Location: pulumi.StringRef(_default.Location),
* Name: _default.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.cloudrunv2.Cloudrunv2Functions;
* import com.pulumi.gcp.cloudrunv2.inputs.GetServiceIamPolicyArgs;
* 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 policy = Cloudrunv2Functions.getServiceIamPolicy(GetServiceIamPolicyArgs.builder()
* .project(default_.project())
* .location(default_.location())
* .name(default_.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:cloudrunv2:getServiceIamPolicy
* Arguments:
* project: ${default.project}
* location: ${default.location}
* name: ${default.name}
* ```
*
* @param argument A collection of arguments for invoking getServiceIamPolicy.
* @return A collection of values returned by getServiceIamPolicy.
*/
public suspend fun getServiceIamPolicy(argument: GetServiceIamPolicyPlainArgs): GetServiceIamPolicyResult =
getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getServiceIamPolicy].
* @param location The location of the cloud run service Used to find the parent resource to bind the IAM policy to
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getServiceIamPolicy.
*/
public suspend fun getServiceIamPolicy(
location: String? = null,
name: String,
project: String? = null,
): GetServiceIamPolicyResult {
val argument = GetServiceIamPolicyPlainArgs(
location = location,
name = name,
project = project,
)
return getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getServiceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.cloudrunv2.kotlin.inputs.GetServiceIamPolicyPlainArgs].
* @return A collection of values returned by getServiceIamPolicy.
*/
public suspend fun getServiceIamPolicy(argument: suspend GetServiceIamPolicyPlainArgsBuilder.() -> Unit): GetServiceIamPolicyResult {
val builder = GetServiceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy