aws

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 30 Imported by: 0

README

scaffold toolbox aws

MiniStack-backed local AWS service for scaffold. It starts a single local AWS-compatible endpoint on port 4566, exposes SDK configuration helpers, and can create common resources such as S3 buckets, SQS queues, and SNS topics. Services can be picked per your needs and configured to work with your setup.

Install

go get github.com/hlfshell/scaffold-toolbox/aws
import "github.com/hlfshell/scaffold-toolbox/aws"

Example

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithS3("documents"),
	aws.WithSQS("jobs"),
	aws.WithSNS("events"),
)
if err != nil {
	return err
}

stack := scaffold.NewStack("app", scaffold.WithServices(cloud))

Services

Use typed With<Service> options instead of passing MiniStack service flags directly:

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithS3("documents", "uploads"),
	aws.WithDynamoDB(aws.DynamoDBTable{Name: "items"}),
	aws.WithSecretsManager(aws.Secret{Name: "api-key", Value: "secret"}),
	aws.WithSSM(aws.Parameter{Name: "/app/url", Value: "http://localhost"}),
	aws.WithKinesis(aws.KinesisStream{Name: "events"}),
	aws.WithEventBridge(aws.EventBus{Name: "app"}),
	aws.WithLambda(),
	aws.WithECS(),
)

Resource-aware options both enable the MiniStack service and create the requested resources after MiniStack is ready. Today that includes:

  • WithS3 for buckets.
  • WithSQS for queues.
  • WithSNS for topics.
  • WithDynamoDB for simple string-key tables.
  • WithSecretsManager for string secrets.
  • WithSSM for parameters.
  • WithKinesis for streams.
  • WithEventBridge for event buses.

For lower-level or newly added MiniStack services, WithServices("service") is still available as an escape hatch.

To start every service known to this toolbox module:

cloud, err := aws.NewStack("cloud", "latest", aws.WithAll())

Use WithDockerSocket when MiniStack needs to create real backing containers through the host Docker daemon, such as RDS, ElastiCache, ECS, or Docker-backed Lambda. Use WithDockerNetwork("network-name") when those backing containers need to share a Docker network with other scaffold services.

WithEnv passes MiniStack configuration flags through directly, such as PERSIST_STATE, service-specific dataplane flags, or logging options.

Application connection config

Use HostConnection or HostEnv for applications running on your machine. Use ContainerConnection or ContainerEnv for applications running in another container on the same Docker network as MiniStack.

hostEnv := cloud.HostEnv()
fmt.Println(hostEnv["AWS_ENDPOINT_URL"])

containerEnv := cloud.ContainerEnv()
fmt.Println(containerEnv["AWS_ENDPOINT_URL"])

HostEnv points at the published localhost port, such as http://127.0.0.1:32781. ContainerEnv points at the Docker-network name, such as http://cloud-ministack:4566. Container access requires a shared user-defined Docker network; using the AWS stack inside a scaffold stack with scaffold.WithSharedNetwork() handles that for scaffold services.

Both env helpers include:

  • AWS_ENDPOINT_URL
  • AWS_REGION
  • AWS_DEFAULT_REGION
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_S3_FORCE_PATH_STYLE=true
  • S3_FORCE_PATH_STYLE=true

Queue URLs, topic ARNs, and registry values are included after those resources exist.

ECS containers

MiniStack's ECS support runs tasks as real Docker containers through the host Docker daemon. The AWS toolbox builds on that with typed helpers for clusters, services, one-shot tasks, and local images.

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithECSCluster("app"),
	aws.WithECSService(aws.ECSService{
		Name:       "api",
		Cluster:    "app",
		Family:     "api",
		LaunchType: aws.ECSLaunchTypeFargate,
		Containers: []aws.ECSContainer{{
			Name:       "api",
			Dockerfile: "./Dockerfile",
			Image:      "app/api:dev",
			Ports: []aws.ECSPort{{
				ContainerPort: 8080,
			}},
		}},
	}),
)

Dockerfile and LocalImage containers automatically enable a local Docker registry. The image is built or tagged, pushed to that registry, and the ECS task definition uses the host-reachable registry image because MiniStack asks the host Docker daemon to run the task.

