com.pulumi.gcp.datastream.kotlin.DatastreamFunctions.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.datastream.kotlin
import com.pulumi.gcp.datastream.DatastreamFunctions.getStaticIpsPlain
import com.pulumi.gcp.datastream.kotlin.inputs.GetStaticIpsPlainArgs
import com.pulumi.gcp.datastream.kotlin.inputs.GetStaticIpsPlainArgsBuilder
import com.pulumi.gcp.datastream.kotlin.outputs.GetStaticIpsResult
import com.pulumi.gcp.datastream.kotlin.outputs.GetStaticIpsResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object DatastreamFunctions {
/**
* Returns the list of IP addresses that Datastream connects from. For more information see
* the [official documentation](https://cloud.google.com/datastream/docs/ip-allowlists-and-regions).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const datastreamIps = gcp.datastream.getStaticIps({
* location: "us-west1",
* project: "my-project",
* });
* export const ipList = datastreamIps.then(datastreamIps => datastreamIps.staticIps);
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* datastream_ips = gcp.datastream.get_static_ips(location="us-west1",
* project="my-project")
* pulumi.export("ipList", datastream_ips.static_ips)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var datastreamIps = Gcp.Datastream.GetStaticIps.Invoke(new()
* {
* Location = "us-west1",
* Project = "my-project",
* });
* return new Dictionary
* {
* ["ipList"] = datastreamIps.Apply(getStaticIpsResult => getStaticIpsResult.StaticIps),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* datastreamIps, err := datastream.GetStaticIps(ctx, &datastream.GetStaticIpsArgs{
* Location: "us-west1",
* Project: pulumi.StringRef("my-project"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("ipList", datastreamIps.StaticIps)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.datastream.DatastreamFunctions;
* import com.pulumi.gcp.datastream.inputs.GetStaticIpsArgs;
* 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 datastreamIps = DatastreamFunctions.getStaticIps(GetStaticIpsArgs.builder()
* .location("us-west1")
* .project("my-project")
* .build());
* ctx.export("ipList", datastreamIps.applyValue(getStaticIpsResult -> getStaticIpsResult.staticIps()));
* }
* }
* ```
* ```yaml
* variables:
* datastreamIps:
* fn::invoke:
* Function: gcp:datastream:getStaticIps
* Arguments:
* location: us-west1
* project: my-project
* outputs:
* ipList: ${datastreamIps.staticIps}
* ```
*
* @param argument A collection of arguments for invoking getStaticIps.
* @return A collection of values returned by getStaticIps.
*/
public suspend fun getStaticIps(argument: GetStaticIpsPlainArgs): GetStaticIpsResult =
toKotlin(getStaticIpsPlain(argument.toJava()).await())
/**
* @see [getStaticIps].
* @param location The location to list Datastream IPs for. For example: `us-east1`.
* @param project Project from which to list static IP addresses. Defaults to project declared in the provider.
* @return A collection of values returned by getStaticIps.
*/
public suspend fun getStaticIps(location: String, project: String? = null): GetStaticIpsResult {
val argument = GetStaticIpsPlainArgs(
location = location,
project = project,
)
return toKotlin(getStaticIpsPlain(argument.toJava()).await())
}
/**
* @see [getStaticIps].
* @param argument Builder for [com.pulumi.gcp.datastream.kotlin.inputs.GetStaticIpsPlainArgs].
* @return A collection of values returned by getStaticIps.
*/
public suspend fun getStaticIps(argument: suspend GetStaticIpsPlainArgsBuilder.() -> Unit): GetStaticIpsResult {
val builder = GetStaticIpsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getStaticIpsPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy