Documentation ¶
Overview ¶
Package config implements CRUD operations for application, environment, service and pipeline configuration. This configuration contains the Copilot applications a customer has, and the environments and pipelines associated with each application.
Index ¶
- type AdjustVPC
- type Application
- type CustomizeEnv
- type Environment
- type ErrNoSuchApplication
- type ErrNoSuchEnvironment
- type ErrNoSuchJob
- type ErrNoSuchService
- type ImportVPC
- type Store
- func (s *Store) CreateApplication(application *Application) error
- func (s *Store) CreateEnvironment(environment *Environment) error
- func (s *Store) CreateJob(job *Workload) error
- func (s *Store) CreateService(svc *Workload) error
- func (s *Store) DeleteApplication(name string) error
- func (s *Store) DeleteEnvironment(appName, environmentName string) error
- func (s *Store) DeleteJob(appName, jobName string) error
- func (s *Store) DeleteService(appName, svcName string) error
- func (s *Store) GetApplication(applicationName string) (*Application, error)
- func (s *Store) GetEnvironment(appName string, environmentName string) (*Environment, error)
- func (s *Store) GetJob(appName, jobName string) (*Workload, error)
- func (s *Store) GetService(appName, svcName string) (*Workload, error)
- func (s *Store) ListApplications() ([]*Application, error)
- func (s *Store) ListEnvironments(appName string) ([]*Environment, error)
- func (s *Store) ListJobs(appName string) ([]*Workload, error)
- func (s *Store) ListServices(appName string) ([]*Workload, error)
- type Workload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdjustVPC ¶ added in v0.5.0
type AdjustVPC struct { CIDR string `json:"cidr"` // CIDR range for the VPC. PublicSubnetCIDRs []string `json:"publicSubnetCIDRs"` PrivateSubnetCIDRs []string `json:"privateSubnetCIDRs"` }
AdjustVPC holds the fields to adjust default VPC resources.
type Application ¶
type Application struct { Name string `json:"name"` // Name of an Application. Must be unique amongst other apps in the same account. AccountID string `json:"account"` // AccountID this app is mastered in. Domain string `json:"domain"` // Existing domain name in Route53. An empty domain name means the user does not have one. Version string `json:"version"` // The version of the app layout in the underlying datastore (e.g. SSM). Tags map[string]string `json:"tags,omitempty"` // Labels to apply to resources created within the app. }
Application is a named collection of environments and services.
func (*Application) RequiresDNSDelegation ¶
func (a *Application) RequiresDNSDelegation() bool
RequiresDNSDelegation returns true if we have to set up DNS Delegation resources
type CustomizeEnv ¶ added in v0.5.0
type CustomizeEnv struct { ImportVPC *ImportVPC `json:"importVPC,omitempty"` VPCConfig *AdjustVPC `json:"adjustVPC,omitempty"` }
CustomizeEnv represents the custom environment config.
func NewCustomizeEnv ¶ added in v0.5.0
func NewCustomizeEnv(importVPC *ImportVPC, adjustVPC *AdjustVPC) *CustomizeEnv
NewCustomizeEnv returns a new CustomizeEnv struct.
type Environment ¶
type Environment struct { App string `json:"app"` // Name of the app this environment belongs to. Name string `json:"name"` // Name of the environment, must be unique within a App. Region string `json:"region"` // Name of the region this environment is stored in. AccountID string `json:"accountID"` // Account ID of the account this environment is stored in. Prod bool `json:"prod"` // Whether or not this environment is a production environment. RegistryURL string `json:"registryURL"` // URL For ECR Registry for this environment. ExecutionRoleARN string `json:"executionRoleARN"` // ARN used by CloudFormation to make modification to the environment stack. ManagerRoleARN string `json:"managerRoleARN"` // ARN for the manager role assumed to manipulate the environment and its services. CustomConfig *CustomizeEnv `json:"customConfig,omitempty"` // Custom environment configuration by users. }
Environment represents a deployment environment in an application.
type ErrNoSuchApplication ¶
ErrNoSuchApplication means an application couldn't be found within a specific account and region.
func (*ErrNoSuchApplication) Error ¶
func (e *ErrNoSuchApplication) Error() string
func (*ErrNoSuchApplication) Is ¶
func (e *ErrNoSuchApplication) Is(target error) bool
Is returns whether the provided error equals this error.
type ErrNoSuchEnvironment ¶
ErrNoSuchEnvironment means a specific environment couldn't be found in a specific project.
func (*ErrNoSuchEnvironment) Error ¶
func (e *ErrNoSuchEnvironment) Error() string
func (*ErrNoSuchEnvironment) Is ¶
func (e *ErrNoSuchEnvironment) Is(target error) bool
Is returns whether the provided error equals this error.
type ErrNoSuchJob ¶ added in v0.5.0
ErrNoSuchJob means a specific job couldn't be found in a specific application.
func (*ErrNoSuchJob) Error ¶ added in v0.5.0
func (e *ErrNoSuchJob) Error() string
func (*ErrNoSuchJob) Is ¶ added in v0.5.0
func (e *ErrNoSuchJob) Is(target error) bool
Is returns whether the provided error equals this error.
type ErrNoSuchService ¶
ErrNoSuchService means a specific service couldn't be found in a specific application.
func (*ErrNoSuchService) Error ¶
func (e *ErrNoSuchService) Error() string
func (*ErrNoSuchService) Is ¶
func (e *ErrNoSuchService) Is(target error) bool
Is returns whether the provided error equals this error.
type ImportVPC ¶ added in v0.5.0
type ImportVPC struct { ID string `json:"id"` // ID for the VPC. PublicSubnetIDs []string `json:"publicSubnetIDs"` PrivateSubnetIDs []string `json:"privateSubnetIDs"` }
ImportVPC holds the fields to import VPC resources.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is in charge of fetching and creating applications, environment, services and other workloads, and pipeline configuration in SSM.
func NewStore ¶
NewStore returns a new store, allowing you to query or create Applications, Environments, Services, and other workloads.
func (*Store) CreateApplication ¶
func (s *Store) CreateApplication(application *Application) error
CreateApplication instantiates a new application, validates its uniqueness and stores it in SSM.
func (*Store) CreateEnvironment ¶
func (s *Store) CreateEnvironment(environment *Environment) error
CreateEnvironment instantiates a new environment within an existing App. Skip if the environment already exists in the App.
func (*Store) CreateJob ¶ added in v0.5.0
CreateJob instantiates a new job within an existing application. Skip if the job already exists in the application.
func (*Store) CreateService ¶
CreateService instantiates a new service within an existing application. Skip if the service already exists in the application.
func (*Store) DeleteApplication ¶
DeleteApplication deletes the SSM parameter related to the application.
func (*Store) DeleteEnvironment ¶
DeleteEnvironment removes an environment from SSM. If the environment does not exist in the store or is successfully deleted then returns nil. Otherwise, returns an error.
func (*Store) DeleteJob ¶ added in v0.5.0
DeleteJob removes a job from SSM. If the job does not exist in the store or is successfully deleted then returns nil. Otherwise, returns an error.
func (*Store) DeleteService ¶
DeleteService removes a service from SSM. If the service does not exist in the store or is successfully deleted then returns nil. Otherwise, returns an error.
func (*Store) GetApplication ¶
func (s *Store) GetApplication(applicationName string) (*Application, error)
GetApplication fetches an application by name. If it can't be found, return a ErrNoSuchApplication
func (*Store) GetEnvironment ¶
func (s *Store) GetEnvironment(appName string, environmentName string) (*Environment, error)
GetEnvironment gets an environment belonging to a particular application by name. If no environment is found it returns ErrNoSuchEnvironment.
func (*Store) GetJob ¶ added in v0.5.0
GetJob gets a job belonging to a particular application by name. If no job by that name is found, it returns ErrNoSuchJob.
func (*Store) GetService ¶
GetService gets a service belonging to a particular application by name. If no job or svc is found it returns ErrNoSuchService.
func (*Store) ListApplications ¶
func (s *Store) ListApplications() ([]*Application, error)
ListApplications returns the list of existing applications in the customer's account and region.
func (*Store) ListEnvironments ¶
func (s *Store) ListEnvironments(appName string) ([]*Environment, error)
ListEnvironments returns all environments belonging to a particular application.
type Workload ¶ added in v0.5.0
type Workload struct { App string `json:"app"` // Name of the app this workload belongs to. Name string `json:"name"` // Name of the workload, which must be unique within a app. Type string `json:"type"` // Type of the workload (ex: Load Balanced Web Service, etc) }
Workload represents a deployable long running service or task.