| name | unified-customer-profile |
| description | Build a production-ready unified customer profile system on AWS using Connect Customer
Profiles + Entity Resolution + Bedrock AI. Generates a full CDK TypeScript project
with Lambda handlers, React + shadcn/ui frontend, ETL scripts, and Calculated
Attributes. Use when the user asks for "customer 360", "unified profile",
"unified customer profile", "customer profile integration", "customer profile system",
"entity resolution", "customer matching", "ID resolution", or describes scenarios with
multi-channel customer data needing identity resolution. Industry-agnostic: airline,
hotel, retail, finance, etc.
|
| license | MIT |
| metadata | {"version":"1.0","author":"aws-solution-skills"} |
Unified Customer Profile Builder
Purpose
Through conversation with the user, gather requirements and generate a custom customer
profile integration system based on AWS Connect Customer Profiles + Entity Resolution.
Industry/domain-agnostic.
Knowledge sources
All the architecture knowledge, patterns, and examples needed to execute this Skill are in shared/:
shared/reference/architecture.md โ architecture decisions and rationale
shared/reference/decision-tree.md โ conditional selection logic
shared/reference/aws-services.md โ service/model catalog (Bedrock Claude model IDs)
shared/reference/constraints.md โ limitations and constraints
shared/reference/calculated-attributes.md โ Calc Attribute definition, behavior, debugging (must read)
shared/patterns/cdk-stacks.md โ CDK stack code
shared/patterns/lambda-handlers.md โ Lambda handlers (CP send, ObjectType pitfalls)
shared/patterns/frontend-pages.md โ React + Tailwind + shadcn/ui pages
shared/patterns/etl-transforms.md โ Raw โ ER input pipeline
shared/patterns/bedrock-prompts.md โ model selection + prompts
shared/patterns/er-strategies.md โ ER matching strategies
shared/examples/{travel,hotel,retail}.md โ industry-specific golden examples
Workflow
Phase 1: Discovery (conversational requirements gathering)
Collect the following questions from the user in order. Skip information already known.
1. Industry/domain: airline/hotel/retail/finance/healthcare/other
2. Channels: web/app/call center/OTA/POS/corporate, etc.
3. Identity data: name/email/phone/date of birth/membership number, etc.
4. Transaction data: reservations/orders/visits/billing โ CP child Object Types
5. KPIs: annual revenue/visit frequency/AOV/CLV โ Calculated Attributes
6. Data sources: existing DB (Glue Connection)/CSV/Parquet/Kinesis
7. Matching strategy: Rule (highly structured) / ML (varied variations)
8. Additional features: whether Knowledge Graph, Cross-Domain are needed
9. Region/cost constraints
10. PII normalization: already clean / Inline ETL / Glue ETL Job
11. **LLM model** โ see the catalog in `shared/reference/aws-services.md`
- Accuracy (ER rule generation) โ Claude Opus 4.7 (`us.anthropic.claude-opus-4-7`)
- Balance โ Claude Sonnet 4 (`anthropic.claude-sonnet-4-20250514-v1:0`)
- Cost (personalization) โ Claude Haiku 4.5 (`anthropic.claude-haiku-4-5-20251001`)
- Recommended combination: ER rules = Opus 4.7, personalization = Haiku 4.5
- Always re-confirm the latest ID with AWS Knowledge MCP `aws___search_documentation`
12. Guide on the CP send workflow (Send to CP page included automatically)
13. Calculated Attribute definition โ `calculated_attributes` in `config/schema.yaml`
โ GATE 1: Summarize gathered requirements โ user approval โ Phase 2.
Phase 2: Architecture Design
Based on shared/reference/decision-tree.md:
- Stack composition: Foundation, Storage, Profiles, Matching, Ingestion, Auth, API, [Graph], [Cross-Domain]
- ER matching strategy โ
shared/patterns/er-strategies.md
- Cost estimation โ
shared/reference/aws-services.md
- Regional availability โ AWS Knowledge MCP verification
โ GATE 2: Present design diagram/tables โ user approval.
Phase 3: Code Generation
Based on the approved design, generate incrementally in the following order:
- Scaffolding:
bin/app.ts, package.json, tsconfig.json, cdk.json, jest.config.js
config/schema.yaml โ reflects Discovery results. Must include:
object_types[] โ never define a _profileId key. Use GuestKey [PROFILE, UNIQUE] on the Parent and GuestKey [PROFILE] on children
calculated_attributes[] โ KPI question mapping
features.ai.bedrock.model_id + personalization_model_id
features.etl.mode โ none / inline / glue
- CDK stacks โ see
shared/patterns/cdk-stacks.md
lib/{foundation,storage,profiles,matching,ingestion,auth,api,main}-stack.ts
[optional] lib/{graph,cross-domain}-stack.ts
Required Custom Resources: upsert-object-type + create-calculated-attributes (both include a SchemaRev cache-buster)
- Lambda handlers โ
shared/patterns/lambda-handlers.md
backend/lambdas/{matching,accuracy,ai-agent,profiles,ingestion}/handler.ts
backend/lambdas/profile-import/handler.ts โ Send to CP โ Step 1
backend/lambdas/cp-data-import/handler.ts โ Send to CP โ Step 2 (self-invoke worker)
backend/lambdas/personalization/handler.ts โ assembleProfile + assembleFromGolden
backend/custom-resources/upsert-object-type/handler.ts
backend/custom-resources/create-calculated-attributes/handler.ts
backend/glue-scripts/build-er-input.py
- Frontend โ
shared/patterns/frontend-pages.md (React + Vite + Tailwind + shadcn/ui, NO Cloudscape)
frontend/src/pages/{Dashboard,Workflow,Ingestion,MatchingComparison,Accuracy,AiRules,
ProfileImport,ProfileView}.tsx
frontend/src/components/{AuthGate,Layout,PageHeader,StatCard}.tsx
frontend/src/components/ui/ โ shadcn (Card, Button, Badge, Alert, Skeleton, Table, Select, Tabs, Dialog)
frontend/src/api/{client,auth}.ts โ singleton userManager + apiCall
frontend/src/{lib,hooks}/
ํ์ ํ๋ฉด: WorkflowPage (๋ฐ๋ชจ ์คํ
ํผ), MatchingComparison (์์ฐจ ์คํ + ๋น๊ต ํ
์ด๋ธ + AI ์ถ์ฒ)
ํ์ ์ปดํฌ๋ํธ: AuthGate (์ธ์ฆ ๋ํผ), singleton userManager
- Scripts:
โ GATE 3: Verify cdk synth passes. Verify the APIs used with AWS Knowledge MCP.
Phase 4: Validate
cdk synth clean
- Re-confirm used IAM actions / model IDs / regional availability via MCP
- Map to eval scenarios (
evals/<industry>-scenario.md)
Phase 5: Deploy
Deployment guide + post-deploy verification steps:
- Run ER matching (Matching Comparison page) โ ํ ๋ฒ์ ํ๋์ฉ ์์ฐจ ์คํ (๋ฆฌ์ ๋น ๋์ job 1๊ฐ)
- Send to CP โ Step 1: golden profiles import
- Send to CP โ Step 2: Reservation/Folio import (3-10 min, background)
- Wait Calculated Attribute Status โ COMPLETED (a few minutes)
- Verify calc attr values are populated on the Profile Detail page
- If empty, follow the "debugging checklist" in
shared/reference/calculated-attributes.md
์ฝ๋ ๋ณ๊ฒฝ ํ ์ฌ๋ฐฐํฌ ์ ์ฐจ (Hot Reload)
cdk deploy๋ ์ธํ๋ผ ๋ณ๊ฒฝ๋ง ๋ฐ์ํฉ๋๋ค. Lambda ์ฝ๋๋ ํ๋ก ํธ์๋ ์์ ์ ๋ณ๋ ์ฌ๋ฐฐํฌ๊ฐ ํ์ํฉ๋๋ค.
Lambda ์ฌ๋ฐฐํฌ:
cd backend/lambdas/<handler-name>
npx esbuild handler.ts --bundle --platform=node --target=node20 --outfile=dist/handler.js
cd dist && zip -r handler.zip handler.js
aws lambda update-function-code --function-name <projectName>-<handler> --zip-file fileb://handler.zip
aws lambda wait function-updated --function-name <projectName>-<handler>
ํ๋ก ํธ์๋ ์ฌ๋ฐฐํฌ:
cd frontend && npm run build
aws s3 sync dist/ s3://<frontend-bucket>/ --delete
aws cloudfront create-invalidation --distribution-id <dist-id> --paths "/*"
CDK ์คํ ์ด๋ฆ ํ์ธ (๋ฐฐํฌ ์คํจ ๋ฐฉ์ง):
aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE \
--query "StackSummaries[?contains(StackName,'<projectName>')].StackName"
E2E ํ
์คํธ ๊ถ์ฅ: Playwright๋ก ์ ์ฒด ํ๋ก์ฐ ํ
์คํธ. API ํ
์คํธ๋ง์ผ๋ก๋ ์ก์ ์ ์๋ "๊ตฌ์กฐ์ ์ผ๋ก ๋์ ๋ถ๊ฐํ ๋ฒํผ"๊ณผ "๋ ๋๋ง ๋ฐฑ์ง" ๋ฌธ์ ๋ฅผ ๋ฐ๊ฒฌํ ์ ์์ต๋๋ค.
Generation rules
- CDK: TypeScript + aws-cdk-lib v2 + Constructs v10
- Lambda: Node 20+ TypeScript + esbuild + AWS SDK v3 modular imports
- Frontend: React 18 + Vite + Tailwind v3 + shadcn/ui (Cloudscape NOT used). Icons
lucide-react, charts recharts, toasts sonner. Auth via oidc-client-ts + react-oidc-context.
- Domain terminology follows the language provided by the user (Korean/English)
- ER rule names are
{MatchKey1}And{MatchKey2} (e.g. NameAndEmail)
- Resource prefix:
{projectName}-
- Enforce KMS encryption (all data at rest)
- Enforce SQS DLQ (all async Lambdas)
- No hardcoding: account ID, region, and model ID must all be env-overridable
Hard Constraints
For detailed explanations, see shared/reference/constraints.md. One-line summary:
- Connect Instance Quota: Default 2/account, max 4โ5 with quota request. Never > 4 without explicit user approval.
- ER ML Matching: Supported in only some regions โ always verify via AWS Knowledge MCP.
- โ ๏ธ ER Concurrent Jobs: ๋ฆฌ์ ๋น 1๊ฐ (์กฐ์ ๋ถ๊ฐ):
Promise.all๋ก ๋์ ์คํํ๋ฉด silent failure (HTTP 200์ด์ง๋ง job ๋ฏธ์์). ๋ฐ๋์ ์์ฐจ ์คํ + ์ฌ์ /running ์ฒดํฌ.
- Neptune cost: db.r5.large =
$300/mo, warning required. Serverless recommended ($200/mo).
- CP Domain names: unique per account ร region.
- Bedrock model ID: cross-region inference profile prefix (
us., eu., apac.) required. Re-confirm the latest ID via MCP.
- EventBridge Pipes + Kinesis:
pipes.amazonaws.com required in the IAM trust.
- CP Object Type โ no
_profileId: CP reserved key (auto-filled with a UUID). Use a custom PROFILE key like GuestKey instead. For details, see "CP Object Type definition" in shared/patterns/lambda-handlers.md.
- CP Object Type โ Target only
_profile: AWS docs state "the only supported target object is _profile." Child instances (Reservation, Folio) must omit Target.
- CP Object Type โ Keys immutable: Keys/StandardIdentifiers cannot be changed via PutProfileObjectType. To change, delete-then-create +
SchemaRev cache-buster.
- Calculated Attribute lifecycle: values are populated only after Object Type instance ingestion + CP indexing (Status=COMPLETED, Readiness=100%). The UI explicitly guides through Send-to-CP step 2. For details, see
shared/reference/calculated-attributes.md.
- Cognito OIDC redirect URI: must exactly match the Hosted UI callback URL (down to the trailing slash).
- โ ๏ธ API Gateway REST API 29์ด ํ์์์ (๋ณ๊ฒฝ ๋ถ๊ฐ): Bedrock ํธ์ถ(๊ท์น ์์ฑ, ๋งค์นญ ์ถ์ฒ, ๊ทธ๋ํ ์ธ์ฌ์ดํธ)์ 30์ด+ ์์. ์์+ํด๋ง ํจํด ํ์ (DDB ์บ์ + Lambda self-invoke +
/status ํด๋ง ์๋ํฌ์ธํธ).
- โ ๏ธ Authorizer 401์ CORS ํค๋ ๋๋ฝ: Gateway Response(DEFAULT_4XX)์ CORS ์ค์ ํ์. ๋ฏธ์ค์ ์ ๋ชจ๋ ์ธ์ฆ ์ค๋ฅ๊ฐ
Failed to fetch๋ก ์์ฅ๋จ.
- ์ฝ๋ ๋ณ๊ฒฝ โ cdk deploy: Lambda ์ฝ๋/ํ๋ก ํธ์๋ ์์ ์ ๋ณ๋ ์ฌ๋ฐฐํฌ ํ์. ํนํ CloudFront ๋ฌดํจํ ๋๋ฝ์ด "๊ณ ์ณค๋๋ฐ ๋ฐ์ ์ ๋จ"์ ์ต๋ ์์ธ.
When to call MCP
| When | MCP | Call |
|---|
| Confirm regional availability (ER ML, Connect, etc.) | AWS Knowledge | aws___get_regional_availability |
| Look up service constraints / IAM actions | AWS Knowledge | aws___search_documentation |
| Confirm latest Bedrock model ID | AWS Knowledge | aws___search_documentation (e.g. "claude opus 4 inference profile id") |
| Verify CDK construct props | AWS Knowledge | aws___read_documentation |
| Verify generated code (optional) | CloudFormation | validate-template |
| Actual deployment (optional) | CloudFormation | create-stack |