describe

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package describe provides functionality to retrieve information about deployed applications, environments and workloads.

Index

Constants

View Source
const (
	// BlankServiceDiscoveryURI is an empty URI to denote services
	// that cannot be reached with Service Discovery.
	BlankServiceDiscoveryURI = "-"
)

Variables

This section is empty.

Functions

func IsStackNotExistsErr

func IsStackNotExistsErr(err error) bool

IsStackNotExistsErr returns true if error type is stack not exist.

func NewAppRunnerStatusDescriber added in v1.7.0

func NewAppRunnerStatusDescriber(opt *NewServiceStatusConfig) (*appRunnerStatusDescriber, error)

NewAppRunnerStatusDescriber instantiates a new appRunnerStatusDescriber struct.

func NewECSStatusDescriber added in v1.7.0

func NewECSStatusDescriber(opt *NewServiceStatusConfig) (*ecsStatusDescriber, error)

NewECSStatusDescriber instantiates a new ecsStatusDescriber struct.

func NewStaticSiteStatusDescriber added in v1.29.0

func NewStaticSiteStatusDescriber(opt *NewServiceStatusConfig) (*staticSiteStatusDescriber, error)

NewStaticSiteStatusDescriber instantiates a new staticSiteStatusDescriber struct.

Types

type App

type App struct {
	Name                string                   `json:"name"`
	Version             string                   `json:"version"`
	URI                 string                   `json:"uri"`
	PermissionsBoundary string                   `json:"permissionsBoundary"`
	Envs                []*config.Environment    `json:"environments"`
	Services            []*config.Workload       `json:"services"`
	Jobs                []*config.Workload       `json:"jobs"`
	Pipelines           []*codepipeline.Pipeline `json:"pipelines"`
	WkldDeployedtoEnvs  map[string][]string      `json:"-"`
}

App contains serialized parameters for an application.

func (*App) HumanString

func (a *App) HumanString() string

HumanString returns the stringified App struct with human readable format.

func (*App) JSONString

func (a *App) JSONString() (string, error)

JSONString returns the stringified App struct with json format.

type AppDescriber added in v1.5.0

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

AppDescriber retrieves information about an application.

func NewAppDescriber added in v1.5.0

func NewAppDescriber(appName string) (*AppDescriber, error)

NewAppDescriber instantiates an application describer.

func (*AppDescriber) Version added in v1.5.0

func (d *AppDescriber) Version() (string, error)

Version returns the app CloudFormation template version associated with the application by reading the Metadata.Version field from the template. Specifically it will get both app CFN stack template version and app StackSet template version, and return the minimum as the current app version.

If the Version field does not exist, then it's a legacy template and it returns an deploy.LegacyAppTemplate and nil error.

type BackendServiceDescriber

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

BackendServiceDescriber retrieves information about a backend service.

func NewBackendServiceDescriber

func NewBackendServiceDescriber(opt NewServiceConfig) (*BackendServiceDescriber, error)

NewBackendServiceDescriber instantiates a backend service describer.

func (*BackendServiceDescriber) Describe

Describe returns info of a backend service.

func (*BackendServiceDescriber) Manifest added in v1.20.0

func (d *BackendServiceDescriber) Manifest(env string) ([]byte, error)

Manifest returns the contents of the manifest used to deploy a backend service stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

func (*BackendServiceDescriber) URI

func (d *BackendServiceDescriber) URI(envName string) (URI, error)

URI returns the service discovery namespace and is used to make BackendServiceDescriber have the same signature as WebServiceDescriber.

type ConfigStoreSvc

type ConfigStoreSvc interface {
	GetEnvironment(appName string, environmentName string) (*config.Environment, error)
	ListEnvironments(appName string) ([]*config.Environment, error)
	ListServices(appName string) ([]*config.Workload, error)
	GetWorkload(appName string, name string) (*config.Workload, error)
	ListJobs(appName string) ([]*config.Workload, error)
}

