com.pulumi.aws.customerprofiles.kotlin.Domain.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.customerprofiles.kotlin
import com.pulumi.aws.customerprofiles.kotlin.outputs.DomainMatching
import com.pulumi.aws.customerprofiles.kotlin.outputs.DomainRuleBasedMatching
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.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import com.pulumi.aws.customerprofiles.kotlin.outputs.DomainMatching.Companion.toKotlin as domainMatchingToKotlin
import com.pulumi.aws.customerprofiles.kotlin.outputs.DomainRuleBasedMatching.Companion.toKotlin as domainRuleBasedMatchingToKotlin
/**
* Builder for [Domain].
*/
@PulumiTagMarker
public class DomainResourceBuilder internal constructor() {
public var name: String? = null
public var args: DomainArgs = DomainArgs()
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 DomainArgsBuilder.() -> Unit) {
val builder = DomainArgsBuilder()
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(): Domain {
val builtJavaResource = com.pulumi.aws.customerprofiles.Domain(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Domain(builtJavaResource)
}
}
/**
* Resource for managing an Amazon Customer Profiles Domain.
* See the [Create Domain](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateDomain.html) for more information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.customerprofiles.Domain("example", {domainName: "example"});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.customerprofiles.Domain("example", domain_name="example")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.CustomerProfiles.Domain("example", new()
* {
* DomainName = "example",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/customerprofiles"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := customerprofiles.NewDomain(ctx, "example", &customerprofiles.DomainArgs{
* DomainName: pulumi.String("example"),
* })
* 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.customerprofiles.Domain;
* import com.pulumi.aws.customerprofiles.DomainArgs;
* 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 example = new Domain("example", DomainArgs.builder()
* .domainName("example")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:customerprofiles:Domain
* properties:
* domainName: example
* ```
*
* ### With SQS DLQ and KMS set
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.sqs.Queue("example", {
* name: "example",
* policy: JSON.stringify({
* Version: "2012-10-17",
* Statement: [{
* Sid: "Customer Profiles SQS policy",
* Effect: "Allow",
* Action: ["sqs:SendMessage"],
* Resource: "*",
* Principal: {
* Service: "profile.amazonaws.com",
* },
* }],
* }),
* });
* const exampleKey = new aws.kms.Key("example", {
* description: "example",
* deletionWindowInDays: 10,
* });
* const exampleBucketV2 = new aws.s3.BucketV2("example", {
* bucket: "example",
* forceDestroy: true,
* });
* const exampleBucketPolicy = new aws.s3.BucketPolicy("example", {
* bucket: exampleBucketV2.id,
* policy: pulumi.jsonStringify({
* Version: "2012-10-17",
* Statement: [{
* Sid: "Customer Profiles S3 policy",
* Effect: "Allow",
* Action: [
* "s3:GetObject",
* "s3:PutObject",
* "s3:ListBucket",
* ],
* Resource: [
* exampleBucketV2.arn,
* pulumi.interpolate`${exampleBucketV2.arn}/*`,
* ],
* Principal: {
* Service: "profile.amazonaws.com",
* },
* }],
* }),
* });
* const test = new aws.customerprofiles.Domain("test", {
* domainName: example,
* deadLetterQueueUrl: example.id,
* defaultEncryptionKey: exampleKey.arn,
* defaultExpirationDays: 365,
* });
* ```
* ```python
* import pulumi
* import json
* import pulumi_aws as aws
* example = aws.sqs.Queue("example",
* name="example",
* policy=json.dumps({
* "Version": "2012-10-17",
* "Statement": [{
* "Sid": "Customer Profiles SQS policy",
* "Effect": "Allow",
* "Action": ["sqs:SendMessage"],
* "Resource": "*",
* "Principal": {
* "Service": "profile.amazonaws.com",
* },
* }],
* }))
* example_key = aws.kms.Key("example",
* description="example",
* deletion_window_in_days=10)
* example_bucket_v2 = aws.s3.BucketV2("example",
* bucket="example",
* force_destroy=True)
* example_bucket_policy = aws.s3.BucketPolicy("example",
* bucket=example_bucket_v2.id,
* policy=pulumi.Output.json_dumps({
* "Version": "2012-10-17",
* "Statement": [{
* "Sid": "Customer Profiles S3 policy",
* "Effect": "Allow",
* "Action": [
* "s3:GetObject",
* "s3:PutObject",
* "s3:ListBucket",
* ],
* "Resource": [
* example_bucket_v2.arn,
* example_bucket_v2.arn.apply(lambda arn: f"{arn}/*"),
* ],
* "Principal": {
* "Service": "profile.amazonaws.com",
* },
* }],
* }))
* test = aws.customerprofiles.Domain("test",
* domain_name=example,
* dead_letter_queue_url=example.id,
* default_encryption_key=example_key.arn,
* default_expiration_days=365)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using System.Text.Json;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Sqs.Queue("example", new()
* {
* Name = "example",
* Policy = JsonSerializer.Serialize(new Dictionary
* {
* ["Version"] = "2012-10-17",
* ["Statement"] = new[]
* {
* new Dictionary
* {
* ["Sid"] = "Customer Profiles SQS policy",
* ["Effect"] = "Allow",
* ["Action"] = new[]
* {
* "sqs:SendMessage",
* },
* ["Resource"] = "*",
* ["Principal"] = new Dictionary
* {
* ["Service"] = "profile.amazonaws.com",
* },
* },
* },
* }),
* });
* var exampleKey = new Aws.Kms.Key("example", new()
* {
* Description = "example",
* DeletionWindowInDays = 10,
* });
* var exampleBucketV2 = new Aws.S3.BucketV2("example", new()
* {
* Bucket = "example",
* ForceDestroy = true,
* });
* var exampleBucketPolicy = new Aws.S3.BucketPolicy("example", new()
* {
* Bucket = exampleBucketV2.Id,
* Policy = Output.JsonSerialize(Output.Create(new Dictionary
* {
* ["Version"] = "2012-10-17",
* ["Statement"] = new[]
* {
* new Dictionary
* {
* ["Sid"] = "Customer Profiles S3 policy",
* ["Effect"] = "Allow",
* ["Action"] = new[]
* {
* "s3:GetObject",
* "s3:PutObject",
* "s3:ListBucket",
* },
* ["Resource"] = new[]
* {
* exampleBucketV2.Arn,
* exampleBucketV2.Arn.Apply(arn => $"{arn}/*"),
* },
* ["Principal"] = new Dictionary
* {
* ["Service"] = "profile.amazonaws.com",
* },
* },
* },
* })),
* });
* var test = new Aws.CustomerProfiles.Domain("test", new()
* {
* DomainName = example,
* DeadLetterQueueUrl = example.Id,
* DefaultEncryptionKey = exampleKey.Arn,
* DefaultExpirationDays = 365,
* });
* });
* ```
* ```go
* package main
* import (
* "encoding/json"
* "fmt"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/customerprofiles"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* tmpJSON0, err := json.Marshal(map[string]interface{}{
* "Version": "2012-10-17",
* "Statement": []map[string]interface{}{
* map[string]interface{}{
* "Sid": "Customer Profiles SQS policy",
* "Effect": "Allow",
* "Action": []string{
* "sqs:SendMessage",
* },
* "Resource": "*",
* "Principal": map[string]interface{}{
* "Service": "profile.amazonaws.com",
* },
* },
* },
* })
* if err != nil {
* return err
* }
* json0 := string(tmpJSON0)
* example, err := sqs.NewQueue(ctx, "example", &sqs.QueueArgs{
* Name: pulumi.String("example"),
* Policy: pulumi.String(json0),
* })
* if err != nil {
* return err
* }
* exampleKey, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
* Description: pulumi.String("example"),
* DeletionWindowInDays: pulumi.Int(10),
* })
* if err != nil {
* return err
* }
* exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
* Bucket: pulumi.String("example"),
* ForceDestroy: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = s3.NewBucketPolicy(ctx, "example", &s3.BucketPolicyArgs{
* Bucket: exampleBucketV2.ID(),
* Policy: pulumi.All(exampleBucketV2.Arn, exampleBucketV2.Arn).ApplyT(func(_args []interface{}) (string, error) {
* exampleBucketV2Arn := _args[0].(string)
* exampleBucketV2Arn1 := _args[1].(string)
* var _zero string
* tmpJSON1, err := json.Marshal(map[string]interface{}{
* "Version": "2012-10-17",
* "Statement": []map[string]interface{}{
* map[string]interface{}{
* "Sid": "Customer Profiles S3 policy",
* "Effect": "Allow",
* "Action": []string{
* "s3:GetObject",
* "s3:PutObject",
* "s3:ListBucket",
* },
* "Resource": []string{
* exampleBucketV2Arn,
* fmt.Sprintf("%v/*", exampleBucketV2Arn1),
* },
* "Principal": map[string]interface{}{
* "Service": "profile.amazonaws.com",
* },
* },
* },
* })
* if err != nil {
* return _zero, err
* }
* json1 := string(tmpJSON1)
* return json1, nil
* }).(pulumi.StringOutput),
* })
* if err != nil {
* return err
* }
* _, err = customerprofiles.NewDomain(ctx, "test", &customerprofiles.DomainArgs{
* DomainName: example,
* DeadLetterQueueUrl: example.ID(),
* DefaultEncryptionKey: exampleKey.Arn,
* DefaultExpirationDays: pulumi.Int(365),
* })
* 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.sqs.Queue;
* import com.pulumi.aws.sqs.QueueArgs;
* import com.pulumi.aws.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.s3.BucketV2;
* import com.pulumi.aws.s3.BucketV2Args;
* import com.pulumi.aws.s3.BucketPolicy;
* import com.pulumi.aws.s3.BucketPolicyArgs;
* import com.pulumi.aws.customerprofiles.Domain;
* import com.pulumi.aws.customerprofiles.DomainArgs;
* import static com.pulumi.codegen.internal.Serialization.*;
* 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 example = new Queue("example", QueueArgs.builder()
* .name("example")
* .policy(serializeJson(
* jsonObject(
* jsonProperty("Version", "2012-10-17"),
* jsonProperty("Statement", jsonArray(jsonObject(
* jsonProperty("Sid", "Customer Profiles SQS policy"),
* jsonProperty("Effect", "Allow"),
* jsonProperty("Action", jsonArray("sqs:SendMessage")),
* jsonProperty("Resource", "*"),
* jsonProperty("Principal", jsonObject(
* jsonProperty("Service", "profile.amazonaws.com")
* ))
* )))
* )))
* .build());
* var exampleKey = new Key("exampleKey", KeyArgs.builder()
* .description("example")
* .deletionWindowInDays(10)
* .build());
* var exampleBucketV2 = new BucketV2("exampleBucketV2", BucketV2Args.builder()
* .bucket("example")
* .forceDestroy(true)
* .build());
* var exampleBucketPolicy = new BucketPolicy("exampleBucketPolicy", BucketPolicyArgs.builder()
* .bucket(exampleBucketV2.id())
* .policy(Output.tuple(exampleBucketV2.arn(), exampleBucketV2.arn()).applyValue(values -> {
* var exampleBucketV2Arn = values.t1;
* var exampleBucketV2Arn1 = values.t2;
* return serializeJson(
* jsonObject(
* jsonProperty("Version", "2012-10-17"),
* jsonProperty("Statement", jsonArray(jsonObject(
* jsonProperty("Sid", "Customer Profiles S3 policy"),
* jsonProperty("Effect", "Allow"),
* jsonProperty("Action", jsonArray(
* "s3:GetObject",
* "s3:PutObject",
* "s3:ListBucket"
* )),
* jsonProperty("Resource", jsonArray(
* exampleBucketV2Arn,
* String.format("%s/*", exampleBucketV2Arn1)
* )),
* jsonProperty("Principal", jsonObject(
* jsonProperty("Service", "profile.amazonaws.com")
* ))
* )))
* ));
* }))
* .build());
* var test = new Domain("test", DomainArgs.builder()
* .domainName(example)
* .deadLetterQueueUrl(example.id())
* .defaultEncryptionKey(exampleKey.arn())
* .defaultExpirationDays(365)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:sqs:Queue
* properties:
* name: example
* policy:
* fn::toJSON:
* Version: 2012-10-17
* Statement:
* - Sid: Customer Profiles SQS policy
* Effect: Allow
* Action:
* - sqs:SendMessage
* Resource: '*'
* Principal:
* Service: profile.amazonaws.com
* exampleKey:
* type: aws:kms:Key
* name: example
* properties:
* description: example
* deletionWindowInDays: 10
* exampleBucketV2:
* type: aws:s3:BucketV2
* name: example
* properties:
* bucket: example
* forceDestroy: true
* exampleBucketPolicy:
* type: aws:s3:BucketPolicy
* name: example
* properties:
* bucket: ${exampleBucketV2.id}
* policy:
* fn::toJSON:
* Version: 2012-10-17
* Statement:
* - Sid: Customer Profiles S3 policy
* Effect: Allow
* Action:
* - s3:GetObject
* - s3:PutObject
* - s3:ListBucket
* Resource:
* - ${exampleBucketV2.arn}
* - ${exampleBucketV2.arn}/*
* Principal:
* Service: profile.amazonaws.com
* test:
* type: aws:customerprofiles:Domain
* properties:
* domainName: ${example}
* deadLetterQueueUrl: ${example.id}
* defaultEncryptionKey: ${exampleKey.arn}
* defaultExpirationDays: 365
* ```
*
* ## Import
* Using `pulumi import`, import Amazon Customer Profiles Domain using the resource `id`. For example:
* ```sh
* $ pulumi import aws:customerprofiles/domain:Domain example e6f777be-22d0-4b40-b307-5d2720ef16b2
* ```
* */*/*/*/*/*/
*/
public class Domain internal constructor(
override val javaResource: com.pulumi.aws.customerprofiles.Domain,
) : KotlinCustomResource(javaResource, DomainMapper) {
/**
* The Amazon Resource Name (ARN) of the Customer Profiles Domain.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications.
*/
public val deadLetterQueueUrl: Output?
get() = javaResource.deadLetterQueueUrl().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The default encryption key, which is an AWS managed key, is used when no specific type of encryption key is specified. It is used to encrypt all data before it is placed in permanent or semi-permanent storage.
*/
public val defaultEncryptionKey: Output?
get() = javaResource.defaultEncryptionKey().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The default number of days until the data within the domain expires.
* The following arguments are optional:
*/
public val defaultExpirationDays: Output
get() = javaResource.defaultExpirationDays().applyValue({ args0 -> args0 })
/**
* The name for your Customer Profile domain. It must be unique for your AWS account.
*/
public val domainName: Output
get() = javaResource.domainName().applyValue({ args0 -> args0 })
/**
* A block that specifies the process of matching duplicate profiles. Documented below.
*/
public val matching: Output?
get() = javaResource.matching().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
domainMatchingToKotlin(args0)
})
}).orElse(null)
})
/**
* A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below.
*/
public val ruleBasedMatching: Output?
get() = javaResource.ruleBasedMatching().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> domainRuleBasedMatchingToKotlin(args0) })
}).orElse(null)
})
/**
* Tags to apply to the domain. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public val tags: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy