Menu

How CloudSlash isolates plugin environment variables and rolls back AWS changes in Go
📰

How CloudSlash isolates plugin environment variables and rolls back AWS changes in Go

DEV Community: aws·DrSkyle·about 5 hours ago
#tv2GiHvy
#devtoaws#devto#dev#plugin#environment
Long article (415 words) — no AI summary yet.
Reading 0:00
15s threshold

In the CloudSlash AWS demo, I used the terminal UI to find unused resources, trace their dependencies, and make changes to reduce waste. I checked the changes in the AWS console, then used CloudSlash to restore the deleted resources and undo the reductions.

The interesting part for me was how to keep AWS-specific logic out of the Go core without reducing the core to a launcher. CloudSlash still needs to show what depends on a resource and give you a way to review a change. The plugin handles what that change actually means in AWS.

Give each plugin its own environment

CloudSlash uses gRPC plugins, with the AWS-specific logic in the AWS plugin. That split is useful for more than keeping provider code out of the core. It also lets us scope the environment variables a plugin receives instead of treating the parent shell’s environment as shared configuration.

In Go, the distinction is easy to miss: if you leave exec.Cmd.Env nil, the child inherits the parent’s environment.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.