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
* Add foundational feature matrix system for generation support
- Implement IsFeatureSupported() helper function for Cedar/Fir generation differences
- Add feature matrix tracking space capabilities across generations
- Include comprehensive test coverage with 14 test cases
- Cedar generation: supports all space features including shield spaces
- Fir generation: supports private spaces only, shield spaces unsupported
- Foundation for graceful handling of generation-specific feature differences
* Add generation support to apps with CNB validation and acceptance tests
* Refactor app generation to be computed from space
Major UX improvement: generation is now automatically determined
from the space the app is deployed to, rather than user-configured.
Changes:
- App 'generation' field is now computed-only (was optional)
- Apps in Fir spaces automatically get generation = 'fir'
- Apps in Cedar spaces (or no space) get generation = 'cedar'
Core Improvements:
- Fix CNB buildpack errors by conditionally querying based on generation
- Smart buildpack handling: skip traditional queries for Fir apps
- Automatic space generation detection via SpaceInfo API
- Better error prevention and more intuitive configuration
Test Improvements:
- Consolidate acceptance tests with single space approach
- Remove invalid validation tests (no longer user-configurable)
- Update test expectations for computed generation behavior
- Maintain comprehensive coverage for both generations
Documentation Updates:
- Update examples to show space-based generation approach
- Clarify that generation is computed from space deployment
- Improve migration guide with proper space-first workflow
- Update argument/attribute references for computed field
* Update docs/resources/app.md
Co-authored-by: Mars Hall <[email protected]>
Signed-off-by: Johnny Winn <[email protected]>
* Optimize app generation detection by using AppInfo response
- Use app.Generation.Name directly from AppInfo response instead of making separate SpaceInfo API call
- Remove unnecessary getSpaceGeneration() function and SpaceInfo API request
- Maintains same functionality with better performance and fewer API calls
- Addresses PR feedback about unnecessary API requests
---------
Signed-off-by: Johnny Winn <[email protected]>
Co-authored-by: Mars Hall <[email protected]>
# Apps deployed to Fir spaces automatically use Fir generation
51
+
resource "heroku_app" "fir_app" {
52
+
name = "my-fir-app"
53
+
region = "virginia"
54
+
space = heroku_space.fir_space.name
55
+
56
+
organization {
57
+
name = "my-org"
58
+
}
59
+
60
+
config_vars = {
61
+
FOOBAR = "baz"
62
+
}
63
+
64
+
# Note: buildpacks and stack are not supported for Fir generation
65
+
# Use project.toml in your application code instead
30
66
}
31
67
```
32
68
@@ -52,9 +88,12 @@ The following arguments are supported:
52
88
*`name` - (Required) The name of the application. In Heroku, this is also the
53
89
unique ID, so it must be unique and have a minimum of 3 characters.
54
90
*`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.
91
+
*`generation` - (Computed) Generation of the app platform. Automatically determined based on the space the app is deployed to. Apps in Fir generation spaces will be `fir`, all other apps will be `cedar`.
92
+
-`cedar`: Traditional platform supporting buildpacks, stack configuration, and internal routing
93
+
-`fir`: Next-generation platform with Cloud Native Buildpacks (CNB). Does not support `buildpacks`, `stack`, or `internal_routing` fields
94
+
*`stack` - (Optional) The application stack is what platform to run the application in. **Note**: Not supported for `fir` generation apps.
56
95
*`buildpacks` - (Optional) Buildpack names or URLs for the application.
57
-
Buildpacks configured externally won't be altered if this is not present.
96
+
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
97
*`config_vars`<sup>[1](#deleting-vars)</sup> - (Optional) Configuration variables for the application.
59
98
The config variables in this map are not the final set of configuration
60
99
variables, but rather variables you want present. That is, other
@@ -68,7 +107,7 @@ The following arguments are supported:
68
107
*`space` - (Optional) The name of a private space to create the app in.
69
108
*`internal_routing` - (Optional) If true, the application will be routable
70
109
only internally in a private space. This option is only available for apps
71
-
that also specify `space`.
110
+
that also specify `space`.**Note**: Not supported for `fir` generation apps.
72
111
*`organization` - (Optional) A block that can be specified once to define
73
112
Heroku Team settings for this app. The fields for this block are
74
113
documented below.
@@ -96,6 +135,7 @@ The following attributes are exported:
96
135
97
136
*`id` - The ID (UUID) of the app.
98
137
*`name` - The name of the app.
138
+
*`generation` - Generation of the app platform (cedar or fir). Automatically determined from the space the app is deployed to.
99
139
*`stack` - The application stack is what platform to run the application in.
100
140
*`space` - The private space the app should run in.
101
141
*`internal_routing` - Whether internal routing is enabled the private space app.
@@ -113,6 +153,71 @@ The following attributes are exported:
113
153
attribute `set_app_all_config_vars_in_state` is `false`.
114
154
*`uuid` - The unique UUID of the Heroku app. **NOTE:** Use this for `null_resource` triggers.
115
155
156
+
## Cloud Native Buildpacks (Fir Generation)
157
+
158
+
When apps are deployed to Fir generation spaces, they automatically use Cloud Native Buildpacks (CNB) instead of traditional Heroku buildpacks. This requires different configuration approaches:
159
+
160
+
### project.toml Configuration
161
+
162
+
Instead of specifying `buildpacks` in Terraform, create a `project.toml` file in your application root:
163
+
164
+
```toml
165
+
[build]
166
+
[[build.buildpacks]]
167
+
id = "heroku/nodejs"
168
+
169
+
[[build.buildpacks]]
170
+
id = "heroku/procfile"
171
+
172
+
[build.env]
173
+
BP_NODE_VERSION = "18.*"
174
+
```
175
+
176
+
### Migration from Cedar to Fir
177
+
178
+
When migrating from Cedar to Fir generation:
179
+
180
+
1.**Create Fir space**: Create a new space with `generation = "fir"`
181
+
2.**Remove incompatible fields**: Remove `buildpacks`, `stack`, and `internal_routing` from your Terraform configuration
182
+
3.**Add project.toml**: Create a `project.toml` file in your application code with buildpack configuration
183
+
4.**Update app space**: Change your app's `space` to use the Fir space
184
+
5.**Redeploy**: Deploy your application with the new configuration
185
+
186
+
```hcl-terraform
187
+
# Before (Cedar)
188
+
resource "heroku_space" "cedar_space" {
189
+
name = "my-space"
190
+
organization = "my-org"
191
+
region = "virginia"
192
+
}
193
+
194
+
resource "heroku_app" "example" {
195
+
name = "my-app"
196
+
region = "virginia"
197
+
space = heroku_space.cedar_space.name
198
+
199
+
buildpacks = ["heroku/nodejs"]
200
+
stack = "heroku-22"
201
+
}
202
+
203
+
# After (Fir)
204
+
resource "heroku_space" "fir_space" {
205
+
name = "my-space-fir"
206
+
organization = "my-org"
207
+
region = "virginia"
208
+
generation = "fir"
209
+
}
210
+
211
+
resource "heroku_app" "example" {
212
+
name = "my-app"
213
+
region = "virginia"
214
+
space = heroku_space.fir_space.name
215
+
216
+
# buildpacks and stack removed - configured via project.toml
217
+
# generation is automatically "fir" from the space
218
+
}
219
+
```
220
+
116
221
## Import
117
222
118
223
Apps can be imported using an existing app's `UUID` or name.
0 commit comments