Jakob Fix
04/03/2021, 10:28 AMdotenv
and .env files but this doesnāt seem to be the way to go with SST or CDK. Also, the information on the SST site reference the Serverless Framework and `serverless.yml`files a lot, but I wanted to not use this framework for this project. Could you provide some SST-specific information for the handling of secrets on the site maybe? Thanks! šMichael Wolfenden
04/05/2021, 10:23 PMconstĀ tableĀ =Ā /*Ā tableĀ stackĀ */
constĀ apiĀ =Ā newĀ sst.Api(this,Ā 'Api',Ā {
Ā Ā routes:Ā {
Ā Ā Ā Ā 'GETĀ /restaurants':Ā {
Ā Ā Ā Ā Ā Ā handler:Ā `src/functions/get-restaurants.main`,
Ā Ā Ā Ā Ā Ā environment:Ā {
Ā Ā Ā Ā Ā Ā Ā Ā RESTAURANTS_TABLE_NAME:Ā table.dynamodbTable.tableName,
Ā Ā Ā Ā Ā Ā },
Ā Ā Ā Ā },
Ā Ā },
})
IĀ wantĀ toĀ giveĀ thatĀ particularĀ routeĀ onlyĀ scanĀ accessĀ toĀ dynamodb.
IsĀ theĀ codeĀ belowĀ correctĀ orĀ doĀ IĀ needĀ toĀ useĀ toĀ specifyĀ aĀ completeĀ IAMĀ policy
api.attachPermissionsToRoute('GETĀ /restaurants',Ā [table,Ā 'dynamodb:Scan'])
AlsoĀ isĀ itĀ possibleĀ toĀ specifyĀ permissionsĀ in-lineĀ withĀ theĀ routeĀ definition?Tony J
04/05/2021, 11:57 PMBma
04/06/2021, 4:53 PMS3
question.
I canāt upload images to the S3 bucket when I set useAccelerateEndpoint
to true
. Does anyone has encountered this problem?
I can retrieve an upload URL, but Iām not able to upload something with it. The error returned is: S3 Transfer Acceleration is not configured on this bucket.
Bobby Ross
04/06/2021, 5:02 PMBobby Ross
04/06/2021, 6:09 PMAnthony Xiques
04/07/2021, 5:29 PMproject-serverless
repo which contains our serverless services. Then we have project-main
repo which contains EventBridge and some other resources in a regular CFN template.
So we're deploying updates to project-serverless
through Seed, and then exporting the ARN for those Lambdas in serverless.yml
and importing them into project-main
.
I ran into some cross-stack dependency errors when trying to import the qualified ARN into project-main
, and then doing another deploy to project-serverless
.
So now I'm importing the unqualified ARN (without the Lambda version number at the end) into project-main
, so project-main
is always pointing to the LATEST version of the Lambda. And that solves the cross-stack dependency errors, so now I'm able to do deploys to project-serverless
and everything seems to work. š
Question:
Will importing the unqualified ARN in project-main
cause us any issues down the road? Is it possible that at some point on prod as we're deploying updates to project-serverless
through Seed that LATEST may not be deployed on prod?
Hope that makes sense. Thank you for the help! šFabian Osorio
04/07/2021, 11:20 PMDamjan
04/08/2021, 3:24 PMAtul Kumbhar
04/08/2021, 5:17 PMBen Nichols
04/11/2021, 6:14 PMTomasz Sobczyk
04/12/2021, 8:57 PMHarry Collin
04/13/2021, 1:41 PMThibault
04/14/2021, 10:15 PMserverless-framework
to SST
but I have some ApiGateways protected by an api key. According to @Frank https://serverless-stack.slack.com/archives/C01JVDJQU2C/p1617958912086200 ApiGatewayV1Api
allows using Api Key
. I didn't find any example showing how to achieve this. Can someone provide me with an example? ThanksMichael Wolfenden
04/15/2021, 2:35 AMsstĀ remove
Removing stacks
Error: Inline source not allowed for nodejs14.x
at verifyCodeConfig (D:\serverless\production-ready-serverless-workshop-sst\backend\node_modules\@aws-cdk\aws-lambda\lib\function.ts:1022:11)
Michael Wolfenden
04/15/2021, 4:10 AM- Effect: 'Allow'
Action:
- 'execute-api:Invoke'
Resource:
Fn::Join:
- ''
- - 'arn:aws:execute-api:'
- Ref: AWS::Region
- ':'
- Ref: AWS::AccountId
- ':'
- Ref: ApiGatewayRestApi
- '/*'
What would be the equivalent in cdk given I have a api = new sst.Api
this.role.addToPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['execute-api:Invoke'],
resources: [api.httpApi.???],
}),
)
Harry Collin
04/15/2021, 4:50 PMthdxr
04/17/2021, 5:26 AMHarry Collin
04/20/2021, 9:57 AMJoshua Harrowell
04/20/2021, 3:19 PMserverless invoke local --function hello
on multiple computers and different node versions. Error logs inside the thread.Amo Moloko
04/20/2021, 8:57 PM$ serverless invoke local --function get --path mocks/get-event.json
to mock the API URL provided by the SST output via Postman?Matt Stibbard
04/20/2021, 11:24 PMAnthony Xiques
04/23/2021, 9:21 PMprovider:
name: aws
runtime: nodejs12.x
memorySize: 128
lambdaHashingVersion: 20201221
iam:
role:
statements:
- Effect: 'Allow'
Action:
- s3:DeleteObject
Resource: 'arn:aws:s3:::xyz-user-downloads-dev/*'
- Effect: 'Allow'
Action:
- s3:DeleteObject
Resource: 'arn:aws:s3:::xyz-user-downloads-prod/*'
But when I deploy through Seed and then check the permissions shown for that Lambda in the AWS console, I only see CloudWatch Logs permissions (screenshot attached).
TIA for your help!Dries Hooghe
04/26/2021, 7:14 AMDries Hooghe
04/26/2021, 7:19 AMAmar Parmar
04/26/2021, 1:33 PMAwsCustomResource
. The questions are:
⢠is this the best way to do this?
⢠and if so, we are getting an error Cannot read property 'statements' of undefined
in AwsCustomResource
Anthony Xiques
04/26/2021, 3:43 PMDennis Dang
04/26/2021, 5:46 PMVignesh Rajagopalan
04/27/2021, 3:49 PMArtem Kalantai
04/29/2021, 12:39 PM