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

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

package com.pulumi.awsnative.ssm.kotlin

import com.pulumi.awsnative.ssm.kotlin.enums.ParameterDataType
import com.pulumi.awsnative.ssm.kotlin.enums.ParameterTier
import com.pulumi.awsnative.ssm.kotlin.enums.ParameterType
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.Map
import com.pulumi.awsnative.ssm.kotlin.enums.ParameterDataType.Companion.toKotlin as parameterDataTypeToKotlin
import com.pulumi.awsnative.ssm.kotlin.enums.ParameterTier.Companion.toKotlin as parameterTierToKotlin
import com.pulumi.awsnative.ssm.kotlin.enums.ParameterType.Companion.toKotlin as parameterTypeToKotlin

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

    public var args: ParameterArgs = ParameterArgs()

    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 ParameterArgsBuilder.() -> Unit) {
        val builder = ParameterArgsBuilder()
        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(): Parameter {
        val builtJavaResource = com.pulumi.awsnative.ssm.Parameter(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Parameter(builtJavaResource)
    }
}

/**
 * The ``AWS::SSM::Parameter`` resource creates an SSM parameter in SYSlong Parameter Store.
 *   To create an SSM parameter, you must have the IAMlong (IAM) permissions ``ssm:PutParameter`` and ``ssm:AddTagsToResource``. On stack creation, CFNlong adds the following three tags to the parameter: ``aws:cloudformation:stack-name``, ``aws:cloudformation:logical-id``, and ``aws:cloudformation:stack-id``, in addition to any custom tags you specify.
 *  To add, update, or remove tags during stack update, you must have IAM permissions for both ``ssm:AddTagsToResource`` and ``ssm:RemoveTagsFromResource``. For more information, see [Managing Access Using Policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/security-iam.html#security_iam_access-manage) in the *User Guide*.
 *   For information about valid values for parameters, see [About requirements and constraints for parameter names](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-create.html#sysman-parameter-name-constraints) in the *User Guide* and [PutParameter](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PutParameter.html) in the *API Reference*.
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class Parameter internal constructor(
    override val javaResource: com.pulumi.awsnative.ssm.Parameter,
) : KotlinCustomResource(javaResource, ParameterMapper) {
    /**
     * A regular expression used to validate the parameter value. For example, for ``String`` types with values restricted to numbers, you can specify the following: ``AllowedPattern=^\d+$``
     */
    public val allowedPattern: Output?
        get() = javaResource.allowedPattern().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is ``text``.
     */
    public val dataType: Output?
        get() = javaResource.dataType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    parameterDataTypeToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Information about the parameter.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the parameter.
     *   The maximum length constraint listed below includes capacity for additional system attributes that aren't part of the name. The maximum length for a parameter name, including the full length of the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the following parameter name is 65 characters, not 20 characters: ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName``
     */
    public val name: Output?
        get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Information about the policies assigned to a parameter.
     *   [Assigning parameter policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the *User Guide*.
     */
    public val policies: Output?
        get() = javaResource.policies().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs). Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a SYS parameter to identify the type of resource to which it applies, the environment, or the type of configuration data referenced by the parameter.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The parameter tier.
     */
    public val tier: Output?
        get() = javaResource.tier().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    parameterTierToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The type of parameter.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                parameterTypeToKotlin(args0)
            })
        })

    /**
     * The parameter value.
     *   If type is ``StringList``, the system returns a comma-separated string with no spaces between commas in the ``Value`` field.
     */
    public val `value`: Output
        get() = javaResource.`value`().applyValue({ args0 -> args0 })
}

public object ParameterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ssm.Parameter::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy