---
AWS User Group Taiwan Meetup 2021-12 線上 / 下小聚
書籍特色
目前支援語言 TypeScript, JavaScript, Python, Java, C#/.Net 還有正在 preview 的 Go
如下 20 行的 CDK 可以變出高達 500 行的 CloudFormation 腳本
export class MyEcsConstructStack extends core.Stack {
constructor(scope: core.App, id: string, props?: core.StackProps) {
super(scope, id, props);
const vpc = new ec2.Vpc(this, "MyVpc", {
maxAzs: 3 // 使用 3 個 AZ
});
const cluster = new ecs.Cluster(this, "MyCluster", {
vpc: vpc
});
// 建立 ALB 串接 Fargate 的 ECS Service
new ecs_patterns.ApplicationLoadBalancedFargateService(this, "MyFargateService", {
cluster,
taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample") },
publicLoadBalancer: true // 預設為 false 僅內部使用 ALB
});
}
}
此程式定義了 50 種資源
此程式定義了 50 種資源
超好用的自動補完提示
python3 -m pip install --no-input --upgrade awscli
npm install -g aws-cdk
$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]:
$ aws sts get-caller-identity
{
"UserId": "AKIAIOSFODNN7EXAMPLE",
"Account": "888888888888",
"Arn": "arn:aws:iam::888888888888:user/clarence"
}
cdk list
aka cdk ls
cdk synthesize
aka cdk synth
cdk synth --json
cdk bootstrap
cdk deploy
cdk watch
cdk destroy
cdk diff
cdk docs
cdk init
cdk init --list
cdk init -l typescript
cdk init lib
--require-approval=never
AWS_DEFAULT_REGION=us-west-2 cdk deploy
mkdir hello-cdk && cd hello-cdk
cdk init --language=typescript
mkdir hello-cdk && cd hello-cdk
npx projen new awscdk-app-ts
mkdir hello-cdk && cd hello-cdk
npx projen new awscdk-app-ts --cdk-version 2.1.0
import * as s3 from '@aws-cdk/aws-s3';
import * as s3deploy from '@aws-cdk/aws-s3-deployment';
aws_s3 as s3
aws_s3_deployment as s3deploy
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing