I thought to run `sst build` in my CI build/test a...
# help
m
I thought to run
sst build
in my CI build/test action, but I get this error:
Copy code
[Error at /none-platform-tombo] Need to perform AWS calls for account my-account, but no credentials have been configured
Found errors
There was an error synthesizing your app.
npm ERR! Lifecycle script `build` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: platform-infra@0.1.0 
npm ERR!   at location: /home/runner/work/platform/platform/packages/infra
t
I don't think sst build needs access to AWS, this might be a quirk of how the CLI is structured right now - will let @Frank confirm
f
any
fromLookup()
calls in CDK makes an AWS SDK call if the value is not found in
cdk.context.json
A quick check would be, in CI, after
sst build
, do a
git diff
and see if the
cdk.context.json
is updated. If it is, commit the changes and the next build should not make any AWS calls.
Give it a try.
m
thanks, trying
git diff has no output, so I guess no changes
f
hmm.. can you also try
git status
Just remembered
git diff
doesn’t show if it’s a file is newly added
m
nothing to commit, working tree clean
f
hmm.. I just tried removing the
~/.aws
folder on my local machine, and was able to
sst build
no problem
Can you give that a try and see if u can
sst build
locally without an AWS profile?
m
ok yeah you're right, probably i'm calling something that is trying to import from AWS. is there some recommended way to make sure my stuff builds in CI?
sst cdk synth
fails with the same error for me so it sounds like more of a CDK issue for me not SST
f
Afaik CDK makes AWS calls when you use
fromXXXX
to look up things in ur AWS account. ie.
ec2.Vpc.fromLookup()
. Also, CDK tries to resolve the AWS account ID while building, but that won’t fail the build i think.
But yeah, I haven’t tried synthesizing the CDK app without AWS credentials.
m
yeah