github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/customerprofiles/domain.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package customerprofiles 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an Amazon Customer Profiles Domain. 16 // See the [Create Domain](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateDomain.html) for more information. 17 // 18 // ## Example Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/customerprofiles" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := customerprofiles.NewDomain(ctx, "example", &customerprofiles.DomainArgs{ 34 // DomainName: pulumi.String("example"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ### With SQS DLQ and KMS set 47 // 48 // <!--Start PulumiCodeChooser --> 49 // ```go 50 // package main 51 // 52 // import ( 53 // 54 // "encoding/json" 55 // "fmt" 56 // 57 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/customerprofiles" 58 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 59 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms" 60 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 61 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs" 62 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 63 // 64 // ) 65 // 66 // func main() { 67 // pulumi.Run(func(ctx *pulumi.Context) error { 68 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 69 // "Version": "2012-10-17", 70 // "Statement": []map[string]interface{}{ 71 // map[string]interface{}{ 72 // "Sid": "Customer Profiles SQS policy", 73 // "Effect": "Allow", 74 // "Action": []string{ 75 // "sqs:SendMessage", 76 // }, 77 // "Resource": "*", 78 // "Principal": map[string]interface{}{ 79 // "Service": "profile.amazonaws.com", 80 // }, 81 // }, 82 // }, 83 // }) 84 // if err != nil { 85 // return err 86 // } 87 // json0 := string(tmpJSON0) 88 // example, err := sqs.NewQueue(ctx, "example", &sqs.QueueArgs{ 89 // Name: pulumi.String("example"), 90 // Policy: pulumi.String(json0), 91 // }) 92 // if err != nil { 93 // return err 94 // } 95 // exampleKey, err := kms.NewKey(ctx, "example", &kms.KeyArgs{ 96 // Description: pulumi.String("example"), 97 // DeletionWindowInDays: pulumi.Int(10), 98 // }) 99 // if err != nil { 100 // return err 101 // } 102 // exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 103 // Bucket: pulumi.String("example"), 104 // ForceDestroy: pulumi.Bool(true), 105 // }) 106 // if err != nil { 107 // return err 108 // } 109 // _, err = s3.NewBucketPolicy(ctx, "example", &s3.BucketPolicyArgs{ 110 // Bucket: exampleBucketV2.ID(), 111 // Policy: pulumi.All(exampleBucketV2.Arn, exampleBucketV2.Arn).ApplyT(func(_args []interface{}) (string, error) { 112 // exampleBucketV2Arn := _args[0].(string) 113 // exampleBucketV2Arn1 := _args[1].(string) 114 // var _zero string 115 // tmpJSON1, err := json.Marshal(map[string]interface{}{ 116 // "Version": "2012-10-17", 117 // "Statement": []map[string]interface{}{ 118 // map[string]interface{}{ 119 // "Sid": "Customer Profiles S3 policy", 120 // "Effect": "Allow", 121 // "Action": []string{ 122 // "s3:GetObject", 123 // "s3:PutObject", 124 // "s3:ListBucket", 125 // }, 126 // "Resource": []string{ 127 // exampleBucketV2Arn, 128 // fmt.Sprintf("%v/*", exampleBucketV2Arn1), 129 // }, 130 // "Principal": map[string]interface{}{ 131 // "Service": "profile.amazonaws.com", 132 // }, 133 // }, 134 // }, 135 // }) 136 // if err != nil { 137 // return _zero, err 138 // } 139 // json1 := string(tmpJSON1) 140 // return json1, nil 141 // }).(pulumi.StringOutput), 142 // }) 143 // if err != nil { 144 // return err 145 // } 146 // _, err = customerprofiles.NewDomain(ctx, "test", &customerprofiles.DomainArgs{ 147 // DomainName: example, 148 // DeadLetterQueueUrl: example.ID(), 149 // DefaultEncryptionKey: exampleKey.Arn, 150 // DefaultExpirationDays: pulumi.Int(365), 151 // }) 152 // if err != nil { 153 // return err 154 // } 155 // return nil 156 // }) 157 // } 158 // 159 // ``` 160 // <!--End PulumiCodeChooser --> 161 // 162 // ## Import 163 // 164 // Using `pulumi import`, import Amazon Customer Profiles Domain using the resource `id`. For example: 165 // 166 // ```sh 167 // $ pulumi import aws:customerprofiles/domain:Domain example e6f777be-22d0-4b40-b307-5d2720ef16b2 168 // ``` 169 type Domain struct { 170 pulumi.CustomResourceState 171 172 // The Amazon Resource Name (ARN) of the Customer Profiles Domain. 173 Arn pulumi.StringOutput `pulumi:"arn"` 174 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 175 DeadLetterQueueUrl pulumi.StringPtrOutput `pulumi:"deadLetterQueueUrl"` 176 // 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. 177 DefaultEncryptionKey pulumi.StringPtrOutput `pulumi:"defaultEncryptionKey"` 178 // The default number of days until the data within the domain expires. 179 // 180 // The following arguments are optional: 181 DefaultExpirationDays pulumi.IntOutput `pulumi:"defaultExpirationDays"` 182 // The name for your Customer Profile domain. It must be unique for your AWS account. 183 DomainName pulumi.StringOutput `pulumi:"domainName"` 184 // A block that specifies the process of matching duplicate profiles. Documented below. 185 Matching DomainMatchingPtrOutput `pulumi:"matching"` 186 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 187 RuleBasedMatching DomainRuleBasedMatchingPtrOutput `pulumi:"ruleBasedMatching"` 188 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 189 Tags pulumi.StringMapOutput `pulumi:"tags"` 190 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 191 // 192 // Deprecated: Please use `tags` instead. 193 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 194 } 195 196 // NewDomain registers a new resource with the given unique name, arguments, and options. 197 func NewDomain(ctx *pulumi.Context, 198 name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) { 199 if args == nil { 200 return nil, errors.New("missing one or more required arguments") 201 } 202 203 if args.DefaultExpirationDays == nil { 204 return nil, errors.New("invalid value for required argument 'DefaultExpirationDays'") 205 } 206 if args.DomainName == nil { 207 return nil, errors.New("invalid value for required argument 'DomainName'") 208 } 209 opts = internal.PkgResourceDefaultOpts(opts) 210 var resource Domain 211 err := ctx.RegisterResource("aws:customerprofiles/domain:Domain", name, args, &resource, opts...) 212 if err != nil { 213 return nil, err 214 } 215 return &resource, nil 216 } 217 218 // GetDomain gets an existing Domain resource's state with the given name, ID, and optional 219 // state properties that are used to uniquely qualify the lookup (nil if not required). 220 func GetDomain(ctx *pulumi.Context, 221 name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) { 222 var resource Domain 223 err := ctx.ReadResource("aws:customerprofiles/domain:Domain", name, id, state, &resource, opts...) 224 if err != nil { 225 return nil, err 226 } 227 return &resource, nil 228 } 229 230 // Input properties used for looking up and filtering Domain resources. 231 type domainState struct { 232 // The Amazon Resource Name (ARN) of the Customer Profiles Domain. 233 Arn *string `pulumi:"arn"` 234 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 235 DeadLetterQueueUrl *string `pulumi:"deadLetterQueueUrl"` 236 // 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. 237 DefaultEncryptionKey *string `pulumi:"defaultEncryptionKey"` 238 // The default number of days until the data within the domain expires. 239 // 240 // The following arguments are optional: 241 DefaultExpirationDays *int `pulumi:"defaultExpirationDays"` 242 // The name for your Customer Profile domain. It must be unique for your AWS account. 243 DomainName *string `pulumi:"domainName"` 244 // A block that specifies the process of matching duplicate profiles. Documented below. 245 Matching *DomainMatching `pulumi:"matching"` 246 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 247 RuleBasedMatching *DomainRuleBasedMatching `pulumi:"ruleBasedMatching"` 248 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 249 Tags map[string]string `pulumi:"tags"` 250 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 251 // 252 // Deprecated: Please use `tags` instead. 253 TagsAll map[string]string `pulumi:"tagsAll"` 254 } 255 256 type DomainState struct { 257 // The Amazon Resource Name (ARN) of the Customer Profiles Domain. 258 Arn pulumi.StringPtrInput 259 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 260 DeadLetterQueueUrl pulumi.StringPtrInput 261 // 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. 262 DefaultEncryptionKey pulumi.StringPtrInput 263 // The default number of days until the data within the domain expires. 264 // 265 // The following arguments are optional: 266 DefaultExpirationDays pulumi.IntPtrInput 267 // The name for your Customer Profile domain. It must be unique for your AWS account. 268 DomainName pulumi.StringPtrInput 269 // A block that specifies the process of matching duplicate profiles. Documented below. 270 Matching DomainMatchingPtrInput 271 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 272 RuleBasedMatching DomainRuleBasedMatchingPtrInput 273 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 274 Tags pulumi.StringMapInput 275 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 276 // 277 // Deprecated: Please use `tags` instead. 278 TagsAll pulumi.StringMapInput 279 } 280 281 func (DomainState) ElementType() reflect.Type { 282 return reflect.TypeOf((*domainState)(nil)).Elem() 283 } 284 285 type domainArgs struct { 286 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 287 DeadLetterQueueUrl *string `pulumi:"deadLetterQueueUrl"` 288 // 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. 289 DefaultEncryptionKey *string `pulumi:"defaultEncryptionKey"` 290 // The default number of days until the data within the domain expires. 291 // 292 // The following arguments are optional: 293 DefaultExpirationDays int `pulumi:"defaultExpirationDays"` 294 // The name for your Customer Profile domain. It must be unique for your AWS account. 295 DomainName string `pulumi:"domainName"` 296 // A block that specifies the process of matching duplicate profiles. Documented below. 297 Matching *DomainMatching `pulumi:"matching"` 298 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 299 RuleBasedMatching *DomainRuleBasedMatching `pulumi:"ruleBasedMatching"` 300 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 301 Tags map[string]string `pulumi:"tags"` 302 } 303 304 // The set of arguments for constructing a Domain resource. 305 type DomainArgs struct { 306 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 307 DeadLetterQueueUrl pulumi.StringPtrInput 308 // 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. 309 DefaultEncryptionKey pulumi.StringPtrInput 310 // The default number of days until the data within the domain expires. 311 // 312 // The following arguments are optional: 313 DefaultExpirationDays pulumi.IntInput 314 // The name for your Customer Profile domain. It must be unique for your AWS account. 315 DomainName pulumi.StringInput 316 // A block that specifies the process of matching duplicate profiles. Documented below. 317 Matching DomainMatchingPtrInput 318 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 319 RuleBasedMatching DomainRuleBasedMatchingPtrInput 320 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 321 Tags pulumi.StringMapInput 322 } 323 324 func (DomainArgs) ElementType() reflect.Type { 325 return reflect.TypeOf((*domainArgs)(nil)).Elem() 326 } 327 328 type DomainInput interface { 329 pulumi.Input 330 331 ToDomainOutput() DomainOutput 332 ToDomainOutputWithContext(ctx context.Context) DomainOutput 333 } 334 335 func (*Domain) ElementType() reflect.Type { 336 return reflect.TypeOf((**Domain)(nil)).Elem() 337 } 338 339 func (i *Domain) ToDomainOutput() DomainOutput { 340 return i.ToDomainOutputWithContext(context.Background()) 341 } 342 343 func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput { 344 return pulumi.ToOutputWithContext(ctx, i).(DomainOutput) 345 } 346 347 // DomainArrayInput is an input type that accepts DomainArray and DomainArrayOutput values. 348 // You can construct a concrete instance of `DomainArrayInput` via: 349 // 350 // DomainArray{ DomainArgs{...} } 351 type DomainArrayInput interface { 352 pulumi.Input 353 354 ToDomainArrayOutput() DomainArrayOutput 355 ToDomainArrayOutputWithContext(context.Context) DomainArrayOutput 356 } 357 358 type DomainArray []DomainInput 359 360 func (DomainArray) ElementType() reflect.Type { 361 return reflect.TypeOf((*[]*Domain)(nil)).Elem() 362 } 363 364 func (i DomainArray) ToDomainArrayOutput() DomainArrayOutput { 365 return i.ToDomainArrayOutputWithContext(context.Background()) 366 } 367 368 func (i DomainArray) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput { 369 return pulumi.ToOutputWithContext(ctx, i).(DomainArrayOutput) 370 } 371 372 // DomainMapInput is an input type that accepts DomainMap and DomainMapOutput values. 373 // You can construct a concrete instance of `DomainMapInput` via: 374 // 375 // DomainMap{ "key": DomainArgs{...} } 376 type DomainMapInput interface { 377 pulumi.Input 378 379 ToDomainMapOutput() DomainMapOutput 380 ToDomainMapOutputWithContext(context.Context) DomainMapOutput 381 } 382 383 type DomainMap map[string]DomainInput 384 385 func (DomainMap) ElementType() reflect.Type { 386 return reflect.TypeOf((*map[string]*Domain)(nil)).Elem() 387 } 388 389 func (i DomainMap) ToDomainMapOutput() DomainMapOutput { 390 return i.ToDomainMapOutputWithContext(context.Background()) 391 } 392 393 func (i DomainMap) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput { 394 return pulumi.ToOutputWithContext(ctx, i).(DomainMapOutput) 395 } 396 397 type DomainOutput struct{ *pulumi.OutputState } 398 399 func (DomainOutput) ElementType() reflect.Type { 400 return reflect.TypeOf((**Domain)(nil)).Elem() 401 } 402 403 func (o DomainOutput) ToDomainOutput() DomainOutput { 404 return o 405 } 406 407 func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput { 408 return o 409 } 410 411 // The Amazon Resource Name (ARN) of the Customer Profiles Domain. 412 func (o DomainOutput) Arn() pulumi.StringOutput { 413 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 414 } 415 416 // The URL of the SQS dead letter queue, which is used for reporting errors associated with ingesting data from third party applications. 417 func (o DomainOutput) DeadLetterQueueUrl() pulumi.StringPtrOutput { 418 return o.ApplyT(func(v *Domain) pulumi.StringPtrOutput { return v.DeadLetterQueueUrl }).(pulumi.StringPtrOutput) 419 } 420 421 // 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. 422 func (o DomainOutput) DefaultEncryptionKey() pulumi.StringPtrOutput { 423 return o.ApplyT(func(v *Domain) pulumi.StringPtrOutput { return v.DefaultEncryptionKey }).(pulumi.StringPtrOutput) 424 } 425 426 // The default number of days until the data within the domain expires. 427 // 428 // The following arguments are optional: 429 func (o DomainOutput) DefaultExpirationDays() pulumi.IntOutput { 430 return o.ApplyT(func(v *Domain) pulumi.IntOutput { return v.DefaultExpirationDays }).(pulumi.IntOutput) 431 } 432 433 // The name for your Customer Profile domain. It must be unique for your AWS account. 434 func (o DomainOutput) DomainName() pulumi.StringOutput { 435 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput) 436 } 437 438 // A block that specifies the process of matching duplicate profiles. Documented below. 439 func (o DomainOutput) Matching() DomainMatchingPtrOutput { 440 return o.ApplyT(func(v *Domain) DomainMatchingPtrOutput { return v.Matching }).(DomainMatchingPtrOutput) 441 } 442 443 // A block that specifies the process of matching duplicate profiles using the Rule-Based matching. Documented below. 444 func (o DomainOutput) RuleBasedMatching() DomainRuleBasedMatchingPtrOutput { 445 return o.ApplyT(func(v *Domain) DomainRuleBasedMatchingPtrOutput { return v.RuleBasedMatching }).(DomainRuleBasedMatchingPtrOutput) 446 } 447 448 // Tags to apply to the domain. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 449 func (o DomainOutput) Tags() pulumi.StringMapOutput { 450 return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 451 } 452 453 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 454 // 455 // Deprecated: Please use `tags` instead. 456 func (o DomainOutput) TagsAll() pulumi.StringMapOutput { 457 return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 458 } 459 460 type DomainArrayOutput struct{ *pulumi.OutputState } 461 462 func (DomainArrayOutput) ElementType() reflect.Type { 463 return reflect.TypeOf((*[]*Domain)(nil)).Elem() 464 } 465 466 func (o DomainArrayOutput) ToDomainArrayOutput() DomainArrayOutput { 467 return o 468 } 469 470 func (o DomainArrayOutput) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput { 471 return o 472 } 473 474 func (o DomainArrayOutput) Index(i pulumi.IntInput) DomainOutput { 475 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Domain { 476 return vs[0].([]*Domain)[vs[1].(int)] 477 }).(DomainOutput) 478 } 479 480 type DomainMapOutput struct{ *pulumi.OutputState } 481 482 func (DomainMapOutput) ElementType() reflect.Type { 483 return reflect.TypeOf((*map[string]*Domain)(nil)).Elem() 484 } 485 486 func (o DomainMapOutput) ToDomainMapOutput() DomainMapOutput { 487 return o 488 } 489 490 func (o DomainMapOutput) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput { 491 return o 492 } 493 494 func (o DomainMapOutput) MapIndex(k pulumi.StringInput) DomainOutput { 495 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Domain { 496 return vs[0].(map[string]*Domain)[vs[1].(string)] 497 }).(DomainOutput) 498 } 499 500 func init() { 501 pulumi.RegisterInputType(reflect.TypeOf((*DomainInput)(nil)).Elem(), &Domain{}) 502 pulumi.RegisterInputType(reflect.TypeOf((*DomainArrayInput)(nil)).Elem(), DomainArray{}) 503 pulumi.RegisterInputType(reflect.TypeOf((*DomainMapInput)(nil)).Elem(), DomainMap{}) 504 pulumi.RegisterOutputType(DomainOutput{}) 505 pulumi.RegisterOutputType(DomainArrayOutput{}) 506 pulumi.RegisterOutputType(DomainMapOutput{}) 507 }