SlideShare a Scribd company logo
1 of 22
AWS EBS Snapshots with
IAM Cross-Account Access
3/5/2014
Naoya Hashimoto
2014/3/5 1
Table of Contents
• Overview
• IAM Cross-Account Access
• IAM Cross-Account Access Setup Process
• IAM Policy for EBS Snapshot
• IAM Policy for AssumeRole
• How to set up IAM Cross-Account Access (1-8)
• EBS Snapshots environment Setup Process
• EBS Snapshots script Overview
• How to set up EBS snapshot environment (1-2)
• CloudFormation template for EBS snapshots
Environment
2014/3/5 2
• Take EBS Snapshots for EBS volumes to retrieve other AWS
account’s EBS snapshot over IAM Cross Account Access.
• Integrate EC2 instance with Amazon Linux AMI and install
Ruby script with AWS SDK for Ruby to take EBS Snapshots.
• Use IAM Role to assume the role to take EBS snapshot for
Cross Account API Access.
Overview
2014/3/5 3
Snapshot
S3 bucket
Target AWS Account
AWS SDK for Ruby
Own AWS Account
EC2 Instance
cron
IAM Role
Cross Account API Access
EBS Volume
EC2 Instance IAM Role
Script
IAM Cross-Account Access
• Use the AWS STS(Security Token Service) to request
limited-privilege credentials for AWS IAM user
• Create IAM Role to allow to manage EBS snapshot.
• Use Assume Role for cross-account access.
Amazon EBS Snapshot
Policy for EBS Snapshot
Target AWS Account
IAM Role
Policy for AssumeRole
Own AWS Account
IAM Role
arn:aws:iam::<RoleARN>:role/<policy name
for EBS snapshot>
Security Token Service
Assume Role
Temporary Access
2014/3/5 4
IAM Cross-Account Access Setup Process
2014/3/5 5
① Create IAM Role and apply IAM Policy for EBS Snapshot on the target AWS account
 Role Name: CrossAccountAccessEBSSnapshots
 Policy Name: EBSSnapshots
 Policy Document: See P7
② Establish the trust relationships between the IAM Role and own AWS account.
③ Create IAM Role to request STS (Security Token Service) for Cross-Account Access on own AWS account
 Role Name: CrossAccountAccessManagementEBSSnapshots
 Policy Name: CrossAccountAccessEBSSnapshots
 Policy Document: See P8