ConfigStoreSvc wraps methods of config store.

type DeployedEnvServicesLister

type DeployedEnvServicesLister interface {
	ListEnvironmentsDeployedTo(appName string, svcName string) ([]string, error)
	ListDeployedServices(appName string, envName string) ([]string, error)
	ListDeployedJobs(appName string, envName string) ([]string, error)
}

DeployedEnvServicesLister wraps methods of deploy store.

type ECSServiceConfig added in v1.7.0

type ECSServiceConfig struct {
	*ServiceConfig

	Tasks string `json:"tasks"`
}

ECSServiceConfig contains info about how an ECS-based service is configured.

type EnvDescriber

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

EnvDescriber retrieves information about an environment.

func NewEnvDescriber

func NewEnvDescriber(opt NewEnvDescriberConfig) (*EnvDescriber, error)

NewEnvDescriber instantiates an environment describer.

func (*EnvDescriber) AvailableFeatures added in v1.19.0

func (d *EnvDescriber) AvailableFeatures() ([]string, error)

AvailableFeatures returns the available features of the environment stack.

func (*EnvDescriber) Describe

func (d *EnvDescriber) Describe() (*EnvDescription, error)

Describe returns info about an application's environment.

func (*EnvDescriber) Manifest added in v1.19.0

func (d *EnvDescriber) Manifest() ([]byte, error)

Manifest returns the contents of the manifest used to deploy an environment stack.

func (*EnvDescriber) Outputs added in v1.7.1

func (d *EnvDescriber) Outputs() (map[string]string, error)

Outputs returns the outputs of the environment stack.

func (*EnvDescriber) Params added in v1.7.1

func (d *EnvDescriber) Params() (map[string]string, error)

Params returns the parameters of the environment stack.

func (*EnvDescriber) ServiceDiscoveryEndpoint added in v1.9.0

func (d *EnvDescriber) ServiceDiscoveryEndpoint() (string, error)

ServiceDiscoveryEndpoint returns the endpoint the environment was initialized with, if any. Otherwise, it returns the legacy app.local endpoint.

func (*EnvDescriber) ValidateCFServiceDomainAliases added in v1.21.0

func (d *EnvDescriber) ValidateCFServiceDomainAliases() error

ValidateCFServiceDomainAliases returns error if an environment using cdn is deployed without specifying http.alias for all load-balanced web services

func (*EnvDescriber) Version added in v0.5.0

func (d *EnvDescriber) Version() (string, error)

Version returns the CloudFormation template version associated with the environment by reading the Metadata.Version field from the template.

If the Version field does not exist, then it's a legacy template and it returns an version.LegacyEnvTemplate and nil error.

type EnvDescription

type EnvDescription struct {
	Environment    *config.Environment `json:"environment"`
	Services       []*config.Workload  `json:"services"`
	Jobs           []*config.Workload  `json:"jobs"`
	Tags           map[string]string   `json:"tags,omitempty"`
	Resources      []*stack.Resource   `json:"resources,omitempty"`
	EnvironmentVPC EnvironmentVPC      `json:"environmentVPC"`
}

EnvDescription contains the information about an environment.

func (*EnvDescription) HumanString

func (e *EnvDescription) HumanString() string

HumanString returns the stringified EnvDescription struct with human readable format.

func (*EnvDescription) JSONString

func (e *EnvDescription) JSONString() (string, error)

JSONString returns the stringified EnvDescription struct with json format.

type EnvironmentVPC added in v0.6.0

type EnvironmentVPC struct {
	ID               string   `json:"id"`
	PublicSubnetIDs  []string `json:"publicSubnetIDs"`
	PrivateSubnetIDs []string `json:"privateSubnetIDs"`
}

EnvironmentVPC holds the ID of the environment's VPC configuration.

type ErrManifestNotFoundInTemplate added in v1.20.0

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

