「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
「Azure上に素早く環境を構築する」のAWS版
AWSの新しいVM Import、ImportImage?を使用する。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "s3:CreateBucket", "s3:DeleteBucket", "s3:DeleteObject", "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:PutObject" ], "Resource": ["arn:aws:s3:::mys3bucket","arn:aws:s3:::mys3bucket/*"] }, { "Effect": "Allow", "Action": [ "ec2:CancelConversionTask", "ec2:CancelExportTask", "ec2:CreateImage", "ec2:CreateInstanceExportTask", "ec2:CreateTags", "ec2:DeleteTags", "ec2:DescribeConversionTasks", "ec2:DescribeExportTasks", "ec2:DescribeInstanceAttribute", "ec2:DescribeInstanceStatus", "ec2:DescribeInstances", "ec2:DescribeTags", "ec2:ImportInstance", "ec2:ImportVolume", "ec2:StartInstances", "ec2:StopInstances", "ec2:TerminateInstances", "ec2:ImportImage", "ec2:ImportSnapshot", "ec2:DescribeImportImageTasks", "ec2:DescribeImportSnapshotTasks", "ec2:CancelImportTask" ], "Resource": "*" } ] }
>aws s3api create-bucket --bucket import-to-ec2-vhdbucket --region us-east-2 --create-bucket-configuration LocationConstraint=us-east-2 ------------------------------------------------------------------- | CreateBucket | +----------+------------------------------------------------------+ | Location| http://import-to-ec2-vhdbucket.s3.amazonaws.com/ | +----------+------------------------------------------------------+
>aws s3 cp C:\...\xxxx.vhd s3://import-to-ec2-vhdbucket upload: ..\..\xxxx.vhd to s3://import-to-ec2-vhdbucket/xxxx.vhd >aws s3 ls s3://import-to-ec2-vhdbucket 2020-xx-xx xx:xx:xx 9692336128 xxxx.vhd
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "vmie.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals":{ "sts:Externalid": "vmimport" } } } ] }
aws iam create-role --role-name vmimport --assume-role-policy-document file://"C:\...\trust-policy.json"
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::import-to-ec2-vhdbucket" ] }, { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::import-to-ec2-vhdbucket/*" ] }, { "Effect": "Allow", "Action":[ "ec2:ModifySnapshotAttribute", "ec2:CopySnapshot", "ec2:RegisterImage", "ec2:Describe*" ], "Resource": "*" } ] }
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://"C:\...\role-policy.json"
[ { "Description": "Windows 20XX VHD", "Format": "vhd", "UserBucket": { "S3Bucket": "import-to-ec2-vhdbucket", "S3Key": "xxxx.vhd" } } ]
>aws ec2 import-image --cli-input-json file://"C:\...\containers.json"
>aws ec2 describe-import-image-tasks
AWSの、高度に自動化されたクラウド移行ソリューションらしい。