Closed jar-b closed 2 months ago
Hello @jar-b,
Thanks for reaching out.
To delete the environment variables, you need to set the key to a space character and the value to an empty string. Here is the code that will delete the environment variables:
fmt.Println("Deleting environment variables...")
out1, err := client.UpdateApp(ctx, &lify.UpdateAppInput{
AppId: aws.String(appId),
EnvironmentVariables: map[string]string{
" ": "",
},
})
Thanks ~Bhavya
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Thank you for the clarification @bhavya2109sharma!
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
After creating an
amplify
app with environment variables configured, there is no way to remove them. TheEnvironmentVariables
field is amap[string]string
and I've attempted the following.map[string]string{}
nil
map[string]string{"": ""}
I'd expect either 1 or 2 to from above to remove the existing environment variables. 3 at one point worked with AWS SDK for Go V1 (see the Terraform AWS provider implementation and acceptance test), but even V1 now returns an error.
Regression Issue
Expected Behavior
The ability to remove configured environment variables.
Current Behavior
Not possible to remove environment variables once configured.
Reproduction Steps
Result:
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.23.1 darwin/arm64
Operating System and version
MacOS Sonoma 14.6.1