com.pulumi.gcp.cloudbuild.kotlin.CloudbuildFunctions.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.cloudbuild.kotlin
import com.pulumi.gcp.cloudbuild.CloudbuildFunctions.getTriggerPlain
import com.pulumi.gcp.cloudbuild.kotlin.inputs.GetTriggerPlainArgs
import com.pulumi.gcp.cloudbuild.kotlin.inputs.GetTriggerPlainArgsBuilder
import com.pulumi.gcp.cloudbuild.kotlin.outputs.GetTriggerResult
import com.pulumi.gcp.cloudbuild.kotlin.outputs.GetTriggerResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object CloudbuildFunctions {
/**
* To get more information about Cloudbuild Trigger, see:
* * [API documentation](https://cloud.google.com/build/docs/api/reference/rest/v1/projects.triggers)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/build/docs/automating-builds/create-manage-triggers)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const name = gcp.cloudbuild.getTrigger({
* project: "your-project-id",
* triggerId: filename_trigger.triggerId,
* location: "location of trigger build",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* name = gcp.cloudbuild.get_trigger(project="your-project-id",
* trigger_id=filename_trigger["triggerId"],
* location="location of trigger build")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var name = Gcp.CloudBuild.GetTrigger.Invoke(new()
* {
* Project = "your-project-id",
* TriggerId = filename_trigger.TriggerId,
* Location = "location of trigger build",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuild"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudbuild.LookupTrigger(ctx, &cloudbuild.LookupTriggerArgs{
* Project: pulumi.StringRef("your-project-id"),
* TriggerId: filename_trigger.TriggerId,
* Location: "location of trigger build",
* }, 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.cloudbuild.CloudbuildFunctions;
* import com.pulumi.gcp.cloudbuild.inputs.GetTriggerArgs;
* 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 name = CloudbuildFunctions.getTrigger(GetTriggerArgs.builder()
* .project("your-project-id")
* .triggerId(filename_trigger.triggerId())
* .location("location of trigger build")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* name:
* fn::invoke:
* Function: gcp:cloudbuild:getTrigger
* Arguments:
* project: your-project-id
* triggerId: ${["filename-trigger"].triggerId}
* location: location of trigger build
* ```
*
* @param argument A collection of arguments for invoking getTrigger.
* @return A collection of values returned by getTrigger.
*/
public suspend fun getTrigger(argument: GetTriggerPlainArgs): GetTriggerResult =
toKotlin(getTriggerPlain(argument.toJava()).await())
/**
* @see [getTrigger].
* @param location The Cloud Build location for the trigger.
* - - -
* @param project The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
* @param triggerId The unique identifier for the trigger..
* @return A collection of values returned by getTrigger.
*/
public suspend fun getTrigger(
location: String,
project: String? = null,
triggerId: String,
): GetTriggerResult {
val argument = GetTriggerPlainArgs(
location = location,
project = project,
triggerId = triggerId,
)
return toKotlin(getTriggerPlain(argument.toJava()).await())
}
/**
* @see [getTrigger].
* @param argument Builder for [com.pulumi.gcp.cloudbuild.kotlin.inputs.GetTriggerPlainArgs].
* @return A collection of values returned by getTrigger.
*/
public suspend fun getTrigger(argument: suspend GetTriggerPlainArgsBuilder.() -> Unit): GetTriggerResult {
val builder = GetTriggerPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getTriggerPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy