This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Starting from offical aws-cli container. | |
FROM amazon/aws-cli:2.5.5 | |
# Adding some unzip tool | |
RUN yum install -y unzip | |
# Download fixed version -> unzip -> run install script | |
RUN curl -L https://github.com/aws/aws-sam-cli/releases/download/v1.46.0/aws-sam-cli-linux-x86_64.zip -o /tmp/aws-sam.zip \ | |
&& unzip /tmp/aws-sam.zip -d /tmp/aws-sam \ | |
&& /tmp/aws-sam/install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function: | |
foo: | |
handler: index.handler | |
# Ways to reference function in serverless.yml | |
FunctionName: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service.name}-${self:provider.stage}-foo | |
FunctionName: !GetAtt FooLambdaFunction.Arn | |
FunctionName: !Sub "${AWS::StackName}-foo" | |
FunctionName: ${self:service.name}-${self:provider.stage}-foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import MockAdapter from 'axios-mock-adapter'; | |
const mock = new MockAdapter(axios); | |
// this mocks a request which is always at 40% progress | |
mock.onPost('/upload-1').reply((config) => { | |
const total = 1024; // mocked file size | |
const progress = 0.4; | |
if (config.onUploadProgress) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |