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

com.pulumi.awsnative.amplify.kotlin.BranchArgs.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: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.amplify.kotlin

import com.pulumi.awsnative.amplify.BranchArgs.builder
import com.pulumi.awsnative.amplify.kotlin.enums.BranchStage
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchBackendArgs
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchBackendArgsBuilder
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchBasicAuthConfigArgs
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchBasicAuthConfigArgsBuilder
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchEnvironmentVariableArgs
import com.pulumi.awsnative.amplify.kotlin.inputs.BranchEnvironmentVariableArgsBuilder
import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The AWS::Amplify::Branch resource creates a new branch within an app.
 * @property appId The unique ID for an Amplify app.
 * @property backend The backend for a `Branch` of an Amplify app. Use for a backend created from an AWS CloudFormation stack.
 * This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
 * @property basicAuthConfig The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format `user:password` .
 * @property branchName The name for the branch.
 * @property buildSpec The build specification (build spec) for the branch.
 * @property description The description for the branch that is part of an Amplify app.
 * @property enableAutoBuild Enables auto building for the branch.
 * @property enablePerformanceMode Enables performance mode for the branch.
 * Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.
 * @property enablePullRequestPreview Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch.
 * To provide backend support for your preview, Amplify automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property.
 * For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* .
 * @property environmentVariables The environment variables for the branch.
 * @property framework The framework for the branch.
 * @property pullRequestEnvironmentName If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI and mapped to this branch.
 * To enable pull request previews, set the `EnablePullRequestPreview` property to `true` .
 * If you don't specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting deletes this environment when the pull request is closed.
 * For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* .
 * @property stage Describes the current stage for the branch.
 * @property tags The tag for the branch.
 */
