Skip to content

Commit 9aef411

Browse files
committed
fix: dev 환경에서 db url 읽기 권한 부여
1 parent a0e722a commit 9aef411

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

terraform/common/locals.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ locals {
3131
"arn:aws:iam::aws:policy/AmazonS3FullAccess",
3232
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
3333
]
34+
custom_inline_policies = {
35+
ssm_mysql_url_access = {
36+
name = "ssm-mysql-url-access"
37+
description = "Allow reading MySQL URL parameter from SSM"
38+
policy_document = {
39+
Version = "2012-10-17"
40+
Statement = [
41+
{
42+
Effect = "Allow"
43+
Action = ["ssm:GetParameter"]
44+
Resource = "arn:aws:ssm:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:parameter/dev/MYSQL_URL"
45+
}
46+
]
47+
}
48+
}
49+
}
3450
tags = {
3551
Purpose = "ECS EC2 Registration"
3652
}

0 commit comments

Comments
 (0)