ObjectType
The ObjectType resource lets you manage AWS CustomerProfiles ObjectTypes which define the structure of customer profiles in your application.
Minimal Example
Section titled “Minimal Example”Create a basic ObjectType with required properties and a couple of common optional ones.
import AWS from "alchemy/aws/control";
const basicObjectType = await AWS.CustomerProfiles.ObjectType("basicObjectType", { DomainName: "customer-domain", ObjectTypeName: "CustomerProfile", Description: "A type representing customer profile information", AllowProfileCreation: true});
Advanced Configuration
Section titled “Advanced Configuration”Configure an ObjectType with additional fields and keys to capture more detailed customer information.
const advancedObjectType = await AWS.CustomerProfiles.ObjectType("advancedObjectType", { DomainName: "customer-domain", ObjectTypeName: "CustomerProfile", Description: "A type representing customer profile information with specific fields", AllowProfileCreation: true, Fields: [ { Name: "firstName", Type: "String" }, { Name: "lastName", Type: "String" }, { Name: "email", Type: "String" }, { Name: "phoneNumber", Type: "String" } ], Keys: [ { Name: "email" } ]});
Custom Encryption and Expiration
Section titled “Custom Encryption and Expiration”Create an ObjectType with custom encryption settings and expiration days for data retention.
const secureObjectType = await AWS.CustomerProfiles.ObjectType("secureObjectType", { DomainName: "customer-domain", ObjectTypeName: "SecureCustomerProfile", Description: "A secure type representing customer profiles with encryption", EncryptionKey: "arn:aws:kms:us-east-1:123456789012:key/abcd1234-56ef-78gh-90ij-klmn1234opqr", ExpirationDays: 30, AllowProfileCreation: true});
Using Tags for Organization
Section titled “Using Tags for Organization”Create an ObjectType with tags for better organization and resource management.
const taggedObjectType = await AWS.CustomerProfiles.ObjectType("taggedObjectType", { DomainName: "customer-domain", ObjectTypeName: "TaggedCustomerProfile", Description: "A type representing customer profiles with tags for organization", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Department", Value: "Sales" } ]});