Documentation
¶
Overview ¶
Package aws implements the AWS Lambda, S3, and CloudFront serverless provider.
Index ¶
- type AWSProvider
- func (p *AWSProvider) CheckServiceQuotas(ctx context.Context) error
- func (p *AWSProvider) DeployCompute(ctx context.Context, pkg *packaging.PackageResult, ...) error
- func (p *AWSProvider) DeployStatic(ctx context.Context, pkg *packaging.PackageResult, ...) error
- func (p *AWSProvider) Destroy(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) GetResourceMap(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) (core.ServerlessResourceMap, error)
- func (p *AWSProvider) GetSecrets(ctx context.Context, appName string) (map[string]string, error)
- func (p *AWSProvider) Initialize(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) InvalidateCache(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) Rollback(ctx context.Context, appCfg *cfgTypes.NextDeployConfig, ...) error
- func (p *AWSProvider) SetSecret(ctx context.Context, appName string, key, value string) error
- func (p *AWSProvider) UnsetSecret(ctx context.Context, appName string, key string) error
- func (p *AWSProvider) UpdateSecrets(ctx context.Context, appName string, secrets map[string]string) error
- type DeploymentEntry
- type ImageOptConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSProvider ¶
type AWSProvider struct {
// contains filtered or unexported fields
}
func NewAWSProvider ¶
func NewAWSProvider(verbose bool) *AWSProvider
func (*AWSProvider) CheckServiceQuotas ¶
func (p *AWSProvider) CheckServiceQuotas(ctx context.Context) error
func (*AWSProvider) DeployCompute ¶
func (p *AWSProvider) DeployCompute(ctx context.Context, pkg *packaging.PackageResult, appCfg *cfgTypes.NextDeployConfig, meta *nextcore.NextCorePayload) error
func (*AWSProvider) DeployStatic ¶
func (p *AWSProvider) DeployStatic(ctx context.Context, pkg *packaging.PackageResult, appCfg *cfgTypes.NextDeployConfig, meta *nextcore.NextCorePayload) error
func (*AWSProvider) Destroy ¶
func (p *AWSProvider) Destroy(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) GetResourceMap ¶
func (p *AWSProvider) GetResourceMap(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) (core.ServerlessResourceMap, error)
func (*AWSProvider) GetSecrets ¶
func (*AWSProvider) Initialize ¶
func (p *AWSProvider) Initialize(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) InvalidateCache ¶
func (p *AWSProvider) InvalidateCache(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) Rollback ¶
func (p *AWSProvider) Rollback(ctx context.Context, appCfg *cfgTypes.NextDeployConfig, opts core.RollbackOptions) error
Rollback reverts the Lambda function to a previous deployed zip using the S3 deployment history. Target selection:
- opts.ToCommit: prefix-match against history GitCommit (errors if not found within retention).
- opts.Steps (default 1): walk N entries back from the current (last) one.
This is instant — no HTTP download required.
func (*AWSProvider) SetSecret ¶
SetSecret performs an optimistic read-modify-write that survives concurrent writers. See mutateSecrets for the concurrency model.
func (*AWSProvider) UnsetSecret ¶
UnsetSecret performs an optimistic read-modify-write that survives concurrent writers. Returns nil if the key was already absent.
func (*AWSProvider) UpdateSecrets ¶
func (p *AWSProvider) UpdateSecrets(ctx context.Context, appName string, secrets map[string]string) error
UpdateSecrets is the public write entry point. It diffs against the remote blob first to avoid polluting version history and save API calls, then delegates to writeSecretBlob. Callers that already hold the pre-image (e.g. mutateSecrets) should call writeSecretBlob directly to skip the diff.
type DeploymentEntry ¶
type DeploymentEntry struct {
S3Key string `json:"s3_key"`
GitCommit string `json:"git_commit,omitempty"`
GitDirty bool `json:"git_dirty,omitempty"`
GeneratedAt string `json:"generated_at,omitempty"`
}
DeploymentEntry records a single Lambda deployment with the git commit it was built from, so rollbacks can be addressed by commit hash rather than opaque S3 keys.
type ImageOptConfig ¶
type ImageOptConfig struct {
AllowedDomains []string `json:"allowed_domains"`
DeviceSizes []int `json:"device_sizes"`
ImageSizes []int `json:"image_sizes"`
Formats []string `json:"formats"`
}
ImageOptConfig is the JSON contract consumed by the imgopt Lambda binary. AllowedDomains is the flattened list of every Next.js image source — both the legacy `images.domains[]` and the hostnames extracted from `images.remotePatterns[]`. The nextcore feature detector merges both into HasExternalImages, so the imgopt lambda only needs the flat list.