dynamodb

package module
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDisableTelemetry

func WithDisableTelemetry() testcontainers.CustomizeRequestOption

WithDisableTelemetry - DynamoDB local will not send any telemetry

func WithSharedDB

WithSharedDB allows container reuse between successive runs. Data will be persisted

Types

type DynamoDBContainer

type DynamoDBContainer struct {
	testcontainers.Container
}

DynamoDBContainer represents the DynamoDB container type used in the module

func Run

Run creates an instance of the DynamoDB container type

Example
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/testcontainers/testcontainers-go"
	tcdynamodb "github.com/testcontainers/testcontainers-go/modules/dynamodb"
)

func main() {
	// runDynamoDBContainer {
	ctx := context.Background()

	ctr, err := tcdynamodb.Run(ctx, "amazon/dynamodb-local:2.2.1")
	defer func() {
		if err := testcontainers.TerminateContainer(ctr); err != nil {
			log.Printf("failed to terminate container: %s", err)
		}
	}()
	if err != nil {
		log.Printf("failed to run dynamodb container: %s", err)
		return
	}
	// }

	state, err := ctr.State(ctx)
	if err != nil {
		log.Printf("failed to get container state: %s", err)
		return
	}

	fmt.Println(state.Running)

}
Output:
true

func (*DynamoDBContainer) ConnectionString

func (c *DynamoDBContainer) ConnectionString(ctx context.Context) (string, error)

ConnectionString returns DynamoDB local endpoint host and port in <host>:<port> format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL