Terraform - IAM - readonly 사용자 추가

This commit is contained in:
dsk-minchulahn
2024-01-25 17:04:03 +09:00
parent c8f14a323d
commit 4307cf5261
4 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
provider "aws" {
region = var.REGION
}
resource "aws_iam_user" "user" {
name = "devops-readonly"
}
resource "aws_iam_user_policy_attachment" "attachment" {
user = aws_iam_user.user.name
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess"
}
resource "aws_iam_access_key" "access_key" {
user = aws_iam_user.user.name
}