ErrManifestNotFoundInTemplate is returned when a deployed CFN template is missing manifest data.

func (*ErrManifestNotFoundInTemplate) Error added in v1.20.0

Error implements the error interface.

type ErrNonAccessibleServiceType added in v1.28.0

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

ErrNonAccessibleServiceType is returned when a service type cannot be reached over the network.

func (*ErrNonAccessibleServiceType) Error added in v1.28.0

func (err *ErrNonAccessibleServiceType) Error() string

Error implements the error interface.

type HumanJSONStringer

type HumanJSONStringer interface {
	HumanString() string
	JSONString() (string, error)
}

HumanJSONStringer contains methods that stringify app info for output.

type LBWebServiceDescriber added in v1.7.0

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

LBWebServiceDescriber retrieves information about a load balanced web service.

func NewLBWebServiceDescriber added in v1.7.0

func NewLBWebServiceDescriber(opt NewServiceConfig) (*LBWebServiceDescriber, error)

NewLBWebServiceDescriber instantiates a load balanced service describer.

func (*LBWebServiceDescriber) Describe added in v1.7.0

Describe returns info of a web service.

func (*LBWebServiceDescriber) Manifest added in v1.20.0

func (d *LBWebServiceDescriber) Manifest(env string) ([]byte, error)

Manifest returns the contents of the manifest used to deploy a load balanced web service stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

func (*LBWebServiceDescriber) URI added in v1.7.0

func (d *LBWebServiceDescriber) URI(envName string) (URI, error)

URI returns the LBWebServiceURI to identify this service uniquely given an environment name.

type LBWebServiceURI added in v1.7.0

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

LBWebServiceURI represents the unique identifier to access a load balanced web service.

func (*LBWebServiceURI) String added in v1.7.0

func (u *LBWebServiceURI) String() string

type NewEnvDescriberConfig

type NewEnvDescriberConfig struct {
	App             string
	Env             string
	EnableResources bool
	ConfigStore     ConfigStoreSvc
	DeployStore     DeployedEnvServicesLister
}

NewEnvDescriberConfig contains fields that initiates EnvDescriber struct.

type NewServiceConfig

type NewServiceConfig struct {
	App         string
	Env         string
	Svc         string
	ConfigStore ConfigStoreSvc

	EnableResources bool
	DeployStore     DeployedEnvServicesLister
}

NewServiceConfig contains fields that initiates service describer struct.

type NewServiceStatusConfig

type NewServiceStatusConfig struct {
	App         string
	Env         string
	Svc         string
	ConfigStore ConfigStoreSvc
}

NewServiceStatusConfig contains fields that initiates ServiceStatus struct.

type NewWorkloadConfig added in v1.29.0

type NewWorkloadConfig struct {
	App         string
	Env         string
	Name        string
	ConfigStore ConfigStoreSvc
}

NewWorkloadConfig contains fields that initiates workload describer struct.

type Pipeline

type Pipeline struct {
	// Name is the user provided name for a pipeline
	Name string `json:"name"`
	codepipeline.Pipeline

	Resources []*describestack.Resource `json:"resources,omitempty"`
}

Pipeline contains serialized parameters for a pipeline.

func (*Pipeline) HumanString

func (p *Pipeline) HumanString() string

HumanString returns the stringified Pipeline struct with human readable format.

func (*Pipeline) JSONString

func (p *Pipeline) JSONString() (string, error)

JSONString returns the stringified Pipeline struct with JSON format.

type PipelineDescriber

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

PipelineDescriber retrieves information about a deployed pipeline.

func NewPipelineDescriber

func NewPipelineDescriber(pipeline deploy.Pipeline, showResources bool) (*PipelineDescriber, error)

NewPipelineDescriber instantiates a new pipeline describer

func (*PipelineDescriber) Describe

func (d *PipelineDescriber) Describe() (HumanJSONStringer, error)