Use RegistryAddress, RegistryImage, RegistryDockerConfigJSON, PushImage, and BuildAndPushImage when you want to prepare images from your own commands after the stack is running.

Fargate is represented through ECS task definition compatibility and launch type. Locally, MiniStack still runs the container through Docker. EC2 in MiniStack is useful for VPC, subnet, security group, and instance metadata; it does not start real virtual machines.

Common examples

S3 bucket and objects

WithS3 creates buckets after MiniStack is ready. Use the returned S3 client exactly like a normal AWS SDK client.

ctx := context.Background()

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithS3("documents"),
)
if err != nil {
	return err
}
defer cloud.Cleanup(ctx)

if err := cloud.Create(ctx); err != nil {
	return err
}

s3Client, err := cloud.S3Client(ctx)
if err != nil {
	return err
}

_, err = s3Client.PutObject(ctx, &s3.PutObjectInput{
	Bucket: awsSDK.String("documents"),
	Key:    awsSDK.String("notes/hello.txt"),
	Body:   strings.NewReader("hello from scaffold"),
})
if err != nil {
	return err
}

object, err := s3Client.GetObject(ctx, &s3.GetObjectInput{
	Bucket: awsSDK.String("documents"),
	Key:    awsSDK.String("notes/hello.txt"),
})
if err != nil {
	return err
}
defer object.Body.Close()

body, err := io.ReadAll(object.Body)
if err != nil {
	return err
}
fmt.Println(string(body))

The imports for that example use aliases to keep the toolbox package and AWS SDK package distinct:

import (
	"context"
	"fmt"
	"io"
	"strings"

	awsSDK "github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/service/s3"
	"github.com/hlfshell/scaffold-toolbox/aws"
)
ECS service from a Dockerfile

Use WithECSService for an API or worker that should stay running. A container with Dockerfile automatically enables the local registry, builds the image, pushes it, and registers the pushed image in the task definition.

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithECSCluster("app"),
	aws.WithECSService(aws.ECSService{
		Name:         "api",
		Cluster:      "app",
		Family:       "api",
		DesiredCount: 1,
		LaunchType:   aws.ECSLaunchTypeEC2,
		Containers: []aws.ECSContainer{{
			Name:       "api",
			Dockerfile: "./api/Dockerfile",
			Image:      "app/api:dev",
			Ports: []aws.ECSPort{{
				ContainerPort: 8080,
			}},
		}},
	}),
)

If you already built the image locally, use LocalImage instead:

aws.WithECSRunTask(aws.ECSRunTask{
	Name:    "job",
	Cluster: "app",
	Family:  "job",
	Containers: []aws.ECSContainer{{
		Name:       "job",
		LocalImage: "app/job:local",
		Image:      "app/job:dev",
	}},
})
Fargate-style task

For Fargate-shaped workflows, set the launch type to ECSLaunchTypeFargate. MiniStack still runs the task as a local Docker container, but the registered task definition uses Fargate compatibility.

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithECSCluster("jobs"),
	aws.WithECSRunTask(aws.ECSRunTask{
		Name:       "thumbnailer",
		Cluster:    "jobs",
		Family:     "thumbnailer",
		LaunchType: aws.ECSLaunchTypeFargate,
		Containers: []aws.ECSContainer{{
			Name:       "thumbnailer",
			Dockerfile: "./workers/thumbnailer/Dockerfile",
			Image:      "jobs/thumbnailer:dev",
			Env: map[string]string{
				"INPUT_BUCKET":  "uploads",
				"OUTPUT_BUCKET": "thumbs",
			},
		}},
	}),
)
Lambda container image

MiniStack can run Lambda functions from Docker images using PackageType: Image. The image should be a Lambda-compatible container image, such as one built from an AWS Lambda base image or one that includes the Lambda runtime interface client.

ctx := context.Background()

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithLambda(),
	aws.WithDockerfileImage("./lambda/Dockerfile", "functions/echo:dev"),
)
if err != nil {
	return err
}
defer cloud.Cleanup(ctx)

