Last active
October 6, 2020 06:31
-
-
Save oguzhancagliyan/87009c57283679141b445a610e7a4eeb to your computer and use it in GitHub Desktop.
fixture for localstack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalStackFixture : IAsyncLifetime | |
{ | |
private readonly TestcontainersContainer _localStackContainer; | |
public LocalStackFixture() | |
{ | |
var localStackBuilder = new TestcontainersBuilder<TestcontainersContainer>() | |
.WithImage("localstack/localstack:0.10.9") | |
.WithCleanUp(true) | |
.WithEnvironment("DEFAULT_REGION", "eu-central-1") | |
.WithEnvironment("SERVICES", "dynamodb,sqs") | |
.WithEnvironment("DOCKER_HOST", "unix:///var/run/docker.sock") | |
.WithEnvironment("DEBUG", "1") | |
.WithPortBinding(4569, 4569) | |
.WithPortBinding(4564, 4564) | |
.WithPortBinding(4576,4576); | |
_localStackContainer = localStackBuilder.Build(); | |
} | |
public async Task InitializeAsync() | |
{ | |
await _localStackContainer.StartAsync(); | |
} | |
public async Task DisposeAsync() | |
{ | |
await _localStackContainer.StopAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment