Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.cloudfront.kotlin.FieldLevelEncryptionConfig.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.cloudfront.kotlin
import com.pulumi.aws.cloudfront.kotlin.outputs.FieldLevelEncryptionConfigContentTypeProfileConfig
import com.pulumi.aws.cloudfront.kotlin.outputs.FieldLevelEncryptionConfigQueryArgProfileConfig
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 com.pulumi.aws.cloudfront.kotlin.outputs.FieldLevelEncryptionConfigContentTypeProfileConfig.Companion.toKotlin as fieldLevelEncryptionConfigContentTypeProfileConfigToKotlin
import com.pulumi.aws.cloudfront.kotlin.outputs.FieldLevelEncryptionConfigQueryArgProfileConfig.Companion.toKotlin as fieldLevelEncryptionConfigQueryArgProfileConfigToKotlin
/**
* Builder for [FieldLevelEncryptionConfig].
*/
@PulumiTagMarker
public class FieldLevelEncryptionConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: FieldLevelEncryptionConfigArgs = FieldLevelEncryptionConfigArgs()
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 FieldLevelEncryptionConfigArgsBuilder.() -> Unit) {
val builder = FieldLevelEncryptionConfigArgsBuilder()
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(): FieldLevelEncryptionConfig {
val builtJavaResource =
com.pulumi.aws.cloudfront.FieldLevelEncryptionConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return FieldLevelEncryptionConfig(builtJavaResource)
}
}
/**
* Provides a CloudFront Field-level Encryption Config resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const test = new aws.cloudfront.FieldLevelEncryptionConfig("test", {
* comment: "test comment",
* contentTypeProfileConfig: {
* forwardWhenContentTypeIsUnknown: true,
* contentTypeProfiles: {
* items: [{
* contentType: "application/x-www-form-urlencoded",
* format: "URLEncoded",
* }],
* },
* },
* queryArgProfileConfig: {
* forwardWhenQueryArgProfileIsUnknown: true,
* queryArgProfiles: {
* items: [{
* profileId: testAwsCloudfrontFieldLevelEncryptionProfile.id,
* queryArg: "Arg1",
* }],
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* test = aws.cloudfront.FieldLevelEncryptionConfig("test",
* comment="test comment",
* content_type_profile_config={
* "forward_when_content_type_is_unknown": True,
* "content_type_profiles": {
* "items": [{
* "content_type": "application/x-www-form-urlencoded",
* "format": "URLEncoded",
* }],
* },
* },
* query_arg_profile_config={
* "forward_when_query_arg_profile_is_unknown": True,
* "query_arg_profiles": {
* "items": [{
* "profile_id": test_aws_cloudfront_field_level_encryption_profile["id"],
* "query_arg": "Arg1",
* }],
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var test = new Aws.CloudFront.FieldLevelEncryptionConfig("test", new()
* {
* Comment = "test comment",
* ContentTypeProfileConfig = new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigContentTypeProfileConfigArgs
* {
* ForwardWhenContentTypeIsUnknown = true,
* ContentTypeProfiles = new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesArgs
* {
* Items = new[]
* {
* new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArgs
* {
* ContentType = "application/x-www-form-urlencoded",
* Format = "URLEncoded",
* },
* },
* },
* },
* QueryArgProfileConfig = new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigQueryArgProfileConfigArgs
* {
* ForwardWhenQueryArgProfileIsUnknown = true,
* QueryArgProfiles = new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesArgs
* {
* Items = new[]
* {
* new Aws.CloudFront.Inputs.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArgs
* {
* ProfileId = testAwsCloudfrontFieldLevelEncryptionProfile.Id,
* QueryArg = "Arg1",
* },
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudfront.NewFieldLevelEncryptionConfig(ctx, "test", &cloudfront.FieldLevelEncryptionConfigArgs{
* Comment: pulumi.String("test comment"),
* ContentTypeProfileConfig: &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigArgs{
* ForwardWhenContentTypeIsUnknown: pulumi.Bool(true),
* ContentTypeProfiles: &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesArgs{
* Items: cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArray{
* &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArgs{
* ContentType: pulumi.String("application/x-www-form-urlencoded"),
* Format: pulumi.String("URLEncoded"),
* },
* },
* },
* },
* QueryArgProfileConfig: &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigArgs{
* ForwardWhenQueryArgProfileIsUnknown: pulumi.Bool(true),
* QueryArgProfiles: &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesArgs{
* Items: cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArray{
* &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArgs{
* ProfileId: pulumi.Any(testAwsCloudfrontFieldLevelEncryptionProfile.Id),
* QueryArg: pulumi.String("Arg1"),
* },
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.cloudfront.FieldLevelEncryptionConfig;
* import com.pulumi.aws.cloudfront.FieldLevelEncryptionConfigArgs;
* import com.pulumi.aws.cloudfront.inputs.FieldLevelEncryptionConfigContentTypeProfileConfigArgs;
* import com.pulumi.aws.cloudfront.inputs.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesArgs;
* import com.pulumi.aws.cloudfront.inputs.FieldLevelEncryptionConfigQueryArgProfileConfigArgs;
* import com.pulumi.aws.cloudfront.inputs.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var test = new FieldLevelEncryptionConfig("test", FieldLevelEncryptionConfigArgs.builder()
* .comment("test comment")
* .contentTypeProfileConfig(FieldLevelEncryptionConfigContentTypeProfileConfigArgs.builder()
* .forwardWhenContentTypeIsUnknown(true)
* .contentTypeProfiles(FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesArgs.builder()
* .items(FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArgs.builder()
* .contentType("application/x-www-form-urlencoded")
* .format("URLEncoded")
* .build())
* .build())
* .build())
* .queryArgProfileConfig(FieldLevelEncryptionConfigQueryArgProfileConfigArgs.builder()
* .forwardWhenQueryArgProfileIsUnknown(true)
* .queryArgProfiles(FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesArgs.builder()
* .items(FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArgs.builder()
* .profileId(testAwsCloudfrontFieldLevelEncryptionProfile.id())
* .queryArg("Arg1")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:cloudfront:FieldLevelEncryptionConfig
* properties:
* comment: test comment
* contentTypeProfileConfig:
* forwardWhenContentTypeIsUnknown: true
* contentTypeProfiles:
* items:
* - contentType: application/x-www-form-urlencoded
* format: URLEncoded
* queryArgProfileConfig:
* forwardWhenQueryArgProfileIsUnknown: true
* queryArgProfiles:
* items:
* - profileId: ${testAwsCloudfrontFieldLevelEncryptionProfile.id}
* queryArg: Arg1
* ```
*
* ## Import
* Using `pulumi import`, import Cloudfront Field Level Encryption Config using the `id`. For example:
* ```sh
* $ pulumi import aws:cloudfront/fieldLevelEncryptionConfig:FieldLevelEncryptionConfig config E74FTE3AEXAMPLE
* ```
*/
public class FieldLevelEncryptionConfig internal constructor(
override val javaResource: com.pulumi.aws.cloudfront.FieldLevelEncryptionConfig,
) : KotlinCustomResource(javaResource, FieldLevelEncryptionConfigMapper) {
/**
* Internal value used by CloudFront to allow future updates to the Field Level Encryption Config.
*/
public val callerReference: Output
get() = javaResource.callerReference().applyValue({ args0 -> args0 })
/**
* An optional comment about the Field Level Encryption Config.
*/
public val comment: Output?
get() = javaResource.comment().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use.
*/
public val contentTypeProfileConfig: Output
get() = javaResource.contentTypeProfileConfig().applyValue({ args0 ->
args0.let({ args0 ->
fieldLevelEncryptionConfigContentTypeProfileConfigToKotlin(args0)
})
})
/**
* The current version of the Field Level Encryption Config. For example: `E2QWRUHAPOMQZL`.
*/
public val etag: Output
get() = javaResource.etag().applyValue({ args0 -> args0 })
/**
* Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request.
*/
public val queryArgProfileConfig: Output
get() = javaResource.queryArgProfileConfig().applyValue({ args0 ->
args0.let({ args0 ->
fieldLevelEncryptionConfigQueryArgProfileConfigToKotlin(args0)
})
})
}
public object FieldLevelEncryptionConfigMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.cloudfront.FieldLevelEncryptionConfig::class == javaResource::class
override fun map(javaResource: Resource): FieldLevelEncryptionConfig =
FieldLevelEncryptionConfig(
javaResource as
com.pulumi.aws.cloudfront.FieldLevelEncryptionConfig,
)
}
/**
* @see [FieldLevelEncryptionConfig].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [FieldLevelEncryptionConfig].
*/
public suspend fun fieldLevelEncryptionConfig(
name: String,
block: suspend FieldLevelEncryptionConfigResourceBuilder.() -> Unit,
): FieldLevelEncryptionConfig {
val builder = FieldLevelEncryptionConfigResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [FieldLevelEncryptionConfig].
* @param name The _unique_ name of the resulting resource.
*/
public fun fieldLevelEncryptionConfig(name: String): FieldLevelEncryptionConfig {
val builder = FieldLevelEncryptionConfigResourceBuilder()
builder.name(name)
return builder.build()
}