Skip to content

Latest commit

 

History

History
195 lines (167 loc) · 7.35 KB

aws_devops_engineering.md

File metadata and controls

195 lines (167 loc) · 7.35 KB

List AWS devops engineer information

credential 方式

  • 設定的優先權由高到低
  • define client / resource
  • env
  • aws configuration
  • role

AWS CLI

  • 可以多看看 --query 的用法
  • 可以試試 filter 的用法
    • 可用 json 的方式,也可以 key value 的方式
    • 可以用 tag 來 filter
  • 在大多數會需要等待的 resource,都有提供 wait 的動作
$ aws ec2 wait xxx
  • query ec2 instance sample
$ aws ec2 describe-instances --query 'Reservations[].Instances[].InstanceId'
  • query by tags
$ aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, Tags[?Key==`Name`].Value | [0], IamInstanceProfile.Arn]'
  • store to shell variable
$ appROLEARN=$(aws ec2 describe-instances --filter "Name=tag:Name,Values=MadLib Web*" --query 'Reservations[0].Instances[0].IamInstanceProfile.Arn' --output text)
  • AWS CodeDeploy sample cli
$ aws deploy list-applications
$ aws deploy list-deployments

IAM

Tag

Cloud Formation

Cloud Formation reference document

$ aws cloudformation create-stack --stack-name DB-tier --template-body file://DB_Tier.yaml

AWS config

AWS CDK

Others

  • 跟 security 有關, 建議要開的

    • Cloud Trail
    • Config
  • 存放 secure 的地方

    • AWS Secrets Manger
      • 放置 password
    • Parameter Store
      • 放 MySQL endpoint

Code Commit

Code Build

Code Deploy

  • AppSpec

Code Star

lambda

Mocking framework

  • Wiremock

Fault Tolerance Testing

  • chaosmonkey

AWS OpsWorks

  • 寫 client pem 的方式
sudo mkdir /etc/chef
echo $ow_privkey | sudo tee /etc/chef/client.pem
sudo chmod 644 /etc/chef/client.pem

AWS System Manager

  • Documents
    • 可用這個來修復 ssh server

ECR

  • 開始有支援 image life-cycle 功能
  • 進行 ECR login command
$ aws ecr get-login --no-include-email | /bin/bash

roadmap

docker command dictionary

# Get a local Shell of container
      docker run -i -t --entrypoint /bin/bash imageID
# Create image using this directory's Dockerfile
      docker build -t friendlyname .
# Run "friendlyname" mapping port 4000 to 80
      docker run -p 4000:80 friendlyname
# Same thing, but in detached mode
      docker run -d -p 4000:80 friendlyname
# See a list of all running containers
     docker ps
# Gracefully stop the specified container
     docker stop <hash>
# See a list of all containers, even the ones not running
     docker ps -a
# Force shutdown of the specified container
     docker kill <hash>
 # Remove the specified container from this machine
     docker rm <hash>
# Remove all containers from this machine
     docker rm $(docker ps -a -q)
# Show all images on this machine
     docker images -a
# Remove the specified image from this machine
     docker rmi <imagename>
# Remove all images from this machine
     docker rmi $(docker images -q)
# Log in this CLI session using your Docker credentials
     docker login
# Tag <image> for upload to registry
     docker tag <image> username/repository:tag
# Upload tagged image to registry
     docker push username/repository:tag
# Run image from a registry
     docker run username/repository:tag

Training

New Service

  • EC2 Instance Connect

AWS Trainging Portal