Describe returns description of a pipeline.

type PipelineStackDescriber added in v1.29.0

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

PipelineStackDescriber retrieves information about a deployed pipeline stack.

func NewPipelineStackDescriber added in v1.29.0

func NewPipelineStackDescriber(appName, name string, isLegacy bool) (*PipelineStackDescriber, error)

NewPipelineStackDescriber instantiates a new pipeline stack describer

func (*PipelineStackDescriber) Version added in v1.29.0

func (d *PipelineStackDescriber) Version() (string, error)

Version returns the CloudFormation template version associated with the pipeline by reading the Metadata.Version field from the template.

If the Version field does not exist, then it's a legacy template and it returns an version.LegacyPipelineTemplate and nil error.

type PipelineStatus

type PipelineStatus struct {
	Name string `json:"name"`
	codepipeline.PipelineState
}

PipelineStatus contains the status for a pipeline.

func (PipelineStatus) HumanString

func (p PipelineStatus) HumanString() string

HumanString returns stringified PipelineStatus struct with human readable format.

func (PipelineStatus) JSONString

func (p PipelineStatus) JSONString() (string, error)

JSONString returns stringified PipelineStatus struct with json format.

type PipelineStatusDescriber

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

PipelineStatusDescriber retrieves status of a deployed pipeline.

func NewPipelineStatusDescriber

func NewPipelineStatusDescriber(pipeline deploy.Pipeline) (*PipelineStatusDescriber, error)

NewPipelineStatusDescriber instantiates a new PipelineStatus struct.

func (*PipelineStatusDescriber) Describe

Describe returns status of a pipeline.

type RDWSRoute added in v1.23.0

type RDWSRoute struct {
	Environment string      `json:"environment"`
	URL         string      `json:"url"`
	Ingress     rdwsIngress `json:"ingress"`
}

RDWSRoute contains serialized route parameters for a Request-Driven Web Service.

type RDWebServiceDescriber added in v1.7.0

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

RDWebServiceDescriber retrieves information about a request-driven web service.

func NewRDWebServiceDescriber added in v1.7.0

func NewRDWebServiceDescriber(opt NewServiceConfig) (*RDWebServiceDescriber, error)

NewRDWebServiceDescriber instantiates a request-driven service describer.

func (*RDWebServiceDescriber) Describe added in v1.7.0

Describe returns info for a request-driven web service.

func (*RDWebServiceDescriber) Manifest added in v1.20.0

func (d *RDWebServiceDescriber) Manifest(env string) ([]byte, error)

Manifest returns the contents of the manifest used to deploy a request-driven web service stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

func (*RDWebServiceDescriber) ServiceARN added in v1.18.0

func (d *RDWebServiceDescriber) ServiceARN(env string) (string, error)

ServiceARN retrieves the ARN of the app runner service.

func (*RDWebServiceDescriber) URI added in v1.7.0

func (d *RDWebServiceDescriber) URI(envName string) (URI, error)

URI returns the WebServiceURI to identify this service uniquely given an environment name.

type ReachableService added in v1.10.0

type ReachableService interface {
	URI(env string) (URI, error)
}

ReachableService represents a service describer that has an endpoint.

func NewReachableService added in v1.10.0

func NewReachableService(app, svc string, store ConfigStoreSvc) (ReachableService, error)

NewReachableService returns a ReachableService based on the type of the service.

type S3ObjectTree added in v1.29.0

type S3ObjectTree struct {
	Environment string
	Tree        string
}

S3ObjectTree contains serialized parameters for an S3 object tree.

type ServiceConfig

type ServiceConfig struct {
	Environment string `json:"environment"`
	Port        string `json:"port"`
	CPU         string `json:"cpu"`
	Memory      string `json:"memory"`
	Platform    string `json:"platform,omitempty"`
}

ServiceConfig contains serialized configuration parameters for a service.

type StaticSiteDescriber added in v1.28.0

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

