Open1

google-api-python-client(Custom AWS Lambda Layer)

marchanmarchan

-- 2024.11.05
-- Cloud9 Amazon Linux2 で作業する
-- python のバージョンを確認する

$ python --version

Python 3.12.0

mkdir python
ls -ls

0 drwxrwxr-x 2 ec2-user ec2-user 6 Nov 5 08:19 python

$ pip install google-api-python-client google-auth google-auth-oauthlib google-auth-httplib2 -t python/
$ cd python 
$ ls -ls 

total 28
0 drwxrwxr-x 3 ec2-user ec2-user 44 Nov 5 08:21 apiclient
0 drwxrwxr-x 2 ec2-user ec2-user 174 Nov 5 08:21 bin
0 drwxrwxr-x 3 ec2-user ec2-user 74 Nov 5 08:21 cachetools
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 cachetools-5.5.0.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 112 Nov 5 08:21 certifi
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 certifi-2024.8.30.dist-info
0 drwxrwxr-x 4 ec2-user ec2-user 308 Nov 5 08:21 charset_normalizer
0 drwxrwxr-x 2 ec2-user ec2-user 126 Nov 5 08:21 charset_normalizer-3.4.0.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 40 Nov 5 08:21 docs
0 drwxrwxr-x 14 ec2-user ec2-user 170 Nov 5 08:21 google
0 drwxrwxr-x 4 ec2-user ec2-user 266 Nov 5 08:21 googleapiclient
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 google_api_core-2.22.0.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 119 Nov 5 08:21 google_api_python_client-2.151.0.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 googleapis_common_protos-1.65.0.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 119 Nov 5 08:21 google_auth-2.35.0.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 119 Nov 5 08:21 google_auth_httplib2-0.2.0.dist-info
12 -rw-rw-r-- 1 ec2-user ec2-user 10211 Nov 5 08:21 google_auth_httplib2.py
0 drwxrwxr-x 4 ec2-user ec2-user 111 Nov 5 08:21 google_auth_oauthlib
0 drwxrwxr-x 2 ec2-user ec2-user 143 Nov 5 08:21 google_auth_oauthlib-1.2.1.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 144 Nov 5 08:21 httplib2
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 httplib2-0.22.0.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 190 Nov 5 08:21 idna
0 drwxrwxr-x 2 ec2-user ec2-user 84 Nov 5 08:21 idna-3.10.dist-info
0 drwxrwxr-x 6 ec2-user ec2-user 144 Nov 5 08:21 oauthlib
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 oauthlib-3.2.2.dist-info
0 drwxrwxr-x 4 ec2-user ec2-user 255 Nov 5 08:21 proto
0 drwxrwxr-x 2 ec2-user ec2-user 81 Nov 5 08:21 protobuf-5.28.3.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 proto_plus-1.25.0.dist-info
0 drwxrwxr-x 6 ec2-user ec2-user 115 Nov 5 08:21 pyasn1
0 drwxrwxr-x 2 ec2-user ec2-user 122 Nov 5 08:21 pyasn1-0.6.1.dist-info
8 drwxrwxr-x 3 ec2-user ec2-user 4096 Nov 5 08:21 pyasn1_modules
0 drwxrwxr-x 2 ec2-user ec2-user 122 Nov 5 08:21 pyasn1_modules-0.4.1.dist-info
0 drwxrwxr-x 2 ec2-user ec2-user 50 Nov 5 08:21 pycache
0 drwxrwxr-x 4 ec2-user ec2-user 233 Nov 5 08:21 pyparsing
0 drwxrwxr-x 2 ec2-user ec2-user 81 Nov 5 08:21 pyparsing-3.2.0.dist-info
4 drwxrwxr-x 3 ec2-user ec2-user 4096 Nov 5 08:21 requests
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 requests-2.32.3.dist-info
0 drwxrwxr-x 4 ec2-user ec2-user 162 Nov 5 08:21 requests_oauthlib
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 requests_oauthlib-2.0.0.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 272 Nov 5 08:21 rsa
0 drwxrwxr-x 2 ec2-user ec2-user 105 Nov 5 08:21 rsa-4.9.dist-info
0 drwxrwxr-x 3 ec2-user ec2-user 24 Nov 5 08:21 scripts
0 drwxrwxr-x 3 ec2-user ec2-user 133 Nov 5 08:21 uritemplate
0 drwxrwxr-x 2 ec2-user ec2-user 102 Nov 5 08:21 uritemplate-4.1.1.dist-info
4 drwxrwxr-x 6 ec2-user ec2-user 4096 Nov 5 08:21 urllib3
0 drwxrwxr-x 3 ec2-user ec2-user 82 Nov 5 08:21 urllib3-2.2.3.dist-info

$ cd ../
$ zip -r google-api-python-client-layer.zip python
ls -ls 

17220 -rw-rw-r-- 1 ec2-user ec2-user 17630150 Nov 5 08:23 google-api-python-client-layer.zip