Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AWS CDKを触ってみて
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Toru_Kubota
July 22, 2022
Technology
660
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AWS CDKを触ってみて
Toru_Kubota
July 22, 2022
More Decks by Toru_Kubota
See All by Toru_Kubota
ガバメントクラウドでのAWS DevOps Agentの活用
toru_kubota
2
82
制約が多いからこそ設計しがいがある!?公共領域でのAWSと生成AIの活用
toru_kubota
0
150
AWSアップデートから考える継続的な運用改善
toru_kubota
2
500
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
340
ガバメントクラウド運用改善からSaaS製品の開発へ
toru_kubota
0
89
生成AI活用によるガバメントクラウド運用管理補助業務の効率化
toru_kubota
0
80
「どこにある?」の解決。生成AI(RAG)で効率化するガバメントクラウド運用
toru_kubota
4
1.2k
いつも初心者向けの記事に助けられているので得意分野では初心者向けの記事を書きます
toru_kubota
2
700
AWSの利点
toru_kubota
0
300
Other Decks in Technology
See All in Technology
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
1.9k
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
1
1.3k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
LLMに渡さなかった仕事
nanaism
0
170
AI時代、データエンジニアが一番おもろい
genshun9
0
580
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
8
4k
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
320
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
1
1.6k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
400
Railsのように考える: See through the Master
snoozer05
PRO
3
820
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
4
1.7k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
BBQ
matthewcrist
89
10k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
Music & Morning Musume
bryan
47
7.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Spectacular Lies of Maps
axbom
PRO
1
990
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Faster Mobile Websites
deanohume
310
32k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Transcript
AWS CDKを触ってみて NCDC Dev Meetup クラウドなんでもLT会 #6 2022/07/22 久保田 亨
自己紹介 氏名 : 久保田 亨 会社 : SaaS企業 職業 : インフラエンジニア 趣味 : 歩くこと
背景 ~2022/06 SI勤務(DC) 2022/07~(転職) SaaS企業 ・AWSサービス検証 ・AWSサービスメニュー化 ・AWSを使用 CloudFormation(CFn) CloudFormation(CFn)
CFn (CloudFormation) Stack Template YAML/JSON AWS Cloud CloudFormation(CFn)
実行環境 AWS CDK Stack Template JavaScript/TypeScript/Python/Java/C# AWS Cloud AWS CDK
AWS Cloud VPC Public subnet Public subnet Private subnet Private
subnet AWS Cloud VPC Public subnet Public subnet Private subnet Private subnet AWS Cloud VPC Public subnet Public subnet Private subnet Private subnet AWS Cloud VPC Public subnet Public subnet Private subnet Private subnet AWS Cloud VPC Public subnet Public subnet Private subnet Private subnet
import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct
} from 'constructs'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; import { Vpc } from 'aws-cdk-lib/aws-ec2'; export class VpcStack extends Stack { //別スタックから参照できるようにする public readonly vpc: Vpc; constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const vpc_name = 'cdk-vpc'; const cidr = '10.1.0.0/16'; this.vpc = new ec2.Vpc(this, 'VPC', { vpcName: vpc_name, cidr: cidr, maxAzs: 2, subnetConfiguration: [ { cidrMask: 24, name: `${vpc_name}-public`, subnetType: ec2.SubnetType.PUBLIC, }, { cidrMask: 24, name: `${vpc_name}-private`, subnetType: ec2.SubnetType.PRIVATE_ISOLATED, }, ] }) } };
Resources: VPCXXXXXXX: Type: 'AWS::EC2::VPC' Properties: CidrBlock: 10.1.0.0/16 EnableDnsHostnames: true EnableDnsSupport:
true InstanceTenancy: default Tags: - Key: Name Value: cdk-vpc Metadata: 'aws:cdk:path': VpcStack/VPC/Resource VPCcdkvpcpublicSubnet1SubnetYYYYYYYY: Type: 'AWS::EC2::Subnet' Properties: VpcId: !Ref VPCXXXXXXX AvailabilityZone: ap-northeast-1a CidrBlock: 10.1.0.0/24 MapPublicIpOnLaunch: true Tags: - Key: 'aws-cdk:subnet-name' Value: cdk-vpc-public - Key: 'aws-cdk:subnet-type' Value: Public - Key: Name Value: VpcStack/VPC/cdk-vpc-publicSubnet1 Metadata: 'aws:cdk:path': VpcStack/VPC/cdk-vpc- publicSubnet1/Subnet VPCcdkvpcpublicSubnet1RouteTableZZZZZZZZ: Type: 'AWS::EC2::RouteTable' Properties: VpcId: !Ref VPCXXXXXXXX Tags: - Key: Name Value: VpcStack/VPC/cdk-vpc-publicSubnet1 ・・・・222行(CDKで出力されたテンプレート)
https://qiita.com/Toru_Kubota/items/f6fb42c5da442b03a98f ALB+ECS+Aurora
//aws-ecs-patternsモジュール使用 new ecsp.ApplicationLoadBalancedFargateService(this, 'WebApp01', { cluster, domainName: domain_name, domainZone, memoryLimitMiB:
512, desiredCount: 2, cpu: 256, assignPublicIp: true, loadBalancerName: 'WebApp01-lb01', publicLoadBalancer: true, taskImageOptions: { image: ecs.ContainerImage.fromRegistry('nginx'), },}); ALB+Fargate設定(一部抜粋)
・セキュアなベースラインを提供するテンプレート ・AWS CDKで実装 ・共通設定とシステム固有設定の2層 Baseline Environment on AWS
共通設定箇所 Amazon GuardDuty AWS Security Hub AWS CloudTrail AWS Config
Amazon SNS AWS Systems Manager
・少ないコード量で運用が楽そう! ・書き方は慣れれば難しくない! ・BLEAと合わせて運用が楽になりそう! AWS CDKを触ってみて