Francis Menguito
05/30/2022, 1:08 PMDanny Rivadeneira
05/30/2022, 2:15 PMKenny
05/30/2022, 7:02 PMnpx aws-api-gateway-cli-test --username <mailto:test@gmail.com|test@gmail.com> --password 12345Foo! --user-pool-id us-east-1_I8XLnM67Q --app-client-id 44hqn436m45aa92j9vkh7pjdfn --cognito-region us-east-1 --identity-pool-id us-east-1:966cd055-29d0-4f48-ba65-3326cf9dea63 --invoke-url <https://d8cdv8pdh4.execute-api.us-east-1.amazonaws.com> --api-gateway-region us-east-1 --path-template /notes --method POST --body "{\"content\":\"h\",\"attachment\":\"h.jpg\"}"
But I get an error saying {\ SyntaxError: Unexpected token \ in JSON at position 1
I have even tried this
npx aws-api-gateway-cli-test --username <mailto:test@gmail.com|test@gmail.com> --password 12345Foo! --user-pool-id us-east-1_I8XLnM67Q --app-client-id 44hqn436m45aa92j9vkh7pjdfn --cognito-region us-east-1 --identity-pool-id us-east-1:966cd055-29d0-4f48-ba65-3326cf9dea63 --invoke-url <https://d8cdv8pdh4.execute-api.us-east-1.amazonaws.com> --api-gateway-region us-east-1 --path-template /notes --method POST --body '{"content":"d","attachment":"hello.jpg"}'
Klaus
05/30/2022, 7:44 PMnpm run start
has been completed and the stage was deployed with npm run deploy
The doc mentions that stacks can be removed individually by providing the stack name as parameter. However, this seems to fail for me in case of my customized debugApp stack.Devin
05/30/2022, 11:12 PMnpx sst start
in my app all this time. That recently stopped working and now I’m using npm run start
My npx command outputs…
➜ frontend git:(main) ✗ npx sst start
npx: installed 1 in 0.465s
command not found: sst
npm run start seems to work but this is a surprising result.Carlos Daniel
05/31/2022, 12:11 AMHazel
05/31/2022, 12:19 AMx-api-key
value for accessing the Graphql playground of my AppSync instance, through the SST console. I’m using v1 of SST. Can you please tell me how to find this value? I’m not seeing it anywhere in the documentation.justindra
05/31/2022, 1:15 AMexpo build:web
and when I print out the ENV, I just get the following instead of it being filled properly.
REACT_APP_COGNITO_USER_POOL_ID: '{{ REACT_APP_COGNITO_USER_POOL_ID }}',
REACT_APP_AWS_REGION: 'us-west-2',
REACT_APP_API_ENDPOINT: '{{ REACT_APP_API_ENDPOINT }}',
The defn:
new StaticSite(this, 'ClientApp', {
path: 'frontend/client',
buildOutput: 'web-build',
buildCommand: 'npm run build:web',
errorPage: 'redirect_to_index_page',
environment: {
REACT_APP_AWS_REGION: scope.region,
REACT_APP_COGNITO_USER_POOL_ID: this.auth.userPoolId || '',
REACT_APP_COGNITO_USER_POOL_CLIENT_ID: this.auth.userPoolClientId || '',
REACT_APP_API_ENDPOINT: this.api.url,
REACT_APP_COGNITO_DOMAIN: rootDomain,
},
});
Daniel Gato
05/31/2022, 9:31 AMdisablePlaceholder: true
set. What would be the easiest to get those variables replaced on sst start and sst deploy? Isn’t there a native way for SST to replace it. The documentation mentions {{ MY_VAR }}
but I tried and it doesn’t get replaced.T Indie
05/31/2022, 11:14 AMStatus: failed
Error: already exists in stack arn:aws:cloudformation:
Francis Menguito
05/31/2022, 12:37 PMEdward Asquith
05/31/2022, 12:55 PMyarn sst update v1.2.12
What does this actually do? For me, I get some console printing but no change to package.json:
% yarn sst update v1.2.12
Updating @serverless-stack/cli to v1.2.12
Updating @serverless-stack/resources to v1.2.12
Updating aws-cdk-lib@2.24.0
SST: 1.2.11
CDK: 2.24.0
Francis Menguito
05/31/2022, 1:26 PMsforman
05/31/2022, 3:01 PMconst stream = new KinesisStream(stack, "Stream", {
consumers: {
consumer1: {
function: {
handler: "functions/lambda.handler",
timeout: 5,
retryAttempts: 5
},
},
},
});
with the function that will timeout
export const handler: any = async (event) => {
console.log("Run");
await sleep(20000);
};
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
it times out, but doesn't retry - same goes for throwing errors, no retryMiguel
05/31/2022, 4:13 PMAppConfig stack
which will need to access every other stack’s output values. The only way I see to do this with SST is by returning the outputs in every stack, then importing them all one by one in the AppConfig
stack and then accessing the exported values. Is there any way to make this dynamic like accessing every stack deployed from a loop inside the AppConfig stack?
My intention is to create a configuration with certain values from each stack so it can be used later from Lambda functions and suchEkansh Vinaik
05/31/2022, 5:13 PMPaul
05/31/2022, 5:33 PMApiGatewayV1Api
apis that are all using the same imported domain (using DomainName.fromDomainNameAttributes
) and have different base paths. But I am approaching the 500 resources limit and when I tried to split the stack up into multiple stacks (e.g. one stack per ApiGatewayV1Api
) the domain is always only working for one the stacks (deploy works but lambdas cannot be reached). So what are the best practices to structure a case like this and are there any changes to sharing domains in v1 (I am still using 0.69)?Jasjit
06/01/2022, 12:49 AMChris Laplante
06/01/2022, 2:04 AMheyysaiii
06/01/2022, 4:31 AMconst existingUser = await cognito.send(
new AdminGetUserCommand({
UserPoolId: config.cognito.USER_POOL_ID,
Username: user.email,
})
); if (exisitingUser) {}
But seems like it doesn't work. Can someone please help me with this?Luke Stock
06/01/2022, 9:48 AMnpx sst start
I get the following error:
Preparing your SST app
X [ERROR] The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external
Build failed with 1 error:
error: The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external
This previously worked before the commit to "Update SST to v1".
Any help will be greatly appreciated.
LukeEdward Asquith
06/01/2022, 1:30 PM--trust
the build account and set IAM to allow the CI runner to assume these roles. All good so far.
However, when I set --role-arn
and --region
during SST deployment it still tries to deploy into the build account - which figures. So I tried setting the stack env
which in CDK allows me to specify the target account and region (which I can do based on stage name).
This fails thusly:
Error: Do not set the "env" prop while initializing "teams" stack ({"region":"eu-west-2","account":"<redacted>"}). Use the "AWS_PROFILE" environment variable and "--region" CLI option instead.
That looks like a different behaviour from stock CDK (I presume for some good reason).
Am I at a dead end? Could be that I’ve misunderstood the purpose of CDK bootstrapping as I’m trying to use it for the first time, but it makes it look like I have to use AWS_PROFILE in practice, rather than assuming a bootstrapped role in the target account.Karolis Stulgys
06/01/2022, 3:42 PMFailed to validate the query: `Field does not exist on enclosing type.` at `Mutation.createOneCustomer`
I have tried various thing from suggestions from internet (switching node version, switching prisma version, reinstall deps etc.) but nothing worked. Anyone by any chance run in to this before?
model Customer {
id String @id @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
customerId String @unique
subscription Subscription[]
}
Kelly Davis
06/01/2022, 5:36 PMERROR build_failure: The function [FUNCTION_NAME] failed to build
when I invoke the associated endpoint. It is a Go lambda. I have the sst.json at the root of my repo, and then the go code is in a subfolder "foo". The srcPath prop is set to "foo". Any ideas?Kenny
06/01/2022, 9:10 PMarda
06/01/2022, 9:38 PMDataAccessRole
for the translate service to access S3. How would you create such role? Do you create it in stack creation step and pass it in as a env var or create it in the lambda function?Kenny
06/01/2022, 11:15 PMaws cognito-identity get-id --identity-pool-id us-east-1:c007ebc2-2ebf-44d6-9ea5-e40ea36f34df --logins <http://accounts.google.com|accounts.google.com>="googe_id_token"
I ran this command and got this error Could not connect to the endpoint URL: "<https://cognito-identity.us-east1.amazonaws.com/>"
How do i fix this?Mischa Spiegelmock
06/01/2022, 11:40 PMMischa Spiegelmock
06/01/2022, 11:41 PMSSTEdgeLambdaBucket
resource just deploys forever until it times out hours laterKarmo Rosental
06/01/2022, 11:54 PM{"message":"Unauthorized"}
before authorizer is even run. I can't see what I am doing differently from the official example.
authorizers: {
lambda: {
type: "lambda",
responseTypes: ["simple"],
function: new Function(stack, "Authorizer", {
handler: `functions/authorizer.main`,
}),
},
},
defaults: {
authorizer: "lambda",
},
If I try to access protected endpoint then nothing at all is printed to terminal like it is for public endpoint.
`functions/authorizer.ts`:
export const main = async (event) => {
console.log("Inside authorizer");
};
Where it can get blocked?