VM::EC2ã§IAMãã¼ã«èªè¨¼ãè¡ã
VM::EC2ã§ãIAMãã¼ã«èªè¨¼ãããã¦ã
VM::EC2ã«ãã«ãªã¯ã§ããããããªã¨ã³ã¼ãçºãã¦ãã¨ãã
ããããå¥ã«ã³ã¼ãå¤ããªãã¦ãä»ã®ã¾ã¾ã§è¡ããããããï¼ã
ã¨æ°ä»ãã¦ãã¾ã£ãã
use strict; use warnings; use VM::EC2; # dummy instance my $ec2_dummy = VM::EC2->new( -access_key => 'a', # 空ã ã¨æãããããã -secret_key => 'b', # 空ã ã¨æãããããã ); # get iam token my $token = $ec2_dummy->instance_metadata->iam_credentials; # get ec2 instance my $ec2 = VM::EC2->new( -security_token => $token, ); # api access... print $ec2->describe_instances();
ä¸åº¦ããã¼ã¤ã³ã¹ã¿ã³ã¹ãä½ã£ã¦ãiam_credentialsãåå¾ã
ãã®ãã¼ã¯ã³ãç¨ãã¦åèªè¨¼ããããããã
ããã§EC2ãµã¼ãã«ãã¼ãç½®ããªãã¦ãIAMãã¼ã«ï¼VM::EC2ã§APIã¢ã¯ã»ã¹åºæ¥ã¾ããï¼