You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Note: buildpacks and stack are not supported for Fir generation
52
+
# Use project.toml in your application code instead
30
53
}
31
54
```
32
55
@@ -52,9 +75,12 @@ The following arguments are supported:
52
75
*`name` - (Required) The name of the application. In Heroku, this is also the
53
76
unique ID, so it must be unique and have a minimum of 3 characters.
54
77
*`region` - (Required) The region that the app should be deployed in.
55
-
*`stack` - (Optional) The application stack is what platform to run the application in.
78
+
*`generation` - (Optional) Generation of the app platform. Valid values are `cedar` and `fir`. Defaults to `cedar` for backward compatibility. **ForceNew**.
79
+
-**Cedar**: Traditional platform supporting buildpacks, stack configuration, and internal routing
80
+
-**Fir**: Next-generation platform with Cloud Native Buildpacks (CNB). Does not support `buildpacks`, `stack`, or `internal_routing` fields
81
+
*`stack` - (Optional) The application stack is what platform to run the application in. **Note**: Not supported for `fir` generation apps.
56
82
*`buildpacks` - (Optional) Buildpack names or URLs for the application.
57
-
Buildpacks configured externally won't be altered if this is not present.
83
+
Buildpacks configured externally won't be altered if this is not present.**Note**: Not supported for `fir` generation apps. Use project.toml for Cloud Native Buildpacks configuration instead.
58
84
*`config_vars`<sup>[1](#deleting-vars)</sup> - (Optional) Configuration variables for the application.
59
85
The config variables in this map are not the final set of configuration
60
86
variables, but rather variables you want present. That is, other
@@ -68,7 +94,7 @@ The following arguments are supported:
68
94
*`space` - (Optional) The name of a private space to create the app in.
69
95
*`internal_routing` - (Optional) If true, the application will be routable
70
96
only internally in a private space. This option is only available for apps
71
-
that also specify `space`.
97
+
that also specify `space`.**Note**: Not supported for `fir` generation apps.
72
98
*`organization` - (Optional) A block that can be specified once to define
73
99
Heroku Team settings for this app. The fields for this block are
74
100
documented below.
@@ -96,6 +122,7 @@ The following attributes are exported:
96
122
97
123
*`id` - The ID (UUID) of the app.
98
124
*`name` - The name of the app.
125
+
*`generation` - Generation of the app platform (cedar or fir). Defaults to cedar.
99
126
*`stack` - The application stack is what platform to run the application in.
100
127
*`space` - The private space the app should run in.
101
128
*`internal_routing` - Whether internal routing is enabled the private space app.
@@ -113,6 +140,55 @@ The following attributes are exported:
113
140
attribute `set_app_all_config_vars_in_state` is `false`.
114
141
*`uuid` - The unique UUID of the Heroku app. **NOTE:** Use this for `null_resource` triggers.
115
142
143
+
## Cloud Native Buildpacks (Fir Generation)
144
+
145
+
When using the Fir generation (`generation = "fir"`), applications use Cloud Native Buildpacks (CNB) instead of traditional Heroku buildpacks. This requires different configuration approaches:
146
+
147
+
### project.toml Configuration
148
+
149
+
Instead of specifying `buildpacks` in Terraform, create a `project.toml` file in your application root:
150
+
151
+
```toml
152
+
[build]
153
+
[[build.buildpacks]]
154
+
id = "heroku/nodejs"
155
+
156
+
[[build.buildpacks]]
157
+
id = "heroku/procfile"
158
+
159
+
[build.env]
160
+
BP_NODE_VERSION = "18.*"
161
+
```
162
+
163
+
### Migration from Cedar to Fir
164
+
165
+
When migrating from Cedar to Fir generation:
166
+
167
+
1.**Remove incompatible fields**: Remove `buildpacks`, `stack`, and `internal_routing` from your Terraform configuration
168
+
2.**Add project.toml**: Create a `project.toml` file in your application code with buildpack configuration
169
+
3.**Update generation**: Set `generation = "fir"` in your app resource
170
+
4.**Redeploy**: Deploy your application with the new configuration
171
+
172
+
```hcl-terraform
173
+
# Before (Cedar)
174
+
resource "heroku_app" "example" {
175
+
name = "my-app"
176
+
region = "us"
177
+
178
+
buildpacks = ["heroku/nodejs"]
179
+
stack = "heroku-22"
180
+
}
181
+
182
+
# After (Fir)
183
+
resource "heroku_app" "example" {
184
+
name = "my-app"
185
+
region = "us"
186
+
generation = "fir"
187
+
188
+
# buildpacks and stack removed - configured via project.toml
189
+
}
190
+
```
191
+
116
192
## Import
117
193
118
194
Apps can be imported using an existing app's `UUID` or name.
returnfmt.Errorf("buildpacks are not supported for %s generation apps. Use Cloud Native Buildpacks and configure via project.toml instead", generationStr)
0 commit comments