Terraform - IAM user, role, policies 최신화

This commit is contained in:
dsk-minchulahn
2024-01-30 17:46:36 +09:00
parent 886e60ab28
commit f3e9a26a95
11 changed files with 115 additions and 49 deletions

View File

@@ -0,0 +1,23 @@
resource "aws_iam_policy" "agent_s3_policy" {
name = "DSK_Agent_S3FullAccess"
path = "/"
policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
"s3-object-lambda:*"
],
"Resource": [
"arn:aws:s3:::dsk-agent-s3",
"arn:aws:s3:::dsk-agent-s3/*",
"arn:aws:s3:::dsk-middleware-backup",
"arn:aws:s3:::dsk-middleware-backup/*"
]
}
]
})
}

View File

@@ -0,0 +1,21 @@
resource "aws_iam_policy" "api_s3_policy" {
name = "DSK_API_S3FullAccess"
path = "/"
policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
"s3-object-lambda:*"
],
"Resource": [
"arn:aws:s3:::dsk-metering",
"arn:aws:s3:::dsk-metering/*"
]
}
]
})
}

View File

@@ -0,0 +1,21 @@
resource "aws_iam_policy" "devops_s3_policy" {
name = "DSK_DEVOPS_S3FullAccess"
path = "/"
policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
"s3-object-lambda:*"
],
"Resource": [
"arn:aws:s3:::dsk-middleware-backup",
"arn:aws:s3:::dsk-middleware-backup/*"
]
}
]
})
}

View File

@@ -1,4 +1,4 @@
resource "aws_iam_policy" "policy" {
resource "aws_iam_policy" "lambda_execute_policy" {
name = "DSK_LambdaExecute"
path = "/"
@@ -32,4 +32,4 @@ resource "aws_iam_policy" "policy" {
}
]
})
}
}