aws

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 48 Imported by: 0

Documentation

Overview

Package aws assembles CloudEmu's AWS-compatible HTTP server.

New takes a Drivers bundle and returns a *server.Server preloaded with the handler for each non-nil driver. Consumers that want a single service can skip this package and register the handler directly on their own server.Server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(d Drivers) *server.Server

New returns a server that speaks the AWS SDK wire protocols for every non-nil driver in d. Handlers are registered most-specific-first so the dispatch is unambiguous:

  • CloudWatch matches on Smithy-Protocol: rpc-v2-cbor header.
  • DynamoDB matches on X-Amz-Target header (JSON-RPC).
  • RDS matches form-encoded POSTs whose Action is one of the known RDS operations. It must register before EC2 because both speak the AWS query protocol on the same content type.
  • EC2 matches on Action= (form-encoded POST or query string). The EC2 handler also serves VPC and Auto Scaling ops since real AWS uses the same query-protocol endpoint for all of them.
  • Lambda matches on the /2015-03-31/functions path prefix and must register before S3 so its REST URLs aren't swallowed by the catch-all.
  • K8sAPI matches /k8s/{uid}/... — disjoint from every other AWS path; registered before S3's REST fallback.
  • S3 is the REST fallback.

keeps the caller API ergonomic (awsserver.New(Drivers{...})).

Types

type Drivers

type Drivers struct {
	S3         storagedriver.Bucket
	DynamoDB   dbdriver.Database
	EC2        computedriver.Compute
	VPC        netdriver.Networking
	CloudWatch mondriver.Monitoring
	Lambda     sdrv.Serverless
	SQS        mqdriver.MessageQueue
	RDS        rdbdriver.RelationalDB
	Redshift   rdbdriver.RelationalDB
	EKS        eksdriver.EKS
	IAM        iamdriver.IAM
	ECR        crdriver.ContainerRegistry
	Bedrock    bedrockdriver.Bedrock
	SageMaker  sagemakerdriver.Service
	// SecretsManager serves the Secrets Manager JSON 1.1 protocol against
	// the secrets driver.
	SecretsManager secretsdriver.Secrets
	// SSM serves the Systems Manager Parameter Store JSON 1.1 protocol against
	// the parameterstore driver.
	SSM ssmdriver.ParameterStore
	// CloudWatchLogs serves the CloudWatch Logs JSON 1.1 protocol against the
	// logging driver.
	CloudWatchLogs logdriver.Logging
	// Route53 serves the Route 53 REST/XML protocol against the dns driver.
	Route53 dnsdriver.DNS
	// ELB serves the Elastic Load Balancing v2 (ALB/NLB) query protocol
	// against the loadbalancer driver.
	ELB lbdriver.LoadBalancer
	// EventBridge serves the EventBridge JSON 1.1 protocol against the eventbus
	// driver.
	EventBridge ebdriver.EventBus
	// ElastiCache serves the ElastiCache query protocol (cluster control plane)
	// against the cache driver.
	ElastiCache cachedriver.Cache
	// SNS serves the SNS query protocol against the notification driver.
	SNS notifdriver.Notification
	// STS serves the AWS STS query protocol (GetCallerIdentity, AssumeRole,
	// GetSessionToken). It has no backing driver — identity is derived from
	// AccountID and Region — so it is gated on this bool. Enable it so SDK code
	// paths that call sts:GetCallerIdentity or sts:AssumeRole on init succeed.
	STS bool
	// K8sAPI is the shared in-memory Kubernetes data-plane API server. It is
	// shared with azureserver.Drivers.K8sAPI and gcpserver.Drivers.K8sAPI so a
	// kubeconfig issued by any provider's control plane (EKS/AKS/GKE) reaches
	// the same backend. Leave nil to disable Kubernetes data-plane support.
	K8sAPI *kubernetes.APIServer
	// ResourceDiscovery is the cross-service inventory engine. Required to
	// serve Resource Explorer 2 and Resource Groups Tagging API requests.
	// Leave nil to omit both handlers. AccountID and Region are needed for
	// Resource Explorer to construct view/index ARNs.
	ResourceDiscovery *resourcediscovery.Engine
	AccountID         string
	Region            string
}

Drivers bundles the driver interfaces the AWS server can expose. Leave a field nil to omit that service; the server returns 501 Not Implemented for any request that no registered handler matches.

Directories

