com.pulumi.aws.cloudcontrol.kotlin.CloudcontrolFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.cloudcontrol.kotlin
import com.pulumi.aws.cloudcontrol.CloudcontrolFunctions.getResourcePlain
import com.pulumi.aws.cloudcontrol.kotlin.inputs.GetResourcePlainArgs
import com.pulumi.aws.cloudcontrol.kotlin.inputs.GetResourcePlainArgsBuilder
import com.pulumi.aws.cloudcontrol.kotlin.outputs.GetResourceResult
import com.pulumi.aws.cloudcontrol.kotlin.outputs.GetResourceResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object CloudcontrolFunctions {
/**
* Provides details for a Cloud Control API Resource. The reading of these resources is proxied through Cloud Control API handlers to the backend service.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = aws.cloudcontrol.getResource({
* identifier: "example",
* typeName: "AWS::ECS::Cluster",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.cloudcontrol.get_resource(identifier="example",
* type_name="AWS::ECS::Cluster")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = Aws.CloudControl.GetResource.Invoke(new()
* {
* Identifier = "example",
* TypeName = "AWS::ECS::Cluster",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudcontrol"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudcontrol.LookupResource(ctx, &cloudcontrol.LookupResourceArgs{
* Identifier: "example",
* TypeName: "AWS::ECS::Cluster",
* }, 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.cloudcontrol.CloudcontrolFunctions;
* import com.pulumi.aws.cloudcontrol.inputs.GetResourceArgs;
* 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 = CloudcontrolFunctions.getResource(GetResourceArgs.builder()
* .identifier("example")
* .typeName("AWS::ECS::Cluster")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: aws:cloudcontrol:getResource
* Arguments:
* identifier: example
* typeName: AWS::ECS::Cluster
* ```
*
* @param argument A collection of arguments for invoking getResource.
* @return A collection of values returned by getResource.
*/
public suspend fun getResource(argument: GetResourcePlainArgs): GetResourceResult =
toKotlin(getResourcePlain(argument.toJava()).await())
/**
* @see [getResource].
* @param identifier Identifier of the CloudFormation resource type. For example, `vpc-12345678`.
* @param roleArn ARN of the IAM Role to assume for operations.
* @param typeName CloudFormation resource type name. For example, `AWS::EC2::VPC`.
* The following arguments are optional:
* @param typeVersionId Identifier of the CloudFormation resource type version.
* @return A collection of values returned by getResource.
*/
public suspend fun getResource(
identifier: String,
roleArn: String? = null,
typeName: String,
typeVersionId: String? = null,
): GetResourceResult {
val argument = GetResourcePlainArgs(
identifier = identifier,
roleArn = roleArn,
typeName = typeName,
typeVersionId = typeVersionId,
)
return toKotlin(getResourcePlain(argument.toJava()).await())
}
/**
* @see [getResource].
* @param argument Builder for [com.pulumi.aws.cloudcontrol.kotlin.inputs.GetResourcePlainArgs].
* @return A collection of values returned by getResource.
*/
public suspend fun getResource(argument: suspend GetResourcePlainArgsBuilder.() -> Unit): GetResourceResult {
val builder = GetResourcePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getResourcePlain(builtArgument.toJava()).await())
}
}