public data class BranchArgs(
    public val appId: Output? = null,
    public val backend: Output? = null,
    public val basicAuthConfig: Output? = null,
    public val branchName: Output? = null,
    public val buildSpec: Output? = null,
    public val description: Output? = null,
    public val enableAutoBuild: Output? = null,
    public val enablePerformanceMode: Output? = null,
    public val enablePullRequestPreview: Output? = null,
    public val environmentVariables: Output>? = null,
    public val framework: Output? = null,
    public val pullRequestEnvironmentName: Output? = null,
    public val stage: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.amplify.BranchArgs =
        com.pulumi.awsnative.amplify.BranchArgs.builder()
            .appId(appId?.applyValue({ args0 -> args0 }))
            .backend(backend?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .basicAuthConfig(basicAuthConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .branchName(branchName?.applyValue({ args0 -> args0 }))
            .buildSpec(buildSpec?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .enableAutoBuild(enableAutoBuild?.applyValue({ args0 -> args0 }))
            .enablePerformanceMode(enablePerformanceMode?.applyValue({ args0 -> args0 }))
            .enablePullRequestPreview(enablePullRequestPreview?.applyValue({ args0 -> args0 }))
            .environmentVariables(
                environmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .framework(framework?.applyValue({ args0 -> args0 }))
            .pullRequestEnvironmentName(pullRequestEnvironmentName?.applyValue({ args0 -> args0 }))
            .stage(stage?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [BranchArgs].
 */
@PulumiTagMarker
public class BranchArgsBuilder internal constructor() {
    private var appId: Output? = null

    private var backend: Output? = null

    private var basicAuthConfig: Output? = null

    private var branchName: Output? = null

    private var buildSpec: Output? = null

    private var description: Output? = null

    private var enableAutoBuild: Output? = null

    private var enablePerformanceMode: Output? = null

    private var enablePullRequestPreview: Output? = null

    private var environmentVariables: Output>? = null

    private var framework: Output? = null

    private var pullRequestEnvironmentName: Output? = null

    private var stage: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The unique ID for an Amplify app.
     */
    @JvmName("atcaohxacdniuntu")
    public suspend fun appId(`value`: Output) {
        this.appId = value
    }

    /**
     * @param value The backend for a `Branch` of an Amplify app. Use for a backend created from an AWS CloudFormation stack.
     * This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
     */
    @JvmName("yxjnyihvuhjlkxvh")
    public suspend fun backend(`value`: Output) {
        this.backend = value
    }

    /**
     * @param value The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format `user:password` .
     */
    @JvmName("wongpkscgmnokwmd")
    public suspend fun basicAuthConfig(`value`: Output) {
        this.basicAuthConfig = value
    }

    /**
     * @param value The name for the branch.
     */
    @JvmName("abbcbcatsbxykpnq")
    public suspend fun branchName(`value`: Output) {
        this.branchName = value
    }

    /**
     * @param value The build specification (build spec) for the branch.
     */
    @JvmName("rgdixrrtghjhluun")
    public suspend fun buildSpec(`value`: Output) {
        this.buildSpec = value
    }

    /**
     * @param value The description for the branch that is part of an Amplify app.
     */
    @JvmName("fwyfahnutgaqeipd")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Enables auto building for the branch.
     */
    @JvmName("rygndvbpmlsmcfqm")
    public suspend fun enableAutoBuild(`value`: Output) {
        this.enableAutoBuild = value
    }

    /**
     * @param value Enables performance mode for the branch.
     * Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.
     */
    @JvmName("hcinuirrgcqveanr")
    public suspend fun enablePerformanceMode(`value`: Output) {
        this.enablePerformanceMode = value
    }

    /**
     * @param value Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch.
     * To provide backend support for your preview, Amplify automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property.
     * For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* .
     */
    @JvmName("douoxbpdubarnwqv")
    public suspend fun enablePullRequestPreview(`value`: Output) {
        this.enablePullRequestPreview = value
    }

    /**
     * @param value The environment variables for the branch.
     */
    @JvmName("dwkwrkfbqmpwaoak")
    public suspend fun environmentVariables(`value`: Output>) {
        this.environmentVariables = value
    }

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

    /**
     * @param values The environment variables for the branch.
     */
    @JvmName("htmmckkjecmkjinq")
    public suspend fun environmentVariables(values: List>) {
        this.environmentVariables = Output.all(values)
    }

    /**
     * @param value The framework for the branch.
     */
    @JvmName("sljkyfgpyntuwxrh")
    public suspend fun framework(`value`: Output) {
        this.framework = value
    }

    /**
     * @param value If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI and mapped to this branch.
     * To enable pull request previews, set the `EnablePullRequestPreview` property to `true` .
     * If you don't specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting deletes this environment when the pull request is closed.
     * For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* .
     */
    @JvmName("gcckmboqjqkdwytx")
    public suspend fun pullRequestEnvironmentName(`value`: Output) {
        this.pullRequestEnvironmentName = value
    }

    /**
     * @param value Describes the current stage for the branch.
     */
    @JvmName("clcknwwekuhiadgc")
    public suspend fun stage(`value`: Output) {
        this.stage = value
    }

    /**
     * @param value The tag for the branch.
     */
    @JvmName("bvsllbffsmpbgjgj")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values The tag for the branch.
     */
    @JvmName("wkooymhntuveqfhl")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value The unique ID for an Amplify app.
     */
    @JvmName("fpqvygxknuxwvwkr")
    public suspend fun appId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appId = mapped
    }

    /**
     * @param value The backend for a `Branch` of an Amplify app. Use for a backend created from an AWS CloudFormation stack.
     * This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
     */
    @JvmName("wqvleaggnackdsqx")
    public suspend fun backend(`value`: BranchBackendArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backend = mapped
    }

    /**
     * @param argument The backend for a `Branch` of an Amplify app. Use for a backend created from an AWS CloudFormation stack.
     * This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
     */
    @JvmName("svlkdfesfuykawml")
    public suspend fun backend(argument: suspend BranchBackendArgsBuilder.() -> Unit) {
        val toBeMapped = BranchBackendArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.backend = mapped
    }

    /**
     * @param value The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format `user:password` .
     */
    @JvmName("vrsrhjgmpcruxfkr")
    public suspend fun basicAuthConfig(`value`: BranchBasicAuthConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.basicAuthConfig = mapped
    }

    /**
     * @param argument The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format `user:password` .
     */
    @JvmName("padrmefsaueeinns")
    public suspend fun basicAuthConfig(argument: suspend BranchBasicAuthConfigArgsBuilder.() -> Unit) {
        val toBeMapped = BranchBasicAuthConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.basicAuthConfig = mapped
    }

    /**
     * @param value The name for the branch.
     */
    @JvmName("rkjmkklgovektqrt")
    public suspend fun branchName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.branchName = mapped
    }

    /**
     * @param value The build specification (build spec) for the branch.
     */
    @JvmName("wnbvlplitcoagowq")
    public suspend fun buildSpec(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildSpec = mapped
    }

    /**
     * @param value The description for the branch that is part of an Amplify app.
     */
    @JvmName("jcysmghxcsmunjhi")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Enables auto building for the branch.
     */
    @JvmName("xomgocjuafibgbtc")
    public suspend fun enableAutoBuild(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableAutoBuild = mapped
    }

    /**
     * @param value Enables performance mode for the branch.
     * Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.
     */
    @JvmName("ediwjiwvikdcroro")
    public suspend fun enablePerformanceMode(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enablePerformanceMode = mapped
    }

    /**
     * @param value Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch. If this property is enabled, Amplify deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch.
     * To provide backend support for your preview, Amplify automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the `PullRequestEnvironmentName` property.
     * For more information, see [Web Previews](https://docs.aws.amazon.com/amplify/latest/userguide/pr-previews.html) in the *AWS Amplify Hosting User Guide* .
     */
    @JvmName("xclpiptxjgqomimi")
    public suspend fun enablePullRequestPreview(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enablePullRequestPreview = mapped
    }

    /**
     * @param value The environment variables for the branch.
     */
    @JvmName("fakoggootsfnnqis")
    public suspend fun environmentVariables(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables for the branch.
     */
    @JvmName("iysysdjapqfvwsab")
    public suspend fun environmentVariables(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BranchEnvironmentVariableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables for the branch.
     */
    @JvmName("hpejuikxknprvkjk")
    public suspend fun environmentVariables(vararg argument: suspend BranchEnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BranchEnvironmentVariableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables for the branch.
     */
    @JvmName("hpgsgqqmbicpxguf")
    public suspend fun environmentVariables(argument: suspend BranchEnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            BranchEnvironmentVariableArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param values The environment variables for the branch.
     */
    @JvmName("opukmxvxhplkaqki")
    public suspend fun environmentVariables(vararg values: BranchEnvironmentVariableArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param value The framework for the branch.
     */
    @JvmName("lepfeyhkebxkessd")
    public suspend fun framework(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.framework = mapped
    }

    /**
     * @param value If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews. For example, you could specify an environment named `prod` , `test` , or `dev` that you initialized with the Amplify CLI and mapped to this branch.
     * To enable pull request previews, set the `EnablePullRequestPreview` property to `true` .
     * If you don't specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting deletes this environment when the pull request is closed.
     * For more information about creating backend environments, see [Feature Branch Deployments and Team Workflows](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html) in the *AWS Amplify Hosting User Guide* .
     */
    @JvmName("dbdsevthwqheqwmy")
    public suspend fun pullRequestEnvironmentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pullRequestEnvironmentName = mapped
    }

    /**
     * @param value Describes the current stage for the branch.
     */
    @JvmName("hywoeetonxrwtfge")
    public suspend fun stage(`value`: BranchStage?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stage = mapped
    }

    /**
     * @param value The tag for the branch.
     */
    @JvmName("fyyppxmpmijfpgko")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument The tag for the branch.
     */
    @JvmName("lolanykedaxipepb")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tag for the branch.
     */
    @JvmName("kjkemcutxbaqosux")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tag for the branch.
     */
    @JvmName("jgkfnepyduotgoui")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values The tag for the branch.
     */
    @JvmName("fbtuswlyfbxomyyr")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): BranchArgs = BranchArgs(
        appId = appId,
        backend = backend,
        basicAuthConfig = basicAuthConfig,
        branchName = branchName,
        buildSpec = buildSpec,
        description = description,
        enableAutoBuild = enableAutoBuild,
        enablePerformanceMode = enablePerformanceMode,
        enablePullRequestPreview = enablePullRequestPreview,
        environmentVariables = environmentVariables,
        framework = framework,
        pullRequestEnvironmentName = pullRequestEnvironmentName,
        stage = stage,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy