Hi <@U01JVDKASAC> I am new to SST. My team created...
# help
a
Hi @Frank I am new to SST. My team created a new project using SST. When run locally(sst start) I am getting stack contains no resources error. Could you please help me?
t
Can you show me what's in the stack?
the code
r
Please can you share what your stack file contains?
t
me first!
The authorizer isn't actually a real resource, it's something that needs to be attached to an APIGateway which is why you're seeing that error. Instead of making this a real stack, you can just make it a normal function and call it wherever you need it
a
Can you suggest me another solution?
The thing is, it is working for other users I just need to fix some issues.
t
Is there a reason you're putting this in its own stack?
The error you're getting is because just defining an authorizer doesn't do anything, it needs to be attached to an API
a
After removing the authorizer from there I am getting below error.
t
You need to include it but attach it to the api you are defining
f
Just to chime, @Ambati Srinivas what’s ur SST version?
To add a bit of context, we made a recent change to get around this exact issue, by always adding a
AWS::CDK::Metadata
resource to each stack.
Can you update to the latest SST version and try deploy again?
a
I’m running into the same error `stack contains no resources`:
Copy code
export class CredentialsStack extends sst.Stack {
   public readonly credentials: Credentials;

   public constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
      super(scope, id, props);

      const secretUsername = Secret.fromSecretCompleteArn(
      );

      const secretPassword = Secret.fromSecretCompleteArn(
      );

      this.credentials = {
         username: secretUsername,
         password: secretPassword,
      };
   }
I should be plugging metadata?
t
can you update to latest sst?
a
Will do, i also went ahead and added the plug
Copy code
new CfnResource(this, "SSTCredentialsMetadata", {
			type: "AWS::CDK::Metadata",
		});
which fixed the issue
f
@Addison Kasper the latest version of SST should have a
AWS::CDK::Metadata
resource in each template, so every template should have at least 1 resource and nvr be empty.
You should be able to remove the above workaround after u upgrade.
But let me know if otherwise 🙂