Documentation
¶
Overview ¶
Package orchestration brings together the other components of the API into a single orchestration interface for creating and deleting ecs services
Package orchestration brings together the other components of the API into a single orchestration interface for creating and deleting ecs services
Index ¶
- Variables
- type Orchestrator
- func (o *Orchestrator) CreateService(ctx context.Context, input *ServiceOrchestrationInput) (*ServiceOrchestrationOutput, error)
- func (o *Orchestrator) DeleteService(ctx context.Context, input *ServiceDeleteInput) (*ServiceOrchestrationOutput, error)
- func (o *Orchestrator) UpdateService(ctx context.Context, cluster, service string, ...) (*ServiceOrchestrationUpdateOutput, error)
- type ServiceDeleteInput
- type ServiceOrchestrationInput
- type ServiceOrchestrationOutput
- type ServiceOrchestrationUpdateInput
- type ServiceOrchestrationUpdateOutput
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultCompatabilities sets the default task definition compatabilities to // Fargate. By default, we won't support standard ECS. // https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskDefinition.html DefaultCompatabilities = []*string{ aws.String("FARGATE"), } // DefaultNetworkMode sets the default networking more for task definitions created // by the api. Currently, Fargate only supports vpc networking. // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html DefaultNetworkMode = aws.String("awsvpc") // DefaultLaunchType sets the default launch type to Fargate DefaultLaunchType = aws.String("FARGATE") // DefaultPublic disables the setting of public IPs on ENIs by default DefaultPublic = aws.String("DISABLED") // DefaultSubnets sets a list of default subnets to attach ENIs DefaultSubnets = []*string{} // DefaultSecurityGroups sets a list of default sgs to attach to ENIs DefaultSecurityGroups = []*string{} )
Functions ¶
This section is empty.
Types ¶
type Orchestrator ¶
type Orchestrator struct {
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#ECS
ECS ecs.ECS
// https://docs.aws.amazon.com/sdk-for-go/api/service/iam/#IAM
IAM iam.IAM
// https://docs.aws.amazon.com/sdk-for-go/api/service/secretsmanager/#SecretsManager
SecretsManager secretsmanager.SecretsManager
// https://docs.aws.amazon.com/sdk-for-go/api/service/servicediscovery/#ServiceDiscovery
ServiceDiscovery servicediscovery.ServiceDiscovery
// Token is a uniqueness token for calls to AWS
Token string
// Org is the organization where this orchestration runs
Org string
}
Orchestrator holds the service discovery client, iam client, ecs client, secretsmanager client, input, and output
func (*Orchestrator) CreateService ¶
func (o *Orchestrator) CreateService(ctx context.Context, input *ServiceOrchestrationInput) (*ServiceOrchestrationOutput, error)
CreateService takes service orchestration input, builds up a service and returns the service orchestration output
func (*Orchestrator) DeleteService ¶
func (o *Orchestrator) DeleteService(ctx context.Context, input *ServiceDeleteInput) (*ServiceOrchestrationOutput, error)
DeleteService takes a service orchestrator, service name and a cluster to delete and removes the service and the service registry
func (*Orchestrator) UpdateService ¶ added in v1.2.0
func (o *Orchestrator) UpdateService(ctx context.Context, cluster, service string, input *ServiceOrchestrationUpdateInput) (*ServiceOrchestrationUpdateOutput, error)
UpdateService updates a service and related services
type ServiceDeleteInput ¶
ServiceDeleteInput encapsulates a request to delete a service with optional recursion
type ServiceOrchestrationInput ¶
type ServiceOrchestrationInput struct {
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#CreateClusterInput
Cluster *ecs.CreateClusterInput
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#RegisterTaskDefinitionInput
TaskDefinition *ecs.RegisterTaskDefinitionInput
// map of container definition names to private repository credentials
// https://docs.aws.amazon.com/sdk-for-go/api/service/secretsmanager/#CreateSecretInput
Credentials map[string]*secretsmanager.CreateSecretInput
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#CreateServiceInput
Service *ecs.CreateServiceInput
// https://docs.aws.amazon.com/sdk-for-go/api/service/servicediscovery/#CreateServiceInput
ServiceRegistry *servicediscovery.CreateServiceInput
}
ServiceOrchestrationInput encapsulates a single request for a service
type ServiceOrchestrationOutput ¶
type ServiceOrchestrationOutput struct {
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#Cluster
Cluster *ecs.Cluster
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#TaskDefinition
TaskDefinition *ecs.TaskDefinition
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#Service
Service *ecs.Service
// https://docs.aws.amazon.com/sdk-for-go/api/service/servicediscovery/#Service
ServiceDiscoveryService *servicediscovery.Service
}
ServiceOrchestrationOutput is the output structure for service orchestration
type ServiceOrchestrationUpdateInput ¶ added in v1.2.0
type ServiceOrchestrationUpdateInput struct {
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#UpdateServiceInput
// Service *ecs.UpdateServiceInput
Tags []*ecs.Tag
ForceNewDeployment bool
}
ServiceOrchestrationUpdateInput is in the input for service orchestration updates. The following are supported:
service: desired count, deployment configuration, network configuration and task definition can be updated tags: will be applied to all resources
type ServiceOrchestrationUpdateOutput ¶ added in v1.2.0
ServiceOrchestrationUpdateOutput is the output for service orchestration updates