opsworks

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 19 Imported by: 0

README

OpsWorks

Parity grade: A · SDK aws-sdk-go-v2/service/opsworks@v1.31.0 · last audited 2026-07-12 (cf40ff4d)

Coverage

Metric Value
Operations audited 32 (32 ok)
Feature families 9 (9 ok)
Known gaps 3
Deferred items 2
Resource leaks clean
Known gaps
  • DescribeStackSummary's InstancesCount JSON uses field names 'Starting'/'Total' that do not exist in the real AWS type (real fields: Assigning, Booting, ConnectionLost, Deregistering, Online, Pending, Rebooting, Registered, Registering, Requested, RunningSetup, SetupFailed, ShuttingDown, StartFailed, StopFailed, Stopped, Stopping, Terminated, Terminating, Unassigning — no Total). Harmless in practice: AWS JSON-1.1 clients ignore unknown response fields, and after the state-machine fix in this pass, 'Starting' is always 0 anyway since Start/Stop now commit synchronously to a terminal status. (bd: none filed — low value fix for a fully AWS-deprecated service)
  • stacksToJSON emits an extra 'Status' field and DescribeStackProvisioningParameters emits an extra 'StackArn' field, neither of which exist on the real AWS Stack / DescribeStackProvisioningParametersOutput shapes. Same 'harmless extra field, client ignores it' class as above — not fixed this pass.
  • CreateStack/CreateLayer/CreateApp do not validate several AWS-required parameters they silently drop (e.g. CreateStack's ServiceRoleArn is required by AWS but unvalidated here; CreateLayer's Type is not restricted to AWS's enum). Only Name emptiness is validated. Not fixed this pass — would need a broader validation pass across all Create* ops, out of scope for this budget.
Deferred
  • Full parameter surface of CreateStack/CreateLayer/CreateApp/CreateInstance (ConfigurationManager, ChefConfiguration, VpcId, Attributes, BlockDeviceMappings, etc.) — only the fields this backend's Handler already decodes were audited for wire-shape correctness; AWS's much larger optional parameter surface was not modeled.
  • AssignInstance/UnassignInstance/AssignVolume do not verify the layer/instance belongs to the same stack as its target — cross-stack assignment is silently permitted. Data-integrity nicety, not a wire or state-machine bug.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStackNotFound is returned when a stack does not exist.
	ErrStackNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrLayerNotFound is returned when a layer does not exist.
	ErrLayerNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrInstanceNotFound is returned when an instance does not exist.
	ErrInstanceNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrAppNotFound is returned when an app does not exist.
	ErrAppNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrDeploymentNotFound is returned when a deployment does not exist.
	ErrDeploymentNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrCommandNotFound is returned when a command does not exist.
	ErrCommandNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrUserProfileNotFound is returned when a user profile does not exist.
	ErrUserProfileNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrElasticLBNotFound is returned when an ELB is not found.
	ErrElasticLBNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrElasticIPNotFound is returned when an elastic IP is not found.
	ErrElasticIPNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrVolumeNotFound is returned when a volume is not found.
	ErrVolumeNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrRdsDBInstanceNotFound is returned when an RDS DB instance is not found.
	ErrRdsDBInstanceNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrEcsClusterNotFound is returned when an ECS cluster is not found.
	ErrEcsClusterNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrValidation is returned on invalid input.
	ErrValidation = awserr.New(errValidation, awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("opsworks: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AgentVersion

type AgentVersion struct {
	ConfigurationManager *ConfigurationManager
	Version              string
}

AgentVersion describes an OpsWorks agent version.

type App

type App struct {
	CreatedAt time.Time
	StackID   string
	AppID     string
	Arn       string
	Name      string
	Type      string
}

App represents an OpsWorks app. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type AutoScalingSchedule

type AutoScalingSchedule struct {
	Monday    map[string]string `json:"Monday"`
	Tuesday   map[string]string `json:"Tuesday"`
	Wednesday map[string]string `json:"Wednesday"`
	Thursday  map[string]string `json:"Thursday"`
	Friday    map[string]string `json:"Friday"`
	Saturday  map[string]string `json:"Saturday"`
	Sunday    map[string]string `json:"Sunday"`
}

AutoScalingSchedule specifies time-based auto-scaling configuration.

type Command

type Command struct {
	CreatedAt      time.Time
	AcknowledgedAt time.Time
	CompletedAt    time.Time
	DeploymentID   string
	InstanceID     string
	CommandID      string
	Type           string
	Status         string
	LogURL         string
	ExitCode       int32
}

Command represents an OpsWorks command. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type ConfigurationManager

type ConfigurationManager struct {
	Name    string
	Version string
}

ConfigurationManager describes a configuration manager.

type Deployment

type Deployment struct {
	CreatedAt    time.Time
	CompletedAt  time.Time
	StackID      string
	AppID        string
	DeploymentID string
	Command      string
	Status       string
	Duration     int32
}

Deployment represents an OpsWorks deployment. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type EcsCluster

type EcsCluster struct {
	RegisteredAt   time.Time
	EcsClusterArn  string
	EcsClusterName string
	StackID        string
	Status         string
}

EcsCluster represents a registered ECS cluster.

type ElasticIP

type ElasticIP struct {
	IP         string
	Domain     string
	Name       string
	Region     string
	InstanceID string
}

ElasticIP represents an elastic IP registered with OpsWorks.

type ElasticLoadBalancer

type ElasticLoadBalancer struct {
	ElasticLoadBalancerName string
	Region                  string
	DNSName                 string
	StackID                 string
	LayerID                 string
}

ElasticLoadBalancer represents an OpsWorks-attached elastic load balancer.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler handles OpsWorks HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(_ *echo.Context) string

ExtractResource extracts the resource identifier from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for OpsWorks requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend and rebuilds the dispatch table.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend. See the Snapshot doc comment above for why this delegation is new.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches OpsWorks API requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

Prior to Phase 3.3, Handler had no Snapshot/Restore of its own even though InMemoryBackend implemented both (dead wiring: nothing ever called them). This delegation is what actually wires OpsWorks into the persistence Manager.

type InMemoryBackend

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

InMemoryBackend is an in-memory OpsWorks backend.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory OpsWorks backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the configured account ID.

func (*InMemoryBackend) AssignInstance

func (b *InMemoryBackend) AssignInstance(instanceID string, layerIDs []string) error

AssignInstance assigns an existing EC2 instance to a layer.

func (*InMemoryBackend) AssignVolume

func (b *InMemoryBackend) AssignVolume(volumeID, instanceID string) error

AssignVolume assigns a registered volume to an instance.

func (*InMemoryBackend) AssociateElasticIP

func (b *InMemoryBackend) AssociateElasticIP(elasticIP, instanceID string) error

AssociateElasticIP associates an elastic IP with an instance.

func (*InMemoryBackend) AttachElasticLoadBalancer

func (b *InMemoryBackend) AttachElasticLoadBalancer(elbName, layerID string) error

AttachElasticLoadBalancer attaches an ELB to a layer.

func (*InMemoryBackend) CloneStack

func (b *InMemoryBackend) CloneStack(sourceStackID, name, region string) (*Stack, error)

CloneStack creates a new stack that is a copy of the source stack.

func (*InMemoryBackend) CreateApp

func (b *InMemoryBackend) CreateApp(stackID, name, appType string) (*App, error)

CreateApp creates a new app in a stack.

func (*InMemoryBackend) CreateDeployment

func (b *InMemoryBackend) CreateDeployment(stackID, appID, command string) (*Deployment, error)

CreateDeployment creates a new deployment.

func (*InMemoryBackend) CreateInstance

func (b *InMemoryBackend) CreateInstance(stackID, layerID, instanceType string) (*Instance, error)

CreateInstance creates a new instance in a stack/layer.

func (*InMemoryBackend) CreateLayer

func (b *InMemoryBackend) CreateLayer(stackID, layerType, name, shortname string) (*Layer, error)

CreateLayer creates a new layer in a stack.

func (*InMemoryBackend) CreateStack

func (b *InMemoryBackend) CreateStack(
	name, region, defaultInstanceProfileArn, serviceRoleArn string,
) (*Stack, error)

CreateStack creates a new OpsWorks stack.

func (*InMemoryBackend) CreateUserProfile

func (b *InMemoryBackend) CreateUserProfile(
	iamUserArn, sshUsername, sshPublicKey string,
	allowSelfManagement bool,
) (*UserProfile, error)

CreateUserProfile creates an OpsWorks IAM user profile.

func (*InMemoryBackend) DeleteApp

func (b *InMemoryBackend) DeleteApp(appID string) error

DeleteApp deletes an app.

func (*InMemoryBackend) DeleteInstance

func (b *InMemoryBackend) DeleteInstance(instanceID string) error

DeleteInstance deletes an instance.

func (*InMemoryBackend) DeleteLayer

func (b *InMemoryBackend) DeleteLayer(layerID string) error

DeleteLayer deletes a layer.

func (*InMemoryBackend) DeleteStack

func (b *InMemoryBackend) DeleteStack(stackID string) error

DeleteStack deletes a stack and all its child resources.

func (*InMemoryBackend) DeleteUserProfile

func (b *InMemoryBackend) DeleteUserProfile(iamUserArn string) error

DeleteUserProfile removes a user profile.

func (*InMemoryBackend) DeregisterEcsCluster

func (b *InMemoryBackend) DeregisterEcsCluster(ecsClusterArn string) error

DeregisterEcsCluster removes a registered ECS cluster.

func (*InMemoryBackend) DeregisterElasticIP

func (b *InMemoryBackend) DeregisterElasticIP(elasticIP string) error

DeregisterElasticIP removes a registered elastic IP.

func (*InMemoryBackend) DeregisterInstance

func (b *InMemoryBackend) DeregisterInstance(instanceID string) error

DeregisterInstance deregisters an instance from OpsWorks.

func (*InMemoryBackend) DeregisterRdsDBInstance

func (b *InMemoryBackend) DeregisterRdsDBInstance(rdsDBInstanceArn string) error

DeregisterRdsDBInstance removes a registered RDS DB instance.

func (*InMemoryBackend) DeregisterVolume

func (b *InMemoryBackend) DeregisterVolume(volumeID string) error

DeregisterVolume removes a registered volume.

func (*InMemoryBackend) DescribeAgentVersions

func (b *InMemoryBackend) DescribeAgentVersions(stackID string) ([]*AgentVersion, error)

DescribeAgentVersions returns a static list of supported OpsWorks agent versions.

func (*InMemoryBackend) DescribeApps

func (b *InMemoryBackend) DescribeApps(stackID string, appIDs []string) ([]*App, error)

DescribeApps returns apps filtered by stack and/or app IDs.

func (*InMemoryBackend) DescribeCommands

func (b *InMemoryBackend) DescribeCommands(deploymentID, instanceID string, commandIDs []string) ([]*Command, error)

DescribeCommands returns commands filtered by deployment, instance, or IDs.

func (*InMemoryBackend) DescribeDeployments

func (b *InMemoryBackend) DescribeDeployments(stackID, appID string, deploymentIDs []string) ([]*Deployment, error)

DescribeDeployments returns deployments filtered by stack, app, or IDs.

func (*InMemoryBackend) DescribeEcsClusters

func (b *InMemoryBackend) DescribeEcsClusters(stackID string, ecsClusterArns []string) ([]*EcsCluster, error)

DescribeEcsClusters returns ECS clusters filtered by stack or ARN list.

func (*InMemoryBackend) DescribeElasticIps

func (b *InMemoryBackend) DescribeElasticIps(instanceID string, ips []string) ([]*ElasticIP, error)

DescribeElasticIps returns elastic IPs optionally filtered by instance or IP list.

func (*InMemoryBackend) DescribeElasticLoadBalancers

func (b *InMemoryBackend) DescribeElasticLoadBalancers(stackID, _ string) ([]*ElasticLoadBalancer, error)

DescribeElasticLoadBalancers returns ELBs optionally filtered by stack/layer.

func (*InMemoryBackend) DescribeInstances

func (b *InMemoryBackend) DescribeInstances(stackID, layerID string, instanceIDs []string) ([]*Instance, error)

DescribeInstances returns instances filtered by stack, layer, or IDs.

func (*InMemoryBackend) DescribeLayers

func (b *InMemoryBackend) DescribeLayers(stackID string, layerIDs []string) ([]*Layer, error)

DescribeLayers returns layers filtered by stack and/or layer IDs.

func (*InMemoryBackend) DescribeLoadBasedAutoScaling

func (b *InMemoryBackend) DescribeLoadBasedAutoScaling(layerIDs []string) ([]*LoadBasedAutoScaling, error)

DescribeLoadBasedAutoScaling returns load-based auto-scaling config for layers.

func (*InMemoryBackend) DescribeMyUserProfile

func (b *InMemoryBackend) DescribeMyUserProfile() (*UserProfile, error)

DescribeMyUserProfile returns a placeholder profile for the current user.

func (*InMemoryBackend) DescribeOperatingSystems

func (b *InMemoryBackend) DescribeOperatingSystems() ([]*OperatingSystem, error)

DescribeOperatingSystems returns a static list of supported OpsWorks operating systems.

func (*InMemoryBackend) DescribePermissions

func (b *InMemoryBackend) DescribePermissions(stackID, iamUserArn string) ([]*Permission, error)

DescribePermissions returns permissions optionally filtered by stack and user.

func (*InMemoryBackend) DescribeRaidArrays

func (b *InMemoryBackend) DescribeRaidArrays(
	_, _ string,
	_ []string,
) ([]map[string]any, error)

DescribeRaidArrays returns RAID arrays (always empty in mock).

func (*InMemoryBackend) DescribeRdsDBInstances

func (b *InMemoryBackend) DescribeRdsDBInstances(stackID string, rdsDBInstanceArns []string) ([]*RdsDBInstance, error)

DescribeRdsDBInstances returns RDS DB instances filtered by stack or ARN list.

func (*InMemoryBackend) DescribeServiceErrors

func (b *InMemoryBackend) DescribeServiceErrors(
	stackID, _ string,
	_ []string,
) ([]map[string]any, error)

DescribeServiceErrors returns service errors (always empty in mock).

func (*InMemoryBackend) DescribeStackProvisioningParameters

func (b *InMemoryBackend) DescribeStackProvisioningParameters(stackID string) (map[string]string, string, error)

DescribeStackProvisioningParameters returns provisioning parameters for a stack.

func (*InMemoryBackend) DescribeStackSummary

func (b *InMemoryBackend) DescribeStackSummary(stackID string) (*StackSummary, error)

DescribeStackSummary returns summary counts for a stack.

func (*InMemoryBackend) DescribeStacks

func (b *InMemoryBackend) DescribeStacks(stackIDs []string) ([]*Stack, error)

DescribeStacks returns stacks, optionally filtered by IDs.

func (*InMemoryBackend) DescribeTimeBasedAutoScaling

func (b *InMemoryBackend) DescribeTimeBasedAutoScaling(instanceIDs []string) ([]*TimeBasedAutoScaling, error)

DescribeTimeBasedAutoScaling returns time-based auto-scaling config for instances.

func (*InMemoryBackend) DescribeUserProfiles

func (b *InMemoryBackend) DescribeUserProfiles(iamUserArns []string) ([]*UserProfile, error)

DescribeUserProfiles returns user profiles optionally filtered by ARN.

func (*InMemoryBackend) DescribeVolumes

func (b *InMemoryBackend) DescribeVolumes(instanceID, _ string, volumeIDs []string) ([]*Volume, error)

DescribeVolumes returns volumes filtered by instance, RAID array, or IDs.

func (*InMemoryBackend) DetachElasticLoadBalancer

func (b *InMemoryBackend) DetachElasticLoadBalancer(elbName, _ string) error

DetachElasticLoadBalancer detaches an ELB from a layer.

func (*InMemoryBackend) DisassociateElasticIP

func (b *InMemoryBackend) DisassociateElasticIP(elasticIP string) error

DisassociateElasticIP removes an elastic IP's instance association.

func (*InMemoryBackend) GetHostnameSuggestion

func (b *InMemoryBackend) GetHostnameSuggestion(stackID, _ string) (string, error)

GetHostnameSuggestion returns a suggested hostname for a new instance.

func (*InMemoryBackend) GrantAccess

func (b *InMemoryBackend) GrantAccess(instanceID string, validForInMinutes int32) (*TemporaryCredential, error)

GrantAccess returns temporary SSH credentials for an instance.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(
	resourceARN string,
	maxResults int32,
	nextToken string,
) (map[string]string, string, error)

ListTags lists tags for a resource with pagination support.

func (*InMemoryBackend) RebootInstance

func (b *InMemoryBackend) RebootInstance(instanceID string) error

RebootInstance transitions an instance back to online. See StartInstance's doc comment for why this commits directly to the terminal state instead of parking the instance in a transient status.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the configured region.

func (*InMemoryBackend) RegisterEcsCluster

func (b *InMemoryBackend) RegisterEcsCluster(ecsClusterArn, stackID string) (string, error)

RegisterEcsCluster registers an ECS cluster with a stack.

func (*InMemoryBackend) RegisterElasticIP

func (b *InMemoryBackend) RegisterElasticIP(elasticIP, region string) (*ElasticIP, error)

RegisterElasticIP registers an elastic IP address.

func (*InMemoryBackend) RegisterInstance

func (b *InMemoryBackend) RegisterInstance(stackID, hostname string) (string, error)

RegisterInstance registers an on-premises instance with a stack.

func (*InMemoryBackend) RegisterRdsDBInstance

func (b *InMemoryBackend) RegisterRdsDBInstance(stackID, rdsDBInstanceArn, dbUser, _ string) error

RegisterRdsDBInstance registers an RDS DB instance with a stack.

func (*InMemoryBackend) RegisterVolume

func (b *InMemoryBackend) RegisterVolume(ec2VolumeID, stackID string) (string, error)

RegisterVolume registers an EBS volume with a stack.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored data.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot.

func (*InMemoryBackend) SetLoadBasedAutoScaling

func (b *InMemoryBackend) SetLoadBasedAutoScaling(
	layerID string,
	enable bool,
	upScaling, downScaling *ScalingParameters,
) error

SetLoadBasedAutoScaling sets load-based auto-scaling config for a layer.

func (*InMemoryBackend) SetPermission

func (b *InMemoryBackend) SetPermission(stackID, iamUserArn, level string, allowSSH, allowSudo bool) error

SetPermission sets stack permissions for an IAM user.

func (*InMemoryBackend) SetTimeBasedAutoScaling

func (b *InMemoryBackend) SetTimeBasedAutoScaling(instanceID string, schedule *AutoScalingSchedule) error

SetTimeBasedAutoScaling sets the time-based auto-scaling schedule for an instance.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartInstance

func (b *InMemoryBackend) StartInstance(instanceID string) error

StartInstance transitions an instance to online. Real AWS moves an instance through several transient states (requested, pending, booting, running_setup) before reaching online; this backend has no time-based scheduler, so it commits directly to the terminal state instead of leaving the instance parked in a transient status that nothing ever advances (previously "starting", which is not even a valid AWS OpsWorks instance-status value, and which left DescribeInstances pollers spinning forever since no code ever moved it on to "online").

func (*InMemoryBackend) StartStack

func (b *InMemoryBackend) StartStack(stackID string) error

StartStack transitions all stopped instances in a stack to online. Real AWS OpsWorks moves an instance through several transient states (requested, pending, booting, running_setup) before it reaches online; this backend has no time-based scheduler (see CreateDeployment's synchronous-completion convention), so it commits directly to the terminal state rather than leaving the instance parked in a transient status that nothing ever advances -- a stuck "starting" status previously left DescribeInstances pollers spinning forever.

func (*InMemoryBackend) StopInstance

func (b *InMemoryBackend) StopInstance(instanceID string) error

StopInstance transitions an instance to stopped. See StartInstance's doc comment for why this commits directly to the terminal state instead of parking the instance in the transient "stopping" status.

func (*InMemoryBackend) StopStack

func (b *InMemoryBackend) StopStack(stackID string) error

StopStack transitions all online instances in a stack to stopped. See StartStack's doc comment for why this commits directly to the terminal state instead of parking instances in the transient "stopping" status.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error

TagResource adds or updates tags on a resource.

func (*InMemoryBackend) UnassignInstance

func (b *InMemoryBackend) UnassignInstance(instanceID string) error

UnassignInstance removes an instance from its layer.

func (*InMemoryBackend) UnassignVolume

func (b *InMemoryBackend) UnassignVolume(volumeID string) error

UnassignVolume removes a volume's instance assignment.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateApp

func (b *InMemoryBackend) UpdateApp(appID, name string) error

UpdateApp updates an app's name.

func (*InMemoryBackend) UpdateElasticIP

func (b *InMemoryBackend) UpdateElasticIP(elasticIP, name string) error

UpdateElasticIP updates the name of a registered elastic IP.

func (*InMemoryBackend) UpdateInstance

func (b *InMemoryBackend) UpdateInstance(instanceID, hostname string) error

UpdateInstance updates an instance's hostname.

func (*InMemoryBackend) UpdateLayer

func (b *InMemoryBackend) UpdateLayer(layerID, name string) error

UpdateLayer updates a layer's name.

func (*InMemoryBackend) UpdateMyUserProfile

func (b *InMemoryBackend) UpdateMyUserProfile(_ string) error

UpdateMyUserProfile updates the SSH public key for the current user.

func (*InMemoryBackend) UpdateRdsDBInstance

func (b *InMemoryBackend) UpdateRdsDBInstance(rdsDBInstanceArn, dbUser, _ string) error

UpdateRdsDBInstance updates the DB user/password for a registered RDS instance.

func (*InMemoryBackend) UpdateStack

func (b *InMemoryBackend) UpdateStack(stackID, name string) error

UpdateStack updates a stack's name.

func (*InMemoryBackend) UpdateUserProfile

func (b *InMemoryBackend) UpdateUserProfile(iamUserArn, sshUsername, sshPublicKey string) error

UpdateUserProfile updates a user profile's SSH settings.

func (*InMemoryBackend) UpdateVolume

func (b *InMemoryBackend) UpdateVolume(volumeID, name, mountPoint string) error

UpdateVolume updates a volume's name and mount point.

type Instance

type Instance struct {
	CreatedAt    time.Time
	StackID      string
	LayerID      string
	InstanceID   string
	Arn          string
	Hostname     string
	InstanceType string
	Status       string
	// Registered indicates this is an on-premises registered instance.
	Registered bool
}

Instance represents an OpsWorks instance. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type InstancesCount

type InstancesCount struct {
	Online   int32
	Stopped  int32
	Starting int32
	Stopping int32
	Total    int32
}

InstancesCount holds counts of instances in various states.

type Layer

type Layer struct {
	CreatedAt time.Time
	StackID   string
	LayerID   string
	Arn       string
	Type      string
	Name      string
	Shortname string
}

Layer represents an OpsWorks layer. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type LoadBasedAutoScaling

type LoadBasedAutoScaling struct {
	UpScaling   *ScalingParameters
	DownScaling *ScalingParameters
	LayerID     string
	Enable      bool
}

LoadBasedAutoScaling associates a layer with load-based auto-scaling settings.

type OperatingSystem

type OperatingSystem struct {
	ID                    string
	Name                  string
	Type                  string
	ReportedVersion       string
	ConfigurationManagers []*ConfigurationManager
	Supported             bool
}

OperatingSystem describes a supported OpsWorks operating system. Strings first: moves slice ptr to later offset, reducing GC pointer scan bytes (80→72).

type Permission

type Permission struct {
	StackID    string
	IamUserArn string
	Level      string
	AllowSSH   bool
	AllowSudo  bool
}

Permission represents OpsWorks stack access permissions for an IAM user.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon OpsWorks.

func (*Provider) Init

Init initializes the OpsWorks service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RdsDBInstance

type RdsDBInstance struct {
	RdsDBInstanceArn     string
	DBInstanceIdentifier string
	DBUser               string
	StackID              string
	Region               string
	Address              string
}

RdsDBInstance represents a registered RDS DB instance.

type ScalingParameters

type ScalingParameters struct {
	CPUThreshold       float64 `json:"CpuThreshold"`
	LoadThreshold      float64 `json:"LoadThreshold"`
	MemoryThreshold    float64 `json:"MemoryThreshold"`
	IgnoreMetricsTime  int32   `json:"IgnoreMetricsTime"`
	InstanceCount      int32   `json:"InstanceCount"`
	ThresholdsWaitTime int32   `json:"ThresholdsWaitTime"`
}

ScalingParameters holds scaling trigger thresholds.

type Stack

type Stack struct {
	CreatedAt                 time.Time
	Tags                      map[string]string
	StackID                   string
	Arn                       string
	Name                      string
	Region                    string
	DefaultInstanceProfileArn string
	ServiceRoleArn            string
	Status                    string
}

Stack represents an OpsWorks stack. CreatedAt is first: time.Time non-pointer prefix reduces GC pointer bytes.

type StackSummary

type StackSummary struct {
	InstancesCount   *InstancesCount
	StackID          string
	Arn              string
	Name             string
	LayersCount      int32
	AppsCount        int32
	DeploymentsCount int32
}

StackSummary represents summary information about a stack.

type StorageBackend

type StorageBackend interface {
	// Stack operations
	CreateStack(name, region, defaultInstanceProfileArn, serviceRoleArn string) (*Stack, error)
	CloneStack(sourceStackID, name, region string) (*Stack, error)
	DescribeStacks(stackIDs []string) ([]*Stack, error)
	UpdateStack(stackID, name string) error
	DeleteStack(stackID string) error
	StartStack(stackID string) error
	StopStack(stackID string) error
	GetHostnameSuggestion(stackID, layerID string) (string, error)
	DescribeStackSummary(stackID string) (*StackSummary, error)
	DescribeStackProvisioningParameters(stackID string) (map[string]string, string, error)

	// Layer operations
	CreateLayer(stackID, layerType, name, shortname string) (*Layer, error)
	DescribeLayers(stackID string, layerIDs []string) ([]*Layer, error)
	UpdateLayer(layerID, name string) error
	DeleteLayer(layerID string) error

	// Instance operations
	CreateInstance(stackID, layerID, instanceType string) (*Instance, error)
	RegisterInstance(stackID, hostname string) (string, error)
	DeregisterInstance(instanceID string) error
	AssignInstance(instanceID string, layerIDs []string) error
	UnassignInstance(instanceID string) error
	DescribeInstances(stackID, layerID string, instanceIDs []string) ([]*Instance, error)
	UpdateInstance(instanceID, hostname string) error
	DeleteInstance(instanceID string) error
	StartInstance(instanceID string) error
	StopInstance(instanceID string) error
	RebootInstance(instanceID string) error

	// App operations
	CreateApp(stackID, name, appType string) (*App, error)
	DescribeApps(stackID string, appIDs []string) ([]*App, error)
	UpdateApp(appID, name string) error
	DeleteApp(appID string) error

	// Deployment operations
	CreateDeployment(stackID, appID, command string) (*Deployment, error)
	DescribeDeployments(stackID, appID string, deploymentIDs []string) ([]*Deployment, error)

	// Command operations
	DescribeCommands(deploymentID, instanceID string, commandIDs []string) ([]*Command, error)

	// Tag operations
	TagResource(resourceARN string, tags map[string]string) error
	UntagResource(resourceARN string, tagKeys []string) error
	ListTags(resourceARN string, maxResults int32, nextToken string) (map[string]string, string, error)

	// User profile operations
	CreateUserProfile(iamUserArn, sshUsername, sshPublicKey string, allowSelfManagement bool) (*UserProfile, error)
	DeleteUserProfile(iamUserArn string) error
	DescribeUserProfiles(iamUserArns []string) ([]*UserProfile, error)
	UpdateUserProfile(iamUserArn, sshUsername, sshPublicKey string) error
	DescribeMyUserProfile() (*UserProfile, error)
	UpdateMyUserProfile(sshPublicKey string) error

	// Elastic Load Balancer operations
	AttachElasticLoadBalancer(elbName, layerID string) error
	DetachElasticLoadBalancer(elbName, layerID string) error
	DescribeElasticLoadBalancers(stackID, layerID string) ([]*ElasticLoadBalancer, error)

	// Elastic IP operations
	AssociateElasticIP(elasticIP, instanceID string) error
	DisassociateElasticIP(elasticIP string) error
	RegisterElasticIP(elasticIP, region string) (*ElasticIP, error)
	DeregisterElasticIP(elasticIP string) error
	DescribeElasticIps(instanceID string, ips []string) ([]*ElasticIP, error)
	UpdateElasticIP(elasticIP, name string) error

	// Volume operations
	RegisterVolume(ec2VolumeID, stackID string) (string, error)
	DeregisterVolume(volumeID string) error
	AssignVolume(volumeID, instanceID string) error
	UnassignVolume(volumeID string) error
	DescribeVolumes(instanceID, raidArrayID string, volumeIDs []string) ([]*Volume, error)
	UpdateVolume(volumeID, name, mountPoint string) error

	// RDS DB Instance operations
	RegisterRdsDBInstance(stackID, rdsDBInstanceArn, dbUser, dbPassword string) error
	DeregisterRdsDBInstance(rdsDBInstanceArn string) error
	DescribeRdsDBInstances(stackID string, rdsDBInstanceArns []string) ([]*RdsDBInstance, error)
	UpdateRdsDBInstance(rdsDBInstanceArn, dbUser, dbPassword string) error

	// ECS Cluster operations
	RegisterEcsCluster(ecsClusterArn, stackID string) (string, error)
	DeregisterEcsCluster(ecsClusterArn string) error
	DescribeEcsClusters(stackID string, ecsClusterArns []string) ([]*EcsCluster, error)

	// Permission operations
	SetPermission(stackID, iamUserArn, level string, allowSSH, allowSudo bool) error
	DescribePermissions(stackID, iamUserArn string) ([]*Permission, error)

	// Auto-scaling operations
	SetTimeBasedAutoScaling(instanceID string, schedule *AutoScalingSchedule) error
	DescribeTimeBasedAutoScaling(instanceIDs []string) ([]*TimeBasedAutoScaling, error)
	SetLoadBasedAutoScaling(layerID string, enable bool, upScaling, downScaling *ScalingParameters) error
	DescribeLoadBasedAutoScaling(layerIDs []string) ([]*LoadBasedAutoScaling, error)

	// Misc operations
	GrantAccess(instanceID string, validForInMinutes int32) (*TemporaryCredential, error)
	DescribeServiceErrors(stackID, instanceID string, serviceErrorIDs []string) ([]map[string]any, error)
	DescribeRaidArrays(instanceID, stackID string, raidArrayIDs []string) ([]map[string]any, error)
	DescribeAgentVersions(stackID string) ([]*AgentVersion, error)
	DescribeOperatingSystems() ([]*OperatingSystem, error)

	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for OpsWorks storage operations.

type TemporaryCredential

type TemporaryCredential struct {
	InstanceID        string
	Username          string
	Password          string
	ValidForInMinutes int32
}

TemporaryCredential holds short-lived SSH credentials returned by GrantAccess.

type TimeBasedAutoScaling

type TimeBasedAutoScaling struct {
	AutoScalingSchedule *AutoScalingSchedule
	InstanceID          string
}

TimeBasedAutoScaling associates an instance with its auto-scaling schedule.

type UserProfile

type UserProfile struct {
	IamUserArn          string
	Name                string
	SSHUsername         string
	SSHPublicKey        string
	AllowSelfManagement bool
}

UserProfile represents an OpsWorks IAM user profile.

type Volume

type Volume struct {
	RegisteredAt time.Time
	VolumeID     string
	Ec2VolumeID  string
	StackID      string
	InstanceID   string
	Name         string
	MountPoint   string
	Region       string
	Status       string
	Size         int32
}

Volume represents a registered volume.

Jump to

Keyboard shortcuts

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