Sam Hulick
08/06/2021, 8:51 PMResource handler returned message: "Invalid request provided: AWS::CloudFront::PublicKey" (RequestToken: 1457a7a8-cd44-1785-514a-317b7c2dd2d9, HandlerErrorCode: InvalidRequest)
as usual, not much error detail from AWS 😕
const publicKeyContents = fs.readFileSync('./public_key.pem');
const publicKey = new cloudfront.PublicKey(stack, 'PublicKey', {
encodedKey: publicKeyContents.toString(),
publicKeyName: 'Signature verifier',
});
Ashishkumar Pandey
08/06/2021, 9:27 PMnpx sst start
after npx sst deploy
?Garret Harp
08/06/2021, 10:11 PMSam Hulick
08/06/2021, 10:26 PMBucket.fromBucketArn
do? it seems like it creates a new bucket, because it requires a resource ID. but based on the name, I’d assume it just points to another bucket. I basically want to point to an existing bucket and not create anything extraSam Hulick
08/07/2021, 12:31 AMrds.SubnetGroup
: There are no 'Private' subnet groups in this VPC. Available types: Isolated,Public
it is NOT required to have NAT gateways. am I missing something? I have an existing setup in another account that works perfectly with a DB subnet group of private subnets, and there are no NAT gateways.
EDIT: does my RDS DB even need to be in a VPC? 🤔 I must’ve configured it that way before for some good reason. can Lambdas not access the DB otherwise?Garret Harp
08/07/2021, 3:00 AMOleg Soroka
08/07/2021, 4:05 PMseed.yml
)
• I used aws sts assume-role
command and successfully assumed the role
• I then exported new aws credentials to the shell
• and I can see that the role was assumed properly
• problem: I suppose my tweaked environment is not respected in the subsequent shell (just as this docu says) where the actual deployment… is there a way to overcome this?Kujtim Hoxha
08/07/2021, 8:58 PMNeed to perform AWS calls for account my-account, but no credentials have been configured
I did set the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
using the seed
generated keys.Oleg Soroka
08/08/2021, 9:38 AMDavid Martin
08/08/2021, 5:33 PMproject
app
server
types
SST is inside the server
dir, app
is for my react-native app, `types`is for my typescript types & interfaces that are shared between the two.
When I run tests locally, code in server
can `import { IType } from "@project/types"`successfully. Also, everything works flawlessly when deployed to AWS.
However, when I debug a lambda function locally that uses the `import`above, I get the following error:
ERROR Error: Cannot find module ‘/Users/davidmartin/dev/myapp/node_modules/@project/types/dist/index.js’. Please verify that the package.json has a valid “main” entry
I can debug lambda’s locally when:
1. The lambda does NOT import from @project/types
2. If I run `npx tsc`and put and outdir
as “dist” in my tsconfig.json, then dist/index.js is found and debugging works
But it feels weird to run `tsc`in my types directory before I debug. I don’t think I should have to do that. I don’t run npx tsc
at other time. It’s also a bit weird now to have a `dist`directory.
Thoughts?Adrián Mouly
08/08/2021, 5:56 PMorm.init()
call on every lambda, which also has to keep that connection on the scope.Sam Hulick
08/08/2021, 10:26 PMtsconfig.path
weirdness going on, specifically with paths
aliases. I have this in my config:
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"@libs/*": ["libs/*"]
},
// ..etc
and yet when I try to use this shortcut in my code:Sam Hulick
08/08/2021, 11:46 PM../v2-microservices
├── README.md
├── cdk.context.json
├── infra
│ ├── api
│ │ ├── appsync.ts
│ │ ├── graphql-schema.gql
│ │ ├── rest-routes.ts
│ │ └── stack.ts
│ ├── core
│ │ ├── auth.ts
│ │ ├── buckets.ts
│ │ ├── cloudfront.ts
│ │ ├── database.ts
│ │ ├── ec2-tunnel.ts
│ │ └── stack.ts
│ ├── index.ts
│ └── libs
│ ├── get-ssm-parameter.ts
│ ├── route-helpers.ts
│ └── types
│ └── infra.ts
├── package.json
├── public_key.pem
├── src
│ └── services
│ ├── auth
│ │ ├── cognito-email-sender.ts
│ │ └── package.json
│ ├── graphql
│ │ ├── package.json
│ │ └── tracking.ts
│ └── rest-api
│ ├── functions
│ │ ├── create-thing.spec.ts
│ │ ├── create-thing.ts
│ │ └── get-things.ts
│ ├── package.json
│ ├── routes
│ └── util
├── sst.json
├── tsconfig.json
└── yarn.lock
13 directories, 29 files
Sam Hulick
08/09/2021, 12:04 AM.eslintrc.js
working in an SST project? it seems to be ignoring my rulesSam Hulick
08/09/2021, 12:37 AMyarn deploy
would output excess stuff I didn’t request?
Outputs:
BastionHostBastionHostIdC743CBD6: xx
BastionHostId: xx
BastionHostZone: us-east-1a
ExportsOutputRefUserPool6BA7E5F296FD7236: xx
ExportsOutputRefUserPoolClient2F5918F753847A55: xx
UserPoolId: xx
but this is what I’m actually requesting to output:
this.addOutputs({
BastionHostId: bastionHost.instanceId,
BastionHostZone: bastionHost.instanceAvailabilityZone,
UserPoolId: auth.cognitoUserPool!.userPoolId,
});
Garret Harp
08/09/2021, 2:05 AMAdrián Mouly
08/09/2021, 2:58 AMMiddy
or lambda-middleware
libraries?
I want to build a middleware that can GET some “secret attributes” during runtime from SSM, and I don’t want to put the “get parameters” call on each function code… I want to encapsulate all that and put them in a “context”.
Looking for ideas, I think Middy should work fine for this?Fazi
08/09/2021, 10:59 AMWarwick Grigg
08/09/2021, 12:20 PMBhuvaneshwaran Rajendran
08/09/2021, 12:21 PMGarret Harp
08/09/2021, 3:54 PMBen McGraw
08/10/2021, 2:37 AMevent.requestContext.identity
from the lambda is all nulls, but I'm verifying that the cognito user is being verified correctly by aws-api-gateway-cli-test itself, resulting in that looks like a good accessKey, secretKey, and sessionToken from AWS.config.credentials....brent
08/10/2021, 1:56 PMUPDATE_IN_PROGRESS | AWS::CloudFront::Distribution | AuthSPADistribution60D2FDA1
Checking deploy status...
Checking deploy status...
Checking deploy status...
... repeat for 10 minutes
is driving me insane.Sam Hulick
08/10/2021, 3:11 PMGuy Shechter
08/10/2021, 10:40 PMdeploy
but fails in debugging start
mode. I noticed that the debug lambda functions are not deployed into the VPC. Could that be the issue?Garret Harp
08/11/2021, 3:56 AM(0 , import_uuid.version) is not a function
anyone know how to fix this? I tried setting it in the nodeModules array on the function bundle but that did not changing anything.Bhuvaneshwaran Rajendran
08/11/2021, 9:48 AMnode_modules
in the testing coverage report? I tried with sst test --coverage
showing the node_modules files also in the coverage report.Fazi
08/11/2021, 12:51 PMconst clearDynamodbTableFunction = new Function(this, 'ClearDynamodbTableFunction', {
srcPath: "src/helpers/clear_table",
handler: 'index.handler',
timeout: 30,
environment: env,
permissions: ["ssm", skillsTable, usersTable]
});
skillsTable
and usersTable
are tables I create earlier.
I put this function behind an API:
api.addRoutes(this, {
"DELETE /clear-table/{table-name}": clearDynamodbTableFunction,
});
However, upon hitting this API endpoint, I get the following message:
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the DescribeTable operation: User: arn:aws:sts::123:assumed-role/dev-sst-integration-my-st-ClearDynamodbTableFuncti-1T3MU86FI83FK/dev-sst-integration-my-st-ClearDynamodbTableFuncti-eQz66VCa26mn is not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:us-east-1:table/UsersTable
Anyone got any ideas why this happens? I thought I was giving my function full access to the table.Kujtim Hoxha
08/11/2021, 1:26 PMSam Frampton
08/11/2021, 9:14 PMInvalid parameter: Message too long
error. My payloads are variable in size and can exceed 256kb. I’m just wondering what is considered best practice for transfering data between services when payload size is too big for sns/sqs? I’ve been reading that S3 bucket and passing signature link via sns message is one method. Does anyone have any other options to investigate?