Documentation
¶
Index ¶
- func GenerateTemplate(opts TemplateOptions) string
- type StackDeployer
- func (d *StackDeployer) CreateGameSession(ctx context.Context, fleetID string, maxPlayers int) (*deploy.SessionInfo, error)
- func (d *StackDeployer) Deploy(ctx context.Context) (*StackResult, error)
- func (d *StackDeployer) DescribeGameSession(ctx context.Context, sessionID string) (string, error)
- func (d *StackDeployer) Destroy(ctx context.Context) error
- func (d *StackDeployer) GetFleetID(ctx context.Context) (string, error)
- func (d *StackDeployer) Status(ctx context.Context) (*StackStatus, error)
- type StackOptions
- type StackResult
- type StackStatus
- type TargetAdapter
- func (a *TargetAdapter) Capabilities() deploy.Capabilities
- func (a *TargetAdapter) CreateSession(ctx context.Context, maxPlayers int) (*deploy.SessionInfo, error)
- func (a *TargetAdapter) Deploy(ctx context.Context, input deploy.DeployInput) (*deploy.DeployResult, error)
- func (a *TargetAdapter) Deployer() *StackDeployer
- func (a *TargetAdapter) DescribeSession(ctx context.Context, sessionID string) (string, error)
- func (a *TargetAdapter) Destroy(ctx context.Context) error
- func (a *TargetAdapter) Name() string
- func (a *TargetAdapter) Status(ctx context.Context) (*deploy.DeployStatus, error)
- type TemplateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTemplate ¶
func GenerateTemplate(opts TemplateOptions) string
GenerateTemplate returns a CloudFormation JSON template that provisions:
- IAM role for GameLift container fleet
- Container group definition
- Container fleet with inbound UDP permissions
Template parameters (ImageURI, ServerPort, InstanceType) allow stack updates without regenerating the template.
Types ¶
type StackDeployer ¶
type StackDeployer struct {
// contains filtered or unexported fields
}
StackDeployer manages CloudFormation stack lifecycle for GameLift resources.
func NewStackDeployer ¶
func NewStackDeployer(opts StackOptions, awsCfg aws.Config) *StackDeployer
NewStackDeployer creates a new CloudFormation stack deployer.
func (*StackDeployer) CreateGameSession ¶
func (d *StackDeployer) CreateGameSession(ctx context.Context, fleetID string, maxPlayers int) (*deploy.SessionInfo, error)
CreateGameSession creates a game session on the fleet managed by this stack.
func (*StackDeployer) Deploy ¶
func (d *StackDeployer) Deploy(ctx context.Context) (*StackResult, error)
Deploy creates or updates the CloudFormation stack and waits for completion.
func (*StackDeployer) DescribeGameSession ¶
DescribeGameSession returns the current status of a game session.
func (*StackDeployer) Destroy ¶
func (d *StackDeployer) Destroy(ctx context.Context) error
Destroy deletes the CloudFormation stack and waits for completion.
func (*StackDeployer) GetFleetID ¶
func (d *StackDeployer) GetFleetID(ctx context.Context) (string, error)
GetFleetID reads the FleetId output from the stack.
func (*StackDeployer) Status ¶
func (d *StackDeployer) Status(ctx context.Context) (*StackStatus, error)
Status returns the current status of the CloudFormation stack.
type StackOptions ¶
type StackOptions struct {
// StackName is the CloudFormation stack name.
StackName string
// Region is the AWS region.
Region string
// ImageURI is the ECR image URI for the game server container.
ImageURI string
// FleetName is the GameLift fleet name (used for tagging).
FleetName string
// InstanceType is the EC2 instance type for the fleet.
InstanceType string
// ContainerGroupName is the container group definition name.
ContainerGroupName string
// ServerPort is the game server port.
ServerPort int
// ServerSDKVersion is the GameLift Server SDK version.
ServerSDKVersion string
// Tags are applied to the stack and all its resources.
Tags map[string]string
}
StackOptions configures a CloudFormation stack deployment.
type StackResult ¶
StackResult holds the outcome of a stack deployment.
type StackStatus ¶
StackStatus holds the current state of a CloudFormation stack.
type TargetAdapter ¶
type TargetAdapter struct {
// contains filtered or unexported fields
}
TargetAdapter wraps a StackDeployer to implement deploy.Target and deploy.SessionManager.
func NewTargetAdapter ¶
func NewTargetAdapter(d *StackDeployer) *TargetAdapter
NewTargetAdapter creates a TargetAdapter wrapping the given StackDeployer.
func (*TargetAdapter) Capabilities ¶
func (a *TargetAdapter) Capabilities() deploy.Capabilities
func (*TargetAdapter) CreateSession ¶
func (a *TargetAdapter) CreateSession(ctx context.Context, maxPlayers int) (*deploy.SessionInfo, error)
CreateSession implements deploy.SessionManager.
func (*TargetAdapter) Deploy ¶
func (a *TargetAdapter) Deploy(ctx context.Context, input deploy.DeployInput) (*deploy.DeployResult, error)
func (*TargetAdapter) Deployer ¶
func (a *TargetAdapter) Deployer() *StackDeployer
Deployer returns the underlying StackDeployer for direct access.
func (*TargetAdapter) DescribeSession ¶
DescribeSession implements deploy.SessionManager.
func (*TargetAdapter) Name ¶
func (a *TargetAdapter) Name() string
func (*TargetAdapter) Status ¶
func (a *TargetAdapter) Status(ctx context.Context) (*deploy.DeployStatus, error)