Improve Error Messages for Missing Environment Variables in AWS App Runner
- Dominant language
- No language data
- Stars
- 301
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
When deploying an App Runner service that depends on environment variables,
if any required environment variable is undefined, the deployment fails with an uninformative error message:
```
Resource handler returned message: "null"
```
I was sending the environment variable as undefined via CDK like this (with `!`).
Although the main cause was due to the poor way I wrote the CDK code,
it would be helpful if the error message was more explicit.
```TypeScript
const appRunner = new apprunner.Service(this, 'Service', {
source: apprunner.Source.fromEcr({
imageConfiguration: {
port: 3000,
environmentVariables: {
ENV_VAR: process.env.ENV_VAR!,
},
},
repository,
tag,
}),
})
```
Contributor guide
Research direction
Start with the TypeScript CDK example and reproduce an AWS App Runner deployment where a required environment variable is undefined. Compare the resulting null message with the requested explicit explanation; done means the deployment identifies the missing environment variable and guides the user to correct it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100