if err := cloud.Create(ctx); err != nil {
	return err
}

lambdaClient, err := cloud.LambdaClient(ctx)
if err != nil {
	return err
}

_, err = lambdaClient.CreateFunction(ctx, &lambda.CreateFunctionInput{
	FunctionName: awsSDK.String("echo"),
	Role:         awsSDK.String("arn:aws:iam::000000000000:role/lambda"),
	PackageType:  lambdatypes.PackageTypeImage,
	Code: &lambdatypes.FunctionCode{
		ImageUri: awsSDK.String(cloud.RegistryImage("functions/echo:dev")),
	},
})
if err != nil {
	return err
}

result, err := lambdaClient.Invoke(ctx, &lambda.InvokeInput{
	FunctionName: awsSDK.String("echo"),
	Payload:      []byte(`{"message":"hello"}`),
})
if err != nil {
	return err
}
fmt.Println(string(result.Payload))

Add these imports for the Lambda example:

import (
	"context"
	"fmt"

	awsSDK "github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/service/lambda"
	lambdatypes "github.com/aws/aws-sdk-go-v2/service/lambda/types"
	"github.com/hlfshell/scaffold-toolbox/aws"
)
SQS and SNS

Resource-aware options store useful identifiers after startup. QueueURL and TopicARN make it easy to wire tests or app config.

cloud, err := aws.NewStack("cloud", "latest",
	aws.WithSQS("jobs"),
	aws.WithSNS("events"),
)
if err != nil {
	return err
}
if err := cloud.Create(ctx); err != nil {
	return err
}

sqsClient, err := cloud.SQSClient(ctx)
if err != nil {
	return err
}
queueURL, ok := cloud.QueueURL("jobs")
if !ok {
	return fmt.Errorf("queue was not created")
}

_, err = sqsClient.SendMessage(ctx, &sqs.SendMessageInput{
	QueueUrl:    awsSDK.String(queueURL),
	MessageBody: awsSDK.String("work item"),
})
if err != nil {
	return err
}

Documentation

Index

Constants

