The VPC market has public subnets public-a and public-b and private subnets private-a and private-b. The app server app runs in public-a in the security group app-sg, with an instance profile for Session Manager. On it, /opt/market/catalogue.sql creates the catalogue and /opt/market/db-password holds the password to give the database. In CloudShell, ~/catalogue.json is the same eight monsters as a DynamoDB batch.
- A PostgreSQL instance
market-db(master usermarket, databasemarket) in a subnet groupmarket-db-subnetson the private subnets, behind a groupdb-sgthat onlyapp-sgcan get through, with no public address. It must survive the loss of a zone. Load the catalogue into it fromapp. - A read replica
market-db-reports, a manual snapshotmarket-db-snapshottaken after the catalogue is loaded, and proof that the snapshot works: an instancemarket-db-checkrestored from it, holding the catalogue. - An on-demand DynamoDB table
market-monsterskeyed by the stringid, holding the catalogue, with an indexby-typeontypeand thenprice. - The fire monsters, read through that index cheapest first, saved to
~/fire.json.