Amazon EBS Snapshot
IAM Policy
(EBSSnapshots)
Target AWS Account
① IAM Role
(CrossAccountAccessEBSSnapshots)
IAM Policy
(CrossAccountAccessEBSSnapshots)
Own AWS Account
③ IAM Role
(CrossAccountAccessManagementEBSSnapshots)
arn:aws:iam::xxxxxxxxxxxx:role/CrossAccount
Security Token
Service
Assume Role
Temporary Access
② Trust Relationships
IAM Policy for EBS Snapshot
2014/3/5 6
Policy Name: EBSSnapshots
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1391473701000",
"Effect": "Allow",
"Action": [
"ec2:Describe*",
"ec2:*Tags",
"ec2:CopySnapshot",
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot",
"ec2:ModifySnapshotAttribute",
"ec2:ResetSnapshotAttribute"
],
"Resource": [
"*"
]
}
]
}
IAM Policy for AssumeRole
2014/3/5 7
Policy Name: CrossAccountAccessEBSSnapshots
{
"Statement" : [
{
"Effect" : "Allow",
"Action" : "sts:AssumeRole",
"Resource" : "arn:aws:iam::<Target AWS Account ID *1>:role/EBSSnapshots"
}
]
}
*1 Put the ID of target AWS Account on <Target AWS Account ID>
How to set up IAM Cross-Account Access (1)
2014/3/5 8
• Log in to AWS Management Console of the target AWS Account.
• Click [Services] - [Deploy & Management] – [IAM] and get to the IAM dashboard.
• Click [Roles] – [Create New Role].
• Input [Role Name] and click [Continue].
- Role Name: CrossAccountEBSSnapshot
• Select [AWS Service Roles] and [Amazon EC2 Select].
How to set up IAM Cross-Account Access (2)
2014/3/5 9
• Select [Custom Policy].
• Input the following items and click [Continue].
- Policy Name: EBSSnapshots
- Policy Document: See P7
How to set up IAM Cross-Account Access (3)
2014/3/5 10
• Remember or Copy [Role ARN] and Click [Create Role].
* You can check [Role ARN] on the summary section after creating IAM Role
How to set up IAM Cross-Account Access (4)
2014/3/5 11
• Click [Role ARN] – [Trust Relationships] – [Edit Trust Relationship].
• Modify the “Principal” section of the policy as follows and click [Update Trust Policy].
"Principal": {
"Service": “ec2.amazonaws.com"},
↓
},
"Principal": {
"AWS": "arn:aws:iam::<Own AWS Account ID>:root"
},
How to set up IAM Cross-Account Access (5)
2014/3/5 12
• Log in to AWS Management Console of own AWS Account.
• Click [Services] - [Deploy & Management] – [IAM] and get to the IAM dashboard.
• Click [Roles] – [Create New Role].
• Input [Role Name] and click [Continue].
- Role Name: CrossAccountAccessManagementEBSSnapshots
• Select [Role for Cross-Account Access] and click [Provide access… Select].
How to set up IAM Cross-Account Access (6)
2014/3/5 13
• Input the following item and click [Continue].
Account ID: <Target AWS Account ID>
How to set up IAM Cross-Account Access (7)
2014/3/5 14
• Select [Custom Policy].
• Input the following items and click [Continue]. * Replace<AWS Account ID> with target AWS account ID
- Policy Name: CrossAccountAccessEBSSnapshots
- Policy Document: See P8
{ "Statement" : [
{
"Effect" : "Allow",
"Action" : "sts:AssumeRole",
"Resource" : "arn:aws:iam::<AWS Account ID>:role/CrossAccountEBSSnapshot"
}
]
}
How to set up IAM Cross-Account Access (8)
2014/3/5 15
• Click [Create Role].
EBS Snapshots environment Setup Process
2014/3/5 16
① Create EC2 Instance and attach IAM Role for Cross-Account Access
② Install ruby, gems (aws-sdk) and set up ruby script
③ Verify to take EBS snapshots for
④ Set up cron jobs to create EBS snapshot
Snapshot
S3 bucket
Target AWS Account
AWS SDK for Ruby
Own AWS Account
① Create EC2 Instance & apply IAM Role
cron
Cross Account API Access
EBS Volume
EC2 Instance IAM Role
Script
② Install ruby and set up script
③ Verify to take EBS Snapshots with IAM Cross Account Access
④ Set up cron job to take regular EBS Snapshots
EBS Snapshots script Overview
2014/3/5 17
Cron(ec2-user)
$HOME/bin/create_ebs_snapshot.sh <EBS Volume ID> <generation *1> <Role ARN>
*1 Every EBS snapshots maintains by default without the number of generation
create_ebs_snapshot_crossaccount.rb
# Create EBS snapshot
ec2 = AWS::EC2.new
reg = ec2.regions[endpoint]
snapshot = reg.volumes[volume_id].create_snapshot(description)
sleep 1 until [:completed, :error].include?(snapshot.status)
snapshot.add_tag('Name', :value => name)
# Describe snapshot status
puts "#{name} Snapshot iD: #{snapshot.id}, Progress: #{snapshot.progress}%, Status: #{snapshot.status}"
# Rotate and Delete EBS snapshot
if generation
snapshots = reg.snapshots.filter('volume-id', volume_id).sort_by { |x| x.start_time }.reverse
ss = snapshots[generation..-1]
ss.each { |x| x.delete } unless ss.nil?
end
create_ebs_snapshot.sh
volume_id=$1
generation=$2
role_arn=$3
$HOME/.rvm/rubies/${ruby_ver}/bin/ruby ./create_ebs_snapshot_crossaccount.rb -v $volume_id -g $generation -r $role_arn 
>> ${logfile} 2>&1
• autoconf
• automake
• aws-sdk
• bison
• gcc
• gcc-c++
• git
• jq
• libffi-devel
• libtool
• libxml2-devel
• libxslt-devel
• libyaml-devel
• make
• openssl-devel
• patch
• readline-devel
• ruby-2.0.0
• rvm
Packages to run script
2014/3/5 18
How to set up EBS snapshot environment (1)
2014/3/5 19
• Install libraries
$ sudo yum -y groupinstall "Development libraries" "Development tools"
$ sudo yum -y install git libxml2-devel libxslt-devel
• Install RVM, Ruby, gems, aws sdk for ruby
$ curl -L https://get.rvm.io | bash -s stable
$ . ~/.bashrc
$ rvm install 2.0.0
$ rvm use 2.0.0 –default
$ gem i aws-sdk
• Install jq
$ git clone https://github.com/stedolan/jq.git
$ cd jq
$ autoreconf -i
$ ./configure && make && sudo make install
• Set up script
$ git clone https://github.com/hashnao/aws/archive/master.zip $HOME/bin
$ chown -R ec2-user:ec2-user $HOME/bin
$ find $HOME/bin -type f -name "*.sh" -exec chmod 755 {} ;
• Set up crontab * sample job
$ crontab -e
10 2 * * * $HOME/bin/ebssnapshot/1.0/create_ebs_snapshot_crossaccount.sh <Volume ID>
<generation><RoleARN>
How to set up EBS snapshot environment (2)
2014/3/5 20
• Verify to take EBS snapshots with IAM Cross-Account Access
$ $HOME/bin/ebssnapshot/1.0/create_ebs_snapshot_crossaccount.sh <EBS Volume ID> <generation> <Role ARN>
Ex.
$ $HOME/bin/create_ebs_snapshot_crossaccount.sh vol-xxxxxxxx 1 arn:aws:iam::<AWS Account
ID>:role/CrossAccountEBSSnapshot
• See the log file to confirm the EBS snaphost has been taken.
$ tail -f $HOME/log/create_ebs_snapshot_crossaccount.sh_<yyyymmdd>.log
vol-3967a333-2014/03/13_18:03:45 Snapshot iD: snap-325ab6d3, Progress: 100%, Status: completed
* The following messages are output if the IAM Role of EBS Snapshot is not correct.
/home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/core/client.rb:374:in `return_or_raise': User:
arn:aws:sts::<AWS Account ID>:assumed-role/bbt-snapshot/i-47409c40 is not authorized to perform: sts:AssumeRole on
resource: arn:aws:iam::099897076573:role/CrossAccountEBSSnapshot (AWS::STS::Errors::AccessDenied)
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/core/client.rb:475:in `client_request'
from (eval):3:in `assume_role'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/sts.rb:58:in `assume_role'
from ./create_ebs_snapshot_crossaccount.rb:48:in `<main>'
CloudFormation template for EBS snapshots Environment
2014/3/5 21
• Template PATH on github
https://github.com/hashnao/aws-cloudformation/blob/master/EC2/ec2-ebssnapshot.template
• Validate template
$ wget https://raw.github.com/hashnao/aws-cloudformation/master/EC2/ec2-ebssnapshot-
instance.template
$ aws cloudformation validate-template 
--template-body file://$PWD/ec2-ebssnapshot-instance.template
• Deploy stack
$ aws cloudformation create-stack 
--capabilities CAPABILITY_IAM 
--template-body file://$PWD/ec2-ebssnapshot-instance.template 
--parameters 
ParameterKey=InsntanceType,ParameterValue=<InstanceType> 
ParameterKey=KeyName,ParameterValue=<SSHKeyName> 
ParameterKey=SSHLocatoin,ParameterValue=<CIDR> 
--stack-name <StackName>
AWS CloudFormation
Never fail to regularly take
EBS snapshot just in case.
2014/3/5 22

More Related Content

What's hot

RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012
RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012
RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012Amazon Web Services
 
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows ServerAWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows ServerAmazon Web Services
 
Deploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudDeploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudAmazon Web Services
 
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Amazon Web Services
 
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with GitDeploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with GitAmazon Web Services
 
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014Amazon Web Services
 
DevOps with Amazon Web Services (November 2016)
DevOps with Amazon Web Services (November 2016)DevOps with Amazon Web Services (November 2016)
DevOps with Amazon Web Services (November 2016)Julien SIMON
 
Programming Amazon Web Services for Beginners (1)
Programming Amazon Web Services for Beginners (1)Programming Amazon Web Services for Beginners (1)
Programming Amazon Web Services for Beginners (1)Markus Klems
 
Running Docker clusters on AWS (November 2016)
Running Docker clusters on AWS (November 2016)Running Docker clusters on AWS (November 2016)
Running Docker clusters on AWS (November 2016)Julien SIMON
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkAmazon Web Services
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAmazon Web Services
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAmazon Web Services
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...Amazon Web Services
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the HoodAmazon Web Services
 
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh VariaAWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh VariaAmazon Web Services
 
Infrastructure as Code - AWS CloudFormation
Infrastructure as Code - AWS CloudFormationInfrastructure as Code - AWS CloudFormation
Infrastructure as Code - AWS CloudFormationChamila de Alwis
 
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCM
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCMWCM-6 Crafter Studio: Extending Alfresco for Next Generation WCM
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCMAlfresco Software
 
Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Angel Borroy López
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with ContainersAmazon Web Services
 

What's hot (20)

RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012
RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012
RMG206 Introduction to Amazon Elastic Beanstalk - AWS re: Invent 2012
 
Docker on AWS
Docker on AWSDocker on AWS
Docker on AWS
 
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows ServerAWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
 
Deploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudDeploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS Cloud
 
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
 
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with GitDeploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
 
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
 
DevOps with Amazon Web Services (November 2016)
DevOps with Amazon Web Services (November 2016)DevOps with Amazon Web Services (November 2016)
DevOps with Amazon Web Services (November 2016)
 
Programming Amazon Web Services for Beginners (1)
Programming Amazon Web Services for Beginners (1)Programming Amazon Web Services for Beginners (1)
Programming Amazon Web Services for Beginners (1)
 
Running Docker clusters on AWS (November 2016)
Running Docker clusters on AWS (November 2016)Running Docker clusters on AWS (November 2016)
Running Docker clusters on AWS (November 2016)
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and Docker
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood
 
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh VariaAWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
 
Infrastructure as Code - AWS CloudFormation
Infrastructure as Code - AWS CloudFormationInfrastructure as Code - AWS CloudFormation
Infrastructure as Code - AWS CloudFormation
 
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCM
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCMWCM-6 Crafter Studio: Extending Alfresco for Next Generation WCM
WCM-6 Crafter Studio: Extending Alfresco for Next Generation WCM
 
Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 

Viewers also liked

Integrate Jenkins with S3
Integrate Jenkins with S3Integrate Jenkins with S3
Integrate Jenkins with S3devopsjourney
 
(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto ScalingAmazon Web Services
 
(SEC307) A Progressive Journey Through AWS IAM Federation Options
(SEC307) A Progressive Journey Through AWS IAM Federation Options(SEC307) A Progressive Journey Through AWS IAM Federation Options
(SEC307) A Progressive Journey Through AWS IAM Federation OptionsAmazon Web Services
 
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...Amazon Web Services
 
(SEC302) IAM Best Practices To Live By
(SEC302) IAM Best Practices To Live By(SEC302) IAM Best Practices To Live By
(SEC302) IAM Best Practices To Live ByAmazon Web Services
 
Identity Access Management 101
Identity Access Management 101Identity Access Management 101
Identity Access Management 101OneLogin
 
Identity and Access Management (IAM)
Identity and Access Management (IAM)Identity and Access Management (IAM)
Identity and Access Management (IAM)Identacor
 
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or LessAmazon Web Services
 
Identity and Access Management 101
Identity and Access Management 101Identity and Access Management 101
Identity and Access Management 101Jerod Brennen
 

Viewers also liked (12)

不談 IAM
不談 IAM不談 IAM
不談 IAM
 
Integrate Jenkins with S3
Integrate Jenkins with S3Integrate Jenkins with S3
Integrate Jenkins with S3
 
(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling
 
Prometheus on AWS
Prometheus on AWSPrometheus on AWS
Prometheus on AWS
 
In Depth: AWS IAM and VPC
In Depth: AWS IAM and VPCIn Depth: AWS IAM and VPC
In Depth: AWS IAM and VPC
 
(SEC307) A Progressive Journey Through AWS IAM Federation Options
(SEC307) A Progressive Journey Through AWS IAM Federation Options(SEC307) A Progressive Journey Through AWS IAM Federation Options
(SEC307) A Progressive Journey Through AWS IAM Federation Options
 
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...
Secure Amazon EC2 Environment with AWS IAM & Resource-Based Permissions (CPN2...
 
(SEC302) IAM Best Practices To Live By
(SEC302) IAM Best Practices To Live By(SEC302) IAM Best Practices To Live By
(SEC302) IAM Best Practices To Live By
 
Identity Access Management 101
Identity Access Management 101Identity Access Management 101
Identity Access Management 101
 
Identity and Access Management (IAM)
Identity and Access Management (IAM)Identity and Access Management (IAM)
Identity and Access Management (IAM)
 
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
 
Identity and Access Management 101
Identity and Access Management 101Identity and Access Management 101
Identity and Access Management 101
 

Similar to Aws ebs snapshot with iam cross account access

AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAmazon Web Services
 
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsCMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsAmazon Web Services
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure EnvironmentMichael Collier
 
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsSEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsAmazon Web Services
 
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012Amazon Web Services
 
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014Amazon Web Services
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Web Services
 
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)Amazon Web Services
 
AWS Cyber Security Best Practices
AWS Cyber Security Best PracticesAWS Cyber Security Best Practices
AWS Cyber Security Best PracticesDoiT International
 
Windsor AWS UG Deep dive IAM 2 - no json101
Windsor AWS UG   Deep dive IAM 2 - no json101Windsor AWS UG   Deep dive IAM 2 - no json101
Windsor AWS UG Deep dive IAM 2 - no json101Goran Karmisevic
 
Integrating_Cloud_Development_Security_And_Operations.pdf
Integrating_Cloud_Development_Security_And_Operations.pdfIntegrating_Cloud_Development_Security_And_Operations.pdf
Integrating_Cloud_Development_Security_And_Operations.pdfAmazon Web Services
 
Detective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeDetective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeAmazon Web Services
 
Avoiding Friendly Fire in AWS
Avoiding Friendly Fire in AWSAvoiding Friendly Fire in AWS
Avoiding Friendly Fire in AWSDebHawk
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoAmazon Web Services
 
Well-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionWell-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionAmazon Web Services
 

Similar to Aws ebs snapshot with iam cross account access (20)

AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated Billing
 
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsCMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure Environment
 
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsSEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
 
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
 
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
 
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)
AWS re:Invent 2016: IAM Best Practices to Live By (SAC317)
 
AWS Cyber Security Best Practices
AWS Cyber Security Best PracticesAWS Cyber Security Best Practices
AWS Cyber Security Best Practices
 
Windsor AWS UG Deep dive IAM 2 - no json101
Windsor AWS UG   Deep dive IAM 2 - no json101Windsor AWS UG   Deep dive IAM 2 - no json101
Windsor AWS UG Deep dive IAM 2 - no json101
 
Amazon ECS
Amazon ECSAmazon ECS
Amazon ECS
 
Integrating_Cloud_Development_Security_And_Operations.pdf
Integrating_Cloud_Development_Security_And_Operations.pdfIntegrating_Cloud_Development_Security_And_Operations.pdf
Integrating_Cloud_Development_Security_And_Operations.pdf
 
Detective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeDetective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record Change
 
Avoiding Friendly Fire in AWS
Avoiding Friendly Fire in AWSAvoiding Friendly Fire in AWS
Avoiding Friendly Fire in AWS
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 
Policy Ninja
Policy NinjaPolicy Ninja
Policy Ninja
 
Well-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionWell-Architected for Security: Advanced Session
Well-Architected for Security: Advanced Session
 

More from Naoya Hashimoto

OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)Naoya Hashimoto
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-containerNaoya Hashimoto
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsNaoya Hashimoto
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Naoya Hashimoto
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編Naoya Hashimoto
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』Naoya Hashimoto
 

More from Naoya Hashimoto (9)

OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)
 
Ansible container
Ansible containerAnsible container
Ansible container
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-container
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jaws
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"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...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 

Aws ebs snapshot with iam cross account access

  • 1. AWS EBS Snapshots with IAM Cross-Account Access 3/5/2014 Naoya Hashimoto 2014/3/5 1
  • 2. Table of Contents • Overview • IAM Cross-Account Access • IAM Cross-Account Access Setup Process • IAM Policy for EBS Snapshot • IAM Policy for AssumeRole • How to set up IAM Cross-Account Access (1-8) • EBS Snapshots environment Setup Process • EBS Snapshots script Overview • How to set up EBS snapshot environment (1-2) • CloudFormation template for EBS snapshots Environment 2014/3/5 2
  • 3. • Take EBS Snapshots for EBS volumes to retrieve other AWS account’s EBS snapshot over IAM Cross Account Access. • Integrate EC2 instance with Amazon Linux AMI and install Ruby script with AWS SDK for Ruby to take EBS Snapshots. • Use IAM Role to assume the role to take EBS snapshot for Cross Account API Access. Overview 2014/3/5 3 Snapshot S3 bucket Target AWS Account AWS SDK for Ruby Own AWS Account EC2 Instance cron IAM Role Cross Account API Access EBS Volume EC2 Instance IAM Role Script
  • 4. IAM Cross-Account Access • Use the AWS STS(Security Token Service) to request limited-privilege credentials for AWS IAM user • Create IAM Role to allow to manage EBS snapshot. • Use Assume Role for cross-account access. Amazon EBS Snapshot Policy for EBS Snapshot Target AWS Account IAM Role Policy for AssumeRole Own AWS Account IAM Role arn:aws:iam::<RoleARN>:role/<policy name for EBS snapshot> Security Token Service Assume Role Temporary Access 2014/3/5 4
  • 5. IAM Cross-Account Access Setup Process 2014/3/5 5 ① Create IAM Role and apply IAM Policy for EBS Snapshot on the target AWS account  Role Name: CrossAccountAccessEBSSnapshots  Policy Name: EBSSnapshots  Policy Document: See P7 ② Establish the trust relationships between the IAM Role and own AWS account. ③ Create IAM Role to request STS (Security Token Service) for Cross-Account Access on own AWS account  Role Name: CrossAccountAccessManagementEBSSnapshots  Policy Name: CrossAccountAccessEBSSnapshots  Policy Document: See P8 Amazon EBS Snapshot IAM Policy (EBSSnapshots) Target AWS Account ① IAM Role (CrossAccountAccessEBSSnapshots) IAM Policy (CrossAccountAccessEBSSnapshots) Own AWS Account ③ IAM Role (CrossAccountAccessManagementEBSSnapshots) arn:aws:iam::xxxxxxxxxxxx:role/CrossAccount Security Token Service Assume Role Temporary Access ② Trust Relationships
  • 6. IAM Policy for EBS Snapshot 2014/3/5 6 Policy Name: EBSSnapshots { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1391473701000", "Effect": "Allow", "Action": [ "ec2:Describe*", "ec2:*Tags", "ec2:CopySnapshot", "ec2:CreateSnapshot", "ec2:DeleteSnapshot", "ec2:ModifySnapshotAttribute", "ec2:ResetSnapshotAttribute" ], "Resource": [ "*" ] } ] }
  • 7. IAM Policy for AssumeRole 2014/3/5 7 Policy Name: CrossAccountAccessEBSSnapshots { "Statement" : [ { "Effect" : "Allow", "Action" : "sts:AssumeRole", "Resource" : "arn:aws:iam::<Target AWS Account ID *1>:role/EBSSnapshots" } ] } *1 Put the ID of target AWS Account on <Target AWS Account ID>
  • 8. How to set up IAM Cross-Account Access (1) 2014/3/5 8 • Log in to AWS Management Console of the target AWS Account. • Click [Services] - [Deploy & Management] – [IAM] and get to the IAM dashboard. • Click [Roles] – [Create New Role]. • Input [Role Name] and click [Continue]. - Role Name: CrossAccountEBSSnapshot • Select [AWS Service Roles] and [Amazon EC2 Select].
  • 9. How to set up IAM Cross-Account Access (2) 2014/3/5 9 • Select [Custom Policy]. • Input the following items and click [Continue]. - Policy Name: EBSSnapshots - Policy Document: See P7
  • 10. How to set up IAM Cross-Account Access (3) 2014/3/5 10 • Remember or Copy [Role ARN] and Click [Create Role]. * You can check [Role ARN] on the summary section after creating IAM Role
  • 11. How to set up IAM Cross-Account Access (4) 2014/3/5 11 • Click [Role ARN] – [Trust Relationships] – [Edit Trust Relationship]. • Modify the “Principal” section of the policy as follows and click [Update Trust Policy]. "Principal": { "Service": “ec2.amazonaws.com"}, ↓ }, "Principal": { "AWS": "arn:aws:iam::<Own AWS Account ID>:root" },
  • 12. How to set up IAM Cross-Account Access (5) 2014/3/5 12 • Log in to AWS Management Console of own AWS Account. • Click [Services] - [Deploy & Management] – [IAM] and get to the IAM dashboard. • Click [Roles] – [Create New Role]. • Input [Role Name] and click [Continue]. - Role Name: CrossAccountAccessManagementEBSSnapshots • Select [Role for Cross-Account Access] and click [Provide access… Select].
  • 13. How to set up IAM Cross-Account Access (6) 2014/3/5 13 • Input the following item and click [Continue]. Account ID: <Target AWS Account ID>
  • 14. How to set up IAM Cross-Account Access (7) 2014/3/5 14 • Select [Custom Policy]. • Input the following items and click [Continue]. * Replace<AWS Account ID> with target AWS account ID - Policy Name: CrossAccountAccessEBSSnapshots - Policy Document: See P8 { "Statement" : [ { "Effect" : "Allow", "Action" : "sts:AssumeRole", "Resource" : "arn:aws:iam::<AWS Account ID>:role/CrossAccountEBSSnapshot" } ] }
  • 15. How to set up IAM Cross-Account Access (8) 2014/3/5 15 • Click [Create Role].
  • 16. EBS Snapshots environment Setup Process 2014/3/5 16 ① Create EC2 Instance and attach IAM Role for Cross-Account Access ② Install ruby, gems (aws-sdk) and set up ruby script ③ Verify to take EBS snapshots for ④ Set up cron jobs to create EBS snapshot Snapshot S3 bucket Target AWS Account AWS SDK for Ruby Own AWS Account ① Create EC2 Instance & apply IAM Role cron Cross Account API Access EBS Volume EC2 Instance IAM Role Script ② Install ruby and set up script ③ Verify to take EBS Snapshots with IAM Cross Account Access ④ Set up cron job to take regular EBS Snapshots
  • 17. EBS Snapshots script Overview 2014/3/5 17 Cron(ec2-user) $HOME/bin/create_ebs_snapshot.sh <EBS Volume ID> <generation *1> <Role ARN> *1 Every EBS snapshots maintains by default without the number of generation create_ebs_snapshot_crossaccount.rb # Create EBS snapshot ec2 = AWS::EC2.new reg = ec2.regions[endpoint] snapshot = reg.volumes[volume_id].create_snapshot(description) sleep 1 until [:completed, :error].include?(snapshot.status) snapshot.add_tag('Name', :value => name) # Describe snapshot status puts "#{name} Snapshot iD: #{snapshot.id}, Progress: #{snapshot.progress}%, Status: #{snapshot.status}" # Rotate and Delete EBS snapshot if generation snapshots = reg.snapshots.filter('volume-id', volume_id).sort_by { |x| x.start_time }.reverse ss = snapshots[generation..-1] ss.each { |x| x.delete } unless ss.nil? end create_ebs_snapshot.sh volume_id=$1 generation=$2 role_arn=$3 $HOME/.rvm/rubies/${ruby_ver}/bin/ruby ./create_ebs_snapshot_crossaccount.rb -v $volume_id -g $generation -r $role_arn >> ${logfile} 2>&1
  • 18. • autoconf • automake • aws-sdk • bison • gcc • gcc-c++ • git • jq • libffi-devel • libtool • libxml2-devel • libxslt-devel • libyaml-devel • make • openssl-devel • patch • readline-devel • ruby-2.0.0 • rvm Packages to run script 2014/3/5 18
  • 19. How to set up EBS snapshot environment (1) 2014/3/5 19 • Install libraries $ sudo yum -y groupinstall "Development libraries" "Development tools" $ sudo yum -y install git libxml2-devel libxslt-devel • Install RVM, Ruby, gems, aws sdk for ruby $ curl -L https://get.rvm.io | bash -s stable $ . ~/.bashrc $ rvm install 2.0.0 $ rvm use 2.0.0 –default $ gem i aws-sdk • Install jq $ git clone https://github.com/stedolan/jq.git $ cd jq $ autoreconf -i $ ./configure && make && sudo make install • Set up script $ git clone https://github.com/hashnao/aws/archive/master.zip $HOME/bin $ chown -R ec2-user:ec2-user $HOME/bin $ find $HOME/bin -type f -name "*.sh" -exec chmod 755 {} ; • Set up crontab * sample job $ crontab -e 10 2 * * * $HOME/bin/ebssnapshot/1.0/create_ebs_snapshot_crossaccount.sh <Volume ID> <generation><RoleARN>
  • 20. How to set up EBS snapshot environment (2) 2014/3/5 20 • Verify to take EBS snapshots with IAM Cross-Account Access $ $HOME/bin/ebssnapshot/1.0/create_ebs_snapshot_crossaccount.sh <EBS Volume ID> <generation> <Role ARN> Ex. $ $HOME/bin/create_ebs_snapshot_crossaccount.sh vol-xxxxxxxx 1 arn:aws:iam::<AWS Account ID>:role/CrossAccountEBSSnapshot • See the log file to confirm the EBS snaphost has been taken. $ tail -f $HOME/log/create_ebs_snapshot_crossaccount.sh_<yyyymmdd>.log vol-3967a333-2014/03/13_18:03:45 Snapshot iD: snap-325ab6d3, Progress: 100%, Status: completed * The following messages are output if the IAM Role of EBS Snapshot is not correct. /home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/core/client.rb:374:in `return_or_raise': User: arn:aws:sts::<AWS Account ID>:assumed-role/bbt-snapshot/i-47409c40 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::099897076573:role/CrossAccountEBSSnapshot (AWS::STS::Errors::AccessDenied) from /home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/core/client.rb:475:in `client_request' from (eval):3:in `assume_role' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p353/gems/aws-sdk-1.33.0/lib/aws/sts.rb:58:in `assume_role' from ./create_ebs_snapshot_crossaccount.rb:48:in `<main>'
  • 21. CloudFormation template for EBS snapshots Environment 2014/3/5 21 • Template PATH on github https://github.com/hashnao/aws-cloudformation/blob/master/EC2/ec2-ebssnapshot.template • Validate template $ wget https://raw.github.com/hashnao/aws-cloudformation/master/EC2/ec2-ebssnapshot- instance.template $ aws cloudformation validate-template --template-body file://$PWD/ec2-ebssnapshot-instance.template • Deploy stack $ aws cloudformation create-stack --capabilities CAPABILITY_IAM --template-body file://$PWD/ec2-ebssnapshot-instance.template --parameters ParameterKey=InsntanceType,ParameterValue=<InstanceType> ParameterKey=KeyName,ParameterValue=<SSHKeyName> ParameterKey=SSHLocatoin,ParameterValue=<CIDR> --stack-name <StackName> AWS CloudFormation
  • 22. Never fail to regularly take EBS snapshot just in case. 2014/3/5 22