Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/soonlabo/soonlabo.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
【図解】AWSでIAMのユーザーとグループとポリシーとロールをざっくりイメージ

【図解】AWSでIAMのユーザーとグループとポリシーとロールをざっくりイメージ

IAMのユーザーやグループ、ポリシー、ロールについて書きます。イメージがついていないとごちゃごちゃしてしまうところだと思いますので、図を使いざっくり説明をしてみます。

AWSアカウントを作成したらルートユーザーが出来ますが、このユーザーを使って作業をするのは推奨されておりません。MFA設定して利用せず、ユーザーを作成し、そのユーザーで作業をします。実際に作成の流れを見て説明したいと思います。

 

ユーザー


作業をするユーザーを上記のように『管理者』『運用者』『開発者』とします。ユーザーは使う人ひとりにつきひとつ作成します。ユーザーを作成しただけでは特に権限はついていませんが、それぞれ役割にあった権限を割り当てていきます。※割り当てることをアタッチするといいます。

管理者:管理権限
運用者:運用するための権限
開発者:開発するための権限

そのままですね。

 

ポリシー


ポリシーとは『権限』のことです。AWSではそれぞれのユーザーに権限をつけるのではなくポリシーとして作り、割り当てることで権限を付与します。

そのため上記ユーザーに権限をつけるにはポリシーを作成し、ポリシーとユーザーをアタッチ(割り当て)します。

管理者

管理者ユーザーには管理者権限をアタッチします。管理者権限はAWSでAdministratorAccessとしてすでに用意されていますのでこの権限でポリシーを作成します。

ポリシーを作成したら管理者ユーザーにアタッチします。

これで管理者は管理者としての権限を使うことができます。

運用者と開発者

次に運用者と開発者のポリシーですが、細かく設定したいのでこちらはそれぞれ権限を自分で作ります。運用者にはConfig、開発者にはEC2とS3に対して許可権限をつけるということが可能です。

ポリシーを作ったら運用者にはConfigの権限がついた運用者ポリシーを、開発者には開発者ポリシーをそれぞれアタッチすることでそれぞれのユーザーに適した権限をつけることができました。

 

グループ


上記まではユーザー単体にポリシーをつけていましたが、グループを作ってグループに対してポリシーをアタッチすることもできます。AWSではユーザーに直接ポリシーをアタッチするのではなく、グループにポリシーをアタッチし、ユーザーはグループに所属するほうが推奨されています。

 

こんなこともできます

例えば運用者が開発者のポリシーが必要になった場合、自由にポリシーをアタッチすることも可能です。

 

ロール


ロールとはポリシーをAWSのリソースに付与するものです。ここでいうリソースとは例えばEC2などを指します。

例えば上記図のようにEC2にS3へのフルアクセスポリシーをアタッチします。そうすることでEC2はS3に対してフルアクセス権限を得たことになります。

 

注意


説明をわかりやすくするために省略した説明もありますがイメージがついたでしょうか?

実際にIAMを使用するときはもっと細かいこともできますので公式の説明などを読み知識を深めてみてください。

 

soon
  • soon
  • 1986年生まれのjavaプログラマー。28歳の時に7年働いた販売士からプログラマーに転職をする。常駐先を転々としながら日々生きています。