Skip to content

Commit 82c0351

Browse files
committed
update serverless-user policy to use CDK
1 parent 2ed66e3 commit 82c0351

File tree

2 files changed

+15
-31
lines changed

2 files changed

+15
-31
lines changed

terraform/main.tf

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ module "serverless-user" {
1111
source = "silinternational/serverless-user/aws"
1212
version = "~> 0.4.2"
1313

14-
app_name = "${var.app_name}-${var.app_env}"
15-
aws_region_policy = "*"
16-
enable_api_gateway = true
17-
extra_policies = var.extra_policies
14+
app_name = "${var.app_name}-${var.app_env}"
15+
policy_override = jsonencode({
16+
Version = "2012-10-17"
17+
Statement = [
18+
{
19+
Effect = "Allow"
20+
Action = [
21+
"sts:AssumeRole",
22+
]
23+
Resource = [
24+
"arn:aws:iam::*:role/cdk-*"
25+
]
26+
}
27+
],
28+
})
1829
}
1930

2031
// Set up custom domain name for easier fail-over.

terraform/variables.tf

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,6 @@ variable "aws_secret_access_key" {
3434
description = "Secret access Key ID for user with permissions to create resources for serverless framework"
3535
}
3636

37-
variable "extra_policies" {
38-
type = list(string)
39-
description = "Optionally provide additional inline policies to attach to user"
40-
default = [
41-
<<EOT
42-
{
43-
"Version": "2012-10-17",
44-
"Statement": [
45-
{
46-
"Effect": "Allow",
47-
"Action": [
48-
"ec2:CreateTags",
49-
"ec2:DeleteTags",
50-
"iam:getRolePolicy",
51-
"logs:FilterLogEvents",
52-
"apigateway:UpdateRestApiPolicy"
53-
],
54-
"Resource": [
55-
"*"
56-
]
57-
}
58-
]
59-
}
60-
EOT
61-
]
62-
}
63-
6437
variable "api_key_table" {
6538
type = string
6639
description = "Override api key table name"

0 commit comments

Comments
 (0)