Path Synopsis
Package bedrock implements the AWS Bedrock restJson1 control-plane API and the bedrock-runtime InvokeModel / Converse data-plane API as a server.Handler.
Package bedrock implements the AWS Bedrock restJson1 control-plane API and the bedrock-runtime InvokeModel / Converse data-plane API as a server.Handler.
Package cloudwatch implements AWS CloudWatch's Smithy RPC-v2-CBOR protocol as a server.Handler.
Package cloudwatch implements AWS CloudWatch's Smithy RPC-v2-CBOR protocol as a server.Handler.
Package cloudwatchlogs implements the AWS CloudWatch Logs JSON-RPC protocol as a server.Handler.
Package cloudwatchlogs implements the AWS CloudWatch Logs JSON-RPC protocol as a server.Handler.
Package dynamodb implements the DynamoDB JSON-RPC protocol as a server.Handler.
Package dynamodb implements the DynamoDB JSON-RPC protocol as a server.Handler.
Package ec2 implements the AWS EC2 query-protocol as a server.Handler.
Package ec2 implements the AWS EC2 query-protocol as a server.Handler.
Package ecr implements the AWS ECR JSON-RPC protocol as a server.Handler.
Package ecr implements the AWS ECR JSON-RPC protocol as a server.Handler.
Package eks implements the AWS EKS REST/JSON control-plane API as a server.Handler.
Package eks implements the AWS EKS REST/JSON control-plane API as a server.Handler.
Package elasticache implements the AWS ElastiCache query-protocol as a server.Handler.
Package elasticache implements the AWS ElastiCache query-protocol as a server.Handler.
Package elbv2 implements the AWS Elastic Load Balancing v2 (ALB/NLB) query-protocol as a server.Handler.
Package elbv2 implements the AWS Elastic Load Balancing v2 (ALB/NLB) query-protocol as a server.Handler.
Package eventbridge implements the AWS EventBridge JSON-RPC protocol as a server.Handler.
Package eventbridge implements the AWS EventBridge JSON-RPC protocol as a server.Handler.
Package iam implements the AWS IAM query-protocol as a server.Handler.
Package iam implements the AWS IAM query-protocol as a server.Handler.
Package lambda implements the AWS Lambda REST+JSON control-plane protocol as a server.Handler.
Package lambda implements the AWS Lambda REST+JSON control-plane protocol as a server.Handler.
Package rds implements the AWS RDS query-protocol as a server.Handler.
Package rds implements the AWS RDS query-protocol as a server.Handler.
Package redshift implements the AWS Redshift query-protocol as a server.Handler.
Package redshift implements the AWS Redshift query-protocol as a server.Handler.
Package resourceexplorer2 serves the AWS Resource Explorer 2 REST-JSON protocol against a *resourcediscovery.Engine.
Package resourceexplorer2 serves the AWS Resource Explorer 2 REST-JSON protocol against a *resourcediscovery.Engine.
Package resourcegroupstaggingapi serves the AWS Resource Groups Tagging API JSON 1.1 protocol against a *resourcediscovery.Engine.
Package resourcegroupstaggingapi serves the AWS Resource Groups Tagging API JSON 1.1 protocol against a *resourcediscovery.Engine.
Package route53 implements the AWS Route 53 REST+XML protocol as a server.Handler.
Package route53 implements the AWS Route 53 REST+XML protocol as a server.Handler.
Package s3 implements the S3 REST+XML protocol as a server.Handler.
Package s3 implements the S3 REST+XML protocol as a server.Handler.
Package sagemaker implements the Amazon SageMaker awsJson1_1 control-plane API and the sagemaker-runtime restJson1 InvokeEndpoint data-plane API as a server.Handler.
Package sagemaker implements the Amazon SageMaker awsJson1_1 control-plane API and the sagemaker-runtime restJson1 InvokeEndpoint data-plane API as a server.Handler.
Package secretsmanager implements the AWS Secrets Manager JSON-RPC protocol as a server.Handler.
Package secretsmanager implements the AWS Secrets Manager JSON-RPC protocol as a server.Handler.
Package sns implements the AWS SNS query-protocol as a server.Handler.
Package sns implements the AWS SNS query-protocol as a server.Handler.
Package sqs implements the AWS SQS JSON-RPC protocol as a server.Handler.
Package sqs implements the AWS SQS JSON-RPC protocol as a server.Handler.
Package ssm implements the AWS Systems Manager (SSM) Parameter Store JSON-RPC protocol as a server.Handler.
Package ssm implements the AWS Systems Manager (SSM) Parameter Store JSON-RPC protocol as a server.Handler.
Package sts implements the AWS STS query-protocol as a server.Handler.
Package sts implements the AWS STS query-protocol as a server.Handler.

Jump to

Keyboard shortcuts

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