StaticSiteDescriber retrieves information about a static site service.

func NewStaticSiteDescriber added in v1.28.0

func NewStaticSiteDescriber(opt NewServiceConfig) (*StaticSiteDescriber, error)

NewStaticSiteDescriber instantiates a static site service describer.

func (*StaticSiteDescriber) Describe added in v1.28.0

func (d *StaticSiteDescriber) Describe() (HumanJSONStringer, error)

Describe returns info of a static site.

func (*StaticSiteDescriber) Manifest added in v1.28.0

func (d *StaticSiteDescriber) Manifest(env string) ([]byte, error)

Manifest returns the contents of the manifest used to deploy a static site stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

func (*StaticSiteDescriber) URI added in v1.28.0

func (d *StaticSiteDescriber) URI(envName string) (URI, error)

URI returns the public accessible URI of a static site service.

type URI added in v1.19.0

type URI struct {
	URI        string
	AccessType URIAccessType
}

URI represents a uri and how it can be accessed.

type URIAccessType added in v1.19.0

type URIAccessType int

URIAccessType represents how a URI can be accessed.

const (
	URIAccessTypeNone URIAccessType = iota
	URIAccessTypeInternet
	URIAccessTypeInternal
	URIAccessTypeServiceDiscovery
	URIAccessTypeServiceConnect

	LBDNS = "COPILOT_LB_DNS"
)

Supported URI Access Types.

type WebServiceRoute

type WebServiceRoute struct {
	Environment string `json:"environment"`
	URL         string `json:"url"`
}

WebServiceRoute contains serialized route parameters for a web service.

type WorkerServiceDescriber added in v1.10.0

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

WorkerServiceDescriber retrieves information about a worker service.

func NewWorkerServiceDescriber added in v1.10.0

func NewWorkerServiceDescriber(opt NewServiceConfig) (*WorkerServiceDescriber, error)

NewWorkerServiceDescriber instantiates a worker service describer.

func (*WorkerServiceDescriber) Describe added in v1.10.0

Describe returns info of a worker service.

func (*WorkerServiceDescriber) Manifest added in v1.20.0

func (d *WorkerServiceDescriber) Manifest(env string) ([]byte, error)

Manifest returns the contents of the manifest used to deploy a worker service stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

type WorkloadStackDescriber added in v1.29.0

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

WorkloadStackDescriber provides base functionality for retrieving info about a workload stack.

func NewWorkloadStackDescriber added in v1.29.0

func NewWorkloadStackDescriber(opt NewWorkloadConfig) (*WorkloadStackDescriber, error)

NewWorkloadStackDescriber instantiates the core elements of a new workload.

func (*WorkloadStackDescriber) Manifest added in v1.29.0

func (d *WorkloadStackDescriber) Manifest() ([]byte, error)

Manifest returns the contents of the manifest used to deploy a workload stack. If the Manifest metadata doesn't exist in the stack template, then returns ErrManifestNotFoundInTemplate.

func (*WorkloadStackDescriber) Outputs added in v1.29.0

func (d *WorkloadStackDescriber) Outputs() (map[string]string, error)

Outputs returns the outputs of the service stack.

func (*WorkloadStackDescriber) Params added in v1.29.0

func (d *WorkloadStackDescriber) Params() (map[string]string, error)

Params returns the parameters of the workload stack.

func (*WorkloadStackDescriber) StackResources added in v1.29.0

func (d *WorkloadStackDescriber) StackResources() ([]*stack.Resource, error)

StackResources returns the workload stack resources created by CloudFormation.

func (*WorkloadStackDescriber) Version added in v1.29.0

func (d *WorkloadStackDescriber) Version() (string, error)

Version returns the CloudFormation template version associated with the workload by reading the Metadata.Version field from the template.

If the Version field does not exist, then it's a legacy template and it returns an version.LegacyWorkloadTemplate and nil error.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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