We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02dc465 commit 9b3f038Copy full SHA for 9b3f038
iam.tf
@@ -1,4 +1,6 @@
1
2
+data "aws_caller_identity" "current" {}
3
+
4
resource "aws_iam_role" "this" {
5
name = "lambda-${var.name}"
6
assume_role_policy = jsonencode(
@@ -10,7 +12,12 @@ resource "aws_iam_role" "this" {
10
12
Principal = {
11
13
Service = "lambda.amazonaws.com"
14
},
- Effect = "Allow"
15
+ Effect = "Allow",
16
+ Condition = {
17
+ StringEquals = {
18
+ "aws:SourceAccount" = data.aws_caller_identity.current.account_id
19
+ }
20
21
}
22
]
23
0 commit comments