├── .eslintignore
├── .github
├── FUNDING.yml
└── workflows
│ ├── ci-build.yml
│ └── ci-run.yml
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── base
├── .dockerignore
├── Dockerfile
├── amazonlinux1.txt
├── base-2
│ ├── Dockerfile
│ ├── amazonlinux2.txt
│ ├── diff.txt
│ ├── dump-packages.sh
│ ├── fs.txt
│ ├── missing.txt
│ └── packages.txt
├── build-2
│ └── Dockerfile
├── build-all-build.sh
├── build-all-run.sh
├── build-all.sh
├── build
│ └── Dockerfile
├── create-base-2.sh
├── create-base.sh
├── create-build-2.sh
├── create-build.sh
├── dump-dotnetcore20
│ ├── Function.cs
│ ├── Readme.md
│ ├── aws-lambda-tools-defaults.json
│ └── dump-dotnetcore20.csproj
├── dump-dotnetcore21
│ ├── Function.cs
│ ├── Readme.md
│ ├── aws-lambda-tools-defaults.json
│ └── dump-dotnetcore21.csproj
├── dump-dotnetcore31
│ ├── Function.cs
│ ├── aws-lambda-tools-defaults.json
│ └── dump-dotnetcore31.csproj
├── dump-go1x
│ ├── dump-go1x.go
│ ├── go.mod
│ └── go.sum
├── dump-java11
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ └── org.eclipse.jdt.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── lambci
│ │ └── lambda
│ │ └── DumpJava11.java
├── dump-java8
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ ├── org.eclipse.core.resources.prefs
│ │ └── org.eclipse.jdt.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── lambci
│ │ └── lambda
│ │ └── DumpJava8.java
├── dump-java8al2
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ ├── org.eclipse.core.resources.prefs
│ │ └── org.eclipse.jdt.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── lambci
│ │ └── lambda
│ │ └── DumpJava8.java
├── dump-node10x.js
├── dump-node12x.js
├── dump-nodejs.js
├── dump-nodejs43.js
├── dump-nodejs610.js
├── dump-nodejs810.js
├── dump-packages.sh
├── dump-provided.sh
├── dump-providedal2
│ ├── bootstrap.go
│ ├── go.mod
│ └── go.sum
├── dump-python27.py
├── dump-python36.py
├── dump-python37.py
├── dump-python38.py
├── dump-ruby25.rb
├── dump-ruby27.rb
├── dump.sh
├── native-test.sh
├── packages.txt
├── publish-all.sh
├── runtimes.sh
├── tag-all.sh
├── tar-find-layer
│ └── build.sh
└── test-all.sh
├── docker-lambda.code-workspace
├── dotnetcore2.0
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ ├── MockBootstraps
│ ├── DebuggerExtensions.cs
│ ├── MockBootstraps.csproj
│ ├── MockBootstraps.sln
│ ├── MockLambdaContext.cs
│ ├── MockRuntime.cs
│ ├── Program.cs
│ └── lib
│ │ ├── Amazon.Lambda.Core.dll
│ │ ├── Bootstrap.dll
│ │ └── Bootstrap.pdb
│ └── update_libs.sh
├── dotnetcore2.1
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ ├── MockBootstraps
│ ├── DebuggerExtensions.cs
│ ├── MockBootstraps.csproj
│ ├── MockBootstraps.sln
│ ├── MockLambdaContext.cs
│ ├── MockRuntime.cs
│ ├── Program.cs
│ └── lib
│ │ ├── Amazon.Lambda.Core.dll
│ │ ├── Bootstrap.dll
│ │ └── Bootstrap.pdb
│ └── update_libs.sh
├── dotnetcore3.1
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── examples
├── docker-file
│ ├── Dockerfile
│ ├── index.js
│ └── package.json
├── dotnetcore2.0
│ ├── Function.cs
│ ├── README.md
│ └── test.csproj
├── dotnetcore2.1
│ ├── Function.cs
│ ├── README.md
│ ├── test.csproj
│ └── test.sln
├── dotnetcore3.1
│ ├── Function.cs
│ ├── README.md
│ ├── test.csproj
│ └── test.sln
├── go1.x
│ ├── go.mod
│ ├── go.sum
│ └── handler.go
├── java
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ ├── org.eclipse.core.resources.prefs
│ │ └── org.eclipse.jdt.core.prefs
│ ├── README.md
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── lambci
│ │ └── lambda
│ │ └── ExampleHandler.java
├── nodejs-native-module
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── nodejs6.10
│ ├── index.js
│ └── package.json
├── nodejs8.10
│ ├── index.js
│ └── package.json
├── post.lua
├── provided.al2
│ ├── bootstrap.go
│ ├── go.mod
│ └── go.sum
├── provided
│ └── bootstrap
├── python
│ └── lambda_function.py
├── ruby
│ └── lambda_function.rb
└── terminal3.png
├── go1.x
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ ├── aws-lambda-mock.go
│ ├── go.mod
│ └── go.sum
├── index.js
├── java11
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── java8.al2
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── java8
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ ├── README.md
│ └── lambda-runtime-mock
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ └── org.eclipse.jdt.core.prefs
│ ├── build.sh
│ ├── gson-2.3.1.jar
│ └── src
│ └── main
│ └── java
│ └── lambdainternal
│ └── LambdaRuntime.java
├── nodejs10.x
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── nodejs12.x
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── nodejs4.3
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ └── awslambda-mock.js
├── nodejs6.10
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ └── awslambda-mock.js
├── nodejs8.10
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ └── awslambda-mock.js
├── package.json
├── provided.al2
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── provided
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ ├── go.mod
│ ├── go.sum
│ └── init.go
├── python2.7
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ └── runtime_mock.py
├── python3.6
├── build
│ └── Dockerfile
└── run
│ ├── Dockerfile
│ └── runtime_mock.py
├── python3.7
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── python3.8
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── ruby2.5
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
├── ruby2.7
├── build
│ └── Dockerfile
└── run
│ └── Dockerfile
└── test.js
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: mhart
4 |
--------------------------------------------------------------------------------
/.github/workflows/ci-build.yml:
--------------------------------------------------------------------------------
1 | name: ci-build
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v2
15 | - name: Build build Docker images
16 | working-directory: base
17 | run: ./build-all-build.sh
18 | - name: List Docker images
19 | run: |
20 | docker images
21 |
--------------------------------------------------------------------------------
/.github/workflows/ci-run.yml:
--------------------------------------------------------------------------------
1 | name: ci-run
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v2
15 | - name: Build run Docker images
16 | working-directory: base
17 | run: ./build-all-run.sh
18 | - name: List Docker images
19 | run: |
20 | docker images
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | base/diff
3 | base/diff-2
4 | *.pyc
5 | *.vs
6 | *.userprefs
7 | .gradle
8 | base/tar-find-layer/layer.zip
9 | base/dump-java8/bin
10 | base/dump-java8/build
11 | base/dump-java8al2/bin
12 | base/dump-java8al2/build
13 | base/dump-java11/bin
14 | base/dump-java11/build
15 | base/dump-dotnetcore20/bin
16 | base/dump-dotnetcore20/obj
17 | base/dump-dotnetcore21/bin
18 | base/dump-dotnetcore21/obj
19 | base/dump-dotnetcore31/bin
20 | base/dump-dotnetcore31/obj
21 | base/dump-providedal2/bootstrap
22 | base/dump-providedal2/bootstrap.zip
23 | dotnetcore2.0/run/MockBootstraps/bin
24 | dotnetcore2.0/run/MockBootstraps/obj
25 | dotnetcore2.1/run/MockBootstraps/bin
26 | dotnetcore2.1/run/MockBootstraps/obj
27 | java8/run/lambda-runtime-mock/target
28 | examples/dotnetcore2.0/bin
29 | examples/dotnetcore2.0/obj
30 | examples/dotnetcore2.0/pub
31 | examples/dotnetcore2.1/bin
32 | examples/dotnetcore2.1/obj
33 | examples/dotnetcore2.1/pub
34 | examples/dotnetcore3.1/bin
35 | examples/dotnetcore3.1/obj
36 | examples/dotnetcore3.1/pub
37 | examples/java/bin
38 | examples/java/build
39 | examples/go1.x/handler
40 | examples/go1.x/handler
41 | examples/provided.al2/bootstrap
42 | package-lock.json
43 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | base
2 | examples
3 | nodejs*
4 | python*
5 | java*
6 | go1*
7 | dotnetcore*
8 | ruby*
9 | provided
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2016 Michael Hart and LambCI contributors
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/base/.dockerignore:
--------------------------------------------------------------------------------
1 | **
2 | !base*.tgz
3 |
--------------------------------------------------------------------------------
/base/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM amazonlinux:1
2 |
3 | # Docker doesn't support unpacking from remote URLs with ADD,
4 | # and we don't want to 'docker import' because we can't squash into a small layer
5 | # So this is expected to be downloaded from https://lambci.s3.amazonaws.com/fs/base.tgz
6 | ADD ./base.tgz /opt/
7 |
8 | RUN yum --installroot=/opt reinstall -y filesystem-2.4.30-3.8.amzn1 && \
9 | yum --installroot=/opt clean all
10 |
11 | FROM scratch
12 |
13 | COPY --from=0 /opt /
14 |
15 | ENV PATH=/usr/local/bin:/usr/bin/:/bin:/opt/bin \
16 | LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib \
17 | LANG=en_US.UTF-8 \
18 | TZ=:UTC \
19 | LAMBDA_TASK_ROOT=/var/task \
20 | LAMBDA_RUNTIME_DIR=/var/runtime \
21 | _LAMBDA_CONTROL_SOCKET=14 \
22 | _LAMBDA_SHARED_MEM_FD=11 \
23 | _LAMBDA_LOG_FD=9 \
24 | _LAMBDA_SB_ID=7 \
25 | _LAMBDA_CONSOLE_SOCKET=16 \
26 | _LAMBDA_RUNTIME_LOAD_TIME=1530232235231 \
27 | _AWS_XRAY_DAEMON_ADDRESS=169.254.79.2 \
28 | _AWS_XRAY_DAEMON_PORT=2000 \
29 | AWS_XRAY_DAEMON_ADDRESS=169.254.79.2:2000 \
30 | AWS_XRAY_CONTEXT_MISSING=LOG_ERROR \
31 | _X_AMZN_TRACE_ID='Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=1'
32 |
33 | # pam has problems reinstalling from a non-standard installroot,
34 | # so reinstall everything except filesystem here
35 | RUN yum reinstall -y setup-2.8.14-20.12.amzn1 audit-libs-2.6.5-3.28.amzn1 shadow-utils-4.1.4.2-13.10.amzn1 \
36 | openssl-1.0.2k-16.152.amzn1 glibc-2.17-292.180.amzn1 glibc-common-2.17-292.180.amzn1 pam-1.1.8-12.33.amzn1 && \
37 | yum clean all && \
38 | chown sbx_user1051:495 /tmp && \
39 | chmod 700 /tmp
40 |
41 | WORKDIR /var/task
42 |
--------------------------------------------------------------------------------
/base/amazonlinux1.txt:
--------------------------------------------------------------------------------
1 | basesystem-10.0-4.9.amzn1.noarch
2 | bash-4.2.46-34.43.amzn1.x86_64
3 | bzip2-libs-1.0.6-8.12.amzn1.x86_64
4 | ca-certificates-2018.2.22-65.1.22.amzn1.noarch
5 | chkconfig-1.3.49.3-2.14.amzn1.x86_64
6 | coreutils-8.22-15.52.amzn1.x86_64
7 | curl-7.61.1-12.95.amzn1.x86_64
8 | cyrus-sasl-lib-2.1.23-13.16.amzn1.x86_64
9 | db4-4.7.25-18.11.amzn1.x86_64
10 | db4-utils-4.7.25-18.11.amzn1.x86_64
11 | elfutils-libelf-0.168-8.19.amzn1.x86_64
12 | expat-2.1.0-11.22.amzn1.x86_64
13 | file-libs-5.37-8.49.amzn1.x86_64
14 | filesystem-2.4.30-3.8.amzn1.x86_64
15 | gawk-3.1.7-10.10.amzn1.x86_64
16 | gdbm-1.8.0-36.6.amzn1.x86_64
17 | glib2-2.36.3-5.21.amzn1.x86_64
18 | glibc-2.17-292.180.amzn1.x86_64
19 | glibc-common-2.17-292.180.amzn1.x86_64
20 | gmp-6.0.0-11.16.amzn1.x86_64
21 | gnupg2-2.0.28-2.33.amzn1.x86_64
22 | gpgme-1.4.3-5.15.amzn1.x86_64
23 | grep-2.20-3.18.amzn1.x86_64
24 | gzip-1.5-9.19.amzn1.x86_64
25 | info-5.1-4.10.amzn1.x86_64
26 | keyutils-libs-1.5.8-3.12.amzn1.x86_64
27 | krb5-libs-1.15.1-46.48.amzn1.x86_64
28 | libacl-2.2.49-6.11.amzn1.x86_64
29 | libassuan-2.0.3-3.3.amzn1.x86_64
30 | libattr-2.4.46-12.10.amzn1.x86_64
31 | libcap-2.16-5.5.8.amzn1.x86_64
32 | libcom_err-1.43.5-2.43.amzn1.x86_64
33 | libcurl-7.61.1-12.95.amzn1.x86_64
34 | libffi-3.0.13-16.5.amzn1.x86_64
35 | libgcc72-7.2.1-2.59.amzn1.x86_64
36 | libgcrypt-1.5.3-12.19.amzn1.x86_64
37 | libgpg-error-1.11-1.12.amzn1.x86_64
38 | libicu-50.2-4.0.amzn1.x86_64
39 | libidn2-2.3.0-1.4.amzn1.x86_64
40 | libnghttp2-1.33.0-1.1.6.amzn1.x86_64
41 | libpsl-0.6.2-1.2.amzn1.x86_64
42 | libselinux-2.1.10-3.22.amzn1.x86_64
43 | libsepol-2.1.7-3.12.amzn1.x86_64
44 | libssh2-1.4.2-3.12.amzn1.x86_64
45 | libstdc++72-7.2.1-2.59.amzn1.x86_64
46 | libtasn1-2.3-6.6.amzn1.x86_64
47 | libunistring-0.9.3-6.1.amzn1.x86_64
48 | libverto-0.2.5-4.9.amzn1.x86_64
49 | libxml2-2.9.1-6.4.41.amzn1.x86_64
50 | libxml2-python27-2.9.1-6.4.41.amzn1.x86_64
51 | lua-5.1.4-4.1.9.amzn1.x86_64
52 | make-3.82-21.10.amzn1.x86_64
53 | ncurses-5.7-4.20090207.14.amzn1.x86_64
54 | ncurses-base-5.7-4.20090207.14.amzn1.x86_64
55 | ncurses-libs-5.7-4.20090207.14.amzn1.x86_64
56 | nspr-4.21.0-1.43.amzn1.x86_64
57 | nss-3.44.0-7.84.amzn1.x86_64
58 | nss-pem-1.0.3-4.3.amzn1.x86_64
59 | nss-softokn-3.44.0-8.44.amzn1.x86_64
60 | nss-softokn-freebl-3.44.0-8.44.amzn1.x86_64
61 | nss-sysinit-3.44.0-7.84.amzn1.x86_64
62 | nss-tools-3.44.0-7.84.amzn1.x86_64
63 | nss-util-3.44.0-4.56.amzn1.x86_64
64 | openldap-2.4.40-16.31.amzn1.x86_64
65 | openssl-1.0.2k-16.151.amzn1.x86_64
66 | p11-kit-0.18.5-2.3.amzn1.x86_64
67 | p11-kit-trust-0.18.5-2.3.amzn1.x86_64
68 | pcre-8.21-7.8.amzn1.x86_64
69 | pinentry-0.7.6-6.11.amzn1.x86_64
70 | pkgconfig-0.27.1-2.7.amzn1.x86_64
71 | popt-1.13-7.7.amzn1.x86_64
72 | pth-2.0.7-9.3.7.amzn1.x86_64
73 | python27-2.7.18-2.140.amzn1.x86_64
74 | python27-chardet-2.0.1-7.7.amzn1.noarch
75 | python27-iniparse-0.3.1-2.1.9.amzn1.noarch
76 | python27-kitchen-1.1.1-5.6.amzn1.noarch
77 | python27-libs-2.7.18-2.140.amzn1.x86_64
78 | python27-pycurl-7.19.0-17.12.amzn1.x86_64
79 | python27-pygpgme-0.3-9.12.amzn1.x86_64
80 | python27-pyliblzma-0.5.3-11.6.amzn1.x86_64
81 | python27-pyxattr-0.5.0-1.6.amzn1.x86_64
82 | python27-urlgrabber-3.10-8.16.amzn1.noarch
83 | readline-6.2-9.14.amzn1.x86_64
84 | rpm-4.11.3-40.78.amzn1.x86_64
85 | rpm-build-libs-4.11.3-40.78.amzn1.x86_64
86 | rpm-libs-4.11.3-40.78.amzn1.x86_64
87 | rpm-python27-4.11.3-40.78.amzn1.x86_64
88 | sed-4.2.1-10.10.amzn1.x86_64
89 | setup-2.8.14-20.12.amzn1.noarch
90 | shared-mime-info-1.1-9.8.amzn1.x86_64
91 | sqlite-3.7.17-8.14.amzn1.x86_64
92 | sysctl-defaults-1.0-1.1.amzn1.noarch
93 | system-release-2018.03-0.0.noarch
94 | tar-1.26-31.22.amzn1.x86_64
95 | tzdata-2020a-1.75.amzn1.noarch
96 | xz-libs-5.2.2-1.13.amzn1.x86_64
97 | yum-3.4.3-150.71.amzn1.noarch
98 | yum-metadata-parser-1.1.4-10.20.amzn1.x86_64
99 | yum-plugin-ovl-1.1.31-46.30.amzn1.noarch
100 | yum-plugin-priorities-1.1.31-46.30.amzn1.noarch
101 | yum-utils-1.1.31-46.30.amzn1.noarch
102 | zlib-1.2.8-7.18.amzn1.x86_64
103 |
--------------------------------------------------------------------------------
/base/base-2/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM amazonlinux:2
2 |
3 | # Docker doesn't support unpacking from remote URLs with ADD,
4 | # and we don't want to 'docker import' because we can't squash into a small layer
5 | # So this is expected to be downloaded from https://lambci.s3.amazonaws.com/fs/base-2.tgz
6 | ADD ./base-2.tgz /opt/
7 |
8 | RUN yum --installroot=/opt reinstall -y filesystem-3.2-25.amzn2.0.4 \
9 | setup-2.8.71-10.amzn2.0.1 glibc-2.26-39.amzn2 glibc-common-2.26-39.amzn2 && \
10 | yum --installroot=/opt clean all
11 |
12 | FROM scratch
13 |
14 | COPY --from=0 /opt /
15 |
16 | ENV PATH=/usr/local/bin:/usr/bin/:/bin:/opt/bin \
17 | LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib \
18 | LANG=en_US.UTF-8 \
19 | TZ=:UTC \
20 | LAMBDA_TASK_ROOT=/var/task \
21 | LAMBDA_RUNTIME_DIR=/var/runtime \
22 | _LAMBDA_CONTROL_SOCKET=14 \
23 | _LAMBDA_SHARED_MEM_FD=11 \
24 | _LAMBDA_LOG_FD=9 \
25 | _LAMBDA_SB_ID=7 \
26 | _LAMBDA_CONSOLE_SOCKET=16 \
27 | _LAMBDA_RUNTIME_LOAD_TIME=1530232235231 \
28 | _AWS_XRAY_DAEMON_ADDRESS=169.254.79.2 \
29 | _AWS_XRAY_DAEMON_PORT=2000 \
30 | AWS_XRAY_DAEMON_ADDRESS=169.254.79.2:2000 \
31 | AWS_XRAY_CONTEXT_MISSING=LOG_ERROR \
32 | _X_AMZN_TRACE_ID='Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=1'
33 |
34 | RUN chown sbx_user1051:495 /tmp && \
35 | chmod 700 /tmp
36 |
37 | WORKDIR /var/task
38 |
--------------------------------------------------------------------------------
/base/base-2/amazonlinux2.txt:
--------------------------------------------------------------------------------
1 | amazon-linux-extras-1.6.12-1.amzn2.noarch
2 | basesystem-10.0-7.amzn2.0.1.noarch
3 | bash-4.2.46-34.amzn2.x86_64
4 | bzip2-libs-1.0.6-13.amzn2.0.2.x86_64
5 | ca-certificates-2019.2.32-76.amzn2.0.3.noarch
6 | chkconfig-1.7.4-1.amzn2.0.2.x86_64
7 | coreutils-8.22-24.amzn2.x86_64
8 | cpio-2.11-28.amzn2.x86_64
9 | curl-7.61.1-12.amzn2.0.2.x86_64
10 | cyrus-sasl-lib-2.1.26-23.amzn2.x86_64
11 | diffutils-3.3-5.amzn2.x86_64
12 | elfutils-libelf-0.176-2.amzn2.x86_64
13 | expat-2.1.0-12.amzn2.x86_64
14 | file-libs-5.11-36.amzn2.0.1.x86_64
15 | filesystem-3.2-25.amzn2.0.4.x86_64
16 | findutils-4.5.11-6.amzn2.x86_64
17 | gawk-4.0.2-4.amzn2.1.2.x86_64
18 | gdbm-1.13-6.amzn2.0.2.x86_64
19 | glib2-2.56.1-7.amzn2.0.1.x86_64
20 | glibc-2.26-38.amzn2.x86_64
21 | glibc-common-2.26-38.amzn2.x86_64
22 | glibc-langpack-en-2.26-38.amzn2.x86_64
23 | glibc-minimal-langpack-2.26-38.amzn2.x86_64
24 | gmp-6.0.0-15.amzn2.0.2.x86_64
25 | gnupg2-2.0.22-5.amzn2.0.4.x86_64
26 | gpgme-1.3.2-5.amzn2.0.2.x86_64
27 | grep-2.20-3.amzn2.0.2.x86_64
28 | info-5.1-5.amzn2.x86_64
29 | keyutils-libs-1.5.8-3.amzn2.0.2.x86_64
30 | krb5-libs-1.15.1-37.amzn2.2.2.x86_64
31 | libacl-2.2.51-14.amzn2.x86_64
32 | libassuan-2.1.0-3.amzn2.0.2.x86_64
33 | libattr-2.4.46-12.amzn2.0.2.x86_64
34 | libblkid-2.30.2-2.amzn2.0.4.x86_64
35 | libcap-2.22-9.amzn2.0.2.x86_64
36 | libcom_err-1.42.9-19.amzn2.x86_64
37 | libcrypt-2.26-38.amzn2.x86_64
38 | libcurl-7.61.1-12.amzn2.0.2.x86_64
39 | libdb-5.3.21-24.amzn2.0.3.x86_64
40 | libdb-utils-5.3.21-24.amzn2.0.3.x86_64
41 | libffi-3.0.13-18.amzn2.0.2.x86_64
42 | libgcc-7.3.1-9.amzn2.x86_64
43 | libgcrypt-1.5.3-14.amzn2.0.2.x86_64
44 | libgpg-error-1.12-3.amzn2.0.3.x86_64
45 | libidn2-2.3.0-1.amzn2.x86_64
46 | libmetalink-0.1.3-13.amzn2.x86_64
47 | libmount-2.30.2-2.amzn2.0.4.x86_64
48 | libnghttp2-1.41.0-1.amzn2.x86_64
49 | libselinux-2.5-12.amzn2.0.2.x86_64
50 | libsepol-2.5-8.1.amzn2.0.2.x86_64
51 | libssh2-1.4.3-12.amzn2.2.3.x86_64
52 | libstdc++-7.3.1-9.amzn2.x86_64
53 | libtasn1-4.10-1.amzn2.0.2.x86_64
54 | libunistring-0.9.3-9.amzn2.0.2.x86_64
55 | libuuid-2.30.2-2.amzn2.0.4.x86_64
56 | libverto-0.2.5-4.amzn2.0.2.x86_64
57 | libxml2-2.9.1-6.amzn2.5.1.x86_64
58 | lua-5.1.4-15.amzn2.0.2.x86_64
59 | ncurses-6.0-8.20170212.amzn2.1.3.x86_64
60 | ncurses-base-6.0-8.20170212.amzn2.1.3.noarch
61 | ncurses-libs-6.0-8.20170212.amzn2.1.3.x86_64
62 | nspr-4.25.0-2.amzn2.x86_64
63 | nss-3.53.1-3.amzn2.x86_64
64 | nss-pem-1.0.3-5.amzn2.x86_64
65 | nss-softokn-3.53.1-6.amzn2.x86_64
66 | nss-softokn-freebl-3.53.1-6.amzn2.x86_64
67 | nss-sysinit-3.53.1-3.amzn2.x86_64
68 | nss-tools-3.53.1-3.amzn2.x86_64
69 | nss-util-3.53.1-1.amzn2.x86_64
70 | openldap-2.4.44-22.amzn2.x86_64
71 | openssl-libs-1.0.2k-19.amzn2.0.3.x86_64
72 | p11-kit-0.23.21-2.amzn2.0.1.x86_64
73 | p11-kit-trust-0.23.21-2.amzn2.0.1.x86_64
74 | pcre-8.32-17.amzn2.0.2.x86_64
75 | pinentry-0.8.1-17.amzn2.0.2.x86_64
76 | popt-1.13-16.amzn2.0.2.x86_64
77 | pth-2.0.7-23.amzn2.0.2.x86_64
78 | pygpgme-0.3-9.amzn2.0.2.x86_64
79 | pyliblzma-0.5.3-11.amzn2.0.2.x86_64
80 | python-2.7.18-1.amzn2.0.2.x86_64
81 | python-iniparse-0.4-9.amzn2.noarch
82 | python-libs-2.7.18-1.amzn2.0.2.x86_64
83 | python-pycurl-7.19.0-19.amzn2.0.2.x86_64
84 | python-urlgrabber-3.10-9.amzn2.0.1.noarch
85 | python2-rpm-4.11.3-40.amzn2.0.5.x86_64
86 | pyxattr-0.5.1-5.amzn2.0.2.x86_64
87 | readline-6.2-10.amzn2.0.2.x86_64
88 | rpm-4.11.3-40.amzn2.0.5.x86_64
89 | rpm-build-libs-4.11.3-40.amzn2.0.5.x86_64
90 | rpm-libs-4.11.3-40.amzn2.0.5.x86_64
91 | sed-4.2.2-5.amzn2.0.2.x86_64
92 | setup-2.8.71-10.amzn2.0.1.noarch
93 | shared-mime-info-1.8-4.amzn2.x86_64
94 | sqlite-3.7.17-8.amzn2.1.1.x86_64
95 | system-release-2-12.amzn2.x86_64
96 | tzdata-2020a-1.amzn2.noarch
97 | vim-minimal-8.1.1602-1.amzn2.x86_64
98 | xz-libs-5.2.2-1.amzn2.0.2.x86_64
99 | yum-3.4.3-158.amzn2.0.4.noarch
100 | yum-metadata-parser-1.1.4-10.amzn2.0.2.x86_64
101 | yum-plugin-ovl-1.1.31-46.amzn2.0.1.noarch
102 | yum-plugin-priorities-1.1.31-46.amzn2.0.1.noarch
103 | zlib-1.2.7-18.amzn2.x86_64
104 |
--------------------------------------------------------------------------------
/base/base-2/diff.txt:
--------------------------------------------------------------------------------
1 | amazon-linux-extras-1.6.11-1.amzn2.noarch
2 | bzip2-libs-1.0.6-13.amzn2.0.2.x86_64
3 | cpio-2.11-27.amzn2.x86_64
4 | curl-7.61.1-12.amzn2.0.1.x86_64
5 | cyrus-sasl-lib-2.1.26-23.amzn2.x86_64
6 | diffutils-3.3-5.amzn2.x86_64
7 | elfutils-libelf-0.176-2.amzn2.x86_64
8 | expat-2.1.0-10.amzn2.0.2.x86_64
9 | file-libs-5.11-35.amzn2.0.2.x86_64
10 | findutils-4.5.11-6.amzn2.x86_64
11 | gdbm-1.13-6.amzn2.0.2.x86_64
12 | glib2-2.56.1-5.amzn2.0.1.x86_64
13 | glibc-langpack-en-2.26-34.amzn2.x86_64
14 | gnupg2-2.0.22-5.amzn2.0.4.x86_64
15 | gpgme-1.3.2-5.amzn2.0.2.x86_64
16 | libassuan-2.1.0-3.amzn2.0.2.x86_64
17 | libblkid-2.30.2-2.amzn2.0.4.x86_64
18 | libcrypt-2.26-34.amzn2.x86_64
19 | libcurl-7.61.1-12.amzn2.0.1.x86_64
20 | libdb-5.3.21-24.amzn2.0.3.x86_64
21 | libdb-utils-5.3.21-24.amzn2.0.3.x86_64
22 | libgcrypt-1.5.3-14.amzn2.0.2.x86_64
23 | libgpg-error-1.12-3.amzn2.0.3.x86_64
24 | libidn2-2.3.0-1.amzn2.x86_64
25 | libmetalink-0.1.2-7.amzn2.0.2.x86_64
26 | libmount-2.30.2-2.amzn2.0.4.x86_64
27 | libnghttp2-1.39.2-1.amzn2.x86_64
28 | libssh2-1.4.3-12.amzn2.2.2.x86_64
29 | libunistring-0.9.3-9.amzn2.0.2.x86_64
30 | libuuid-2.30.2-2.amzn2.0.4.x86_64
31 | libxml2-2.9.1-6.amzn2.3.3.x86_64
32 | lua-5.1.4-15.amzn2.0.2.x86_64
33 | nss-3.44.0-7.amzn2.x86_64
34 | nss-pem-1.0.3-5.amzn2.x86_64
35 | nss-softokn-3.44.0-8.amzn2.x86_64
36 | nss-sysinit-3.44.0-7.amzn2.x86_64
37 | nss-tools-3.44.0-7.amzn2.x86_64
38 | openldap-2.4.44-15.amzn2.x86_64
39 | pinentry-0.8.1-17.amzn2.0.2.x86_64
40 | pth-2.0.7-23.amzn2.0.2.x86_64
41 | pygpgme-0.3-9.amzn2.0.2.x86_64
42 | pyliblzma-0.5.3-11.amzn2.0.2.x86_64
43 | python-2.7.18-1.amzn2.x86_64
44 | python-iniparse-0.4-9.amzn2.noarch
45 | python-libs-2.7.18-1.amzn2.x86_64
46 | python-pycurl-7.19.0-19.amzn2.0.2.x86_64
47 | python-urlgrabber-3.10-9.amzn2.0.1.noarch
48 | python2-rpm-4.11.3-40.amzn2.0.4.x86_64
49 | pyxattr-0.5.1-5.amzn2.0.2.x86_64
50 | readline-6.2-10.amzn2.0.2.x86_64
51 | rpm-4.11.3-40.amzn2.0.4.x86_64
52 | rpm-build-libs-4.11.3-40.amzn2.0.4.x86_64
53 | rpm-libs-4.11.3-40.amzn2.0.4.x86_64
54 | shared-mime-info-1.8-4.amzn2.x86_64
55 | sqlite-3.7.17-8.amzn2.1.1.x86_64
56 | vim-minimal-8.1.1602-1.amzn2.x86_64
57 | xz-libs-5.2.2-1.amzn2.0.2.x86_64
58 | yum-3.4.3-158.amzn2.0.4.noarch
59 | yum-metadata-parser-1.1.4-10.amzn2.0.2.x86_64
60 | yum-plugin-ovl-1.1.31-46.amzn2.0.1.noarch
61 | yum-plugin-priorities-1.1.31-46.amzn2.0.1.noarch
62 |
--------------------------------------------------------------------------------
/base/base-2/dump-packages.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | curl https://lambci.s3.amazonaws.com/fs/base-2.tgz | tar -xz --strip-components=2 -- var/lib/rpm
4 |
5 | docker pull amazonlinux:2
6 | docker run -v "$PWD/rpm":/rpm --rm amazonlinux:2 rpm -qa --dbpath /rpm | grep -v ^gpg-pubkey- | sort > packages.txt
7 | rm -rf rpm
8 |
9 | docker run --rm amazonlinux:2 bash -c 'yum upgrade -y > /dev/null && rpm -qa' | grep -v ^gpg-pubkey- | sort > amazonlinux2.txt
10 |
11 | if diff -w -d amazonlinux2.txt packages.txt | grep -q '>'; then
12 | echo 'Mismatching packages on images'
13 | diff -w -d amazonlinux2.txt packages.txt
14 | else
15 | diff -w -d amazonlinux2.txt packages.txt | grep '<' | awk '{print $2}' > diff.txt
16 | fi
17 |
--------------------------------------------------------------------------------
/base/base-2/missing.txt:
--------------------------------------------------------------------------------
1 | /etc/securetty
2 | /etc/shadow
3 | /etc/gshadow
4 | /var/log/yum.log
5 | /var/lib/yum/history/2019-04-17/1
6 | /var/lib/yum/history/history-2019-04-17.sqlite
7 | /var/cache/ldconfig
8 | /usr/sbin/build-locale-archive
9 | /usr/sbin/glibc_post_upgrade.x86_64
10 | /root/
11 |
--------------------------------------------------------------------------------
/base/base-2/packages.txt:
--------------------------------------------------------------------------------
1 | basesystem-10.0-7.amzn2.0.1.noarch
2 | bash-4.2.46-34.amzn2.x86_64
3 | ca-certificates-2019.2.32-76.amzn2.0.3.noarch
4 | chkconfig-1.7.4-1.amzn2.0.2.x86_64
5 | coreutils-8.22-24.amzn2.x86_64
6 | filesystem-3.2-25.amzn2.0.4.x86_64
7 | gawk-4.0.2-4.amzn2.1.2.x86_64
8 | glibc-2.26-38.amzn2.x86_64
9 | glibc-all-langpacks-2.26-38.amzn2.x86_64
10 | glibc-common-2.26-38.amzn2.x86_64
11 | glibc-minimal-langpack-2.26-38.amzn2.x86_64
12 | gmp-6.0.0-15.amzn2.0.2.x86_64
13 | grep-2.20-3.amzn2.0.2.x86_64
14 | info-5.1-5.amzn2.x86_64
15 | keyutils-libs-1.5.8-3.amzn2.0.2.x86_64
16 | krb5-libs-1.15.1-37.amzn2.2.2.x86_64
17 | libacl-2.2.51-14.amzn2.x86_64
18 | libattr-2.4.46-12.amzn2.0.2.x86_64
19 | libcap-2.22-9.amzn2.0.2.x86_64
20 | libcom_err-1.42.9-19.amzn2.x86_64
21 | libffi-3.0.13-18.amzn2.0.2.x86_64
22 | libgcc-7.3.1-9.amzn2.x86_64
23 | libicu-50.2-4.amzn2.x86_64
24 | libselinux-2.5-12.amzn2.0.2.x86_64
25 | libsepol-2.5-8.1.amzn2.0.2.x86_64
26 | libstdc++-7.3.1-9.amzn2.x86_64
27 | libtasn1-4.10-1.amzn2.0.2.x86_64
28 | libverto-0.2.5-4.amzn2.0.2.x86_64
29 | ncurses-6.0-8.20170212.amzn2.1.3.x86_64
30 | ncurses-base-6.0-8.20170212.amzn2.1.3.noarch
31 | ncurses-libs-6.0-8.20170212.amzn2.1.3.x86_64
32 | nspr-4.25.0-2.amzn2.x86_64
33 | nss-softokn-freebl-3.53.1-6.amzn2.x86_64
34 | nss-util-3.53.1-1.amzn2.x86_64
35 | openssl-libs-1.0.2k-19.amzn2.0.3.x86_64
36 | p11-kit-0.23.21-2.amzn2.0.1.x86_64
37 | p11-kit-trust-0.23.21-2.amzn2.0.1.x86_64
38 | pcre-8.32-17.amzn2.0.2.x86_64
39 | popt-1.13-16.amzn2.0.2.x86_64
40 | sed-4.2.2-5.amzn2.0.2.x86_64
41 | setup-2.8.71-10.amzn2.0.1.noarch
42 | system-release-2-12.amzn2.x86_64
43 | tzdata-2020a-1.amzn2.noarch
44 | zlib-1.2.7-18.amzn2.x86_64
45 |
--------------------------------------------------------------------------------
/base/build-2/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM lambci/lambda-base-2
2 |
3 | FROM amazonlinux:2
4 |
5 | COPY --from=0 / /opt/
6 |
7 | RUN yum --installroot=/opt install -y yum yum-plugin-ovl yum-plugin-priorities
8 |
9 | FROM lambci/lambda-base-2
10 |
11 | ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin \
12 | PIPX_BIN_DIR=/usr/local/bin \
13 | PIPX_HOME=/usr/local/pipx
14 |
15 | COPY --from=1 /opt /
16 |
17 | RUN chown root:root /tmp && \
18 | chmod 1777 /tmp && \
19 | yum install -y glibc-langpack-en && \
20 | yum groupinstall -y development && \
21 | yum install -y which clang cmake python-devel python3-devel amazon-linux-extras && \
22 | amazon-linux-extras install -y docker && \
23 | yum clean all && \
24 | pip3 install -U pip setuptools wheel --no-cache-dir && \
25 | pip3 install pipx --no-cache-dir
26 |
--------------------------------------------------------------------------------
/base/build-all-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | source ${PWD}/runtimes.sh
5 |
6 | TOP_DIR="${PWD}/.."
7 |
8 | for RUNTIME in $RUNTIMES; do
9 | echo build-${RUNTIME}
10 |
11 | cd ${TOP_DIR}/${RUNTIME}/build
12 |
13 | docker build -t lambci/lambda:build-${RUNTIME} .
14 | done
15 |
--------------------------------------------------------------------------------
/base/build-all-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | source ${PWD}/runtimes.sh
5 |
6 | TOP_DIR="${PWD}/.."
7 |
8 | for RUNTIME in $RUNTIMES; do
9 | echo $RUNTIME
10 |
11 | cd ${TOP_DIR}/${RUNTIME}/run
12 |
13 | [ -x ./update_libs.sh ] && ./update_libs.sh
14 |
15 | docker build --no-cache -t lambci/lambda:${RUNTIME} .
16 | done
17 |
--------------------------------------------------------------------------------
/base/build-all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ${PWD}/build-all-run.sh
5 |
6 | ${PWD}/build-all-build.sh
7 |
--------------------------------------------------------------------------------
/base/build/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM lambci/lambda-base
2 |
3 | ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin \
4 | PIPX_BIN_DIR=/usr/local/bin \
5 | PIPX_HOME=/usr/local/pipx
6 |
7 | RUN chown root:root /tmp && \
8 | chmod 1777 /tmp && \
9 | yum groups mark convert && \
10 | yum groupinstall -y development && \
11 | yum install -y clang cmake docker python27-devel python36-devel \
12 | ImageMagick-devel-6.9.10.68 cairo-devel libssh2-devel libxslt-devel libmpc-devel readline-devel db4-devel \
13 | libffi-devel expat-devel libicu-devel lua-devel gdbm-devel sqlite-devel pcre-devel libcurl-devel && \
14 | yum clean all && \
15 | alternatives --set gcc /usr/bin/gcc48 && \
16 | alternatives --set g++ /usr/bin/g++48 && \
17 | alternatives --set cpp /usr/bin/cpp48 && \
18 | python3 -m pip install -U pip setuptools wheel --no-cache-dir && \
19 | pip install pipx --no-cache-dir && \
20 | pipx run awscli==1.* 2>/dev/null || true
21 |
--------------------------------------------------------------------------------
/base/create-base-2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | curl -O https://lambci.s3.amazonaws.com/fs/base-2.tgz
4 |
5 | docker build --squash -t lambci/lambda-base-2 -f ./base-2/Dockerfile .
6 |
7 | rm ./base-2.tgz
8 |
--------------------------------------------------------------------------------
/base/create-base.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | curl -O https://lambci.s3.amazonaws.com/fs/base.tgz
4 |
5 | docker build --squash -t lambci/lambda-base .
6 |
7 | rm ./base.tgz
8 |
--------------------------------------------------------------------------------
/base/create-build-2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | docker build --no-cache --squash -t lambci/lambda-base-2:build -f ./build-2/Dockerfile .
4 |
--------------------------------------------------------------------------------
/base/create-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | docker build --no-cache -t lambci/lambda-base:build -f ./build/Dockerfile .
4 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore20/Function.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Threading.Tasks;
5 |
6 | using Amazon.Lambda.Core;
7 | using Amazon.S3;
8 |
9 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
10 |
11 | namespace dump_dotnetcore20
12 | {
13 | public class Function
14 | {
15 | ///
16 | /// Lambda function to dump the container directories /var/lang
17 | /// and /var/runtime and upload the resulting archive to S3
18 | ///
19 | ///
20 | public async Task FunctionHandler(object invokeEvent, ILambdaContext context)
21 | {
22 | string filename = "dotnetcore2.0.tgz";
23 | string cmd = $"tar -cpzf /tmp/{filename} --numeric-owner --ignore-failed-read /var/runtime /var/lang";
24 |
25 | Console.WriteLine($"invokeEvent: {invokeEvent}");
26 | Console.WriteLine($"context.RemainingTime: {context.RemainingTime}");
27 |
28 | Console.WriteLine("Parent cmdline:");
29 | Console.WriteLine(File.ReadAllText("/proc/1/cmdline").Replace("\0", " "));
30 |
31 | Console.WriteLine("Parent env:");
32 | RunShell("xargs --null --max-args=1 < /proc/1/environ");
33 |
34 | Console.WriteLine("This cmdline:");
35 | Console.WriteLine(File.ReadAllText($"/proc/{Process.GetCurrentProcess().Id}/cmdline").Replace("\0", " "));
36 |
37 | Console.WriteLine("This env:");
38 | RunShell($"xargs --null --max-args=1 < /proc/{Process.GetCurrentProcess().Id}/environ");
39 |
40 | Console.WriteLine($"Current working directory: {Directory.GetCurrentDirectory()}");
41 |
42 | RunShell(cmd);
43 |
44 | Console.WriteLine("Zipping done! Uploading...");
45 |
46 | var s3Client = new AmazonS3Client();
47 | var response = await s3Client.PutObjectAsync(new Amazon.S3.Model.PutObjectRequest
48 | {
49 | BucketName = "lambci",
50 | Key = $"fs/{filename}",
51 | FilePath = $"/tmp/{filename}",
52 | CannedACL = S3CannedACL.PublicRead,
53 | });
54 |
55 | Console.WriteLine("Uploading done!");
56 |
57 | return response.HttpStatusCode.ToString();
58 | }
59 |
60 | private static Process RunShell(string cmd)
61 | {
62 | var escapedArgs = cmd.Replace("\"", "\\\"");
63 | var process = new Process
64 | {
65 | StartInfo = new ProcessStartInfo
66 | {
67 | FileName = "/bin/sh",
68 | Arguments = $"-c \"{escapedArgs}\"",
69 | UseShellExecute = false,
70 | CreateNoWindow = true,
71 | }
72 | };
73 | process.Start();
74 | process.WaitForExit();
75 | return process;
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/base/dump-dotnetcore20/Readme.md:
--------------------------------------------------------------------------------
1 | # AWS Lambda Dump Runtime Project
2 | This functions dumps the runtime and uploads it to s3.
3 |
4 |
5 | ## Here are some steps to follow from Visual Studio:
6 |
7 | To deploy your function to AWS Lambda, right click the project in Solution Explorer and select *Publish to AWS Lambda*.
8 |
9 | To view your deployed function open its Function View window by double-clicking the function name shown beneath the AWS Lambda node in the AWS Explorer tree.
10 |
11 | To perform testing against your deployed function use the Test Invoke tab in the opened Function View window.
12 |
13 | To configure event sources for your deployed function, for example to have your function invoked when an object is created in an Amazon S3 bucket, use the Event Sources tab in the opened Function View window.
14 |
15 | To update the runtime configuration of your deployed function use the Configuration tab in the opened Function View window.
16 |
17 | To view execution logs of invocations of your function use the Logs tab in the opened Function View window.
18 |
19 | ## Here are some steps to follow to get started from the command line:
20 |
21 | Restore dependencies
22 | ```shell
23 | dotnet restore
24 | ```
25 |
26 | Deploy function to AWS Lambda
27 | ```shell
28 | dotnet lambda deploy-function [--profile ] [--region ] dump-dotnetcore20
29 | ```
30 |
31 | Invoke function
32 | ```shell
33 | dotnet lambda invoke-function [--profile ] [--region ] dump-dotnetcore20
34 | ```
35 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore20/aws-lambda-tools-defaults.json:
--------------------------------------------------------------------------------
1 | {
2 | "configuration": "Release",
3 | "framework": "netcoreapp2.0",
4 | "function-runtime": "dotnetcore2.0",
5 | "function-memory-size": 1536,
6 | "function-timeout": 300,
7 | "function-handler": "dump_dotnetcore20::dump_dotnetcore20.Function::FunctionHandler"
8 | }
9 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore20/dump-dotnetcore20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 | true
6 | dump_dotnetcore20
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore21/Function.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Threading.Tasks;
5 |
6 | using Amazon.Lambda.Core;
7 | using Amazon.S3;
8 |
9 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
10 |
11 | namespace dump_dotnetcore21
12 | {
13 | public class Function
14 | {
15 | ///
16 | /// Lambda function to dump the container directories /var/lang
17 | /// and /var/runtime and upload the resulting archive to S3
18 | ///
19 | ///
20 | public async Task FunctionHandler(object invokeEvent, ILambdaContext context)
21 | {
22 | string filename = "dotnetcore2.1.tgz";
23 | string cmd = $"tar -cpzf /tmp/{filename} --numeric-owner --ignore-failed-read /var/runtime /var/lang";
24 |
25 | Console.WriteLine($"invokeEvent: {invokeEvent}");
26 | Console.WriteLine($"context.RemainingTime: {context.RemainingTime}");
27 |
28 | Console.WriteLine("Parent cmdline:");
29 | Console.WriteLine(File.ReadAllText("/proc/1/cmdline").Replace("\0", " "));
30 |
31 | Console.WriteLine("Parent env:");
32 | RunShell("xargs --null --max-args=1 < /proc/1/environ");
33 |
34 | Console.WriteLine("This cmdline:");
35 | Console.WriteLine(File.ReadAllText($"/proc/{Process.GetCurrentProcess().Id}/cmdline").Replace("\0", " "));
36 |
37 | Console.WriteLine("This env:");
38 | RunShell($"xargs --null --max-args=1 < /proc/{Process.GetCurrentProcess().Id}/environ");
39 |
40 | Console.WriteLine($"Current working directory: {Directory.GetCurrentDirectory()}");
41 |
42 | RunShell(cmd);
43 |
44 | Console.WriteLine("Zipping done! Uploading...");
45 |
46 | var s3Client = new AmazonS3Client();
47 | var response = await s3Client.PutObjectAsync(new Amazon.S3.Model.PutObjectRequest
48 | {
49 | BucketName = "lambci",
50 | Key = $"fs/{filename}",
51 | FilePath = $"/tmp/{filename}",
52 | CannedACL = S3CannedACL.PublicRead,
53 | });
54 |
55 | Console.WriteLine("Uploading done!");
56 |
57 | return response.HttpStatusCode.ToString();
58 | }
59 |
60 | private static Process RunShell(string cmd)
61 | {
62 | var escapedArgs = cmd.Replace("\"", "\\\"");
63 | var process = new Process
64 | {
65 | StartInfo = new ProcessStartInfo
66 | {
67 | FileName = "/bin/sh",
68 | Arguments = $"-c \"{escapedArgs}\"",
69 | UseShellExecute = false,
70 | CreateNoWindow = true,
71 | }
72 | };
73 | process.Start();
74 | process.WaitForExit();
75 | return process;
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore21/Readme.md:
--------------------------------------------------------------------------------
1 | # AWS Lambda Dump Runtime Project
2 | This functions dumps the runtime and uploads it to s3.
3 |
4 |
5 | ## Here are some steps to follow from Visual Studio:
6 |
7 | To deploy your function to AWS Lambda, right click the project in Solution Explorer and select *Publish to AWS Lambda*.
8 |
9 | To view your deployed function open its Function View window by double-clicking the function name shown beneath the AWS Lambda node in the AWS Explorer tree.
10 |
11 | To perform testing against your deployed function use the Test Invoke tab in the opened Function View window.
12 |
13 | To configure event sources for your deployed function, for example to have your function invoked when an object is created in an Amazon S3 bucket, use the Event Sources tab in the opened Function View window.
14 |
15 | To update the runtime configuration of your deployed function use the Configuration tab in the opened Function View window.
16 |
17 | To view execution logs of invocations of your function use the Logs tab in the opened Function View window.
18 |
19 | ## Here are some steps to follow to get started from the command line:
20 |
21 | Restore dependencies
22 | ```shell
23 | dotnet restore
24 | ```
25 |
26 | Deploy function to AWS Lambda
27 | ```shell
28 | dotnet lambda deploy-function [--profile ] [--region ] dump-dotnetcore21
29 | ```
30 |
31 | Invoke function
32 | ```shell
33 | dotnet lambda invoke-function [--profile ] [--region ] dump-dotnetcore21
34 | ```
35 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore21/aws-lambda-tools-defaults.json:
--------------------------------------------------------------------------------
1 | {
2 | "configuration": "Release",
3 | "framework": "netcoreapp2.1",
4 | "function-runtime": "dotnetcore2.1",
5 | "function-memory-size": 1536,
6 | "function-timeout": 300,
7 | "function-handler": "dump_dotnetcore21::dump_dotnetcore21.Function::FunctionHandler"
8 | }
9 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore21/dump-dotnetcore21.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1
5 | true
6 | dump_dotnetcore21
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore31/Function.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Threading.Tasks;
5 |
6 | using Amazon.Lambda.Core;
7 | using Amazon.S3;
8 |
9 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
10 |
11 | namespace dump_dotnetcore31
12 | {
13 | public class Function
14 | {
15 | ///
16 | /// Lambda function to dump the container directories /var/lang
17 | /// and /var/runtime and upload the resulting archive to S3
18 | ///
19 | ///
20 | public async Task FunctionHandler(object invokeEvent, ILambdaContext context)
21 | {
22 | string filename = "dotnetcore3.1.tgz";
23 | string cmd = $"tar -cpzf /tmp/{filename} --numeric-owner --ignore-failed-read /var/runtime /var/lang";
24 |
25 | Console.WriteLine($"invokeEvent: {invokeEvent}");
26 | Console.WriteLine($"context.RemainingTime: {context.RemainingTime}");
27 |
28 | Console.WriteLine("Parent cmdline:");
29 | Console.WriteLine(File.ReadAllText("/proc/1/cmdline").Replace("\0", " "));
30 |
31 | Console.WriteLine("Parent env:");
32 | RunShell("xargs --null --max-args=1 < /proc/1/environ");
33 |
34 | Console.WriteLine("This cmdline:");
35 | Console.WriteLine(File.ReadAllText($"/proc/{Process.GetCurrentProcess().Id}/cmdline").Replace("\0", " "));
36 |
37 | Console.WriteLine("This env:");
38 | RunShell($"xargs --null --max-args=1 < /proc/{Process.GetCurrentProcess().Id}/environ");
39 |
40 | Console.WriteLine($"Current working directory: {Directory.GetCurrentDirectory()}");
41 |
42 | RunShell(cmd);
43 |
44 | Console.WriteLine("Zipping done! Uploading...");
45 |
46 | var s3Client = new AmazonS3Client();
47 | var response = await s3Client.PutObjectAsync(new Amazon.S3.Model.PutObjectRequest
48 | {
49 | BucketName = "lambci",
50 | Key = $"fs/{filename}",
51 | FilePath = $"/tmp/{filename}",
52 | CannedACL = S3CannedACL.PublicRead,
53 | });
54 |
55 | Console.WriteLine("Uploading done!");
56 |
57 | return response.HttpStatusCode.ToString();
58 | }
59 |
60 | private static Process RunShell(string cmd)
61 | {
62 | var escapedArgs = cmd.Replace("\"", "\\\"");
63 | var process = new Process
64 | {
65 | StartInfo = new ProcessStartInfo
66 | {
67 | FileName = "/bin/sh",
68 | Arguments = $"-c \"{escapedArgs}\"",
69 | UseShellExecute = false,
70 | CreateNoWindow = true,
71 | }
72 | };
73 | process.Start();
74 | process.WaitForExit();
75 | return process;
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore31/aws-lambda-tools-defaults.json:
--------------------------------------------------------------------------------
1 | {
2 | "configuration": "Release",
3 | "framework": "netcoreapp3.1",
4 | "function-runtime": "dotnetcore3.1",
5 | "function-memory-size": 3008,
6 | "function-timeout": 60,
7 | "function-handler": "dump_dotnetcore31::dump_dotnetcore31.Function::FunctionHandler"
8 | }
9 |
--------------------------------------------------------------------------------
/base/dump-dotnetcore31/dump-dotnetcore31.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 | dump_dotnetcore31
6 | true
7 | dump_dotnetcore31
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/base/dump-go1x/dump-go1x.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "context"
5 | "fmt"
6 | "github.com/aws/aws-lambda-go/lambda"
7 | "github.com/aws/aws-sdk-go-v2/aws"
8 | "github.com/aws/aws-sdk-go-v2/aws/external"
9 | "github.com/aws/aws-sdk-go-v2/service/s3"
10 | "log"
11 | "os"
12 | "os/exec"
13 | )
14 |
15 | func handleRequest(ctx context.Context, event interface{}) (*s3.PutObjectResponse, error) {
16 | filename := "go1.x.tgz"
17 |
18 | runShell("tar -cpzf /tmp/" + filename + " --numeric-owner --ignore-failed-read /var/runtime /var/lang")
19 |
20 | fmt.Println("Zipping done! Uploading...")
21 |
22 | cfg, err := external.LoadDefaultAWSConfig()
23 | if err != nil {
24 | log.Fatal(err)
25 | }
26 |
27 | file, err := os.Open("/tmp/" + filename)
28 | if err != nil {
29 | log.Fatal(err)
30 | }
31 |
32 | resp, err := s3.New(cfg).PutObjectRequest(&s3.PutObjectInput{
33 | ACL: s3.ObjectCannedACLPublicRead,
34 | Body: file,
35 | Bucket: aws.String("lambci"),
36 | Key: aws.String("fs/" + filename),
37 | }).Send(context.Background())
38 | if err != nil {
39 | log.Fatal(err)
40 | }
41 |
42 | fmt.Println("Uploading done!")
43 |
44 | runShell("ps aux")
45 |
46 | runShell("xargs --null --max-args=1 < /proc/1/environ")
47 |
48 | for _, a := range os.Args {
49 | fmt.Println(a)
50 | }
51 | pwd, _ := os.Getwd()
52 | fmt.Println(pwd)
53 | for _, e := range os.Environ() {
54 | fmt.Println(e)
55 | }
56 | fmt.Println(ctx)
57 |
58 | return resp, nil
59 | }
60 |
61 | func runShell(shellCmd string) {
62 | cmd := exec.Command("sh", "-c", shellCmd)
63 | cmd.Stdout = os.Stdout
64 | cmd.Stderr = os.Stderr
65 | cmd.Run()
66 | }
67 |
68 | func main() {
69 | lambda.Start(handleRequest)
70 | }
71 |
72 | /*
73 | PATH=/usr/local/bin:/usr/bin/:/bin:/opt/bin
74 | LANG=en_US.UTF-8
75 | TZ=:UTC
76 | LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
77 | _LAMBDA_CONTROL_SOCKET=15
78 | _LAMBDA_CONSOLE_SOCKET=17
79 | LAMBDA_TASK_ROOT=/var/task
80 | LAMBDA_RUNTIME_DIR=/var/runtime
81 | _LAMBDA_LOG_FD=24
82 | _LAMBDA_SB_ID=8
83 | _LAMBDA_SHARED_MEM_FD=12
84 | AWS_REGION=us-east-1
85 | AWS_DEFAULT_REGION=us-east-1
86 | AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/dump-go1x
87 | AWS_LAMBDA_LOG_STREAM_NAME=2018/01/16/[$LATEST]12d47417179844e3ad55190a93a817d7
88 | AWS_LAMBDA_FUNCTION_NAME=dump-go1x
89 | AWS_LAMBDA_FUNCTION_MEMORY_SIZE=3008
90 | AWS_LAMBDA_FUNCTION_VERSION=$LATEST
91 | _AWS_XRAY_DAEMON_ADDRESS=169.254.79.2
92 | _AWS_XRAY_DAEMON_PORT=2000
93 | AWS_XRAY_DAEMON_ADDRESS=169.254.79.2:2000
94 | AWS_XRAY_CONTEXT_MISSING=LOG_ERROR
95 | _X_AMZN_TRACE_ID=Parent=41bc1aa71e1174a5
96 | _HANDLER=my_handler
97 | _LAMBDA_RUNTIME_LOAD_TIME=1522376103407
98 |
99 | /var/task
100 | /var/task/my_handler
101 |
102 | PATH=/usr/local/bin:/usr/bin/:/bin:/opt/bin
103 | LANG=en_US.UTF-8
104 | TZ=:UTC
105 | LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
106 | _LAMBDA_CONTROL_SOCKET=15
107 | _LAMBDA_CONSOLE_SOCKET=17
108 | LAMBDA_TASK_ROOT=/var/task
109 | LAMBDA_RUNTIME_DIR=/var/runtime
110 | _LAMBDA_LOG_FD=24
111 | _LAMBDA_SB_ID=8
112 | _LAMBDA_SHARED_MEM_FD=12
113 | AWS_REGION=us-east-1
114 | AWS_DEFAULT_REGION=us-east-1
115 | AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/dump-go1x
116 | AWS_LAMBDA_LOG_STREAM_NAME=2018/01/16/[$LATEST]12d47417179844e3ad55190a93a817d7
117 | AWS_LAMBDA_FUNCTION_NAME=dump-go1x
118 | AWS_LAMBDA_FUNCTION_MEMORY_SIZE=3008
119 | AWS_LAMBDA_FUNCTION_VERSION=$LATEST
120 | _AWS_XRAY_DAEMON_ADDRESS=169.254.79.2
121 | _AWS_XRAY_DAEMON_PORT=2000
122 | AWS_XRAY_DAEMON_ADDRESS=169.254.79.2:2000
123 | AWS_XRAY_CONTEXT_MISSING=LOG_ERROR
124 | _X_AMZN_TRACE_ID=Parent=41bc1aa71e1174a5
125 | _HANDLER=my_handler
126 | _LAMBDA_RUNTIME_LOAD_TIME=1522376103407
127 |
128 | _LAMBDA_SERVER_PORT=60304
129 | AWS_ACCESS_KEY=
130 | AWS_ACCESS_KEY_ID=
131 | AWS_SECRET_KEY=
132 | AWS_SECRET_ACCESS_KEY=
133 | AWS_SESSION_TOKEN=
134 | AWS_SECURITY_TOKEN=
135 |
136 | context.Background.WithDeadline(2018-01-12 21:16:44.121702432 +0000 UTC [2.981503691s]).WithValue(
137 | &lambdacontext.key{},
138 | &lambdacontext.LambdaContext{
139 | AwsRequestID:"e1e762a8-f7dd-11e7-8572-1dc9a2c870b7",
140 | InvokedFunctionArn:"arn:aws:lambda:us-east-1:XXXXXXXXXXXX:function:dump-go1x",
141 | Identity:lambdacontext.CognitoIdentity{CognitoIdentityID:"", CognitoIdentityPoolID:""},
142 | ClientContext:lambdacontext.ClientContext{Client:lambdacontext.ClientApplication{InstallationID:"", AppTitle:"", AppVersionCode:"", AppPackageName:""},
143 | Env:map[string]string(nil),
144 | Custom:map[string]string(nil)}
145 | }).WithValue("x-amzn-trace-id", "Root=1-5a5925b8-30ae34971b99966e26b15b1e;Parent=06346dc778d0afed;Sampled=1")
146 | */
147 |
--------------------------------------------------------------------------------
/base/dump-go1x/go.mod:
--------------------------------------------------------------------------------
1 | module dump-go1x
2 |
3 | require (
4 | github.com/aws/aws-lambda-go v1.13.3
5 | github.com/aws/aws-sdk-go-v2 v0.17.0
6 | )
7 |
8 | go 1.15
9 |
--------------------------------------------------------------------------------
/base/dump-go1x/go.sum:
--------------------------------------------------------------------------------
1 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2 | github.com/aws/aws-lambda-go v1.13.2 h1:8lYuRVn6rESoUNZXdbCmtGB4bBk4vcVYojiHjE4mMrM=
3 | github.com/aws/aws-lambda-go v1.13.2/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
4 | github.com/aws/aws-lambda-go v1.13.3 h1:SuCy7H3NLyp+1Mrfp+m80jcbi9KYWAs9/BXwppwRDzY=
5 | github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
6 | github.com/aws/aws-sdk-go-v2 v0.16.0 h1:X5pkFnjRNdDEX18NwDGWMaWL5ocNQX0qIYEhEcsTy64=
7 | github.com/aws/aws-sdk-go-v2 v0.16.0/go.mod h1:pFLIN9LDjOEwHfruGweAXEq0XaD6uRkY8FsRkxhuBIg=
8 | github.com/aws/aws-sdk-go-v2 v0.17.0 h1:b/9gp0SD6doAWv72f3ZwzFJSsWmUw9dM8wMNmf6OBws=
9 | github.com/aws/aws-sdk-go-v2 v0.17.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
10 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
11 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
13 | github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
14 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
15 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
16 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
17 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
18 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
19 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
20 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
21 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
22 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
23 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
24 | github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
25 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
26 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0=
27 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
28 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
29 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
30 | google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
31 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
32 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
33 |
--------------------------------------------------------------------------------
/base/dump-java11/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/base/dump-java11/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | dump-java11
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
25 | 1599680497019
26 |
27 | 30
28 |
29 | org.eclipse.core.resources.regexFilterMatcher
30 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/base/dump-java11/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | arguments=
2 | auto.sync=false
3 | build.scans.enabled=false
4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0-20191016123526+0000))
5 | connection.project.dir=
6 | eclipse.preferences.version=1
7 | gradle.user.home=
8 | java.home=
9 | jvm.arguments=
10 | offline.mode=false
11 | override.workspace.settings=true
12 | show.console.view=true
13 | show.executions.view=true
14 |
--------------------------------------------------------------------------------
/base/dump-java11/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
3 | org.eclipse.jdt.core.compiler.compliance=11
4 | org.eclipse.jdt.core.compiler.source=11
5 |
--------------------------------------------------------------------------------
/base/dump-java11/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | sourceCompatibility = '11'
4 | targetCompatibility = '11'
5 |
6 | repositories {
7 | mavenCentral()
8 | }
9 |
10 | dependencies {
11 | implementation (
12 | 'com.amazonaws:aws-lambda-java-core:1.2.0',
13 | 'com.amazonaws:aws-lambda-java-events:2.2.7',
14 | 'com.amazonaws:aws-java-sdk-s3:1.11.681'
15 | )
16 | }
17 |
18 | task buildZip(type: Zip) {
19 | from compileJava
20 | from processResources
21 | into('lib') {
22 | from configurations.runtimeClasspath
23 | }
24 | }
25 |
26 | build.dependsOn buildZip
27 |
28 | // docker run --rm -v "$PWD":/app -w /app gradle:jdk11 gradle build
29 |
--------------------------------------------------------------------------------
/base/dump-java11/src/main/java/org/lambci/lambda/DumpJava11.java:
--------------------------------------------------------------------------------
1 | package org.lambci.lambda;
2 |
3 | import java.io.File;
4 | import java.lang.management.ManagementFactory;
5 | import java.util.Map;
6 | import java.util.Scanner;
7 |
8 | import com.amazonaws.services.lambda.runtime.Context;
9 | import com.amazonaws.services.lambda.runtime.RequestHandler;
10 | import com.amazonaws.services.s3.AmazonS3;
11 | import com.amazonaws.services.s3.AmazonS3ClientBuilder;
12 | import com.amazonaws.services.s3.model.CannedAccessControlList;
13 | import com.amazonaws.services.s3.model.PutObjectRequest;
14 | import com.amazonaws.services.s3.model.PutObjectResult;
15 |
16 | public class DumpJava11 implements RequestHandler