Des
05/26/2022, 1:54 AMsst.Script
but haven't seen a way where we can get the output of the script, so was wondering if the use case for sst.Script
fit my situation. Would you recommend just sticking with the CDK custom resource?Roger Plichta
05/26/2022, 4:54 AMnpx sst start
is blowing up and not sure exactly what is happening. I’m hoping someone will see something obvious. Thanks.Harish Venkatesan
05/26/2022, 5:15 AMJason S
05/26/2022, 6:16 AMnotes
REST API with associated verbs. I also have a transactions
API with associated verbs. Should I create two separate modules/stacks - one for each API?Jason S
05/26/2022, 6:17 AMSwapnil Bandiwadekar
05/26/2022, 7:50 AM"@serverless-stack/cli": "^1.2.8",
"@serverless-stack/resources": "^1.2.8",
But no change. Still giving the same error.Panagiotis Psonis
05/26/2022, 11:43 AMnpm init sst
does not produce a .gitignore file. Is this intended behavior?Josimar Zimermann
05/26/2022, 4:54 PMlgupta
05/26/2022, 5:21 PMKenny
05/26/2022, 9:08 PMinternal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:791:11)
at Loader.resolve (internal/modules/esm/loader.js:89:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
at Loader.import (internal/modules/esm/loader.js:177:28)
at importModuleDynamically (internal/modules/esm/translators.js:114:35)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at file:///C:/Users/kenny/Projects/sst-demo/react-app/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.mjs:20:46
at <anonymous> (<anonymous>) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
There was an error synthesizing your app.
Kenny
05/26/2022, 10:09 PMnpm start
just to see thisMohiuddin Sumon
05/27/2022, 6:00 AMUncharted
05/27/2022, 8:17 AMLouis Holley
05/27/2022, 12:39 PMimport SchemaBuilder from '@pothos/core';
import {
DateTime,
dateTimeParseValue,
dateTimeSerialize,
} from './types/scalars';
export const builder = new SchemaBuilder<{
Scalars: {
DateTime: {
Input: Date;
Output: DateTime;
};
};
}>({});
builder.scalarType('DateTime', {
serialize: dateTimeSerialize,
parseValue: dateTimeParseValue,
});
...
the build is erroring with dateTimeSerialize is not defined
(see screenshot for the out file)Michael Robellard
05/27/2022, 1:35 PMif(scope.region === "us-east-2") {
const replicationRegions = scope.local ? [] : ["ap-southeast-1"]
this.globalchartflowdata = new sst.Table(this, "GlobalChartflowData", {
fields: {
pk: "string",
sk: "string",
gsi1pk: "string",
gsi1sk: "string",
},
primaryIndex: {partitionKey: "pk", sortKey: "sk"},
globalIndexes: {
"GSI1": {partitionKey: "gsi1pk", sortKey: "gsi1sk"},
},
stream: true,
consumers: {
dynamodbstream: {
function: {
srcPath: "backend/",
handler: "services/dynamodbstream/stream.handler",
environment: {
STAGE: props.rootStage,
},
permissions: [new iam.PolicyStatement({
actions: ["ssm:GetParameter", "ssm:GetParameters", "ssm:GetParametersByPath"],
resources: ["*"],
})]
}
}
},
cdk: {
table:
{
replicationRegions: replicationRegions,
}
}
})
}
else{
const tableArn = `arn:aws:dynamodb:${scope.region}:309833148800:table/${props.rootStage}-chartflow-GlobalChartflowData`
this.globalchartflowdata = new sst.Table(this, "GlobalChartflowData", {
cdk: { table: dynamodb.Table.fromTableArn(this, "ImportedTable", tableArn),
}});
this.globalchartflowdata.stream = true;
this.globalchartflowdata.addConsumers(this, {dynamodbstream: {
function: {
srcPath: "backend/",
handler: "services/dynamodbstream/stream.handler",
environment: {
STAGE: props.rootStage,
},
permissions: [new iam.PolicyStatement({
actions: ["ssm:GetParameter", "ssm:GetParameters", "ssm:GetParametersByPath"],
resources: ["*"],
})]
}
}})
}
In the else clause I have tried several variations, including not setting stream = true and trying to set stream = true in the new sst.Table, neither of which work. I either get:
Error: Please enable the "stream" option to add consumers to the "GlobalChartflowData" Table. To import a table with stream enabled, use the "Table.fromTableAttributes()" method, and set the "tableStreamArn" in the attributes.
at Table.addConsumer (file:///tmp/seed/source/node_modules/@serverless-stack/resources/dist/Table.js:283:19)
at file:///tmp/seed/source/node_modules/@serverless-stack/resources/dist/Table.js:164:18
at Array.forEach (<anonymous>)
at Table.addConsumers (file:///tmp/seed/source/node_modules/@serverless-stack/resources/dist/Table.js:163:32)
at new DynamodbStack (file:///tmp/seed/source/.build/lib/index.js:88:32)
at Module.main (file:///tmp/seed/source/.build/lib/index.js:364:24)
at file:///tmp/seed/source/.build/run.mjs:92:16
or I get:
Error: Cannot configure the "stream" when "cdk.table" is a construct in the "Table" Table
at Table.createTable (file:///tmp/seed/source/node_modules/@serverless-stack/resources/dist/Table.js:231:23)
at new Table (file:///tmp/seed/source/node_modules/@serverless-stack/resources/dist/Table.js:29:14)
at new DynamodbStack (file:///tmp/seed/source/.build/lib/index.js:82:34)
at Module.main (file:///tmp/seed/source/.build/lib/index.js:364:24)
at file:///tmp/seed/source/.build/run.mjs:92:16
anyone have any ideas?
I did notice this Stack Overflow Question that seems somewhat similar, but it is talking about a resource completely outside of CDK:
https://stackoverflow.com/questions/65557316/aws-cdk-working-with-existing-dynamodb-and-streams
but it didn't make a lot of sense to me.
I tried just putting the table definition in the else clause without the replication, but that just created a second table in the region with a different name:
dev-chartflow-GlobalChartflowData (Replicant Table without the Stream)
dev-singapore-chartflow-GlobalChartflowData (New Local Table with the Stream)Klaus
05/27/2022, 1:50 PMreservedConcurrentExecutions
or configure `retryAttempts`with an SST-Table construct?
The CDK allows both rC , retry (Alias example) but only during Function creation.Swapnil Bandiwadekar
05/27/2022, 2:18 PMsst
today to 1.2.9
Could not resolve "mock-aws-s3"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:28:
43 │ const AWSMock = require('mock-aws-s3');
╵ ~~~~~~~~~~~~~
You can mark the path "mock-aws-s3" as external to exclude it from the bundle, which will remove
this error. You can also surround this "require" call with a try/catch block to handle this
failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "pg-native"
node_modules/pg/lib/native/client.js:4:21:
4 │ var Native = require('pg-native')
╵ ~~~~~~~~~~~
You can mark the path "pg-native" as external to exclude it from the bundle, which will remove
this error. You can also surround this "require" call with a try/catch block to handle this
failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "nock"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:112:23:
112 │ const nock = require('nock');
╵ ~~~~~~
You can mark the path "nock" as external to exclude it from the bundle, which will remove this
error. You can also surround this "require" call with a try/catch block to handle this failure at
run-time instead of bundle-time.
Sam Hulick
05/27/2022, 3:22 PM.env
file SST looks for? to have SST look for a different file?Sam Hulick
05/27/2022, 4:59 PM.sst/artifacts
directorySupriya N
05/27/2022, 7:51 PMDerek Kershner
05/28/2022, 2:19 AM1.2.11
, this may be related to installing SST Resources in a CDK app (rare, but we do this on occasion), I have not been able to replicate this in many places (error in thread). This may also have something to do with having SST as a peerDependency in a library that is installed. These seem to be the only commonalities for the places it occurs. Downgrading to 1.1.1
fixes the issue.Hongqi Wang
05/28/2022, 6:03 AMAleksandr Matrosov
05/28/2022, 11:16 AMnpx sst diff dev-sst-Stack --stage dev
does deploy only dev-sst-Stack
but it builds all 100 others as welNathan
05/28/2022, 12:44 PMKarolis Stulgys
05/28/2022, 3:04 PMbefore_build:
- yarn prisma:deploy
"prisma:deploy": "npx prisma migrate deploy"
When deployed I see there is an error in seed
ENOENT: no such file or directory, open '/var/task/backend/functions/schema.prisma'
What should I do?Adrian Schweizer
05/28/2022, 4:54 PMarda
05/28/2022, 10:04 PMArpad
05/29/2022, 2:51 PMTobias T
05/30/2022, 12:43 PMGabriel
05/30/2022, 12:58 PMconst api = new sst.Api(this, "Api", {
defaultAuthorizer: new apigAuthorizers.HttpUserPoolAuthorizer("Authorizer", userPool, {
userPoolClients: [userPoolClient],
}),
defaultAuthorizationType: sst.ApiAuthorizationType.JWT,
to:
new Api(stack, "Api", {
authorizers: {
Authorizer: {
type: "user_pool",
userPool: {
id: userPool.userPoolId,
clientIds: [userPoolClient.userPoolClientId],
}
},
},
defaults: {
authorizer: "Authorizer",
},
and now im getting an error
Bearer scope="" error="invalid_token" error_description="the token does not have a valid audience"
the thing is that the token does have an aud. (also the old example worked fine)
Any clues on how to solve this?