com.pulumi.awsnative.ecr.kotlin.RepositoryCreationTemplate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.ecr.kotlin
import com.pulumi.awsnative.ecr.kotlin.enums.RepositoryCreationTemplateAppliedForItem
import com.pulumi.awsnative.ecr.kotlin.enums.RepositoryCreationTemplateImageTagMutability
import com.pulumi.awsnative.ecr.kotlin.outputs.RepositoryCreationTemplateEncryptionConfiguration
import com.pulumi.awsnative.ecr.kotlin.outputs.RepositoryCreationTemplateTag
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.ecr.kotlin.enums.RepositoryCreationTemplateAppliedForItem.Companion.toKotlin as repositoryCreationTemplateAppliedForItemToKotlin
import com.pulumi.awsnative.ecr.kotlin.enums.RepositoryCreationTemplateImageTagMutability.Companion.toKotlin as repositoryCreationTemplateImageTagMutabilityToKotlin
import com.pulumi.awsnative.ecr.kotlin.outputs.RepositoryCreationTemplateEncryptionConfiguration.Companion.toKotlin as repositoryCreationTemplateEncryptionConfigurationToKotlin
import com.pulumi.awsnative.ecr.kotlin.outputs.RepositoryCreationTemplateTag.Companion.toKotlin as repositoryCreationTemplateTagToKotlin
/**
* Builder for [RepositoryCreationTemplate].
*/
@PulumiTagMarker
public class RepositoryCreationTemplateResourceBuilder internal constructor() {
public var name: String? = null
public var args: RepositoryCreationTemplateArgs = RepositoryCreationTemplateArgs()
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 RepositoryCreationTemplateArgsBuilder.() -> Unit) {
val builder = RepositoryCreationTemplateArgsBuilder()
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(): RepositoryCreationTemplate {
val builtJavaResource =
com.pulumi.awsnative.ecr.RepositoryCreationTemplate(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return RepositoryCreationTemplate(builtJavaResource)
}
}
/**
* AWS::ECR::RepositoryCreationTemplate is used to create repository with configuration from a pre-defined template.
*/
public class RepositoryCreationTemplate internal constructor(
override val javaResource: com.pulumi.awsnative.ecr.RepositoryCreationTemplate,
) : KotlinCustomResource(javaResource, RepositoryCreationTemplateMapper) {
/**
* A list of enumerable Strings representing the repository creation scenarios that the template will apply towards.
*/
public val appliedFor: Output>
get() = javaResource.appliedFor().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
repositoryCreationTemplateAppliedForItemToKotlin(args0)
})
})
})
/**
* Create timestamp of the template.
*/
public val createdAt: Output
get() = javaResource.createdAt().applyValue({ args0 -> args0 })
/**
* The ARN of the role to be assumed by ECR. This role must be in the same account as the registry that you are configuring.
*/
public val customRoleArn: Output?
get() = javaResource.customRoleArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The description of the template.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
* By default, when no encryption configuration is set or the `AES256` encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES-256 encryption algorithm. This does not require any action on your part.
* For more control over the encryption of the contents of your repository, you can use server-side encryption with AWS Key Management Service key stored in AWS Key Management Service ( AWS KMS ) to encrypt your images. For more information, see [Amazon ECR encryption at rest](https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html) in the *Amazon Elastic Container Registry User Guide* .
*/
public val encryptionConfiguration: Output?
get() = javaResource.encryptionConfiguration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
repositoryCreationTemplateEncryptionConfigurationToKotlin(args0)
})
}).orElse(null)
})
/**
* The image tag mutability setting for the repository.
*/
public val imageTagMutability: Output?
get() = javaResource.imageTagMutability().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
repositoryCreationTemplateImageTagMutabilityToKotlin(args0)
})
}).orElse(null)
})
/**
* The JSON lifecycle policy text to apply to the repository. For information about lifecycle policy syntax, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html
*/
public val lifecyclePolicy: Output?
get() = javaResource.lifecyclePolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The prefix use to match the repository name and apply the template.
*/
public val prefix: Output
get() = javaResource.prefix().applyValue({ args0 -> args0 })
/**
* The JSON repository policy text to apply to the repository. For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicyExamples.html
*/
public val repositoryPolicy: Output?
get() = javaResource.repositoryPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val resourceTags: Output>?
get() = javaResource.resourceTags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> repositoryCreationTemplateTagToKotlin(args0) })
})
}).orElse(null)
})
/**
* Update timestamp of the template.
*/
public val updatedAt: Output
get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}
public object RepositoryCreationTemplateMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ecr.RepositoryCreationTemplate::class == javaResource::class
override fun map(javaResource: Resource): RepositoryCreationTemplate =
RepositoryCreationTemplate(
javaResource as
com.pulumi.awsnative.ecr.RepositoryCreationTemplate,
)
}
/**
* @see [RepositoryCreationTemplate].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [RepositoryCreationTemplate].
*/
public suspend fun repositoryCreationTemplate(
name: String,
block: suspend RepositoryCreationTemplateResourceBuilder.() -> Unit,
): RepositoryCreationTemplate {
val builder = RepositoryCreationTemplateResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [RepositoryCreationTemplate].
* @param name The _unique_ name of the resulting resource.
*/
public fun repositoryCreationTemplate(name: String): RepositoryCreationTemplate {
val builder = RepositoryCreationTemplateResourceBuilder()
builder.name(name)
return builder.build()
}