Documentation
¶
Index ¶
- Variables
- type AgentVersion
- type App
- type AutoScalingSchedule
- type Command
- type ConfigurationManager
- type Deployment
- type EcsCluster
- type ElasticIP
- type ElasticLoadBalancer
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(_ *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) AssignInstance(instanceID string, layerIDs []string) error
- func (b *InMemoryBackend) AssignVolume(volumeID, instanceID string) error
- func (b *InMemoryBackend) AssociateElasticIP(elasticIP, instanceID string) error
- func (b *InMemoryBackend) AttachElasticLoadBalancer(elbName, layerID string) error
- func (b *InMemoryBackend) CloneStack(sourceStackID, name, region string) (*Stack, error)
- func (b *InMemoryBackend) CreateApp(stackID, name, appType string) (*App, error)
- func (b *InMemoryBackend) CreateDeployment(stackID, appID, command string) (*Deployment, error)
- func (b *InMemoryBackend) CreateInstance(stackID, layerID, instanceType string) (*Instance, error)
- func (b *InMemoryBackend) CreateLayer(stackID, layerType, name, shortname string) (*Layer, error)
- func (b *InMemoryBackend) CreateStack(name, region, defaultInstanceProfileArn, serviceRoleArn string) (*Stack, error)
- func (b *InMemoryBackend) CreateUserProfile(iamUserArn, sshUsername, sshPublicKey string, allowSelfManagement bool) (*UserProfile, error)
- func (b *InMemoryBackend) DeleteApp(appID string) error
- func (b *InMemoryBackend) DeleteInstance(instanceID string) error
- func (b *InMemoryBackend) DeleteLayer(layerID string) error
- func (b *InMemoryBackend) DeleteStack(stackID string) error
- func (b *InMemoryBackend) DeleteUserProfile(iamUserArn string) error
- func (b *InMemoryBackend) DeregisterEcsCluster(ecsClusterArn string) error
- func (b *InMemoryBackend) DeregisterElasticIP(elasticIP string) error
- func (b *InMemoryBackend) DeregisterInstance(instanceID string) error
- func (b *InMemoryBackend) DeregisterRdsDBInstance(rdsDBInstanceArn string) error
- func (b *InMemoryBackend) DeregisterVolume(volumeID string) error
- func (b *InMemoryBackend) DescribeAgentVersions(stackID string) ([]*AgentVersion, error)
- func (b *InMemoryBackend) DescribeApps(stackID string, appIDs []string) ([]*App, error)
- func (b *InMemoryBackend) DescribeCommands(deploymentID, instanceID string, commandIDs []string) ([]*Command, error)
- func (b *InMemoryBackend) DescribeDeployments(stackID, appID string, deploymentIDs []string) ([]*Deployment, error)
- func (b *InMemoryBackend) DescribeEcsClusters(stackID string, ecsClusterArns []string) ([]*EcsCluster, error)
- func (b *InMemoryBackend) DescribeElasticIps(instanceID string, ips []string) ([]*ElasticIP, error)
- func (b *InMemoryBackend) DescribeElasticLoadBalancers(stackID, _ string) ([]*ElasticLoadBalancer, error)
- func (b *InMemoryBackend) DescribeInstances(stackID, layerID string, instanceIDs []string) ([]*Instance, error)
- func (b *InMemoryBackend) DescribeLayers(stackID string, layerIDs []string) ([]*Layer, error)
- func (b *InMemoryBackend) DescribeLoadBasedAutoScaling(layerIDs []string) ([]*LoadBasedAutoScaling, error)
- func (b *InMemoryBackend) DescribeMyUserProfile() (*UserProfile, error)
- func (b *InMemoryBackend) DescribeOperatingSystems() ([]*OperatingSystem, error)
- func (b *InMemoryBackend) DescribePermissions(stackID, iamUserArn string) ([]*Permission, error)
- func (b *InMemoryBackend) DescribeRaidArrays(_, _ string, _ []string) ([]map[string]any, error)
- func (b *InMemoryBackend) DescribeRdsDBInstances(stackID string, rdsDBInstanceArns []string) ([]*RdsDBInstance, error)
- func (b *InMemoryBackend) DescribeServiceErrors(stackID, _ string, _ []string) ([]map[string]any, error)
- func (b *InMemoryBackend) DescribeStackProvisioningParameters(stackID string) (map[string]string, string, error)
- func (b *InMemoryBackend) DescribeStackSummary(stackID string) (*StackSummary, error)
- func (b *InMemoryBackend) DescribeStacks(stackIDs []string) ([]*Stack, error)
- func (b *InMemoryBackend) DescribeTimeBasedAutoScaling(instanceIDs []string) ([]*TimeBasedAutoScaling, error)
- func (b *InMemoryBackend) DescribeUserProfiles(iamUserArns []string) ([]*UserProfile, error)
- func (b *InMemoryBackend) DescribeVolumes(instanceID, _ string, volumeIDs []string) ([]*Volume, error)
- func (b *InMemoryBackend) DetachElasticLoadBalancer(elbName, _ string) error
- func (b *InMemoryBackend) DisassociateElasticIP(elasticIP string) error
- func (b *InMemoryBackend) GetHostnameSuggestion(stackID, _ string) (string, error)
- func (b *InMemoryBackend) GrantAccess(instanceID string, validForInMinutes int32) (*TemporaryCredential, error)
- func (b *InMemoryBackend) ListTags(resourceARN string, maxResults int32, nextToken string) (map[string]string, string, error)
- func (b *InMemoryBackend) RebootInstance(instanceID string) error
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RegisterEcsCluster(ecsClusterArn, stackID string) (string, error)
- func (b *InMemoryBackend) RegisterElasticIP(elasticIP, region string) (*ElasticIP, error)
- func (b *InMemoryBackend) RegisterInstance(stackID, hostname string) (string, error)
- func (b *InMemoryBackend) RegisterRdsDBInstance(stackID, rdsDBInstanceArn, dbUser, _ string) error
- func (b *InMemoryBackend) RegisterVolume(ec2VolumeID, stackID string) (string, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetLoadBasedAutoScaling(layerID string, enable bool, upScaling, downScaling *ScalingParameters) error
- func (b *InMemoryBackend) SetPermission(stackID, iamUserArn, level string, allowSSH, allowSudo bool) error
- func (b *InMemoryBackend) SetTimeBasedAutoScaling(instanceID string, schedule *AutoScalingSchedule) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartInstance(instanceID string) error
- func (b *InMemoryBackend) StartStack(stackID string) error
- func (b *InMemoryBackend) StopInstance(instanceID string) error
- func (b *InMemoryBackend) StopStack(stackID string) error
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) UnassignInstance(instanceID string) error
- func (b *InMemoryBackend) UnassignVolume(volumeID string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateApp(appID, name string) error
- func (b *InMemoryBackend) UpdateElasticIP(elasticIP, name string) error
- func (b *InMemoryBackend) UpdateInstance(instanceID, hostname string) error
- func (b *InMemoryBackend) UpdateLayer(layerID, name string) error
- func (b *InMemoryBackend) UpdateMyUserProfile(_ string) error
- func (b *InMemoryBackend) UpdateRdsDBInstance(rdsDBInstanceArn, dbUser, _ string) error
- func (b *InMemoryBackend) UpdateStack(stackID, name string) error
- func (b *InMemoryBackend) UpdateUserProfile(iamUserArn, sshUsername, sshPublicKey string) error
- func (b *InMemoryBackend) UpdateVolume(volumeID, name, mountPoint string) error
- type Instance
- type InstancesCount
- type Layer
- type LoadBasedAutoScaling
- type OperatingSystem
- type Permission
- type Provider
- type RdsDBInstance
- type ScalingParameters
- type Stack
- type StackSummary
- type StorageBackend
- type TemporaryCredential
- type TimeBasedAutoScaling
- type UserProfile
- type Volume
Constants ¶
This section is empty.
Variables ¶
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) )
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 ¶
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 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 (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
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 ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset resets the backend and rebuilds the dispatch table.
func (*Handler) Restore ¶
Restore implements persistence.Persistable by delegating to the backend. See the Snapshot doc comment above for why this delegation is new.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches OpsWorks API requests.
func (*Handler) Snapshot ¶
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 ¶
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) 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 ¶
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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the OpsWorks service backend and handler.
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.
Source Files
¶
- agent_versions.go
- apps.go
- commands.go
- deployments.go
- ecs_clusters.go
- elastic_ips.go
- elastic_load_balancers.go
- errors.go
- handler.go
- handler_agent_versions.go
- handler_apps.go
- handler_commands.go
- handler_deployments.go
- handler_ecs_clusters.go
- handler_elastic_ips.go
- handler_elastic_load_balancers.go
- handler_instances.go
- handler_layers.go
- handler_load_based_scaling.go
- handler_rds_db_instances.go
- handler_service_errors.go
- handler_stacks.go
- handler_tags.go
- handler_time_based_scaling.go
- handler_users_permissions.go
- handler_volumes.go
- instances.go
- interfaces.go
- layers.go
- load_based_scaling.go
- models.go
- persistence.go
- provider.go
- rds_db_instances.go
- service_errors.go
- stacks.go
- store.go
- store_setup.go
- tags.go
- time_based_scaling.go
- users_permissions.go
- volumes.go