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

com.pulumi.aws.serverlessrepository.kotlin.CloudFormationStackArgs.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.serverlessrepository.kotlin

import com.pulumi.aws.serverlessrepository.CloudFormationStackArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Deploys an Application CloudFormation Stack from the Serverless Application Repository.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const current = aws.getPartition({});
 * const currentGetRegion = aws.getRegion({});
 * const postgres_rotator = new aws.serverlessrepository.CloudFormationStack("postgres-rotator", {
 *     name: "postgres-rotator",
 *     applicationId: "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
 *     capabilities: [
 *         "CAPABILITY_IAM",
 *         "CAPABILITY_RESOURCE_POLICY",
 *     ],
 *     parameters: {
 *         functionName: "func-postgres-rotator",
 *         endpoint: Promise.all([currentGetRegion, current]).then(([currentGetRegion, current]) => `secretsmanager.${currentGetRegion.name}.${current.dnsSuffix}`),
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * current = aws.get_partition()
 * current_get_region = aws.get_region()
 * postgres_rotator = aws.serverlessrepository.CloudFormationStack("postgres-rotator",
 *     name="postgres-rotator",
 *     application_id="arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
 *     capabilities=[
 *         "CAPABILITY_IAM",
 *         "CAPABILITY_RESOURCE_POLICY",
 *     ],
 *     parameters={
 *         "functionName": "func-postgres-rotator",
 *         "endpoint": f"secretsmanager.{current_get_region.name}.{current.dns_suffix}",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Aws.GetPartition.Invoke();
 *     var currentGetRegion = Aws.GetRegion.Invoke();
 *     var postgres_rotator = new Aws.ServerlessRepository.CloudFormationStack("postgres-rotator", new()
 *     {
 *         Name = "postgres-rotator",
 *         ApplicationId = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
 *         Capabilities = new[]
 *         {
 *             "CAPABILITY_IAM",
 *             "CAPABILITY_RESOURCE_POLICY",
 *         },
 *         Parameters =
 *         {
 *             { "functionName", "func-postgres-rotator" },
 *             { "endpoint", Output.Tuple(currentGetRegion, current).Apply(values =>
 *             {
 *                 var currentGetRegion = values.Item1;
 *                 var current = values.Item2;
 *                 return $"secretsmanager.{currentGetRegion.Apply(getRegionResult => getRegionResult.Name)}.{current.Apply(getPartitionResult => getPartitionResult.DnsSuffix)}";
 *             }) },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/serverlessrepository"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		currentGetRegion, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = serverlessrepository.NewCloudFormationStack(ctx, "postgres-rotator", &serverlessrepository.CloudFormationStackArgs{
 * 			Name:          pulumi.String("postgres-rotator"),
 * 			ApplicationId: pulumi.String("arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"),
 * 			Capabilities: pulumi.StringArray{
 * 				pulumi.String("CAPABILITY_IAM"),
 * 				pulumi.String("CAPABILITY_RESOURCE_POLICY"),
 * 			},
 * 			Parameters: pulumi.StringMap{
 * 				"functionName": pulumi.String("func-postgres-rotator"),
 * 				"endpoint":     pulumi.Sprintf("secretsmanager.%v.%v", currentGetRegion.Name, current.DnsSuffix),
 * 			},
 * 		})
 * 		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.AwsFunctions;
 * import com.pulumi.aws.inputs.GetPartitionArgs;
 * import com.pulumi.aws.inputs.GetRegionArgs;
 * import com.pulumi.aws.serverlessrepository.CloudFormationStack;
 * import com.pulumi.aws.serverlessrepository.CloudFormationStackArgs;
 * 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 current = AwsFunctions.getPartition();
 *         final var currentGetRegion = AwsFunctions.getRegion();
 *         var postgres_rotator = new CloudFormationStack("postgres-rotator", CloudFormationStackArgs.builder()
 *             .name("postgres-rotator")
 *             .applicationId("arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser")
 *             .capabilities(
 *                 "CAPABILITY_IAM",
 *                 "CAPABILITY_RESOURCE_POLICY")
 *             .parameters(Map.ofEntries(
 *                 Map.entry("functionName", "func-postgres-rotator"),
 *                 Map.entry("endpoint", String.format("secretsmanager.%s.%s", currentGetRegion.applyValue(getRegionResult -> getRegionResult.name()),current.applyValue(getPartitionResult -> getPartitionResult.dnsSuffix())))
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   postgres-rotator:
 *     type: aws:serverlessrepository:CloudFormationStack
 *     properties:
 *       name: postgres-rotator
 *       applicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser
 *       capabilities:
 *         - CAPABILITY_IAM
 *         - CAPABILITY_RESOURCE_POLICY
 *       parameters:
 *         functionName: func-postgres-rotator
 *         endpoint: secretsmanager.${currentGetRegion.name}.${current.dnsSuffix}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: aws:getPartition
 *       Arguments: {}
 *   currentGetRegion:
 *     fn::invoke:
 *       Function: aws:getRegion
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Serverless Application Repository Stack using the CloudFormation Stack name (with or without the `serverlessrepo-` prefix) or the CloudFormation Stack ID. For example:
 * ```sh
 * $ pulumi import aws:serverlessrepository/cloudFormationStack:CloudFormationStack example serverlessrepo-postgres-rotator
 * ```
 * @property applicationId The ARN of the application from the Serverless Application Repository.
 * @property capabilities A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND`
 * @property name The name of the stack to create. The resource deployed in AWS will be prefixed with `serverlessrepo-`
 * @property parameters A map of Parameter structures that specify input parameters for the stack.
 * @property semanticVersion The version of the application to deploy. If not supplied, deploys the latest version.
 * @property tags A list of tags to associate with this stack. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class CloudFormationStackArgs(
    public val applicationId: Output? = null,
    public val capabilities: Output>? = null,
    public val name: Output? = null,
    public val parameters: Output>? = null,
    public val semanticVersion: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.serverlessrepository.CloudFormationStackArgs =
        com.pulumi.aws.serverlessrepository.CloudFormationStackArgs.builder()
            .applicationId(applicationId?.applyValue({ args0 -> args0 }))
            .capabilities(capabilities?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parameters(
                parameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .semanticVersion(semanticVersion?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [CloudFormationStackArgs].
 */
@PulumiTagMarker
public class CloudFormationStackArgsBuilder internal constructor() {
    private var applicationId: Output? = null

    private var capabilities: Output>? = null

    private var name: Output? = null

    private var parameters: Output>? = null

    private var semanticVersion: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The ARN of the application from the Serverless Application Repository.
     */
    @JvmName("ibhvvypmjtyvnspx")
    public suspend fun applicationId(`value`: Output) {
        this.applicationId = value
    }

    /**
     * @param value A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND`
     */
    @JvmName("wpgroutllarajigb")
    public suspend fun capabilities(`value`: Output>) {
        this.capabilities = value
    }

    @JvmName("wmjfxgkejvexrunk")
    public suspend fun capabilities(vararg values: Output) {
        this.capabilities = Output.all(values.asList())
    }

    /**
     * @param values A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND`
     */
    @JvmName("jequesctyukrgdjd")
    public suspend fun capabilities(values: List>) {
        this.capabilities = Output.all(values)
    }

    /**
     * @param value The name of the stack to create. The resource deployed in AWS will be prefixed with `serverlessrepo-`
     */
    @JvmName("ouvmcwvbvgvcxvgb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A map of Parameter structures that specify input parameters for the stack.
     */
    @JvmName("ybhwnbdumkuffunh")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

    /**
     * @param value The version of the application to deploy. If not supplied, deploys the latest version.
     */
    @JvmName("ktalqbjouexagwof")
    public suspend fun semanticVersion(`value`: Output) {
        this.semanticVersion = value
    }

    /**
     * @param value A list of tags to associate with this stack. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("safnynpivqamqfsj")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The ARN of the application from the Serverless Application Repository.
     */
    @JvmName("apccetfcvwudityw")
    public suspend fun applicationId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationId = mapped
    }

    /**
     * @param value A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND`
     */
    @JvmName("hunursymggikgfrw")
    public suspend fun capabilities(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capabilities = mapped
    }

    /**
     * @param values A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND`
     */
    @JvmName("iyfekyrdbrfnrtum")
    public suspend fun capabilities(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.capabilities = mapped
    }

    /**
     * @param value The name of the stack to create. The resource deployed in AWS will be prefixed with `serverlessrepo-`
     */
    @JvmName("pwiembdorsytwwgo")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A map of Parameter structures that specify input parameters for the stack.
     */
    @JvmName("lbwvgakoylekvsbp")
    public suspend fun parameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param values A map of Parameter structures that specify input parameters for the stack.
     */
    @JvmName("clsbkjelbiyfhktf")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value The version of the application to deploy. If not supplied, deploys the latest version.
     */
    @JvmName("folgumymhpnnlnhr")
    public suspend fun semanticVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.semanticVersion = mapped
    }

    /**
     * @param value A list of tags to associate with this stack. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("obujdtopbdlsieis")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A list of tags to associate with this stack. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("nuqsmsctpcvdvxwt")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): CloudFormationStackArgs = CloudFormationStackArgs(
        applicationId = applicationId,
        capabilities = capabilities,
        name = name,
        parameters = parameters,
        semanticVersion = semanticVersion,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy