Skip to content

Commit

Permalink
Merge pull request #89 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 2.3.1
  • Loading branch information
briskt authored Mar 14, 2022
2 parents 9c082d9 + 3601030 commit 9864788
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module "serverless-user" {
app_name = "mfa-api"
aws_region = var.aws_region
enable_api_gateway = true

extra_policies = [local.s3_policy, local.api_gateway_policy]
}

output "serverless-access-key-id" {
Expand All @@ -18,3 +20,39 @@ output "serverless-secret-access-key" {
value = module.serverless-user.aws_secret_access_key
sensitive = true
}


locals {
s3_policy = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : [
"s3:GetBucketPolicy",
],
"Resource" : [
"arn:aws:s3:::mfa-api-*-serverlessdeploymentbucket*",
]
},
]
})

api_gateway_policy = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : [
"apigateway:UpdateRestApiPolicy",
],
"Resource" : [
// dev-mfa-api
"arn:aws:apigateway:${var.aws_region}:*:restapis/7f2jflg37i",
// prod-mfa-api
"arn:aws:apigateway:${var.aws_region}:*:restapis/7hk96xvik6",
]
},
]
})
}

0 comments on commit 9864788

Please sign in to comment.