闘魂CDK道場:TypeScriptでAWSインフラを組み、Python Lambdaを叩き込むまで
https://qiita.com/torifukukaiou/items/2065f710cfc33083d333
AWS CDK の前提条件
https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/prerequisites.html
今すぐ AWS で構築を開始する
https://ap-southeast-2.signin.aws.amazon.com/
今すぐ AWS で構築を開始する
AWS CDK の開始方法
https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/getting-started.html
AWS CDK とは
https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/home.html
AWS CDK の主要な概念を学ぶ
https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/core-concepts.html
$ docker run -v ./:/tmp/aws -it node /bin/bash
bash
# npm install -g aws-cdk
added 2 packages in 815ms
# mkdir gmail-to-slack && cd gmail-to-slack
# cdk init app --language typescript
Applying project template app for typescript
# Welcome to your CDK TypeScript project
This is a blank project for CDK development with TypeScript.
The `cdk.json` file tells the CDK Toolkit how to execute your app.
## Useful commands
* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `npx cdk deploy` deploy this stack to your default AWS account/region
* `npx cdk diff` compare deployed stack with current state
* `npx cdk synth` emits the synthesized CloudFormation template
Initializing a new git repository...
(node:20) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@6c3d1cb50c08.(none)')
Unable to initialize git repository for your project.
Executing npm install...
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
✅ All done!
NOTICES (What's this? https://github.com/aws/aws-cdk/wiki/CLI-Notices)
34892 CDK CLI will collect telemetry data on command usage starting at version 2.1100.0 (unless opted out)
Overview: We do not collect customer content and we anonymize the
telemetry we do collect. See the attached issue for more
information on what data is collected, why, and how to
opt-out. Telemetry will NOT be collected for any CDK CLI
version prior to version 2.1100.0 - regardless of
opt-in/out.
Affected versions: cli: ^2.0.0
More information at: https://github.com/aws/aws-cdk/issues/34892
If you don’t want to see a notice anymore, use "cdk acknowledge <id>". For example, "cdk acknowledge 34892".
macOS
$ docker commit 6c3d1cb50c08 kaizenjapan/node
sha256:9a281867c20de69e1d3cd950bf13cd99ac5be883f2fb8985880e423faad961e8
$ docker push kaizenjapan/node
Using default tag: latest
The push refers to repository [docker.io/kaizenjapan/node]
d295cd250d18: Pushed
4adfa3f51be7: Mounted from library/node
96cc5c8625ed: Mounted from library/node
2a53c9673402: Mounted from library/node
16ecd7e9dc85: Mounted from library/node
2107ef4525f9: Mounted from library/node
b00e7e0d23ee: Mounted from library/node
1e756556606d: Mounted from library/node
49a607a9913d: Mounted from library/node
latest: digest: sha256:ad3a654b919dc3e5477d3614796ad1b84db1f4752a1cc46d50820d4b745cb522 size: 2217
MacBook-Air:~ ogawakiyoshi$