https://github.com/rosesecurity/go-localstack
Go client for managing LocalStack in testing environments
https://github.com/rosesecurity/go-localstack
aws infrastructure opentofu terraform testing
Last synced: 11 months ago
JSON representation
Go client for managing LocalStack in testing environments
- Host: GitHub
- URL: https://github.com/rosesecurity/go-localstack
- Owner: RoseSecurity
- Created: 2025-04-23T18:18:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-15T16:18:38.000Z (11 months ago)
- Last Synced: 2025-08-15T17:41:38.513Z (11 months ago)
- Topics: aws, infrastructure, opentofu, terraform, testing
- Language: Go
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- Security: SECURITY.md
Awesome Lists containing this project
README

Go client for managing LocalStack in testing environments.
## Example
```go
package test
import (
"context"
"testing"
"github.com/RoseSecurity/go-localstack/localstack"
"github.com/docker/docker/client"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
)
func TestTerraformWithLocalStack(t *testing.T) {
t.Parallel()
ctx := context.Background()
// Create a Docker client
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
assert.NoError(t, err)
defer func() { _ = cli.Close() }()
// Start LocalStack
runner, err := localstack.NewRunner(cli)
assert.NoError(t, err)
containerID, err := runner.Start(ctx)
assert.NoError(t, err)
assert.NotEmpty(t, containerID)
// Run Terratests
tfOptions := &terraform.Options{
TerraformDir: "../../examples/complete",
Upgrade: true,
VarFiles: []string{"fixtures.us-east-2.tfvars"},
}
defer terraform.Destroy(t, tfOptions)
terraform.InitAndApply(t, tfOptions)
}
```