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

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

package com.pulumi.awsnative.apigatewayv2.kotlin

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

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

    public var args: ApiMappingArgs = ApiMappingArgs()

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

/**
 * The ``AWS::ApiGatewayV2::ApiMapping`` resource contains an API mapping. An API mapping relates a path of your custom domain name to a stage of your API. A custom domain name can have multiple API mappings, but the paths can't overlap. A custom domain can map only to APIs of the same protocol type. For more information, see [CreateApiMapping](https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-apimappings.html#CreateApiMapping) in the *Amazon API Gateway V2 API Reference*.
 */
public class ApiMapping internal constructor(
    override val javaResource: com.pulumi.awsnative.apigatewayv2.ApiMapping,
) : KotlinCustomResource(javaResource, ApiMappingMapper) {
    /**
     * The identifier of the API.
     */
    public val apiId: Output
        get() = javaResource.apiId().applyValue({ args0 -> args0 })

    /**
     * The API mapping resource ID.
     */
    public val apiMappingId: Output
        get() = javaResource.apiMappingId().applyValue({ args0 -> args0 })

    /**
     * The API mapping key.
     */
    public val apiMappingKey: Output?
        get() = javaResource.apiMappingKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The domain name.
     */
    public val domainName: Output
        get() = javaResource.domainName().applyValue({ args0 -> args0 })

    /**
     * The API stage.
     */
    public val stage: Output
        get() = javaResource.stage().applyValue({ args0 -> args0 })
}

public object ApiMappingMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.apigatewayv2.ApiMapping::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy