Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sst.aws.Vpc.get() fails with "resource '/sst/vpc/vpc-{id}/private-key' does not exist" on deploy #4998

Closed
aatecey opened this issue Oct 30, 2024 · 3 comments
Assignees

Comments

@aatecey
Copy link
Contributor

aatecey commented Oct 30, 2024

sst version 3.2.70
Was attempting to spin up a stage hanging off a VPC in our dev account and have started encountering this error on deploy:

| Error KindledPrivateKey aws:ssm:Parameter
| resource '/sst/vpc/vpc-{id}/private-key' does not exist

The VPC is using ec2 nats and I never enabled bastion.

export const vpc = isPermanentStage($app.stage)
  ? new sst.aws.Vpc("Kindled", {
      az: isProduction($app.stage) ? 3 : 2,
      nat: isProduction($app.stage) ? "managed" : "ec2",
      transform: {
        vpc: {
          cidrBlock: CIDR_BLOCK,
        },
      },
    })
  : sst.aws.Vpc.get("Kindled", "vpc-{id}");

Within the sst vpc component bastionInstance always is defined for me here so its goes to make a request to ssm:

    const privateKeyValue = bastionInstance.apply((v) => {
      if (!v) return;
      const param = ssm.Parameter.get(
        `${name}PrivateKey`,
        interpolate`/sst/vpc/${vpc.id}/private-key`,
        undefined,
        opts,
      );
      return param.value;
    });

Related commit: fe2f41c

@aatecey aatecey changed the title bug: sst.aws.Vpc.get() fails with "resource '/sst/vpc/vpc-{id}/private-key' does not exist" on deploy sst.aws.Vpc.get() fails with "resource '/sst/vpc/vpc-{id}/private-key' does not exist" on deploy Oct 30, 2024
@msfstef
Copy link

msfstef commented Nov 5, 2024

Running into the same issue here with sst 3.2.56 and aws 6.57.0

@felix-xeel
Copy link

Just hit this too, after upgrading to 3.3.6 - I'm going to 'un-borrow' the dev VPC and just spin up another to work-around this for now.

@fwang
Copy link
Contributor

fwang commented Nov 8, 2024

Releasing v3.3.9 with the fix.

After u update, make sure to deploy the stage where the Vpc is created (ie. new sst.aws.Vpc()) first, and then deploy the stage referencing it.

Please reopen if issue persists.

@fwang fwang closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants