Documentation
¶
Overview ¶
Package replicator copies resources from a source AWS account or endpoint into a running Gopherstack through the public SDK APIs on both sides.
Index ¶
Constants ¶
const ( TypeKMS = "kms" TypeIAM = "iam" TypeLogs = "logs" TypeKinesis = "kinesis" TypeS3 = "s3" TypeDynamoDB = "dynamodb" TypeSSM = "ssm" TypeSecrets = "secretsmanager" TypeSQS = "sqs" TypeLambda = "lambda" TypeSNS = "sns" TypeEventBridge = "eventbridge" )
Resource type names accepted by Config.Types.
const ( ActionCreated = "created" ActionUpdated = "updated" ActionSkipped = "skipped" ActionFailed = "failed" )
Result actions.
Variables ¶
var ErrUnknownType = errors.New("unknown resource type")
ErrUnknownType is returned for a resource type the replicator does not support.
Functions ¶
func OrderQueues ¶
OrderQueues returns names with every dead-letter queue ahead of the queues that redrive to it. dlqOf maps a queue name to its DLQ name ("" when none); cycles are broken arbitrarily.
func OrderTypes ¶
OrderTypes validates selected (empty means all) and returns it in dependency order.
Types ¶
type Config ¶
type Config struct {
Progress func(Result)
Identifier string
Source Endpoint
Target Endpoint
Types []string
MaxObjectBytes int64
DryRun bool
IncludeData bool
WithDecryption bool
}
Config describes one replication run.
type Endpoint ¶
type Endpoint struct {
Profile string `json:"profile,omitempty"`
URL string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
AccessKeyID string `json:"access_key_id,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty"`
SessionToken string `json:"session_token,omitempty"`
}
Endpoint locates one side of the replication. Static credentials are never logged or persisted.
type Remapper ¶
type Remapper struct {
// contains filtered or unexported fields
}
Remapper rewrites source account, region and replicated KMS key ids to target values.
func NewRemapper ¶
NewRemapper builds a Remapper. An empty source account disables account remapping.
func (*Remapper) ARN ¶
ARN remaps one ARN; non-ARNs and foreign-account ARNs are returned unchanged.
func (*Remapper) KeyRef ¶
KeyRef maps a KMS key reference (id, key ARN or alias) to its target form. Aliases pass through (the kms type replicates them); AWS-managed aliases and unreplicated keys report false.
type Report ¶
type Report struct {
Counts map[string]int `json:"counts"`
SourceAccount string `json:"source_account,omitempty"`
TargetAccount string `json:"target_account,omitempty"`
Results []Result `json:"results"`
DryRun bool `json:"dry_run"`
}
Report is the outcome of a run. In a dry run, actions are what would happen.