sst: Adding VPC Configuration Throws 504 Error The Request Could Not Be Satisfied
I’m deploying my NextJS app to AWS. This is my config:
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "oneact-landing-page",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
region: "us-east-1",
},
},
};
},
async run() {
new sst.aws.Nextjs("MyWeb", {
vpc: {
securityGroups: ["sg-123456"],
subnets: [
"subnet-123456",
"subnet-1234567",
],
},
});
},
});
When I remove the VPC Config, the deployment works well. When I add the VPC config, the website starts throwing the following error:
For now, the security group is allowing all inbound and outbound access. The subnets are also both public subnets with Internet Gateway and NAT Gateways available. I have triple checked that VPC configuration. Any idea what can be causing this?
Also, any documentation around what ports should be allowed in the Security Group to allow for NextJS traffic would be really helpful.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 19 (8 by maintainers)
Closing this issue for now as the culprit being NAT not enabled in VPC
@mikexavier Thanks of sharing… VPC will likely soon support fknat.
Feel free to open an issue if u get a chance to look into it.
I’ll check
I’m seeing the same when setting the vpc config in a Nextjs component.
I was losing my mind for the past week trying to figure out where I was going wrong with my vpc set-up (it could still be incorrect 🤫).
In my case, I am setting up an
aws.rds.Instancepostgres database, initially in a private subnet allowing incoming traffic from a public subnet, and then adding the public subnet to the Nextjs component. I wanted a set-up where the Nextjs application (a Payload CMS) could access the database, but the database wasn’t publicly accessible.I’ve tried a few combinations, simplified it to public subnets only for testing and opened it up allowing all traffic from everywhere. No dice.
My vpc/databse/nextjs set-up
I was kinda hoping by copy/pasting all that, I’d notice something… but I’m blind at this point.
I’ve logged all variables and secret, all seem correct and passed in as expected