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

com.pulumi.awsnative.codepipeline.kotlin.Pipeline.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.codepipeline.kotlin

import com.pulumi.awsnative.codepipeline.kotlin.enums.PipelineExecutionMode
import com.pulumi.awsnative.codepipeline.kotlin.enums.PipelineType
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineArtifactStore
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineArtifactStoreMap
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineStageDeclaration
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineStageTransition
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineTriggerDeclaration
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineVariableDeclaration
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.codepipeline.kotlin.enums.PipelineExecutionMode.Companion.toKotlin as pipelineExecutionModeToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.enums.PipelineType.Companion.toKotlin as pipelineTypeToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineArtifactStore.Companion.toKotlin as pipelineArtifactStoreToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineArtifactStoreMap.Companion.toKotlin as pipelineArtifactStoreMapToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineStageDeclaration.Companion.toKotlin as pipelineStageDeclarationToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineStageTransition.Companion.toKotlin as pipelineStageTransitionToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineTriggerDeclaration.Companion.toKotlin as pipelineTriggerDeclarationToKotlin
import com.pulumi.awsnative.codepipeline.kotlin.outputs.PipelineVariableDeclaration.Companion.toKotlin as pipelineVariableDeclarationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

/**
 * Builder for [Pipeline].
 */
@PulumiTagMarker
public class PipelineResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: PipelineArgs = PipelineArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend PipelineArgsBuilder.() -> Unit) {
        val builder = PipelineArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Pipeline {
        val builtJavaResource = com.pulumi.awsnative.codepipeline.Pipeline(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Pipeline(builtJavaResource)
    }
}

/**
 * The AWS::CodePipeline::Pipeline resource creates a CodePipeline pipeline that describes how software changes go through a release process.
 */
public class Pipeline internal constructor(
    override val javaResource: com.pulumi.awsnative.codepipeline.Pipeline,
) : KotlinCustomResource(javaResource, PipelineMapper) {
    /**
     * The S3 bucket where artifacts for the pipeline are stored.
     */
    public val artifactStore: Output?
        get() = javaResource.artifactStore().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> pipelineArtifactStoreToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.
     */
    public val artifactStores: Output>?
        get() = javaResource.artifactStores().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        pipelineArtifactStoreMapToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Represents the input of a DisableStageTransition action.
     */
    public val disableInboundStageTransitions: Output>?
        get() = javaResource.disableInboundStageTransitions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        pipelineStageTransitionToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The method that the pipeline will use to handle multiple executions. The default mode is SUPERSEDED.
     */
    public val executionMode: Output?
        get() = javaResource.executionMode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> pipelineExecutionModeToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The name of the pipeline.
     */
    public val name: Output?
        get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * CodePipeline provides the following pipeline types, which differ in characteristics and price, so that you can tailor your pipeline features and cost to the needs of your applications.
     */
    public val pipelineType: Output?
        get() = javaResource.pipelineType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    pipelineTypeToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Indicates whether to rerun the CodePipeline pipeline after you update it.
     */
    public val restartExecutionOnUpdate: Output?
        get() = javaResource.restartExecutionOnUpdate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) for CodePipeline to use to either perform actions with no actionRoleArn, or to use to assume roles for actions with an actionRoleArn
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * Represents information about a stage and its definition.
     */
    public val stages: Output>
        get() = javaResource.stages().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    pipelineStageDeclarationToKotlin(args0)
                })
            })
        })

    /**
     * Specifies the tags applied to the pipeline.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline.
     */
    public val triggers: Output>?
        get() = javaResource.triggers().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> pipelineTriggerDeclarationToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A list that defines the pipeline variables for a pipeline resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9@\-_]+.
     */
    public val variables: Output>?
        get() = javaResource.variables().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> pipelineVariableDeclarationToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The version of the pipeline.
     */
    public val version: Output
        get() = javaResource.version().applyValue({ args0 -> args0 })
}

public object PipelineMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.codepipeline.Pipeline::class == javaResource::class

    override fun map(javaResource: Resource): Pipeline = Pipeline(
        javaResource as
            com.pulumi.awsnative.codepipeline.Pipeline,
    )
}

/**
 * @see [Pipeline].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Pipeline].
 */
public suspend fun pipeline(name: String, block: suspend PipelineResourceBuilder.() -> Unit): Pipeline {
    val builder = PipelineResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Pipeline].
 * @param name The _unique_ name of the resulting resource.
 */
public fun pipeline(name: String): Pipeline {
    val builder = PipelineResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy