Mischa Spiegelmock
12/05/2021, 2:29 PMgeneratedLambdas.forEach((func) => sqsQueues.notificationQueue.grantSendMessages(func))
Devin
12/05/2021, 7:56 PM// Create a HTTP API
const api = new sst.Api(this, "Api", {
defaultAuthorizationType: "AWS_IAM",
defaultFunctionProps: {
environment: {
TABLE_NAME: myCoolTable.tableName,
},
},
// prettier-ignore
routes: {
"GET /someAuthRoute": "src/doTheThing.main",
"POST /newsletter-signup": "src/newsletterSignUp.main" // I want this to be accessibly just from <http://www.myCoolDomain.com|www.myCoolDomain.com>
},
});
api.attachPermissions([myCoolTable]);
const auth = new sst.Auth(this, "Auth", {
cognito: {
userPool: {
signInAliases: { email: true },
},
},
});
auth.attachPermissionsForAuthUsers([
// Allow access to the API
api,
]);
Now, I’d like my domain to be able to post to /newsletter-signup
and add someone to the table. But the way I have the table set you need to be logged in. And what I want is anyone to be able to sign up. I “could” just make another API and table, but it seems like there’s probably a better way?Bshr Ramadan
12/06/2021, 12:32 AMScript
construct, is there a way to wait it until finish execute, and output its result with stack outputs?Tonny (sstNerd)
12/06/2021, 3:55 AMHaider Abbas
12/06/2021, 10:20 AMArtem Kalantai
12/06/2021, 11:09 AMSahan Amadoruge
12/06/2021, 11:57 AMError: Cannot find module 'prepareUpload'
error. When i trigger the below lambda function
function: {
handler: "src/upload/prepareUpload.main",
environment: {
...props.dbEnvs,
},
},
Artem Kalantai
12/06/2021, 1:40 PMMikko Mannonen
12/06/2021, 9:44 PMSam Hulick
12/06/2021, 10:15 PMBucket
class from an IBucket
? e.g. I want to use s3.Bucket.fromBucketName()
and pass that to an SST function’s permissionsDan Coates
12/07/2021, 4:24 AMsst start
is there any way for the local runner to use the correct virtualenv for each handler? I'm using poetry to install dependencies and have managed to get it working using the VIRTUAL_ENV
environment variable but it would be nice if the runner could either automatically add the virtual env to the path or run the handler using poetry run
instead of using the system python version.Sahan Amadoruge
12/07/2021, 11:52 AMS3Bucket
i'm creating a bucket and apply notification triggers.
const s3Bucket = new S3Bucket(app, "Bucket", {
dbEnvs: database.dbEnvs,
});
Before, i was able get the bucket name using s3Bucket.fileBucket.bucketName
But now when i console logged i get something like this ${Token[TOKEN.637]}
any idea about this?Garret Harp
12/07/2021, 3:39 PMAbdul Taleb
12/07/2021, 9:33 PMSam Hulick
12/07/2021, 9:59 PM[...]
✅ dev-microservices-api-users (no changes)
✅ dev-microservices-api-media (no changes)
✅ dev-microservices-api-reels (no changes)
Mischa Spiegelmock
12/08/2021, 8:29 AMErik Robertson
12/08/2021, 9:39 AMIt seems you are configuring custom domains for you URL. And SST is not able to find the hosted zone "<http://dataworks.us|dataworks.us>" in your AWS Route 53 account. Please double check and make sure the zone exists, or pass in a different zone.
Which makes sense since that account doesn't host the domain. I therefore created a role on the dev account providing access to Route53 to the staging/production account and assigned that role to the user I use for deployment on staging. However that doesn't make a difference and I'm still getting that error.... Any ideas ?
I would like to use dev-api.domain.name for my dev deployment (works fine) and stg-api.domain.name for staging and api.domain.name for prod.Dan Van Brunt
12/08/2021, 6:46 PMChris Visser
12/08/2021, 9:50 PMRyan Doherty
12/08/2021, 11:12 PMmkarsene
12/09/2021, 2:44 AMSahan Amadoruge
12/09/2021, 7:59 AMyarn install
before the sst commandPavan Kumar
12/09/2021, 9:48 AMtype-graqhql
to build the graphql schema which needs emitDecorator feature, which is not supported by esbuild and the above plugin will use tsc
to compile typescript file which contains decorators.Danny Rivadeneira
12/09/2021, 3:52 PMVictor Rodriguez
12/09/2021, 5:10 PMstack-name
passed in to the command sst deploy --stage stage-name stack-name
, is this variable available through env variables, app, or process.argv?Tim V
12/09/2021, 6:57 PMconst auth = new Auth(this, "auth", {
cognito: {
userPool: {
selfSignUpEnabled: false,
signInAliases: { email: true },
customAttributes: {
PasswordUpdated: new DateTimeAttribute({ mutable: true }),
},
},
triggers: {
preAuthentication: {
handler: "stack/cognito/pre-authentication.handler",
permissions: [
new PolicyStatement({
effect: Effect.ALLOW,
resources: ["*"],
actions: [
"cognito-idp:AdminResetPassword",
"cognito-idp:UpdateUserAttributes",
],
}),
],
},
postAuthentication: {
handler: "stack/cognito/post-authentication.handler",
},
customMessage: {
handler: "stack/cognito/custom-message.handler",
environment: {
URL: "https://" + customDomain.domainName,
}
},
},
},
});
Sam Hulick
12/09/2021, 6:58 PMDan Van Brunt
12/09/2021, 9:13 PMError: Cannot find a "tsconfig.json" in the function's srcPath
Dan Van Brunt
12/09/2021, 9:45 PMcloudformation:deleteStack
permissions can tear it down. Specifically a lambda function.JJ Teoh
12/10/2021, 6:35 AMconst stackALambda = new sst.Function(this, 'DoSomething', {
handler: 'path/to/doSomething.handler',
runtime: lambda.Runtime.NODEJS_14_X,
})
When run sst start
, in my aws console, I saw a lambda function name 'my-project-DoSomethingdlsfinksd' .
If I redeploy the lambda function name will change again.
I have another lambda that will invoke this lambda function, how can I get the function name dynamically.
In another lambda function(in another dedicated stack), I need to get the function name dynamically so I don't have to change the name whenever DoSomething update:
await lambda
.invoke({
FunctionName: `DoSomething`, // <-- this will throw resource not found. how to get the formatted function name dynammically?
Payload: JSON.stringify({
data: "data"
}),
InvocationType: 'RequestResponse',
})
.promise()