generated from NHSDigital/nhs-notify-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathamplify_app.tf
More file actions
43 lines (36 loc) · 1.8 KB
/
amplify_app.tf
File metadata and controls
43 lines (36 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resource "aws_amplify_app" "main" {
name = local.csi
repository = "https://github.com/NHSDigital/nhs-notify-web-template-management"
access_token = data.aws_ssm_parameter.github_pat_ssm_param_name.value
iam_service_role_arn = aws_iam_role.amplify.arn
enable_auto_branch_creation = false
enable_branch_auto_deletion = true
enable_branch_auto_build = var.enable_amplify_branch_auto_build
platform = "WEB_COMPUTE"
enable_basic_auth = var.enable_amplify_basic_auth ? true : false
basic_auth_credentials = var.enable_amplify_basic_auth ? base64encode("${local.csi}:${aws_ssm_parameter.amplify_password[0].value}") : null
dynamic "auto_branch_creation_config" {
for_each = var.enable_amplify_basic_auth ? [1] : []
content {
basic_auth_credentials = base64encode("${local.csi}:${aws_ssm_parameter.amplify_password[0].value}")
enable_basic_auth = true
}
}
auto_branch_creation_patterns = [
"*",
"*/**"
]
environment_variables = {
ACCOUNT_ID = var.aws_account_id
AMPLIFY_MONOREPO_APP_ROOT = "frontend"
API_BASE_URL = module.backend_api.api_base_url
CSRF_SECRET = aws_ssm_parameter.csrf_secret.value
NEXT_PUBLIC_ENABLE_LETTERS = var.enable_letters
NEXT_PUBLIC_PROMPT_SECONDS_BEFORE_LOGOUT = 120
NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS = 900
NOTIFY_ENVIRONMENT = var.environment
NOTIFY_GROUP = var.group
USER_POOL_CLIENT_ID = jsondecode(aws_ssm_parameter.cognito_config.value)["USER_POOL_CLIENT_ID"]
USER_POOL_ID = jsondecode(aws_ssm_parameter.cognito_config.value)["USER_POOL_ID"]
}
}