View Source
const (
	// ECSLaunchTypeEC2 runs the task through MiniStack's Docker-backed EC2 mode.
	ECSLaunchTypeEC2 = "EC2"
	// ECSLaunchTypeFargate marks the task as Fargate-compatible. MiniStack
	// still runs the container through the host Docker daemon.
	ECSLaunchTypeFargate = "FARGATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionConfig

type ConnectionConfig struct {
	EndpointURL      string
	Region           string
	AccessKeyID      string
	SecretAccessKey  string
	S3ForcePathStyle bool
}

ConnectionConfig describes how an application should connect to the MiniStack AWS endpoint.

func (ConnectionConfig) Env

func (c ConnectionConfig) Env() map[string]string

Env returns common AWS environment variables for SDKs and application frameworks. Path-style keys are included because S3-compatible local endpoints usually cannot serve virtual-hosted bucket names.

type DynamoDBTable

type DynamoDBTable struct {
	Name         string
	PartitionKey string
	SortKey      string
}

DynamoDBTable describes a simple DynamoDB table to create. Keys are string attributes; PartitionKey defaults to "id" when blank.

type ECSContainer

type ECSContainer struct {
	Name       string
	Image      string
	LocalImage string
	Dockerfile string
	Command    []string
	Env        map[string]string
	Ports      []ECSPort
	CPU        int32
	Memory     int32
	Essential  *bool
}

ECSContainer describes one container in an ECS task definition. Image may point at a public image. LocalImage or Dockerfile pushes an image into the local registry and uses that pushed image in the task definition.

type ECSPort

type ECSPort struct {
	ContainerPort int32
	HostPort      int32
	Protocol      string
}

ECSPort describes a container port mapping for an ECS container.

type ECSRunTask

type ECSRunTask struct {
	Name       string
	Cluster    string
	Family     string
	LaunchType string
	Count      int32
	CPU        string
	Memory     string
	Containers []ECSContainer
}

ECSRunTask describes an ECS task to register and run once during stack startup.

type ECSService

type ECSService struct {
	Name         string
	Cluster      string
	Family       string
	LaunchType   string
	DesiredCount int32
	CPU          string
	Memory       string
	Containers   []ECSContainer
}

ECSService describes a long-running ECS service backed by MiniStack's Docker execution.

type EventBus

type EventBus struct {
	Name string
}

EventBus describes an EventBridge event bus to create.

type Image

type Image struct {
	LocalImage string
	Dockerfile string
	ECSImage   string
}

Image describes a container image that should be made available through the local registry before MiniStack ECS resources are created.

type KinesisStream

type KinesisStream struct {
	Name       string
	ShardCount int32
}

KinesisStream describes a Kinesis stream to create.

type Option

type Option func(*Stack)

Option configures the AWS stack before it starts.

func WithACM

func WithACM() Option

WithACM enables ACM.

func WithAPIGateway

func WithAPIGateway() Option

WithAPIGateway enables API Gateway v1.

func WithAPIGatewayV2

func WithAPIGatewayV2() Option

WithAPIGatewayV2 enables API Gateway v2.

func WithAccount

func WithAccount() Option

WithAccount enables Account.

func WithAll

func WithAll() Option

WithAll enables every MiniStack service known to this toolbox module.

func WithAppConfig

func WithAppConfig() Option

WithAppConfig enables AppConfig.

func WithAppSync

func WithAppSync() Option

WithAppSync enables AppSync.

func WithAthena

func WithAthena() Option

WithAthena enables Athena.

func WithAutoScaling

func WithAutoScaling() Option

WithAutoScaling enables Auto Scaling.

func WithBackup

func WithBackup() Option

WithBackup enables Backup.

func WithBatch

func WithBatch() Option

WithBatch enables Batch.

func WithCloudFormation

func WithCloudFormation() Option

WithCloudFormation enables CloudFormation.

func WithCloudFront

func WithCloudFront() Option

WithCloudFront enables CloudFront.

func WithCloudFrontKeyValueStore

func WithCloudFrontKeyValueStore() Option

WithCloudFrontKeyValueStore enables the CloudFront KeyValueStore data plane.

func WithCloudWatch

func WithCloudWatch() Option

WithCloudWatch enables CloudWatch metrics and alarms.

func WithCloudWatchLogs

func WithCloudWatchLogs() Option

WithCloudWatchLogs enables CloudWatch Logs.

func WithCodeBuild

func WithCodeBuild() Option

WithCodeBuild enables CodeBuild.

func WithCognitoIdentityPools

func WithCognitoIdentityPools() Option

WithCognitoIdentityPools enables Cognito identity pools.

func WithCognitoUserPools

func WithCognitoUserPools() Option

WithCognitoUserPools enables Cognito user pools.

func WithCredentials

func WithCredentials(accessKey string, secretKey string) Option

WithCredentials sets the fake credentials used by generated SDK clients. MiniStack accepts dummy credentials, so these are for application config compatibility.

func WithDockerNetwork

func WithDockerNetwork(network string) Option

WithDockerNetwork sets the Docker network MiniStack should use for container-backed AWS services. It also mounts the Docker socket because MiniStack needs Docker access to create those backing services.

func WithDockerSocket

func WithDockerSocket() Option

WithDockerSocket mounts the local Docker socket into MiniStack. This is needed for MiniStack features that create real backing containers, such as RDS, ElastiCache, ECS, and Lambda Docker execution.

func WithDockerfileImage

func WithDockerfileImage(dockerfile string, ecsImage string) Option

WithDockerfileImage builds a Dockerfile and pushes the result into the local registry before ECS resources are created.

func WithDynamoDB

func WithDynamoDB(tables ...DynamoDBTable) Option

WithDynamoDB enables DynamoDB and optionally creates simple string-key tables after MiniStack starts.

func WithEC2

func WithEC2() Option

WithEC2 enables EC2.

func WithECR

func WithECR() Option

WithECR enables ECR.

func WithECS

func WithECS() Option

WithECS enables ECS. Use WithDockerSocket or WithDockerNetwork when tasks need MiniStack to create Docker containers.

func WithECSCluster

func WithECSCluster(name string) Option

WithECSCluster creates an ECS cluster after MiniStack starts.

func WithECSRunTask

func WithECSRunTask(task ECSRunTask) Option

WithECSRunTask registers a task definition and runs it once during stack startup. Set LaunchType to ECSLaunchTypeFargate to model a Fargate task.

func WithECSService

func WithECSService(service ECSService) Option

WithECSService registers a task definition and creates a long-running ECS service. Set LaunchType to ECSLaunchTypeFargate to model a Fargate task.

func WithEFS

func WithEFS() Option

WithEFS enables EFS.

func WithEKS

func WithEKS() Option

WithEKS enables EKS.

func WithELBv2

func WithELBv2() Option

WithELBv2 enables ALB / ELBv2.

func WithEMR

func WithEMR() Option

WithEMR enables EMR.

func WithElastiCache

func WithElastiCache() Option

WithElastiCache enables ElastiCache. Use WithDockerSocket or WithDockerNetwork when cache dataplanes should be backed by real containers.

func WithEnv

func WithEnv(env map[string]string) Option

WithEnv adds MiniStack environment variables. Use this for service flags such as persistence, debug logging, or real sidecar-backed dataplanes.

func WithEventBridge

func WithEventBridge(buses ...EventBus) Option

WithEventBridge enables EventBridge and optionally creates event buses after MiniStack starts.

func WithEventBridgeScheduler

func WithEventBridgeScheduler() Option

WithEventBridgeScheduler enables EventBridge Scheduler.

func WithFirehose

func WithFirehose() Option

WithFirehose enables Kinesis Data Firehose.

func WithGlue

func WithGlue() Option

WithGlue enables Glue.

func WithIAM

func WithIAM() Option

WithIAM enables IAM.

func WithIMDS

func WithIMDS() Option

WithIMDS enables the EC2 instance metadata service.

func WithKMS

func WithKMS() Option

WithKMS enables KMS.

func WithKinesis

func WithKinesis(streams ...KinesisStream) Option

WithKinesis enables Kinesis and optionally creates streams after MiniStack starts.

func WithLambda

func WithLambda() Option

WithLambda enables Lambda.

func WithLocalImage

func WithLocalImage(localImage string, ecsImage string) Option

WithLocalImage tags and pushes an existing local Docker image into the local registry before ECS resources are created.

func WithOpenSearch

func WithOpenSearch() Option

WithOpenSearch enables OpenSearch.

func WithOrganizations

func WithOrganizations() Option

WithOrganizations enables Organizations.

func WithPipes

func WithPipes() Option

WithPipes enables EventBridge Pipes.

func WithRDS

func WithRDS() Option

WithRDS enables RDS. Use WithDockerSocket or WithDockerNetwork when database dataplanes should be backed by real containers.

func WithRDSData

func WithRDSData() Option

WithRDSData enables the RDS Data API.

func WithRegion

func WithRegion(region string) Option

WithRegion sets the AWS region used by generated SDK clients.

func WithRegistry

func WithRegistry(hostPort string) Option

WithRegistry starts a local Docker registry for ECS task images. hostPort may be blank to let Docker assign a free host port.

func WithRegistryImage

func WithRegistryImage(image string, tag string) Option

WithRegistryImage changes the local registry container image.

func WithResourceGroupsTagging

func WithResourceGroupsTagging() Option

WithResourceGroupsTagging enables the Resource Groups Tagging API.

func WithRoute53

func WithRoute53() Option

WithRoute53 enables Route 53.

func WithS3

func WithS3(buckets ...string) Option

WithS3 enables S3 and optionally creates buckets after MiniStack starts.

func WithS3Bucket

func WithS3Bucket(bucket string) Option

WithS3Bucket registers an S3 bucket to create after MiniStack is ready.

func WithS3Files

func WithS3Files() Option

WithS3Files enables the S3 Files compatibility service.

func WithSES

func WithSES() Option

WithSES enables SES.

func WithSNS

func WithSNS(topics ...string) Option

WithSNS enables SNS and optionally creates topics after MiniStack starts.

func WithSNSTopic

func WithSNSTopic(topic string) Option

WithSNSTopic registers an SNS topic to create after MiniStack is ready.

func WithSQS

func WithSQS(queues ...string) Option

WithSQS enables SQS and optionally creates queues after MiniStack starts.

func WithSQSQueue

func WithSQSQueue(queue string) Option

WithSQSQueue registers an SQS queue to create after MiniStack is ready.

func WithSSM

func WithSSM(parameters ...Parameter) Option

WithSSM enables SSM and optionally creates parameters after MiniStack starts.

func WithSTS

func WithSTS() Option

WithSTS enables STS.

func WithSecretsManager

func WithSecretsManager(secrets ...Secret) Option

WithSecretsManager enables Secrets Manager and optionally creates string secrets after MiniStack starts.

func WithServiceDiscovery

func WithServiceDiscovery() Option

WithServiceDiscovery enables Cloud Map service discovery.

func WithServices

func WithServices(services ...string) Option

WithServices enables raw MiniStack service names. Prefer typed With<Service> helpers when one exists; keep this for escape hatches and newly added MiniStack services.

func WithStepFunctions

func WithStepFunctions() Option

WithStepFunctions enables Step Functions.

func WithTransfer

func WithTransfer() Option

WithTransfer enables Transfer Family.

func WithWAFClassic

func WithWAFClassic() Option

WithWAFClassic enables WAF Classic.

func WithWAFv2

func WithWAFv2() Option

WithWAFv2 enables WAFv2.

type Parameter

type Parameter struct {
	Name  string
	Value string
	Type  string
}

Parameter describes an SSM parameter to put.

type PushedImage

type PushedImage struct {
	HostImage string
}

PushedImage describes an image pushed to the local registry. HostImage is the image reference ECS task definitions should use because MiniStack asks the host Docker daemon to run ECS containers.

type Secret

type Secret struct {
	Name  string
	Value string
}

Secret describes a Secrets Manager string secret to create.

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Stack is a MiniStack-backed AWS development stack. It starts MiniStack, then creates the requested local AWS resources so application code can use normal AWS SDK clients without touching real cloud accounts.

func NewStack

func NewStack(name string, tag string, options ...Option) (*Stack, error)

NewStack creates a MiniStack-backed AWS service. MiniStack provides a single local AWS endpoint on port 4566; options define which resources Scaffold should create after the emulator is ready.

func (*Stack) AWSConfig

func (s *Stack) AWSConfig(ctx context.Context) (awssdk.Config, error)

AWSConfig returns an AWS SDK v2 config routed to MiniStack.

func (*Stack) BuildAndPushImage

func (s *Stack) BuildAndPushImage(ctx context.Context, dockerfile string, ecsImage string) (PushedImage, string, error)

BuildAndPushImage builds a Dockerfile, pushes the result to the registry, and returns the image reference ECS task definitions should use.

func (*Stack) Cleanup

func (s *Stack) Cleanup(ctx context.Context) error

Cleanup removes the MiniStack container.

func (*Stack) ContainerConnection

func (s *Stack) ContainerConnection() ConnectionConfig

ContainerConnection returns connection settings for applications running in another container on the same Docker network as MiniStack.

func (*Stack) ContainerEnv

func (s *Stack) ContainerEnv() map[string]string

ContainerEnv returns environment variables for applications running in another container on the same Docker network as MiniStack.

func (*Stack) Create

func (s *Stack) Create(ctx context.Context) error

Create starts MiniStack and creates the configured AWS resources.

func (*Stack) DynamoDBClient

func (s *Stack) DynamoDBClient(ctx context.Context) (*dynamodb.Client, error)

DynamoDBClient returns a DynamoDB client configured for MiniStack.

func (*Stack) ECSClient

func (s *Stack) ECSClient(ctx context.Context) (*ecs.Client, error)

ECSClient returns an ECS client configured for MiniStack.

func (*Stack) EndpointURL

func (s *Stack) EndpointURL() string

EndpointURL returns the local MiniStack edge endpoint.

func (*Stack) Endpoints

func (s *Stack) Endpoints() map[string]string

func (*Stack) Env

func (s *Stack) Env() map[string]string

func (*Stack) EventBridgeClient

func (s *Stack) EventBridgeClient(ctx context.Context) (*eventbridge.Client, error)

EventBridgeClient returns an EventBridge client configured for MiniStack.

func (*Stack) HostConnection

func (s *Stack) HostConnection() ConnectionConfig

HostConnection returns connection settings for applications running on the host machine.

func (*Stack) HostEnv

func (s *Stack) HostEnv() map[string]string

HostEnv returns environment variables for applications running on the host machine.

func (*Stack) InternalEndpointURL

func (s *Stack) InternalEndpointURL() string

InternalEndpointURL returns the Docker-network endpoint for MiniStack. It is reachable by sibling containers only when they share a user-defined Docker network with this stack.

func (*Stack) KinesisClient

func (s *Stack) KinesisClient(ctx context.Context) (*kinesis.Client, error)

KinesisClient returns a Kinesis client configured for MiniStack.

func (*Stack) LambdaClient

func (s *Stack) LambdaClient(ctx context.Context) (*lambda.Client, error)

LambdaClient returns a Lambda client configured for MiniStack.

func (*Stack) Logs

func (s *Stack) Logs(ctx context.Context) (logs.LogStreams, error)

Logs returns MiniStack logs keyed by the AWS stack name.

func (*Stack) Name

func (s *Stack) Name() string

func (*Stack) PushImage

func (s *Stack) PushImage(ctx context.Context, localImage string, ecsImage string) (PushedImage, error)

PushImage tags a local image, pushes it to the registry, and returns the image reference ECS task definitions should use.

func (*Stack) QueueURL

func (s *Stack) QueueURL(name string) (string, bool)

QueueURL returns the URL for a queue created by the stack.

func (*Stack) RegistryAddress

func (s *Stack) RegistryAddress() string

RegistryAddress returns the host-reachable registry address.

func (*Stack) RegistryDockerConfigJSON

func (s *Stack) RegistryDockerConfigJSON() ([]byte, error)

RegistryDockerConfigJSON returns a Docker config.json payload for the host-reachable registry. The default registry has no authentication.

func (*Stack) RegistryEnv

func (s *Stack) RegistryEnv() map[string]string

RegistryEnv returns environment variables useful for CLI commands that build, tag, push, or register ECS task images.

func (*Stack) RegistryImage

func (s *Stack) RegistryImage(image string) string

RegistryImage returns the image reference ECS task definitions should use.

func (*Stack) S3Client

func (s *Stack) S3Client(ctx context.Context) (*s3.Client, error)

S3Client returns an S3 client configured for MiniStack.

func (*Stack) SNSClient

func (s *Stack) SNSClient(ctx context.Context) (*sns.Client, error)

SNSClient returns an SNS client configured for MiniStack.

func (*Stack) SQSClient

func (s *Stack) SQSClient(ctx context.Context) (*sqs.Client, error)

SQSClient returns an SQS client configured for MiniStack.

func (*Stack) SSMClient

func (s *Stack) SSMClient(ctx context.Context) (*ssm.Client, error)

SSMClient returns an SSM client configured for MiniStack.

func (*Stack) SecretsManagerClient

func (s *Stack) SecretsManagerClient(ctx context.Context) (*secretsmanager.Client, error)

SecretsManagerClient returns a Secrets Manager client configured for MiniStack.

func (*Stack) SetLabels

func (s *Stack) SetLabels(labels map[string]string)

SetLabels merges inherited Docker labels onto MiniStack resources.

func (*Stack) SetNamePrefix

func (s *Stack) SetNamePrefix(prefix string)

SetNamePrefix prefixes the MiniStack Docker container name.

func (*Stack) SetNetwork

func (s *Stack) SetNetwork(name string)

SetNetwork attaches MiniStack to a shared Docker network.

func (*Stack) TopicARN

func (s *Stack) TopicARN(name string) (string, bool)

TopicARN returns the ARN for a topic created by the stack.

Jump to

Keyboard shortcuts

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