Skip to content

Commit f3ade65

Browse files
committed
amplify config in terraform with proper syntax
1 parent 82a6afe commit f3ade65

1 file changed

Lines changed: 25 additions & 36 deletions

File tree

  • infrastructure/modules/amplify-frontend

infrastructure/modules/amplify-frontend/main.tf

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,31 @@ resource "aws_amplify_app" "frontend" {
1111
access_token = var.github_access_token
1212

1313
# Build specification
14-
build_spec = yamlencode({
15-
version = 1
16-
applications = [{
17-
frontend = {
18-
phases = {
19-
preBuild = {
20-
commands = [
21-
"echo 'Installing dependencies...'",
22-
"yarn install",
23-
"echo 'Building shared package...'",
24-
"yarn workspace shared build",
25-
]
26-
}
27-
build = {
28-
commands = [
29-
"echo 'Building frontend...'",
30-
"yarn workspace frontend build",
31-
]
32-
}
33-
}
34-
artifacts = {
35-
baseDirectory = "src/frontend/dist"
36-
files = ["**/*"]
37-
}
38-
cache = {
39-
paths = [
40-
"node_modules/**/*",
41-
"src/frontend/node_modules/**/*",
42-
"src/backend/node_modules/**/*",
43-
"src/shared/node_modules/**/*",
44-
]
45-
}
46-
}
47-
appRoot = "."
48-
}]
49-
})
14+
build_spec = <<-EOT
15+
version: 1
16+
frontend:
17+
phases:
18+
preBuild:
19+
commands:
20+
- echo 'Installing dependencies...'
21+
- yarn install --frozen-lockfile
22+
- echo 'Building shared package...'
23+
- yarn workspace shared build
24+
build:
25+
commands:
26+
- echo 'Building frontend...'
27+
- yarn workspace frontend build
28+
artifacts:
29+
baseDirectory: src/frontend/dist
30+
files:
31+
- '**/*'
32+
cache:
33+
paths:
34+
- node_modules/**/*
35+
- src/frontend/node_modules/**/*
36+
- src/backend/node_modules/**/*
37+
- src/shared/node_modules/**/*
38+
EOT
5039

5140
# Environment variables for the build
5241
environment_variables = merge(

0 commit comments

Comments
 (0)