Joel Corona
11/18/2021, 12:29 PMLukasz K
11/18/2021, 5:19 PMClayton
11/18/2021, 8:55 PM.gitignore
–
https://github.com/serverless-stack/serverless-stack/blob/master/packages/create-serverless-stack/templates/typescript/.template.gitignore#L13
I had a project with a mix of JS and TS files (in the process of learning TS) and didn’t realize until a bit later that a number of files weren’t being committed to version control.Gerald
11/19/2021, 1:11 AMgio
11/19/2021, 9:18 AMnpx sst deploy
everything works great but when I run npx sst start
app is unreachable (it show me the sst page which say to run static site locally).
So I run npx ng serve
to run angular locally, but. it doesn’t work because all environment variables are not filled to properly values.
All environment variables in angular are defined in two file (one for prod) which is called environments.ts:
export const environment = {
production: false,
API_BASE_PATH: '{{ API_DOMAIN }}',
IDENTITY_POOL_ID: '{{ IDENTITY_POOL_ID }}',
IDENTITY_POOL_REGION: '{{ IDENTITY_POOL_REGION }}',
USER_POOL_ID: '{{ USER_POOL_ID }}',
USER_POOL_WEB_CLIENT_ID: '{{ USER_POOL_WEB_CLIENT_ID }}',
USER_POOL_REGION: '{{ USER_POOL_REGION }}',
BUCKET_NAME: '{{ BUCKET_NAME }}',
BUCKET_REGION: '{{ BUCKET_REGION }}'
};
I have two question:
1. Which is the way to run properly an angular app?
2. Why SST doesn’t implement a short way (included in sst start) to serve a local site (maybe specifying external tool command)?Ryan
11/19/2021, 12:05 PMStaticSite.environment
field writes to the static-site-environment-output-values.json
) How would I do that?
My specific use case is that I'm setting up DynamoDB Onetable, and I want to put the table name and function ARN into a config file for it so I don't need to manually grab them and paste.manitej
11/19/2021, 1:54 PMRyan
11/19/2021, 2:11 PMsst.Script
?
Should I temporarily convert it to a sst.Function
and then call it manually?Blake E
11/19/2021, 4:55 PMsst start --console
web-console - SO very cool! 🚀 🏆
Anyone have any links that can point me to learn more about this? vision behind this, ability to extend for our use-cases? We’re seeing this as a very useful lil addition and are excited to see more 😄Ross Coundon
11/19/2021, 10:44 PMexternalModules
in the bundle and omitting aws-sdk?Hamed Mamdoohi
11/20/2021, 11:56 PMGerald
11/21/2021, 3:49 AMMikko Mannonen
11/21/2021, 10:55 AMGerald
11/21/2021, 11:37 AMGerald
11/21/2021, 12:25 PMAdrián Mouly
11/22/2021, 12:49 AMBundling dependencies for backend/src/pythonTest in Docker...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Not sure why is requiring to run on Docker?
This is the definition in my stack:
new Function(this, 'MyPythonTestLambda', {
srcPath: 'backend/src/pythonTest',
handler: 'index.main',
runtime: 'python3.7',
});
Ryan
11/22/2021, 12:01 PM// cognito stack
const userPoolClient = userPool.addClient('app-client', {
oAuth: {
callbackUrls: [frontendStack.url], // Can't inject this here because the static site isn't made yet
logoutUrls: [frontendStack.url],
}
});
const userPoolInstance = new sst.Auth(this, "Auth", {
cognito: {
userPool,
userPoolClient,
},
});
// frontend stack
const frontendSite = new sst.StaticSite(this, "frontend", {
environment: {
"COGNITO_LOGIN": cognitoStack.url // Need this in the constructor
}
}
I have to set those properties in the constructors. There isn't any way to add them afterwards as far as I can see.
Surely there is a way to get this working?
I can manually construct the user pool domain and pass that around rather than the pool itself, but I kind of like everything being auto-generated so I know it's always correct.
But would that be the best solution?
Maybe I could defer the creation of the Auth construct until the front-end is made, but then the backend stack (which depends on it) will come after the front-end... And I'm sure that is going to cause issues?
It feels like I should be able to set those redirect URLs (callback URLs) after the front-end, but I can't see how.Adrián Mouly
11/23/2021, 12:27 AMAdrián Mouly
11/23/2021, 3:13 AM03:08:26 | CREATE_FAILED | AWS::Lambda::Function | MyPythonTestLambda94F3A946 - Resource handler returned message: "Unzipped size must be smaller than 261144790 bytes (Service: Lambda, Status Code: 400, Request ID: 89566dbb-2ba6-4517-b4ee-79fc61a3be73, Extended Request ID: null)" (RequestToken: 593fa1dc-a52d-6714-60a1-76a5e14c23ff, HandlerErrorCode: InvalidRequest)
Ryan
11/23/2021, 5:08 AMsst.Script
to help develop and debug scripts! (It's almost like a "deployment breakpoint")
I found for simple cases, converting to a function is just fine. But for more complex cases, where you need the script to succeed for the rest of the deployment to work, then you get very stuck and resort to commenting out a lot of code everywhere to get the environment in a place where you can use the awesomeness of live lambda development.
I'd love to be able to set a flag on a script that does the following on `sst start`:
• The function is deployed in live mode
• On deployment, when the script would normally be executed (by create or update), the deployment halts there! (Breakpoint)
• In "interactive mode", the function becomes live for local development immediately. You can invoke the lambda, change the code, do whatever you like (just like function live development)
• It gives you helpers, eg. print out an AWS CLI command to invoke the lambda the same way that it would be by cloud formation. Or some kind of console. So by default you can just execute it exactly as it normally would be done with the same params as in the stack code.
• You can at any point continue with deployment or rollback, (marking it as success or failed), and cloud formation continues appropriately
It would make working with scripts an absolute delight 🙂Sean Matheson
11/23/2021, 12:47 PMClayton
11/23/2021, 10:36 PMprimaryIndex
in SST’s Table construct.
Is this value a 1:1 with the Primary Key concept from DDB’s documentation - or does it encapsulate something more?
And, if it is the same, is the reason for the different name in SST to normalize it with ‘Secondary Index’ or something else?Ross Coundon
11/24/2021, 2:41 PMQueue.sqsQueue
property should expose the same properties as are available when doing new CfnQueue() ?
Sean Matheson
11/24/2021, 3:03 PMMichael Orcutt
11/24/2021, 7:50 PMus-east-2
, are there any docs/sst support for multi-az?Adrián Mouly
11/25/2021, 1:59 AMPhil Astle
11/25/2021, 6:45 PMphil-debug-dentr-sst-after-deploy | UPDATE_FAILED | Custom::SSTScript | PostDeploymentScriptResourceE4FC8D7B Response object is too long
Any help much appreciated!Mitchell Mohorovich
11/26/2021, 1:25 AMsrcPath
is a follows:
handler.py
private-repo
poetry.lock
pyproject.toml
Where poetry.lock
and pyproject.toml
install private-repo
directly.
The issue I’m having is with this line: ([GitHub link](https://github.com/serverless-stack/serverless-stack/blob/2328bf3a5f938c9c448d9af5[…]8edded/packages/resources/assets/python/Dockerfile.dependencies))
COPY Pipfile* pyproject* poetry* requirements.tx[t] ./
Where only a small set of files are copied to /var/dependencies
. This causes the error below because custom directories aren’t copied over.
#12 [8/9] RUN if [ -f 'poetry.lock' ]; then poetry export --with-credentials --format requirements.txt --output requirements.txt; else echo "poetry.lock not found"; fi
#12 sha256:729124a64255fd9df11c3256c2f02b195d0f5f7e798150b1579970bce9eccd3b
#12 0.402
#12 0.402 ValueError
#12 0.402
#12 0.402 Directory private-repo does not exist
The question I had was 1. if there’s any way to customize this Dockerfile so I can also specify to copy over private-repo
so the dependencies are installed properly? 🤔
Thanks a lot in advance!Adrián Mouly
11/26/2021, 4:44 AMDockerImageFunction
to an existing API GW v2 created with Api
construct.
Can I use the existing addRoutes
method from Api
or I have to level down to the CDK gw-integration construct?
I did the integration this way:
myApi.httpApi.addRoutes({
path: '/books',
methods: [HttpMethod.GET],
integration: new LambdaProxyIntegration({
handler: lambda,
}),
});
But maybe there is a cleaner way?Adrián Mouly
11/28/2021, 10:38 PMhttpApi: {
disableExecuteApiEndpoint: true,
},
I mean, I’m never going to use it from my client apps.