Documentation
¶
Overview ¶
Package cloudformation provides a server for the CloudFormation interface to Empire.
Index ¶
- Variables
- type AppProperties
- type ContainerDefinition
- type CustomResourceProvisioner
- type ECSEnvironmentProperties
- type ECSEnvironmentResource
- type ECSPlacementConstraint
- type ECSPlacementStrategy
- type ECSServiceProperties
- type ECSServiceResource
- func (p *ECSServiceResource) Create(ctx context.Context, req customresources.Request) (string, interface{}, error)
- func (p *ECSServiceResource) Delete(ctx context.Context, req customresources.Request) error
- func (p *ECSServiceResource) Update(ctx context.Context, req customresources.Request) (interface{}, error)
- type ECSTaskDefinitionProperties
- type ECSTaskDefinitionResource
- type EmpireAppEnvironmentResource
- type EmpireAppResource
- type EnvironmentProperties
- type InstancePortsResource
- type LoadBalancer
- type Message
- type PortMapping
- type SQSDispatcher
- type Ulimit
- type Variable
- type VariableError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AppProperties ¶ added in v0.11.0
type AppProperties struct {
Name *string
}
AppProperties represents the properties for the Custom::EmpireApp
type ContainerDefinition ¶ added in v0.11.0
type ContainerDefinition struct {
Name *string
Command []*string
Cpu *customresources.IntValue
Image *string
Essential *string
Memory *customresources.IntValue
PortMappings []PortMapping
DockerLabels map[string]*string
Ulimits []Ulimit
Environment []string
LogConfiguration *ecs.LogConfiguration
}
type CustomResourceProvisioner ¶
type CustomResourceProvisioner struct {
*SQSDispatcher
// Provisioners routes a custom resource to the thing that should do the
// provisioning.
Provisioners map[string]customresources.Provisioner
// contains filtered or unexported fields
}
CustomResourceProvisioner polls for CloudFormation Custom Resource requests from an sqs queue, provisions them, then responds back.
func NewCustomResourceProvisioner ¶
func NewCustomResourceProvisioner(empire *empire.Empire, config client.ConfigProvider) *CustomResourceProvisioner
NewCustomResourceProvisioner returns a new CustomResourceProvisioner with an sqs client configured from config.
func (*CustomResourceProvisioner) Handle ¶
Handle handles a single sqs.Message to perform the provisioning.
func (*CustomResourceProvisioner) Start ¶
func (c *CustomResourceProvisioner) Start()
type ECSEnvironmentProperties ¶ added in v0.11.0
type ECSEnvironmentProperties struct {
Environment []*ecs.KeyValuePair
}
ECSEnvironmentProperties are the properties provided to the Custom::ECSEnvironment custom resource.
func (*ECSEnvironmentProperties) ReplacementHash ¶ added in v0.11.0
func (p *ECSEnvironmentProperties) ReplacementHash() (uint64, error)
type ECSEnvironmentResource ¶ added in v0.11.0
type ECSEnvironmentResource struct {
// contains filtered or unexported fields
}
ECSEnvironmentResource is a custom resource that takes some environment variables, stores them, then returns a unique identifier to represent the environment, which can be used with the ECSTaskDefinitionResource.
func (*ECSEnvironmentResource) Create ¶ added in v0.11.0
func (p *ECSEnvironmentResource) Create(ctx context.Context, req customresources.Request) (string, interface{}, error)
func (*ECSEnvironmentResource) Delete ¶ added in v0.11.0
func (p *ECSEnvironmentResource) Delete(ctx context.Context, req customresources.Request) error
type ECSPlacementConstraint ¶ added in v0.13.0
type ECSPlacementStrategy ¶ added in v0.13.0
type ECSServiceProperties ¶
type ECSServiceProperties struct {
ServiceName *string
Cluster *string
DesiredCount *customresources.IntValue `hash:"ignore"`
LoadBalancers []LoadBalancer
Role *string
TaskDefinition *string `hash:"ignore"`
PlacementConstraints []ECSPlacementConstraint
PlacementStrategy []ECSPlacementStrategy
}
ECSServiceProperties represents the properties for the Custom::ECSService resource.
func (*ECSServiceProperties) ReplacementHash ¶ added in v0.13.0
func (p *ECSServiceProperties) ReplacementHash() (uint64, error)
type ECSServiceResource ¶
type ECSServiceResource struct {
// contains filtered or unexported fields
}
ECSServiceResource is a Provisioner that creates and updates ECS services.
func (*ECSServiceResource) Create ¶ added in v0.13.0
func (p *ECSServiceResource) Create(ctx context.Context, req customresources.Request) (string, interface{}, error)
func (*ECSServiceResource) Delete ¶ added in v0.13.0
func (p *ECSServiceResource) Delete(ctx context.Context, req customresources.Request) error
func (*ECSServiceResource) Update ¶ added in v0.13.0
func (p *ECSServiceResource) Update(ctx context.Context, req customresources.Request) (interface{}, error)
type ECSTaskDefinitionProperties ¶ added in v0.11.0
type ECSTaskDefinitionProperties struct {
Family *string
TaskRoleArn *string
ContainerDefinitions []ContainerDefinition
PlacementConstraints []ECSPlacementConstraint
}
TaskDefinitionProperties are properties passed to the Custom::ECSTaskDefinition custom resource.
func (*ECSTaskDefinitionProperties) ReplacementHash ¶ added in v0.11.0
func (p *ECSTaskDefinitionProperties) ReplacementHash() (uint64, error)
type ECSTaskDefinitionResource ¶ added in v0.11.0
type ECSTaskDefinitionResource struct {
// contains filtered or unexported fields
}
ECSTaskDefinitionResource is a custom resource that provisions ECS task definitions.
func (*ECSTaskDefinitionResource) Create ¶ added in v0.11.0
func (p *ECSTaskDefinitionResource) Create(ctx context.Context, req customresources.Request) (string, interface{}, error)
func (*ECSTaskDefinitionResource) Delete ¶ added in v0.11.0
func (p *ECSTaskDefinitionResource) Delete(ctx context.Context, req customresources.Request) error
type EmpireAppEnvironmentResource ¶ added in v0.11.0
type EmpireAppEnvironmentResource struct {
// contains filtered or unexported fields
}
EmpireAppEnvironmentResource is a Provisioner that manages environmental variables within an Empire application.
func (*EmpireAppEnvironmentResource) Properties ¶ added in v0.11.0
func (p *EmpireAppEnvironmentResource) Properties() interface{}
func (*EmpireAppEnvironmentResource) Provision ¶ added in v0.11.0
func (p *EmpireAppEnvironmentResource) Provision(ctx context.Context, req customresources.Request) (id string, data interface{}, err error)
type EmpireAppResource ¶ added in v0.11.0
type EmpireAppResource struct {
// contains filtered or unexported fields
}
EmpireAppResource is a Provisioner that will manage an Empire application
func (*EmpireAppResource) Properties ¶ added in v0.11.0
func (p *EmpireAppResource) Properties() interface{}
func (*EmpireAppResource) Provision ¶ added in v0.11.0
func (p *EmpireAppResource) Provision(ctx context.Context, req customresources.Request) (id string, data interface{}, err error)
type EnvironmentProperties ¶ added in v0.11.0
EnvironmentProperties represents the properties for the Custom::EmpireAppEnvironment
type InstancePortsResource ¶ added in v0.13.0
type InstancePortsResource struct {
// contains filtered or unexported fields
}
InstancePortsResource is a Provisioner that allocates instance ports.
func (*InstancePortsResource) Create ¶ added in v0.13.0
func (p *InstancePortsResource) Create(_ context.Context, req customresources.Request) (string, interface{}, error)
func (*InstancePortsResource) Delete ¶ added in v0.13.0
func (p *InstancePortsResource) Delete(_ context.Context, req customresources.Request) error
func (*InstancePortsResource) Properties ¶ added in v0.13.0
func (p *InstancePortsResource) Properties() interface{}
type LoadBalancer ¶
type LoadBalancer struct {
ContainerName *string
ContainerPort *customresources.IntValue
LoadBalancerName *string
TargetGroupArn *string
}
type Message ¶
type Message struct {
Message string `json:"Message"`
}
Represents the body of the SQS message, which would have been received from SNS.
type PortMapping ¶ added in v0.11.0
type PortMapping struct {
ContainerPort *customresources.IntValue
HostPort *customresources.IntValue
}
type SQSDispatcher ¶ added in v0.11.0
type SQSDispatcher struct {
// Root context.Context to use. If a reporter.Reporter is embedded,
// errors generated will be reporter there. If a logger.Logger is
// embedded, logging will be logged there.
Context context.Context
// The SQS queue url to listen for CloudFormation Custom Resource
// requests.
QueueURL string
// When a message is pulled off of sqs, the visibility timeout will be
// extended by this much, and periodically extended while the handler
// performs it's work. If this process crashes, then the sqs message
// will be redelivered later.
VisibilityHeartbeat time.Duration
// Number of worker goroutines to start for receiving messages.
NumWorkers int
// contains filtered or unexported fields
}
SQSDispatcher pulls messages from SQS, and dispatches them to a handler.
func (*SQSDispatcher) Start ¶ added in v0.11.0
Start starts multiple goroutines pulling messages off of the queue.
func (*SQSDispatcher) Stop ¶ added in v0.11.0
func (q *SQSDispatcher) Stop()
type Ulimit ¶ added in v0.11.0
type Ulimit struct {
Name *string
HardLimit *customresources.IntValue
SoftLimit *customresources.IntValue
}
type VariableError ¶ added in v0.11.0
type VariableError struct {
// contains filtered or unexported fields
}
func (*VariableError) Error ¶ added in v0.11.0
func (v *VariableError) Error() string