SlideShare a Scribd company logo
1 of 104
Download to read offline
Advanced Usage of the AWS CLI 
James Saryerwinnie, Amazon Web Services 
November 12, 2014 | Las Vegas 
© 
2014 
Amazon.com, 
Inc. 
and 
its 
affiliates. 
All 
rights 
reserved. 
May 
not 
be 
copied, 
modified, 
or 
distributed 
in 
whole 
or 
in 
part 
without 
the 
express 
consent 
of 
Amazon.com, 
Inc.
Crash Course Foundation Advanced Scenarios 
Intro to the AWS CLI Exploring Key Functionality Looking at Advanced CLI Features
Crash Course Advanced 
Proficient 
Novice 
Intro to the AWS CLI
AWS Command Line Interface 
Unified tool to manage your AWS services
MSI (Windows) 
Bundled (cross platform) 
pip (cross platform)
aws 
configure
$ 
aws 
ec2 
describe-­‐instances 
service (command) operation (subcommand)
$ 
aws 
iam 
list-­‐access-­‐keys 
service (command) operation (subcommand)
--output json 
{ 
"Places": 
[ 
{ 
"City": 
"Seattle", 
"State": 
"WA" 
}, 
{ 
"City": 
"Las 
Vegas", 
"State": 
"NV" 
} 
] 
}
--output text 
PLACES 
Seattle 
WA 
PLACES 
Las 
Vegas 
NV
--output table 
-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ 
| 
SomeOperationName 
| 
+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ 
|| 
Places 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| 
|| 
City 
| 
State 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| 
|| 
Seattle 
| 
WA 
|| 
|| 
Las 
Vegas 
| 
NV 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+|
All Outputs 
{ 
JSON Text Table 
"Places": 
[ 
{ 
"City": 
"Seattle", 
"State": 
"WA" 
}, 
{ 
"City": 
"Las 
Vegas", 
"State": 
"NV" 
} 
] 
} 
PLACES 
Seattle 
WA 
PLACES 
Las 
Vegas 
NV 
-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ 
| 
SomeOperationName 
| 
+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ 
|| 
Places 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| 
|| 
City 
| 
State 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| 
|| 
Seattle 
| 
WA 
|| 
|| 
Las 
Vegas 
| 
NV 
|| 
|+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+|
Basic AWS CLI Usage 
DEMO
Foundation Advanced 
Exploring Key Functionality 
Proficient 
Novice
Configuration
aws 
configure
aws 
configure 
AWS 
Access 
Key 
ID 
[**ABCD]: 
AWS 
Secret 
Access 
Key 
[****************EFGH]: 
Default 
region 
name 
[us-­‐west-­‐2]: 
Default 
output 
format 
[None]:
aws 
configure 
<subcommand>
aws 
configure 
<subcommand> 
list 
- List common configuration sources! 
get 
- Get the value of a single config var! 
set 
- Set the value of a single config var
aws 
configure 
get 
region
aws 
configure 
set 
profile.prod.region 
us-­‐west-­‐2
A profile is a group of configuration values
aws 
configure 
-­‐-­‐profile 
prod
Configuration Files 
~/.aws/credentials ~/.aws/config 
• supported by all AWS SDKs! 
• only contains credentials 
• Used only by the CLI! 
• Can contain credentials (but not 
the default behavior)
~/.aws/credentials ~/.aws/config
aws 
configure 
set 
profile.prod.aws_access_key_id 
foo 
~/.aws/credentials ~/.aws/config
aws 
configure 
set 
profile.prod.aws_access_key_id 
foo 
~/.aws/credentials ~/.aws/config 
[prod] 
aws_access_key_id = foo
aws 
configure 
set 
profile.prod.aws_secret_access_key 
bar 
~/.aws/credentials ~/.aws/config 
[prod] 
aws_access_key_id = foo
aws 
configure 
set 
profile.prod.aws_secret_access_key 
bar 
~/.aws/credentials ~/.aws/config 
[prod] 
aws_access_key_id = foo 
aws_secret_access_key = bar
aws 
configure 
set 
profile.prod.region 
us-­‐west-­‐2 
~/.aws/credentials ~/.aws/config 
[prod] 
aws_access_key_id = foo 
aws_secret_access_key = bar
aws 
configure 
set 
profile.prod.region 
us-­‐west-­‐2 
~/.aws/credentials ~/.aws/config 
[profile prod] 
region = us-west-2 
[prod] 
aws_access_key_id = foo 
aws_secret_access_key = bar
aws 
configure 
set 
profile.prod.output 
text 
~/.aws/credentials ~/.aws/config 
[profile prod] 
region = us-west-2 
[prod] 
aws_access_key_id = foo 
aws_secret_access_key = bar
aws 
configure 
set 
profile.prod.output 
text 
~/.aws/credentials ~/.aws/config 
[profile prod] 
region = us-west-2 
output = text 
[prod] 
aws_access_key_id = foo 
aws_secret_access_key = bar
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
create-new-user.sh 
#!/bin/bash 
# 
Create 
a 
new 
user 
and 
create 
a 
new 
profile. 
aws 
iam 
create-­‐user 
-­‐-­‐user-­‐name 
reinvent-­‐user 
credentials=$(aws 
iam 
create-­‐access-­‐key 
-­‐-­‐user-­‐name 
reinvent-­‐user 
 
-­‐-­‐query 
'AccessKey.[AccessKeyId,SecretAccessKey]' 
 
-­‐-­‐output 
text) 
access_key_id=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
1) 
secret_access_key=$(echo 
$credentials 
| 
cut 
-­‐d' 
' 
-­‐f 
2) 
aws 
configure 
set 
profile.reinvent.aws_access_key_id 
"$access_key_id" 
aws 
configure 
set 
profile.reinvent.secret_access_key 
"$secret_access_key"
Use the aws configure 
suite of subcommands
Query
-­‐-­‐query 
(string) 
! 
A 
JMESPath 
query 
to 
use 
in 
filtering 
the 
response 
data.
Implementation Details --query Processing 
aws ec2 ... 
parse params 
HTTP request 
parse response 
format response 
display response 
Retry Pagination
Implementation Details --query Processing 
aws ec2 ... 
parse params 
HTTP request 
format response 
display response 
Retry Pagination 
parse response 
parse response body 
apply --query
Implementation Details --query Processing 
<ListUsersResponse 
xmlns="..."> 
<ListUsersResult> 
<Users> 
<member> 
<UserId>userid</UserId> 
<Path>/</Path> 
<UserName>james</UserName> 
<Arn>arn:aws:iam::..:user/james</Arn> 
<CreateDate>2013-­‐03-­‐09T23:36:32Z</CreateDate> 
</member> 
<Users> 
</ListUsersResult> 
<ListUsersResponse> 
!!
Implementation Details --query Processing 
{ 
"Users": 
[ 
{ 
"Arn": 
"arn:aws:iam::...:user/james", 
"UserId": 
"userid", 
"CreateDate": 
"2013-­‐03-­‐09T23:36:32Z", 
"Path": 
"/", 
"UserName": 
"james" 
} 
] 
}
Implementation Details --query Processing 
-­‐-­‐query 
Users[0].[UserName,Path,UserId] 
{ 
"Users": 
[ 
{ 
"Arn": 
"arn:aws:iam::...:user/james", 
"UserId": 
"userid", 
"CreateDate": 
"2013-­‐03-­‐09T23:36:32Z", 
"Path": 
"/", 
"UserName": 
"james" 
} 
] 
}
Implementation Details --query Processing 
-­‐-­‐query 
Users[0].[UserName,Path,UserId] 
[ 
[ 
"james", 
"/", 
"id" 
], 
]
Implementation Details --query Processing 
-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ 
| 
ListUsers 
| 
+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ 
| 
james 
| 
/ 
| 
userid 
| 
+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+
Implementation Details --query Processing 
aws ec2 ... 
parse params 
HTTP request 
parse response 
format response 
display response 
Retry Pagination
http://jmespath.org 
A Query Language For JSON
Waiters
Amazon EC2 Instance State Transitions 
pending 
rebooting running 
Stop stopping stopped 
Terminate 
shutting-down 
terminated 
Reboot 
Terminate 
Start
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done
ec2-instance-running.sh 
#!/bin/bash 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
while 
[ 
"$instance_state" 
!= 
"running" 
] 
do 
sleep 
1 
instance_state=$(aws 
ec2 
describe-­‐instances 
-­‐-­‐instance-­‐ids 
$instance_id 
 
-­‐-­‐query 
'Reservations[].Instances[].State.Name') 
done 
• No timeouts 
• Failure states 
• Hand-written code
ec2-waiters.sh 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
aws 
ec2 
wait 
instance-­‐running 
-­‐-­‐instance-­‐ids 
$instance_id
ec2-waiters.sh 
instance_id=$(aws 
ec2 
run-­‐instances 
-­‐-­‐image-­‐id 
ami-­‐12345 
 
-­‐-­‐query 
Reservations[].Instances[].InstanceId 
 
-­‐-­‐output 
text) 
aws 
ec2 
wait 
instance-­‐running 
-­‐-­‐instance-­‐ids 
$instance_id 
subcommand 
waiter name 
describe-instances options
Advanced Scenarios Advanced 
Looking at advanced AWS CLI features 
Proficient 
Novice
Templates
The AWS CLI is data driven
Implementation Details JSON Models 
"RunInstancesRequest":{ 
"type":"structure", 
"required":[ 
"ImageId", 
"MinCount", 
"MaxCount" 
], 
"members":{ 
"ImageId":{"shape":"String"}, 
"MinCount":{"shape":"Integer"}, 
"MaxCount":{"shape":"Integer"}, 
"KeyName":{"shape":"String"}, 
"SecurityGroups":{ 
"shape":"SecurityGroupStringList", 
"locationName":"SecurityGroup" 
},
Implementation Details JSON Models 
"RunInstancesRequest":{ 
"type":"structure", 
"required":[ 
"ImageId", 
"MinCount", 
"MaxCount" 
], 
"members":{ 
"ImageId":{"shape":"String"}, 
"MinCount":{"shape":"Integer"}, 
"MaxCount":{"shape":"Integer"}, 
"KeyName":{"shape":"String"}, 
"SecurityGroups":{ 
"shape":"SecurityGroupStringList", 
"locationName":"SecurityGroup" 
}, 
-­‐-­‐image-­‐id 
-­‐-­‐min-­‐count 
-­‐-­‐max-­‐count 
-­‐-­‐key-­‐name 
-­‐-­‐security-­‐groups
Implementation Details JSON Models 
"RunInstancesRequest":{ 
"type":"structure", 
"required":[ 
"ImageId", 
"MinCount", 
"MaxCount" 
], 
"members":{ 
"ImageId":{"shape":"String"}, 
"MinCount":{"shape":"Integer"}, 
"MaxCount":{"shape":"Integer"}, 
"KeyName":{"shape":"String"}, 
"SecurityGroups":{ 
"shape":"SecurityGroupStringList", 
"locationName":"SecurityGroup" 
}, 
arguments.json 
{ 
"ImageId": 
"ami-­‐12345", 
"MinCount": 
1, 
"MaxCount": 
1, 
"KeyName": 
"id_rsa", 
"SecurityGroups": 
["SSH", 
"web"], 
}
aws 
ec2 
run-­‐instances 
-­‐-­‐cli-­‐input-­‐json 
file://arguments.json
What else can we do?
aws 
ec2 
run-­‐instances 
-­‐-­‐generate-­‐cli-­‐skeleton
Creating and using JSON templates 
DEMO
Credential Providers
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
CredentialLocator ~/.aws/config 
Amazon 
EC2 
Instance 
Metadata
CredentialLocator 
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
~/.aws/config 
Amazon 
EC2 
Instance 
Metadata
CredentialLocator 
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
~/.aws/config 
Amazon 
EC2 
Instance 
Metadata
CredentialLocator 
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
~/.aws/config 
Amazon 
EC2 
Instance 
Metadata
CredentialLocator 
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
~/.aws/config 
Amazon 
EC2 
Instance 
Metadata
export 
AWS_ACCESS_KEY_ID=... 
~/.aws/credentials 
~/.aws/config 
Amazon 
EC2 
Instance 
Metadata 
CredentialLocator 
AssumeRole
Delegate access to AWS resources using 
AWS Identity and Access Management (IAM) roles
Production Development
Production Development 
Role 
Policy 
Trust Policy
Production Development 
AssumeRole
Production Development 
AssumeRole
Production Development 
AssumeRole
configure-role.sh 
aws 
configure 
set 
profile.prodrole.role_arn 
arn:aws:iam... 
aws 
configure 
set 
profile.prodrole.source_profile 
dev
~/.aws/credentials ~/.aws/config 
[dev] 
aws_access_key_id 
= 
foo 
aws_secret_access_key 
= 
bar 
[profile 
prodrole] 
role_arn 
= 
arn:aws:iam 
source_profile 
= 
dev
~/.aws/credentials ~/.aws/config 
[dev] 
aws_access_key_id 
= 
foo 
aws_secret_access_key 
= 
bar 
[profile 
prodrole] 
role_arn 
= 
arn:aws:iam 
source_profile 
= 
dev
Using roles with the AWS CLI 
DEMO
Amazon S3 Streaming
aws 
s3 
cp
We want to avoid disk
aws 
s3 
cp 
-­‐ 
s3://bucket/key
aws 
s3 
cp 
s3://bucket/key 
-­‐
Compress
s3-compress.sh 
aws 
s3 
cp 
s3://bucket/key 
-­‐ 
| 
 
bzip2 
-­‐-­‐best 
| 
 
aws 
s3 
cp 
-­‐ 
s3://bucket/key.bz2
Amazon S3 Streaming 
DEMO
botocore
Implementation Details Architecture 
AWS CLI 
botocore 
Providers Serializers Parsers 
HTTP
Implementation Details Architecture 
AWS CLI 
botocore 
Providers Serializers Parsers 
HTTP 
boto3
list_buckets.py 
import 
botocore 
! 
s 
= 
botocore.session.get_session() 
s3 
= 
s.create_client('s3', 
region_name='us-­‐west-­‐2') 
! 
for 
bucket 
in 
s3.list_buckets()['Buckets']: 
print("Bucket: 
{bucket}".format(bucket=bucket['Name']))
Use botocore in the python REPL 
DEMO
Wrapping Up 
• Configuration! 
• Waiters! 
• Query 
• Templates! 
• Credential Providers! 
• Amazon S3 Streaming
For More Information 
• https://github.com/aws/aws-cli! 
• http://docs.aws.amazon.com/cli/latest/userguide/! 
• https://forums.aws.amazon.com/forum.jspa?forumID=150! 
• http://docs.aws.amazon.com/cli/latest/reference/! 
• http://jmespath.org/! 
• Boto3 Talk
Please give us your feedback on this 
presentation 
Join the conversation on Twitter with #reinvent 
DEV301 
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

More Related Content

What's hot

(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLI(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLIAmazon Web Services
 
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012Amazon Web Services
 
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013Amazon Web Services
 
Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Jin k
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersJeremy Lindblom
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012Amazon Web Services
 
Ansible Assume AWS Role
Ansible Assume AWS RoleAnsible Assume AWS Role
Ansible Assume AWS RoleDougBridgens
 
Let us make clear the aws directconnect
Let us make clear the aws directconnectLet us make clear the aws directconnect
Let us make clear the aws directconnectTomoaki Hira
 
Infrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using CloudformationInfrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using CloudformationJohn Reilly Pospos
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
Building Cloud Castles - LRUG
Building Cloud Castles - LRUGBuilding Cloud Castles - LRUG
Building Cloud Castles - LRUGBen Scofield
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers StealBen Scofield
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Arc & Codementor
 
Chef 0.8, Knife and Amazon EC2
Chef 0.8, Knife and Amazon EC2Chef 0.8, Knife and Amazon EC2
Chef 0.8, Knife and Amazon EC2Robert Berger
 
Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Kris Wallsmith
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails frameworkRuby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails frameworkPankaj Bhageria
 

What's hot (20)

(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLI(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLI
 
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
TLS305 Using DynamoDB with the AWS SDK for PHP - AWS re: Invent 2012
 
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013
 
Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
 
Ansible Assume AWS Role
Ansible Assume AWS RoleAnsible Assume AWS Role
Ansible Assume AWS Role
 
Cloudformation101
Cloudformation101Cloudformation101
Cloudformation101
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
Let us make clear the aws directconnect
Let us make clear the aws directconnectLet us make clear the aws directconnect
Let us make clear the aws directconnect
 
Infrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using CloudformationInfrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using Cloudformation
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
Building Cloud Castles - LRUG
Building Cloud Castles - LRUGBuilding Cloud Castles - LRUG
Building Cloud Castles - LRUG
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Chef 0.8, Knife and Amazon EC2
Chef 0.8, Knife and Amazon EC2Chef 0.8, Knife and Amazon EC2
Chef 0.8, Knife and Amazon EC2
 
Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3
 
Play á la Rails
Play á la RailsPlay á la Rails
Play á la Rails
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails frameworkRuby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
 

Viewers also liked

Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
Getting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceGetting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceAmazon Web Services
 
Test Automation
Test AutomationTest Automation
Test Automationrockoder
 
Boost introduction
Boost introductionBoost introduction
Boost introductionrockoder
 
Sweet Inspiration - KateQuitSugar.com
Sweet Inspiration - KateQuitSugar.comSweet Inspiration - KateQuitSugar.com
Sweet Inspiration - KateQuitSugar.comKateQuitSugar
 
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Amazon Web Services
 
Using AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYUsing AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYHyun-woo Park
 
Netflix Aws Startup Tour 090617134938 Phpapp02
Netflix Aws Startup Tour 090617134938 Phpapp02Netflix Aws Startup Tour 090617134938 Phpapp02
Netflix Aws Startup Tour 090617134938 Phpapp02GovCloud Network
 
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...Amazon Web Services
 
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014Amazon Web Services
 
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...Amazon Web Services
 
Fostering a Culture of Innovation with Cloud
Fostering a Culture of Innovation with CloudFostering a Culture of Innovation with Cloud
Fostering a Culture of Innovation with CloudAmazon Web Services
 
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar Amazon Web Services
 
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridge
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridgeAWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridge
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridgeAmazon Web Services
 
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...Amazon Web Services
 
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...Amazon Web Services
 
Journey Through the Cloud - Digital Media
Journey Through the Cloud - Digital MediaJourney Through the Cloud - Digital Media
Journey Through the Cloud - Digital MediaAmazon Web Services
 

Viewers also liked (20)

Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Getting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceGetting Started with AWS Database Migration Service
Getting Started with AWS Database Migration Service
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Boost introduction
Boost introductionBoost introduction
Boost introduction
 
Sweet Inspiration - KateQuitSugar.com
Sweet Inspiration - KateQuitSugar.comSweet Inspiration - KateQuitSugar.com
Sweet Inspiration - KateQuitSugar.com
 
AWS CodeDeploy Getting Started
AWS CodeDeploy Getting StartedAWS CodeDeploy Getting Started
AWS CodeDeploy Getting Started
 
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
 
Using AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYUsing AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDY
 
Netflix Aws Startup Tour 090617134938 Phpapp02
Netflix Aws Startup Tour 090617134938 Phpapp02Netflix Aws Startup Tour 090617134938 Phpapp02
Netflix Aws Startup Tour 090617134938 Phpapp02
 
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...
How Netflix’s Tools Can Help Accelerate Your Start-up (SVC202) | AWS re:Inven...
 
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014
(BDT202) HPC Now Means 'High Personal Computing' | AWS re:Invent 2014
 
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...
AWS Public Sector Symposium | Effective Security Response in the Cloud - Sess...
 
Fostering a Culture of Innovation with Cloud
Fostering a Culture of Innovation with CloudFostering a Culture of Innovation with Cloud
Fostering a Culture of Innovation with Cloud
 
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar
AWS Webcast - Emergency Preparedness and Interagency Collaboration Webinar
 
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridge
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridgeAWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridge
AWS Paris Summit 2014 - Closing Keynote Werner Vogels - Beyond the fridge
 
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...
Updating Security Operations for the Cloud - AWS Symposium 2014 - Washington ...
 
Workshop part2 – Big Data
Workshop part2 – Big DataWorkshop part2 – Big Data
Workshop part2 – Big Data
 
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #2: Discover the ...
 
Journey Through the Cloud - Digital Media
Journey Through the Cloud - Digital MediaJourney Through the Cloud - Digital Media
Journey Through the Cloud - Digital Media
 
AWS Service Drill Downs
AWS Service Drill DownsAWS Service Drill Downs
AWS Service Drill Downs
 

Similar to (DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014

The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...Amazon Web Services
 
Azure Expert Leading Camp UA - 2015
Azure Expert Leading Camp UA - 2015Azure Expert Leading Camp UA - 2015
Azure Expert Leading Camp UA - 2015Oleg Chorny
 
Web::Machine - Simpl{e,y} HTTP
Web::Machine - Simpl{e,y} HTTPWeb::Machine - Simpl{e,y} HTTP
Web::Machine - Simpl{e,y} HTTPMichael Francis
 
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017Amazon Web Services
 
Service intergration
Service intergration Service intergration
Service intergration 재민 장
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From IusethisMarcus Ramberg
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDanilo Poccia
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needDutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needKacper Gunia
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
 
Provisioning in Microsoft Azure
Provisioning in Microsoft AzureProvisioning in Microsoft Azure
Provisioning in Microsoft Azureilagin
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersKacper Gunia
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Puppet
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteBram Vogelaar
 
Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?geekQ
 

Similar to (DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014 (20)

CLI.pptx
CLI.pptxCLI.pptx
CLI.pptx
 
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
The Best of Both Worlds: Implementing Hybrid IT with AWS (ENT218) | AWS re:In...
 
Azure Expert Leading Camp UA - 2015
Azure Expert Leading Camp UA - 2015Azure Expert Leading Camp UA - 2015
Azure Expert Leading Camp UA - 2015
 
Web::Machine - Simpl{e,y} HTTP
Web::Machine - Simpl{e,y} HTTPWeb::Machine - Simpl{e,y} HTTP
Web::Machine - Simpl{e,y} HTTP
 
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017
AWS CLI: 2017 and Beyond - DEV307 - re:Invent 2017
 
wp cli
wp cliwp cli
wp cli
 
Service intergration
Service intergration Service intergration
Service intergration
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
php2.pptx
php2.pptxphp2.pptx
php2.pptx
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needDutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
 
Provisioning in Microsoft Azure
Provisioning in Microsoft AzureProvisioning in Microsoft Azure
Provisioning in Microsoft Azure
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014

  • 1. Advanced Usage of the AWS CLI James Saryerwinnie, Amazon Web Services November 12, 2014 | Las Vegas © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. Crash Course Foundation Advanced Scenarios Intro to the AWS CLI Exploring Key Functionality Looking at Advanced CLI Features
  • 3. Crash Course Advanced Proficient Novice Intro to the AWS CLI
  • 4. AWS Command Line Interface Unified tool to manage your AWS services
  • 5. MSI (Windows) Bundled (cross platform) pip (cross platform)
  • 7. $ aws ec2 describe-­‐instances service (command) operation (subcommand)
  • 8. $ aws iam list-­‐access-­‐keys service (command) operation (subcommand)
  • 9. --output json { "Places": [ { "City": "Seattle", "State": "WA" }, { "City": "Las Vegas", "State": "NV" } ] }
  • 10. --output text PLACES Seattle WA PLACES Las Vegas NV
  • 11. --output table -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ | SomeOperationName | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ || Places || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| || City | State || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| || Seattle | WA || || Las Vegas | NV || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+|
  • 12. All Outputs { JSON Text Table "Places": [ { "City": "Seattle", "State": "WA" }, { "City": "Las Vegas", "State": "NV" } ] } PLACES Seattle WA PLACES Las Vegas NV -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ | SomeOperationName | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ || Places || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| || City | State || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+| || Seattle | WA || || Las Vegas | NV || |+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+|
  • 13. Basic AWS CLI Usage DEMO
  • 14. Foundation Advanced Exploring Key Functionality Proficient Novice
  • 17. aws configure AWS Access Key ID [**ABCD]: AWS Secret Access Key [****************EFGH]: Default region name [us-­‐west-­‐2]: Default output format [None]:
  • 19. aws configure <subcommand> list - List common configuration sources! get - Get the value of a single config var! set - Set the value of a single config var
  • 21. aws configure set profile.prod.region us-­‐west-­‐2
  • 22. A profile is a group of configuration values
  • 24. Configuration Files ~/.aws/credentials ~/.aws/config • supported by all AWS SDKs! • only contains credentials • Used only by the CLI! • Can contain credentials (but not the default behavior)
  • 26. aws configure set profile.prod.aws_access_key_id foo ~/.aws/credentials ~/.aws/config
  • 27. aws configure set profile.prod.aws_access_key_id foo ~/.aws/credentials ~/.aws/config [prod] aws_access_key_id = foo
  • 28. aws configure set profile.prod.aws_secret_access_key bar ~/.aws/credentials ~/.aws/config [prod] aws_access_key_id = foo
  • 29. aws configure set profile.prod.aws_secret_access_key bar ~/.aws/credentials ~/.aws/config [prod] aws_access_key_id = foo aws_secret_access_key = bar
  • 30. aws configure set profile.prod.region us-­‐west-­‐2 ~/.aws/credentials ~/.aws/config [prod] aws_access_key_id = foo aws_secret_access_key = bar
  • 31. aws configure set profile.prod.region us-­‐west-­‐2 ~/.aws/credentials ~/.aws/config [profile prod] region = us-west-2 [prod] aws_access_key_id = foo aws_secret_access_key = bar
  • 32. aws configure set profile.prod.output text ~/.aws/credentials ~/.aws/config [profile prod] region = us-west-2 [prod] aws_access_key_id = foo aws_secret_access_key = bar
  • 33. aws configure set profile.prod.output text ~/.aws/credentials ~/.aws/config [profile prod] region = us-west-2 output = text [prod] aws_access_key_id = foo aws_secret_access_key = bar
  • 34. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 35. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 36. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 37. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 38. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 39. create-new-user.sh #!/bin/bash # Create a new user and create a new profile. aws iam create-­‐user -­‐-­‐user-­‐name reinvent-­‐user credentials=$(aws iam create-­‐access-­‐key -­‐-­‐user-­‐name reinvent-­‐user -­‐-­‐query 'AccessKey.[AccessKeyId,SecretAccessKey]' -­‐-­‐output text) access_key_id=$(echo $credentials | cut -­‐d' ' -­‐f 1) secret_access_key=$(echo $credentials | cut -­‐d' ' -­‐f 2) aws configure set profile.reinvent.aws_access_key_id "$access_key_id" aws configure set profile.reinvent.secret_access_key "$secret_access_key"
  • 40. Use the aws configure suite of subcommands
  • 41. Query
  • 42. -­‐-­‐query (string) ! A JMESPath query to use in filtering the response data.
  • 43. Implementation Details --query Processing aws ec2 ... parse params HTTP request parse response format response display response Retry Pagination
  • 44. Implementation Details --query Processing aws ec2 ... parse params HTTP request format response display response Retry Pagination parse response parse response body apply --query
  • 45. Implementation Details --query Processing <ListUsersResponse xmlns="..."> <ListUsersResult> <Users> <member> <UserId>userid</UserId> <Path>/</Path> <UserName>james</UserName> <Arn>arn:aws:iam::..:user/james</Arn> <CreateDate>2013-­‐03-­‐09T23:36:32Z</CreateDate> </member> <Users> </ListUsersResult> <ListUsersResponse> !!
  • 46. Implementation Details --query Processing { "Users": [ { "Arn": "arn:aws:iam::...:user/james", "UserId": "userid", "CreateDate": "2013-­‐03-­‐09T23:36:32Z", "Path": "/", "UserName": "james" } ] }
  • 47. Implementation Details --query Processing -­‐-­‐query Users[0].[UserName,Path,UserId] { "Users": [ { "Arn": "arn:aws:iam::...:user/james", "UserId": "userid", "CreateDate": "2013-­‐03-­‐09T23:36:32Z", "Path": "/", "UserName": "james" } ] }
  • 48. Implementation Details --query Processing -­‐-­‐query Users[0].[UserName,Path,UserId] [ [ "james", "/", "id" ], ]
  • 49. Implementation Details --query Processing -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ | ListUsers | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ | james | / | userid | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+
  • 50. Implementation Details --query Processing aws ec2 ... parse params HTTP request parse response format response display response Retry Pagination
  • 51. http://jmespath.org A Query Language For JSON
  • 53. Amazon EC2 Instance State Transitions pending rebooting running Stop stopping stopped Terminate shutting-down terminated Reboot Terminate Start
  • 54. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done
  • 55. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done
  • 56. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done
  • 57. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done
  • 58. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done
  • 59. ec2-instance-running.sh #!/bin/bash instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') while [ "$instance_state" != "running" ] do sleep 1 instance_state=$(aws ec2 describe-­‐instances -­‐-­‐instance-­‐ids $instance_id -­‐-­‐query 'Reservations[].Instances[].State.Name') done • No timeouts • Failure states • Hand-written code
  • 60. ec2-waiters.sh instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) aws ec2 wait instance-­‐running -­‐-­‐instance-­‐ids $instance_id
  • 61. ec2-waiters.sh instance_id=$(aws ec2 run-­‐instances -­‐-­‐image-­‐id ami-­‐12345 -­‐-­‐query Reservations[].Instances[].InstanceId -­‐-­‐output text) aws ec2 wait instance-­‐running -­‐-­‐instance-­‐ids $instance_id subcommand waiter name describe-instances options
  • 62. Advanced Scenarios Advanced Looking at advanced AWS CLI features Proficient Novice
  • 64. The AWS CLI is data driven
  • 65. Implementation Details JSON Models "RunInstancesRequest":{ "type":"structure", "required":[ "ImageId", "MinCount", "MaxCount" ], "members":{ "ImageId":{"shape":"String"}, "MinCount":{"shape":"Integer"}, "MaxCount":{"shape":"Integer"}, "KeyName":{"shape":"String"}, "SecurityGroups":{ "shape":"SecurityGroupStringList", "locationName":"SecurityGroup" },
  • 66. Implementation Details JSON Models "RunInstancesRequest":{ "type":"structure", "required":[ "ImageId", "MinCount", "MaxCount" ], "members":{ "ImageId":{"shape":"String"}, "MinCount":{"shape":"Integer"}, "MaxCount":{"shape":"Integer"}, "KeyName":{"shape":"String"}, "SecurityGroups":{ "shape":"SecurityGroupStringList", "locationName":"SecurityGroup" }, -­‐-­‐image-­‐id -­‐-­‐min-­‐count -­‐-­‐max-­‐count -­‐-­‐key-­‐name -­‐-­‐security-­‐groups
  • 67. Implementation Details JSON Models "RunInstancesRequest":{ "type":"structure", "required":[ "ImageId", "MinCount", "MaxCount" ], "members":{ "ImageId":{"shape":"String"}, "MinCount":{"shape":"Integer"}, "MaxCount":{"shape":"Integer"}, "KeyName":{"shape":"String"}, "SecurityGroups":{ "shape":"SecurityGroupStringList", "locationName":"SecurityGroup" }, arguments.json { "ImageId": "ami-­‐12345", "MinCount": 1, "MaxCount": 1, "KeyName": "id_rsa", "SecurityGroups": ["SSH", "web"], }
  • 68. aws ec2 run-­‐instances -­‐-­‐cli-­‐input-­‐json file://arguments.json
  • 69. What else can we do?
  • 70. aws ec2 run-­‐instances -­‐-­‐generate-­‐cli-­‐skeleton
  • 71. Creating and using JSON templates DEMO
  • 73. export AWS_ACCESS_KEY_ID=... ~/.aws/credentials CredentialLocator ~/.aws/config Amazon EC2 Instance Metadata
  • 74. CredentialLocator export AWS_ACCESS_KEY_ID=... ~/.aws/credentials ~/.aws/config Amazon EC2 Instance Metadata
  • 75. CredentialLocator export AWS_ACCESS_KEY_ID=... ~/.aws/credentials ~/.aws/config Amazon EC2 Instance Metadata
  • 76. CredentialLocator export AWS_ACCESS_KEY_ID=... ~/.aws/credentials ~/.aws/config Amazon EC2 Instance Metadata
  • 77. CredentialLocator export AWS_ACCESS_KEY_ID=... ~/.aws/credentials ~/.aws/config Amazon EC2 Instance Metadata
  • 78. export AWS_ACCESS_KEY_ID=... ~/.aws/credentials ~/.aws/config Amazon EC2 Instance Metadata CredentialLocator AssumeRole
  • 79. Delegate access to AWS resources using AWS Identity and Access Management (IAM) roles
  • 81. Production Development Role Policy Trust Policy
  • 85. configure-role.sh aws configure set profile.prodrole.role_arn arn:aws:iam... aws configure set profile.prodrole.source_profile dev
  • 86. ~/.aws/credentials ~/.aws/config [dev] aws_access_key_id = foo aws_secret_access_key = bar [profile prodrole] role_arn = arn:aws:iam source_profile = dev
  • 87. ~/.aws/credentials ~/.aws/config [dev] aws_access_key_id = foo aws_secret_access_key = bar [profile prodrole] role_arn = arn:aws:iam source_profile = dev
  • 88. Using roles with the AWS CLI DEMO
  • 91. We want to avoid disk
  • 92. aws s3 cp -­‐ s3://bucket/key
  • 93. aws s3 cp s3://bucket/key -­‐
  • 95. s3-compress.sh aws s3 cp s3://bucket/key -­‐ | bzip2 -­‐-­‐best | aws s3 cp -­‐ s3://bucket/key.bz2
  • 98. Implementation Details Architecture AWS CLI botocore Providers Serializers Parsers HTTP
  • 99. Implementation Details Architecture AWS CLI botocore Providers Serializers Parsers HTTP boto3
  • 100. list_buckets.py import botocore ! s = botocore.session.get_session() s3 = s.create_client('s3', region_name='us-­‐west-­‐2') ! for bucket in s3.list_buckets()['Buckets']: print("Bucket: {bucket}".format(bucket=bucket['Name']))
  • 101. Use botocore in the python REPL DEMO
  • 102. Wrapping Up • Configuration! • Waiters! • Query • Templates! • Credential Providers! • Amazon S3 Streaming
  • 103. For More Information • https://github.com/aws/aws-cli! • http://docs.aws.amazon.com/cli/latest/userguide/! • https://forums.aws.amazon.com/forum.jspa?forumID=150! • http://docs.aws.amazon.com/cli/latest/reference/! • http://jmespath.org/! • Boto3 Talk
  • 104. Please give us your feedback on this presentation Join the conversation on Twitter with #reinvent DEV301 © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.