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 ```
13
14 ### S3
15
16 ```
17 aws s3 ls s3://mybucket
18 aws s3 rm s3://mybucket/folder --recursive
19 aws s3 cp myfolder s3://mybucket/folder --recursive
20 aws s3 sync myfolder s3://mybucket/folder --exclude *.tmp
21 ```
22
23 ### ECS
24
25 ```
26 aws ecs create-cluster
27   --cluster-name=NAME
28   --generate-cli-skeleton
29
30 aws ecs create-service
31 ```
32
33 ### Homebrew
34
35 ```
36 brew install awscli
37 aws configure
38 ```
39
40 ### Configuration profiles
41
42 ```
43 aws configure --profile project1
44 aws configure --profile project2
45 ```
46
47 ## Elastic Beanstalk
48
49 ### Configuration
50
51 * .elasticbeanstalk/config.yml - application config
52 * .elasticbeanstalk/dev-env.env.yml - environment config
53
54 ```
55 eb config
56 ```
57
58 See: <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html>
59
60 ## ebextensions
61
62 * <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html>
63 * <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html>
64
65 ## Also see
66
67 * [AWS CLI](https://aws.amazon.com/cli/)
68 * [Documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
69 * [All commands](http://docs.aws.amazon.com/cli/latest/reference/#available-services)