AWS accounts and resources
Three accounts are in play. Using the wrong profile is a common source of “the resource doesn’t exist”.
| Profile | Account | Owns |
|---|---|---|
default | 394922924679 | calculatecost2, dev + prod storefronts, most legacy APIs |
villa-ecommerce | 017176210331 | villacoupon3 |
villaai | 914499832220 | AI/experimental sites, villamarket.ai, this knowledge base |
Credentials are already configured; set AWS_PROFILE rather than exporting keys.
Cross-account invoke
calculatecost2 (default) invokes the VillaCoupon3 checker (villa-ecommerce) directly by ARN. It needs a resource policy statement on the villa-ecommerce side:
AWS_PROFILE=villa-ecommerce aws lambda get-policy \
--function-name villacoupon3-checker-dev --region ap-southeast-1Expected statement ids include AllowCalculateCost3DevCrossAccountInvoke and one for the CI user. Removing them makes calculatecost2 fall back to the legacy checker, which returns no discounts without raising an error.
Frequently used resources
default
| Resource | Id |
|---|---|
| dev CloudFront | E200VHSCVLY8TL |
| dev bucket | s3://dev.villamarket.net |
| calculatecost2 dev Lambda | calculate-cost-3-dev |
| calculatecost2 dev API | vn0mqj906d |
| calculatecost2 master API | m4q33ulvm9 |
| PolygonCost API | 4x2xz1tybj |
| Nationwide cost Lambda | get-nationwide-delivery-cost2-master |
| API key Lambda | get-apikey-master |
villa-ecommerce
| Resource | Id |
|---|---|
| Coupon checker (dev) | villacoupon3-checker-dev |
| Coupon API | qe1hv09c68 |
villaai
| Resource | Id |
|---|---|
Hosted zone villamarket.ai | Z069245539VG1ZOH980UK |
Hosted zone dev.villamarket.ai | Z0156617258RRCQZB8EBI |
| Knowledge base bucket | s3://villa-knowledge-base-914499832220 |
Region is ap-southeast-1 for everything except ACM certificates used by CloudFront, which must be in us-east-1.