A company is implementing a new business application. The application runs on two Amazon EC2 instances and uses an Amazon S3 bucket for document storage. A solutions architect needs to ensure that the EC2 instances can access the S3 bucket.
What should the solutions architect do to meet this requirement?
A. Create an IAM role that grants access to the S3 bucket. Attach the role to the EC2 instances.
B. Create an IAM policy that grants access to the S3 bucket. Attach the policy to the EC2 instances.
C. Create an IAM group that grants access to the S3 bucket. Attach the group to the EC2 instances.
D. Create an IAM user that grants access to the S3 bucket. Attach the user account to the EC2 instances.
A
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
某公司正在實施一個新的業務應用程序,該應用程序運行在兩個Amazon EC2實例上,并使用Amazon S3存儲桶來存儲文檔。解決方案架構師需要確保EC2實例能夠訪問S3存儲桶。
A. 正確。創建一個授予訪問 S3 存儲桶權限的 IAM 角色。將該角色附加到 EC2 實例上。IAM 角色是一種可以附加到 AWS 資源(如 EC2 實例)的權限集合。通過為 EC2 實例附加一個具有 S3 存儲桶訪問權限的 IAM 角色,實例就可以使用該角色來訪問 S3 存儲桶。這種方法既安全又方便,因為不需要在實例上存儲訪問密鑰。
B. 不正確。創建一個授予訪問 S3 存儲桶權限的 IAM 策略。將該策略附加到 EC2 實例上。IAM 策略本身不能直接附加到 EC2 實例上。策略需要被附加到用戶、角色或組上。對于 EC2 實例,通常是通過附加具有所需權限的角色來實現的。
C. 不正確。創建一個授予訪問 S3 存儲桶權限的 IAM 組。將該組附加到 EC2 實例上。IAM 組是用于管理具有相同權限的多個用戶的集合。組本身不能直接附加到 EC2 實例上。
D. 不正確。創建一個授予訪問 S3 存儲桶權限的 IAM 用戶。將該用戶帳戶附加到 EC2 實例上。IAM 用戶是用于表示個體身份(如人類或應用程序)的實體,并且通常與訪問密鑰相關聯。將 IAM 用戶附加到 EC2 實例上并不是一種安全的做法,因為這意味著需要在實例上存儲訪問密鑰,這可能會增加安全風險。