OSDN Git Service

Regular updates
[twpd/master.git] / awscli.md
1 ---
2 title: AWS CLI
3 category: Devops
4 layout: 2017/sheet
5 ---
6
7 ### EC2
8
9 ```
10 aws ec2 describe-instances
11 aws ec2 start-instances --instance-ids i-12345678c
12 aws ec2 terminate-instances --instance-ids i-12345678c
13 ```
14
15 ### S3
16
17 ```
18 aws s3 ls s3://mybucket
19 aws s3 rm s3://mybucket/folder --recursive
20 aws s3 cp myfolder s3://mybucket/folder --recursive
21 aws s3 sync myfolder s3://mybucket/folder --exclude *.tmp
22 ```
23
24 ### ECS
25
26 ```
27 aws ecs create-cluster
28   --cluster-name=NAME
29   --generate-cli-skeleton
30
31 aws ecs create-service
32 ```
33
34 ### Homebrew
35
36 ```
37 brew install awscli
38 aws configure
39 ```
40
41 ### Configuration profiles
42
43 ```
44 aws configure --profile project1
45 aws configure --profile project2
46 ```
47
48 ## Elastic Beanstalk
49
50 ### Configuration
51
52 * .elasticbeanstalk/config.yml - application config
53 * .elasticbeanstalk/dev-env.env.yml - environment config
54
55 ```
56 eb config
57 ```
58
59 See: <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html>
60
61 ## ebextensions
62
63 * <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html>
64 * <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html>
65
66 ## Also see
67
68 * [AWS CLI](https://aws.amazon.com/cli/)
69 * [Documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
70 * [All commands](http://docs.aws.amazon.com/cli/latest/reference/#available-services)