æ¦è¦
Well-Architected IaC (Infrastructure as Code) Analyzerï¼ä»¥ä¸ãW-Aå¯è¦åãã¼ã«ã¨è¨è¼ãã¾ãï¼ ã使ç¨ãã¦ã¿ã¾ãã
W-Aå¯è¦åãã¼ã«ã¯ãIaCãã¡ã¤ã«ãWell-Architected Framework ã«æºæ ãã¦ãããã確èªãããã¨ãã§ãã¾ãã
ä»çµã¿ã¨ãã¦ã¯ãçæAIãµã¼ãã¹ã§ããBedrockãç¨ãã¦ãIaCãã¡ã¤ã«ã®ã³ã¼ãã¨Well-Architectedã«è¨è¼ãããå
容ãæ¯è¼/è©ä¾¡ãã¾ãã
æé
GitHubã®ãµã¤ãã«ãæé ã¯è¨è¼ããã¦ãã¾ãããããã¾ããªè¨è¼ã«ãªã£ã¦ãã¾ãã
åãããããæ¹ã¯ã以ä¸ã®æé ãåèã«ãã¦é ãã¨è¯ããã¨æãã¾ãã
â EC2ãæ§ç¯
以ä¸è¦ä»¶ãæºããããã«EC2ãæ§ç¯ãã¾ããï¼ãªã¼ã¸ã§ã³ã¯ã©ãã§ãè¯ãã§ãï¼
ã»OS㯠Amazon Linux 2023
ã»ãã¼ã«ã«ç«¯æ«ããSSHçã§ã¢ã¯ã»ã¹å¯è½
â» ä»åã¯ä½æ¥ç«¯æ«ã¨ãã¦ãEC2ã使ç¨ãã¾ãã
â¡CDK CLIã¤ã³ã¹ãã¼ã«
以ä¸ã®ã³ãã³ããå®è¡ããnvmãã¤ã³ã¹ãã¼ã«ãã¾ãã
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
以ä¸ã®ã³ãã³ããå®è¡ããnvmãèªã¿è¾¼ã¿ã¾ãã
source ~/.bashrc
以ä¸ã®ã³ãã³ããå®è¡ããnpmãã¤ã³ã¹ãã¼ã«ãã¾ãã
nvm install v22.12.0
以ä¸ã®ã³ãã³ããå®è¡ããCDK CLIãã¤ã³ã¹ãã¼ã«ãã¾ãã
npm install -g aws-cdk
â¢Dockerã¤ã³ã¹ãã¼ã«
以ä¸ã®ã³ãã³ããå®è¡ããDockerãã¤ã³ã¹ãã¼ã«ãã¾ãã
sudo yum install -y docker
以ä¸ã®ã³ãã³ããå®è¡ããDockerãèµ·åãã¾ãã
sudo systemctl start docker
以ä¸ã®ã³ãã³ããå®è¡ããDockerã®æä½æ¨©éãec2-userã¸ä»ä¸ãã¾ãã
sudo usermod -a -G docker ec2-user
â£Pythonã¤ã³ã¹ãã¼ã«ï¼ä¸è¦ï¼
EC2ã«ã¯å
ã
Pythonãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ãã
以ä¸ã®ã³ãã³ããå®è¡ããã¨Pythonã®ãã¼ã¸ã§ã³ã表示ãããã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ã確èªã§ãã¾ãã
python3 -V
â¤Bedrockæå¹å
ãã¼ã¸ãã¢åé¨ã®Bedrockã§ã以ä¸ãæå¹åããã
ã»Titan Text Embeddings V2
ã»Claude 3.5 Sonnet
â¥AWS CLIè¨å®
以ä¸ã®ã³ãã³ããå®è¡ããã¢ã¯ã»ã¹ãã¼ã¨ãªã¼ã¸ã§ã³ãè¨å®ãã¾ãã
aws configure
AWS Access Key ID [None]: <IAMã¦ã¼ã¶ã®ã¢ã¯ã»ã¹ãã¼> AWS Secret Access Key [None]: <IAMã¦ã¼ã¶ã®ã·ã¼ã¯ã¬ãããã¼> Default region name [None]: us-east-1 Default output format [None]:
â¦EC2åèµ·å
EC2ãåèµ·åãã¾ãã
â¦Gitã¯ãã¼ã³
以ä¸ã®ã³ãã³ããå®è¡ããgitã³ãã³ãã使ç¨ã§ããããã«ãã¾ãã
sudo yum install git
以ä¸ã®ã³ãã³ããå®è¡ããã¨gitã®ãã¼ã¸ã§ã³ã表示ãããã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ã確èªã§ãã¾ãã
git version
以ä¸ã®ã³ãã³ããå®è¡ããGitã¯ãã¼ã³ããã¾ãã
git clone https://github.com/aws-samples/well-architected-iac-analyzer
以ä¸ã®ã³ãã³ããå®è¡ãããwell-architected-iac-analyzerãã¸ç§»åãã¾ãã
cd well-architected-iac-analyzer
â§virtualenvæå¹å
以ä¸ã®ã³ãã³ããå®è¡ããvirtualenvãæå¹åãã¾ãã
python3 -m venv .venv source .venv/bin/activate
â¨Pythonã©ã¤ãã©ãªã¤ã³ã¹ãã¼ã«
以ä¸ã®ã³ãã³ããå®è¡ããPythonã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ãã¾ãã
pip install -r requirements.txt
â©ãããã¤ãªã¼ã¸ã§ã³ã®è¨å®
以ä¸ã®ã³ãã³ããå®è¡ãããããã¤ãããªã¼ã¸ã§ã³ãè¨å®ãã¾ãã
export CDK_DEPLOY_REGION=us-east-1
âªCDKå®è¡
以ä¸ã®ã³ãã³ããå®è¡ããCDKãå®è¡ãã¾ãã
cdk bootstrap cdk synth cdk deploy
ã¢ã¯ã»ã¹ãã¦ã¿ã
â EC2ãæ§ç¯
CDKã§æ§ç¯ããW-Aå¯è¦åãã¼ã«ã¸ã¢ã¯ã»ã¹ããããã以ä¸è¦ä»¶ãæºããããã«EC2ãæ§ç¯ãã¾ãã
ã»OS㯠Windows Server 2022
ã»ãã¼ã«ã«ç«¯æ«ããRDPçã§ã¢ã¯ã»ã¹å¯è½
ã»ãªã¼ã¸ã§ã³ã¯ãã¼ã¸ãã¢åé¨ï¼us-east-1ï¼
ã»VPCã¯ä¸è¨æé å
ã®CDKã§æ§ç¯ããStreamlitECSVpc
ã»ãµããããã¯ä¸è¨æé å
ã®CDKã§æ§ç¯ããpublicSubnet1
â¡W-Aå¯è¦åãã¼ã«ã¸ã¢ã¯ã»ã¹
æ§ç¯ããEC2ã®ãã©ã¦ã¶ãããALBã®DNSåã¸ã¢ã¯ã»ã¹ãã¾ãã
â¢å¤ã®å ¥å
以ä¸é
ç®ãå
¥åãããReview Upload Documentããæ¼ä¸ãã¾ãã
Drag and drop file hereï¼è©ä¾¡ãããIaCãã¡ã¤ã«ãã¢ãããã¼ã
Type below your Well-Architected Tool Workload Idï¼Workload Id ãå
¥åï¼CDKã§Well-Architected Toolãä½æããã¦ãã¾ãï¼
â£å¯è¦åã®çµæã確èª
æºæ åã³éæºæ ã®é
ç®ã表示ããã¾ãã
â¤Well-Architected Toolã¸ã®åæ
ãComplete Well-Architected Reviewããæ¼ä¸ããã¨ãWell-Architected Toolã¸åæ ããã¾ãã
ã¾ã¨ã
IaCãã¡ã¤ã«ãWell-Architected Frameworkã«æºæ ãã¦ãããèªåã§è©ä¾¡ã§ããã®ã§æåãã¾ããã
æ£ç¢ºæ§ã«ã¤ãã¦ã¯åãããªããã人éã®ç®ã¯å¿
è¦ã§ããããããå°ãç´ æ©ãä½ããã¨ãããè¯ãã¨æãã¾ããã