All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.athena.kotlin.AthenaFunctions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.athena.kotlin

import com.pulumi.aws.athena.AthenaFunctions.getNamedQueryPlain
import com.pulumi.aws.athena.kotlin.inputs.GetNamedQueryPlainArgs
import com.pulumi.aws.athena.kotlin.inputs.GetNamedQueryPlainArgsBuilder
import com.pulumi.aws.athena.kotlin.outputs.GetNamedQueryResult
import com.pulumi.aws.athena.kotlin.outputs.GetNamedQueryResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object AthenaFunctions {
    /**
     * Provides an Athena Named Query data source.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as aws from "@pulumi/aws";
     * const example = aws.athena.getNamedQuery({
     *     name: "athenaQueryName",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_aws as aws
     * example = aws.athena.get_named_query(name="athenaQueryName")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Aws = Pulumi.Aws;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Aws.Athena.GetNamedQuery.Invoke(new()
     *     {
     *         Name = "athenaQueryName",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/athena"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := athena.LookupNamedQuery(ctx, &athena.LookupNamedQueryArgs{
     * 			Name: "athenaQueryName",
     * 		}, 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.aws.athena.AthenaFunctions;
     * import com.pulumi.aws.athena.inputs.GetNamedQueryArgs;
     * 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 example = AthenaFunctions.getNamedQuery(GetNamedQueryArgs.builder()
     *             .name("athenaQueryName")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: aws:athena:getNamedQuery
     *       Arguments:
     *         name: athenaQueryName
     * ```
     * 
     * @param argument A collection of arguments for invoking getNamedQuery.
     * @return A collection of values returned by getNamedQuery.
     */
    public suspend fun getNamedQuery(argument: GetNamedQueryPlainArgs): GetNamedQueryResult =
        toKotlin(getNamedQueryPlain(argument.toJava()).await())

    /**
     * @see [getNamedQuery].
     * @param name The plain language name for the query. Maximum length of 128.
     * @param workgroup The workgroup to which the query belongs. Defaults to `primary`.
     * @return A collection of values returned by getNamedQuery.
     */
    public suspend fun getNamedQuery(name: String, workgroup: String? = null): GetNamedQueryResult {
        val argument = GetNamedQueryPlainArgs(
            name = name,
            workgroup = workgroup,
        )
        return toKotlin(getNamedQueryPlain(argument.toJava()).await())
    }

    /**
     * @see [getNamedQuery].
     * @param argument Builder for [com.pulumi.aws.athena.kotlin.inputs.GetNamedQueryPlainArgs].
     * @return A collection of values returned by getNamedQuery.
     */
    public suspend fun getNamedQuery(argument: suspend GetNamedQueryPlainArgsBuilder.() -> Unit): GetNamedQueryResult {
        val builder = GetNamedQueryPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getNamedQueryPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy