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

com.pulumi.awsnative.ecr.kotlin.PullThroughCacheRule.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ecr.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 [PullThroughCacheRule].
 */
@PulumiTagMarker
public class PullThroughCacheRuleResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: PullThroughCacheRuleArgs = PullThroughCacheRuleArgs()

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

/**
 * The AWS::ECR::PullThroughCacheRule resource configures the upstream registry configuration details for an Amazon Elastic Container Registry (Amazon Private ECR) pull-through cache.
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class PullThroughCacheRule internal constructor(
    override val javaResource: com.pulumi.awsnative.ecr.PullThroughCacheRule,
) : KotlinCustomResource(javaResource, PullThroughCacheRuleMapper) {
    /**
     * The Amazon Resource Name (ARN) of the AWS Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.
     */
    public val credentialArn: Output?
        get() = javaResource.credentialArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ECRRepositoryPrefix is a custom alias for upstream registry url.
     */
    public val ecrRepositoryPrefix: Output?
        get() = javaResource.ecrRepositoryPrefix().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The upstreamRegistryUrl is the endpoint of upstream registry url of the public repository to be cached
     */
    public val upstreamRegistryUrl: Output?
        get() = javaResource.upstreamRegistryUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object PullThroughCacheRuleMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ecr.PullThroughCacheRule::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy