File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ provider "aws" {
9
9
skip_requesting_account_id = true
10
10
}
11
11
12
+ data "aws_caller_identity" "current" {}
13
+
12
14
# ###################################################
13
15
# Lambda Function (building locally, storing on S3,
14
16
# set allowed triggers, set policies)
@@ -52,15 +54,15 @@ module "lambda_function" {
52
54
allowed_triggers = {
53
55
APIGatewayAny = {
54
56
service = " apigateway"
55
- source_arn = " arn:aws:execute-api:eu-west-1:135367859851 :aqnku8akd0/*/*/*"
57
+ source_arn = " arn:aws:execute-api:eu-west-1:${ data . aws_caller_identity . current . account_id } :aqnku8akd0/*/*/*"
56
58
},
57
59
APIGatewayDevPost = {
58
60
service = " apigateway"
59
- source_arn = " arn:aws:execute-api:eu-west-1:135367859851 :aqnku8akd0/dev/POST/*"
61
+ source_arn = " arn:aws:execute-api:eu-west-1:${ data . aws_caller_identity . current . account_id } :aqnku8akd0/dev/POST/*"
60
62
},
61
63
OneRule = {
62
64
principal = " events.amazonaws.com"
63
- source_arn = " arn:aws:events:eu-west-1:135367859851 :rule/RunDaily"
65
+ source_arn = " arn:aws:events:eu-west-1:${ data . aws_caller_identity . current . account_id } :rule/RunDaily"
64
66
}
65
67
}
66
68
@@ -75,7 +77,7 @@ module "lambda_function" {
75
77
principals = {
76
78
account_principal = {
77
79
type = " AWS" ,
78
- identifiers = [" arn:aws:iam::135367859851 :root" ]
80
+ identifiers = [" arn:aws:iam::${ data . aws_caller_identity . current . account_id } :root" ]
79
81
}
80
82
}
81
83
condition = {
You can’t perform that action at this time.
0 commit comments