AWS accounts and resources

Three accounts are in play. Using the wrong profile is a common source of “the resource doesn’t exist”.

ProfileAccountOwns
default394922924679calculatecost2, dev + prod storefronts, most legacy APIs
villa-ecommerce017176210331villacoupon3
villaai914499832220AI/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-1

Expected 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

ResourceId
dev CloudFrontE200VHSCVLY8TL
dev buckets3://dev.villamarket.net
calculatecost2 dev Lambdacalculate-cost-3-dev
calculatecost2 dev APIvn0mqj906d
calculatecost2 master APIm4q33ulvm9
PolygonCost API4x2xz1tybj
Nationwide cost Lambdaget-nationwide-delivery-cost2-master
API key Lambdaget-apikey-master

villa-ecommerce

ResourceId
Coupon checker (dev)villacoupon3-checker-dev
Coupon APIqe1hv09c68

villaai

ResourceId
Hosted zone villamarket.aiZ069245539VG1ZOH980UK
Hosted zone dev.villamarket.aiZ0156617258RRCQZB8EBI
Knowledge base buckets3://villa-knowledge-base-914499832220

Region is ap-southeast-1 for everything except ACM certificates used by CloudFront, which must be in us-east-1.