aws-amplify / aws-amplify/amplify-hosting

Build fails with Lambda Env variables & Branch autodetection

Open
#2,959 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

dguopq1y75tjd

### Region

us-east-1

### Amplify Hosting feature

Backend builds

### Describe the bug

When enabling "Branch autodetection", and making a lambda function have environment variable with Amplify CLI, the backend build on Amplify fails, and the error says `Parameters: [ENV VALUE KEY] must have values`

### Expected behavior

I expected the build process to ends up deploying Lambda function including env variables successfully.

### Reproduction steps

1. Enable "Branch autodetection"
2. Create new Lambda function with env variable by using Amplify CLI
3. Push to a git branch that matches the pattern
4. Backend build process would be failed

### Build Settings

```yaml
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the listed branch-autodetection steps, Lambda environment variable, and amplifyPush --simple command in the build settings. Trace how the backend build handles those environment variables and verify that a matching branch deploys the Lambda successfully without the missing-value error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
backend, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.