Documentation ¶
Index ¶
- Variables
- func EmptyTemplate() string
- func IsNoUpdatesError(err error) bool
- func ResolveFunc(raw interface{}, params map[string]string) (string, error)
- type CFClient
- func (cf *CFClient) CancelStackUpdate(ctx context.Context, reqToken string, ...) error
- func (cf *CFClient) CreateChangeSet(ctx context.Context, reqToken string, msg *awsinfra_tpb.CreateChangeSetMessage) error
- func (cf *CFClient) CreateNewStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.CreateNewStackMessage) error
- func (cf *CFClient) DeleteStack(ctx context.Context, reqToken string, stackName string) error
- func (cf *CFClient) GetChangeSet(ctx context.Context, stackName, changeSetName string) (*ChangeSetStatus, error)
- func (cf *CFClient) GetOneStack(ctx context.Context, stackName string) (*StackStatus, error)
- func (cf *CFClient) ImportResources(ctx context.Context, templateBody string, params []types.Parameter) (*ImportOutput, error)
- func (cf *CFClient) ScaleStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.ScaleStackMessage) error
- func (cf *CFClient) UpdateStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.UpdateStackMessage) error
- type ChangeSetStatus
- type CloudFormationAPI
- type DBLite
- type DBMigrator
- type DBSecret
- type DeferredParameterResolver
- type DeployerClients
- type ECSAPI
- type ECSTaskStateChangeEvent
- type ECSTaskStateChangeEvent_Container
- type ECSWorker
- type ELBV2API
- type FuncJoin
- type IDBMigrator
- type ImportOutput
- type InfraEvent
- type InfraWorker
- func (cf *InfraWorker) CancelStackUpdate(ctx context.Context, msg *awsinfra_tpb.CancelStackUpdateMessage) (*emptypb.Empty, error)
- func (cf *InfraWorker) CreateChangeSet(ctx context.Context, msg *awsinfra_tpb.CreateChangeSetMessage) (*emptypb.Empty, error)
- func (cf *InfraWorker) CreateNewStack(ctx context.Context, msg *awsinfra_tpb.CreateNewStackMessage) (*emptypb.Empty, error)
- func (cf *InfraWorker) HandleCloudFormationEvent(ctx context.Context, fields map[string]string) error
- func (cf *InfraWorker) ScaleStack(ctx context.Context, msg *awsinfra_tpb.ScaleStackMessage) (*emptypb.Empty, error)
- func (cf *InfraWorker) StabalizeStack(ctx context.Context, msg *awsinfra_tpb.StabalizeStackMessage) (*emptypb.Empty, error)
- func (cf *InfraWorker) UpdateStack(ctx context.Context, msg *awsinfra_tpb.UpdateStackMessage) (*emptypb.Empty, error)
- type PostgresMigrateWorker
- func (d *PostgresMigrateWorker) CleanupPostgresDatabase(ctx context.Context, msg *awsinfra_tpb.CleanupPostgresDatabaseMessage) (*emptypb.Empty, error)
- func (d *PostgresMigrateWorker) ECSTaskStatus(ctx context.Context, msg *awsinfra_tpb.ECSTaskStatusMessage) (*emptypb.Empty, error)
- func (d *PostgresMigrateWorker) MigratePostgresDatabase(ctx context.Context, msg *awsinfra_tpb.MigratePostgresDatabaseMessage) (*emptypb.Empty, error)
- func (d *PostgresMigrateWorker) UpsertPostgresDatabase(ctx context.Context, msg *awsinfra_tpb.UpsertPostgresDatabaseMessage) (*emptypb.Empty, error)
- type RawMessageWorker
- type RawWorkerCFHandler
- type RawWorkerECSHandler
- type Resource
- type S3API
- type SNSAPI
- type SecretsManagerAPI
- type StackArgs
- type StackStatus
- type Storage
- func (s *Storage) ClientTokenToRequest(ctx context.Context, token string) (*messaging_j5pb.RequestMetadata, error)
- func (s *Storage) PublishEvent(ctx context.Context, msg o5msg.Message) error
- func (s *Storage) RequestToClientToken(ctx context.Context, req *messaging_j5pb.RequestMetadata) (string, error)
- type Template
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestTokenNotFound = errors.New("request token not found")
Functions ¶
func EmptyTemplate ¶
func EmptyTemplate() string
func IsNoUpdatesError ¶
Types ¶
type CFClient ¶
type CFClient struct { CallbackARNs []string // contains filtered or unexported fields }
func NewCFAdapter ¶
func NewCFAdapter(clients *DeployerClients, callbackARNs []string) *CFClient
func NewCFAdapterFromConfig ¶
func (*CFClient) CancelStackUpdate ¶
func (cf *CFClient) CancelStackUpdate(ctx context.Context, reqToken string, msg *awsinfra_tpb.CancelStackUpdateMessage) error
func (*CFClient) CreateChangeSet ¶
func (cf *CFClient) CreateChangeSet(ctx context.Context, reqToken string, msg *awsinfra_tpb.CreateChangeSetMessage) error
func (*CFClient) CreateNewStack ¶
func (cf *CFClient) CreateNewStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.CreateNewStackMessage) error
func (*CFClient) DeleteStack ¶
func (*CFClient) GetChangeSet ¶
func (*CFClient) GetOneStack ¶
func (*CFClient) ImportResources ¶
func (*CFClient) ScaleStack ¶
func (cf *CFClient) ScaleStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.ScaleStackMessage) error
func (*CFClient) UpdateStack ¶
func (cf *CFClient) UpdateStack(ctx context.Context, reqToken string, msg *awsinfra_tpb.UpdateStackMessage) error
type ChangeSetStatus ¶
type ChangeSetStatus struct { Status string Lifecycle awsdeployer_pb.CFChangesetLifecycle }
type CloudFormationAPI ¶
type CloudFormationAPI interface { DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error) CreateStack(ctx context.Context, params *cloudformation.CreateStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.CreateStackOutput, error) UpdateStack(ctx context.Context, params *cloudformation.UpdateStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.UpdateStackOutput, error) CreateChangeSet(ctx context.Context, params *cloudformation.CreateChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.CreateChangeSetOutput, error) ExecuteChangeSet(ctx context.Context, params *cloudformation.ExecuteChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ExecuteChangeSetOutput, error) DescribeChangeSet(ctx context.Context, params *cloudformation.DescribeChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeChangeSetOutput, error) DeleteStack(ctx context.Context, params *cloudformation.DeleteStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error) CancelUpdateStack(ctx context.Context, params *cloudformation.CancelUpdateStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.CancelUpdateStackOutput, error) }
type DBLite ¶
type DBLite interface { PublishEvent(context.Context, o5msg.Message) error RequestToClientToken(context.Context, *messaging_j5pb.RequestMetadata) (string, error) ClientTokenToRequest(context.Context, string) (*messaging_j5pb.RequestMetadata, error) }
type DBMigrator ¶
type DBMigrator struct {
// contains filtered or unexported fields
}
func NewDBMigrator ¶
func NewDBMigrator(client SecretsManagerAPI) *DBMigrator
func (*DBMigrator) CleanupPostgresDatabase ¶
func (d *DBMigrator) CleanupPostgresDatabase(ctx context.Context, migrationID string, msg *awsdeployer_pb.PostgresCleanupSpec) error
func (*DBMigrator) UpsertPostgresDatabase ¶
func (d *DBMigrator) UpsertPostgresDatabase(ctx context.Context, migrationID string, msg *awsdeployer_pb.PostgresCreationSpec) error
type DeferredParameterResolver ¶
type DeferredParameterResolver struct {
// contains filtered or unexported fields
}
func NewDeferredParameterResolver ¶
func NewDeferredParameterResolver(elbClient ELBV2API, listenerARN string, desiredCount int32) (*DeferredParameterResolver, error)
func (*DeferredParameterResolver) Resolve ¶
func (dpr *DeferredParameterResolver) Resolve(ctx context.Context, input *awsdeployer_pb.CloudFormationStackParameterType, previous *types.Parameter) (string, error)
type DeployerClients ¶
type DeployerClients struct { CloudFormation CloudFormationAPI SNS SNSAPI ELB ELBV2API SecretsManager SecretsManagerAPI ECS ECSAPI S3 S3API Region string AccountID string }
type ECSAPI ¶
type ECSAPI interface { RunTask(ctx context.Context, params *ecs.RunTaskInput, optFns ...func(*ecs.Options)) (*ecs.RunTaskOutput, error) // used by the TasksStoppedWaiter ecs.DescribeTasksAPIClient }
type ECSTaskStateChangeEvent ¶
type ECSTaskStateChangeEvent struct { ClusterArn string `json:"clusterArn"` TaskArn string `json:"taskArn"` LastStatus string `json:"lastStatus"` StoppedAt string `json:"stoppedAt"` StoppedReason string `json:"stoppedReason"` StopCode *string `json:"stopCode"` Group *string `json:"group"` Containers []ECSTaskStateChangeEvent_Container `json:"containers"` StartedBy string `json:"startedBy"` }
type ECSWorker ¶
type ECSWorker struct { awsinfra_tpb.UnimplementedECSRequestTopicServer // contains filtered or unexported fields }
func (*ECSWorker) HandleECSTaskEvent ¶
func (*ECSWorker) RunECSTask ¶
func (handler *ECSWorker) RunECSTask(ctx context.Context, msg *awsinfra_tpb.RunECSTaskMessage) (*emptypb.Empty, error)
type ELBV2API ¶
type ELBV2API interface {
DescribeRules(ctx context.Context, params *elbv2.DescribeRulesInput, optFns ...func(*elbv2.Options)) (*elbv2.DescribeRulesOutput, error)
}
type FuncJoin ¶
type FuncJoin struct { Join string Values []interface{} }
func (*FuncJoin) MarshalJSON ¶
func (*FuncJoin) UnmarshalJSON ¶
type IDBMigrator ¶
type IDBMigrator interface { UpsertPostgresDatabase(ctx context.Context, migrationID string, msg *awsdeployer_pb.PostgresCreationSpec) error CleanupPostgresDatabase(ctx context.Context, migrationID string, msg *awsdeployer_pb.PostgresCleanupSpec) error }
type ImportOutput ¶
type ImportOutput struct { Imports []types.ResourceToImport NewTemplate string }
type InfraEvent ¶
type InfraEvent struct { Source string `json:"source"` DetailType string `json:"detail-type"` Detail json.RawMessage `json:"detail"` ID string `json:"id"` }
func (*InfraEvent) Valid ¶
func (ie *InfraEvent) Valid() bool
type InfraWorker ¶
type InfraWorker struct { awsinfra_tpb.UnimplementedCloudFormationRequestTopicServer *CFClient // contains filtered or unexported fields }
func NewInfraWorker ¶
func NewInfraWorker(db DBLite, adapter *CFClient) *InfraWorker
func (*InfraWorker) CancelStackUpdate ¶
func (cf *InfraWorker) CancelStackUpdate(ctx context.Context, msg *awsinfra_tpb.CancelStackUpdateMessage) (*emptypb.Empty, error)
func (*InfraWorker) CreateChangeSet ¶
func (cf *InfraWorker) CreateChangeSet(ctx context.Context, msg *awsinfra_tpb.CreateChangeSetMessage) (*emptypb.Empty, error)
func (*InfraWorker) CreateNewStack ¶
func (cf *InfraWorker) CreateNewStack(ctx context.Context, msg *awsinfra_tpb.CreateNewStackMessage) (*emptypb.Empty, error)
func (*InfraWorker) HandleCloudFormationEvent ¶
func (*InfraWorker) ScaleStack ¶
func (cf *InfraWorker) ScaleStack(ctx context.Context, msg *awsinfra_tpb.ScaleStackMessage) (*emptypb.Empty, error)
func (*InfraWorker) StabalizeStack ¶
func (cf *InfraWorker) StabalizeStack(ctx context.Context, msg *awsinfra_tpb.StabalizeStackMessage) (*emptypb.Empty, error)
StabalizeStack is sent to check that the stack is ready for a new deployment. It will emit a 'fake' status change event if the stack is in a stable state, so that the deployer can catch up with remote status.
func (*InfraWorker) UpdateStack ¶
func (cf *InfraWorker) UpdateStack(ctx context.Context, msg *awsinfra_tpb.UpdateStackMessage) (*emptypb.Empty, error)
type PostgresMigrateWorker ¶
type PostgresMigrateWorker struct { awsinfra_tpb.UnimplementedPostgresRequestTopicServer awsinfra_tpb.UnimplementedECSReplyTopicServer // contains filtered or unexported fields }
func NewPostgresMigrateWorker ¶
func NewPostgresMigrateWorker(db DBLite, migrator IDBMigrator) *PostgresMigrateWorker
func (*PostgresMigrateWorker) CleanupPostgresDatabase ¶
func (d *PostgresMigrateWorker) CleanupPostgresDatabase(ctx context.Context, msg *awsinfra_tpb.CleanupPostgresDatabaseMessage) (*emptypb.Empty, error)
func (*PostgresMigrateWorker) ECSTaskStatus ¶
func (d *PostgresMigrateWorker) ECSTaskStatus(ctx context.Context, msg *awsinfra_tpb.ECSTaskStatusMessage) (*emptypb.Empty, error)
func (*PostgresMigrateWorker) MigratePostgresDatabase ¶
func (d *PostgresMigrateWorker) MigratePostgresDatabase(ctx context.Context, msg *awsinfra_tpb.MigratePostgresDatabaseMessage) (*emptypb.Empty, error)
func (*PostgresMigrateWorker) UpsertPostgresDatabase ¶
func (d *PostgresMigrateWorker) UpsertPostgresDatabase(ctx context.Context, msg *awsinfra_tpb.UpsertPostgresDatabaseMessage) (*emptypb.Empty, error)
type RawMessageWorker ¶
type RawMessageWorker struct { messaging_tpb.UnimplementedRawMessageTopicServer // contains filtered or unexported fields }
func NewRawMessageWorker ¶
func NewRawMessageWorker(cfHandler RawWorkerCFHandler, ecsHandler RawWorkerECSHandler) *RawMessageWorker
func (*RawMessageWorker) HandleInfraJSON ¶
func (worker *RawMessageWorker) HandleInfraJSON(ctx context.Context, payload []byte) error
func (*RawMessageWorker) HandleInfraNonJSON ¶
func (worker *RawMessageWorker) HandleInfraNonJSON(ctx context.Context, payload []byte) error
func (*RawMessageWorker) Raw ¶
func (worker *RawMessageWorker) Raw(ctx context.Context, msg *messaging_tpb.RawMessage) (*emptypb.Empty, error)
type RawWorkerCFHandler ¶
type RawWorkerECSHandler ¶
type RawWorkerECSHandler interface {
HandleECSTaskEvent(ctx context.Context, eventID string, event *ECSTaskStateChangeEvent) error
}
type S3API ¶
type S3API interface { PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error) GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error) GetBucketLocation(ctx context.Context, params *s3.GetBucketLocationInput, optFns ...func(*s3.Options)) (*s3.GetBucketLocationOutput, error) }
type SNSAPI ¶
type SNSAPI interface {
CreateTopic(ctx context.Context, params *sns.CreateTopicInput, optsFns ...func(*sns.Options)) (*sns.CreateTopicOutput, error)
}
type SecretsManagerAPI ¶
type SecretsManagerAPI interface { GetSecretValue(ctx context.Context, params *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.GetSecretValueOutput, error) UpdateSecret(ctx context.Context, params *secretsmanager.UpdateSecretInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.UpdateSecretOutput, error) DescribeSecret(ctx context.Context, params *secretsmanager.DescribeSecretInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.DescribeSecretOutput, error) }
type StackArgs ¶
type StackArgs struct { Template *awsdeployer_pb.DeploymentState Parameters []types.Parameter }
type StackStatus ¶
type StackStatus struct { StackStatus types.StackStatus SummaryType awsdeployer_pb.CFLifecycle IsOK bool Stable bool Parameters []*awsdeployer_pb.KeyValue Outputs []*awsdeployer_pb.KeyValue }
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(conn sqrlx.Connection) (*Storage, error)
func (*Storage) ClientTokenToRequest ¶
func (s *Storage) ClientTokenToRequest(ctx context.Context, token string) (*messaging_j5pb.RequestMetadata, error)
func (*Storage) PublishEvent ¶
func (*Storage) RequestToClientToken ¶
func (s *Storage) RequestToClientToken(ctx context.Context, req *messaging_j5pb.RequestMetadata) (string, error)
Click to show internal directories.
Click to hide internal directories.