Documentation
¶
Overview ¶
Copyright © 2025 Stackaroo Contributors SPDX-License-Identifier: BSD-3-Clause
Copyright © 2025 Stackaroo Contributors SPDX-License-Identifier: BSD-3-Clause
Copyright © 2025 Stackaroo Contributors SPDX-License-Identifier: BSD-3-Clause
Copyright © 2025 Stackaroo Contributors SPDX-License-Identifier: BSD-3-Clause
Index ¶
- func NewMockClientFactoryForRegion(region string) (*MockClientFactory, *MockCloudFormationOperations)
- type ChangeSetInfo
- type ClientFactory
- type CloudFormationClient
- type CloudFormationOperations
- type DefaultClientFactory
- type DefaultCloudFormationOperations
- func (cf *DefaultCloudFormationOperations) CreateChangeSetForDeployment(ctx context.Context, stackName string, template string, ...) (*ChangeSetInfo, error)
- func (cf *DefaultCloudFormationOperations) CreateChangeSetPreview(ctx context.Context, stackName string, template string, ...) (*ChangeSetInfo, error)
- func (cf *DefaultCloudFormationOperations) DeleteChangeSet(ctx context.Context, changeSetID string) error
- func (cf *DefaultCloudFormationOperations) DeleteStack(ctx context.Context, input DeleteStackInput) error
- func (cf *DefaultCloudFormationOperations) DeployStack(ctx context.Context, input DeployStackInput) error
- func (cf *DefaultCloudFormationOperations) DeployStackWithCallback(ctx context.Context, input DeployStackInput, eventCallback func(StackEvent)) error
- func (cf *DefaultCloudFormationOperations) DescribeStack(ctx context.Context, stackName string) (*StackInfo, error)
- func (cf *DefaultCloudFormationOperations) DescribeStackEvents(ctx context.Context, stackName string) ([]StackEvent, error)
- func (cf *DefaultCloudFormationOperations) ExecuteChangeSet(ctx context.Context, changeSetID string) error
- func (cf *DefaultCloudFormationOperations) GetStack(ctx context.Context, stackName string) (*Stack, error)
- func (cf *DefaultCloudFormationOperations) GetTemplate(ctx context.Context, stackName string) (string, error)
- func (cf *DefaultCloudFormationOperations) ListStacks(ctx context.Context) ([]*Stack, error)
- func (cf *DefaultCloudFormationOperations) StackExists(ctx context.Context, stackName string) (bool, error)
- func (cf *DefaultCloudFormationOperations) UpdateStack(ctx context.Context, input UpdateStackInput) error
- func (cf *DefaultCloudFormationOperations) ValidateTemplate(ctx context.Context, templateBody string) error
- func (cf *DefaultCloudFormationOperations) WaitForStackOperation(ctx context.Context, stackName string, startTime time.Time, ...) error
- type DeleteStackInput
- type DeployStackInput
- type MockClientFactory
- func (m *MockClientFactory) GetBaseConfig() aws.Config
- func (m *MockClientFactory) GetCloudFormationOperations(ctx context.Context, region string) (CloudFormationOperations, error)
- func (m *MockClientFactory) SetOperations(region string, ops CloudFormationOperations)
- func (m *MockClientFactory) ValidateRegion(region string) error
- type MockCloudFormationClient
- func (m *MockCloudFormationClient) CreateChangeSet(ctx context.Context, params *cloudformation.CreateChangeSetInput, ...) (*cloudformation.CreateChangeSetOutput, error)
- func (m *MockCloudFormationClient) CreateStack(ctx context.Context, params *cloudformation.CreateStackInput, ...) (*cloudformation.CreateStackOutput, error)
- func (m *MockCloudFormationClient) DeleteChangeSet(ctx context.Context, params *cloudformation.DeleteChangeSetInput, ...) (*cloudformation.DeleteChangeSetOutput, error)
- func (m *MockCloudFormationClient) DeleteStack(ctx context.Context, params *cloudformation.DeleteStackInput, ...) (*cloudformation.DeleteStackOutput, error)
- func (m *MockCloudFormationClient) DescribeChangeSet(ctx context.Context, params *cloudformation.DescribeChangeSetInput, ...) (*cloudformation.DescribeChangeSetOutput, error)
- func (m *MockCloudFormationClient) DescribeStackEvents(ctx context.Context, params *cloudformation.DescribeStackEventsInput, ...) (*cloudformation.DescribeStackEventsOutput, error)
- func (m *MockCloudFormationClient) DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, ...) (*cloudformation.DescribeStacksOutput, error)
- func (m *MockCloudFormationClient) ExecuteChangeSet(ctx context.Context, params *cloudformation.ExecuteChangeSetInput, ...) (*cloudformation.ExecuteChangeSetOutput, error)
- func (m *MockCloudFormationClient) GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, ...) (*cloudformation.GetTemplateOutput, error)
- func (m *MockCloudFormationClient) ListStacks(ctx context.Context, params *cloudformation.ListStacksInput, ...) (*cloudformation.ListStacksOutput, error)
- func (m *MockCloudFormationClient) UpdateStack(ctx context.Context, params *cloudformation.UpdateStackInput, ...) (*cloudformation.UpdateStackOutput, error)
- func (m *MockCloudFormationClient) ValidateTemplate(ctx context.Context, params *cloudformation.ValidateTemplateInput, ...) (*cloudformation.ValidateTemplateOutput, error)
- type MockCloudFormationOperations
- func (m *MockCloudFormationOperations) CreateChangeSetForDeployment(ctx context.Context, stackName string, template string, ...) (*ChangeSetInfo, error)
- func (m *MockCloudFormationOperations) CreateChangeSetPreview(ctx context.Context, stackName string, template string, ...) (*ChangeSetInfo, error)
- func (m *MockCloudFormationOperations) DeleteChangeSet(ctx context.Context, changeSetID string) error
- func (m *MockCloudFormationOperations) DeleteStack(ctx context.Context, input DeleteStackInput) error
- func (m *MockCloudFormationOperations) DeployStack(ctx context.Context, input DeployStackInput) error
- func (m *MockCloudFormationOperations) DeployStackWithCallback(ctx context.Context, input DeployStackInput, eventCallback func(StackEvent)) error
- func (m *MockCloudFormationOperations) DescribeStack(ctx context.Context, stackName string) (*StackInfo, error)
- func (m *MockCloudFormationOperations) DescribeStackEvents(ctx context.Context, stackName string) ([]StackEvent, error)
- func (m *MockCloudFormationOperations) ExecuteChangeSet(ctx context.Context, changeSetID string) error
- func (m *MockCloudFormationOperations) GetStack(ctx context.Context, stackName string) (*Stack, error)
- func (m *MockCloudFormationOperations) GetTemplate(ctx context.Context, stackName string) (string, error)
- func (m *MockCloudFormationOperations) ListStacks(ctx context.Context) ([]*Stack, error)
- func (m *MockCloudFormationOperations) StackExists(ctx context.Context, stackName string) (bool, error)
- func (m *MockCloudFormationOperations) UpdateStack(ctx context.Context, input UpdateStackInput) error
- func (m *MockCloudFormationOperations) ValidateTemplate(ctx context.Context, templateBody string) error
- func (m *MockCloudFormationOperations) WaitForStackOperation(ctx context.Context, stackName string, startTime time.Time, ...) error
- type NoChangesError
- type Parameter
- type ResourceChange
- type Stack
- type StackEvent
- type StackInfo
- type StackStatus
- type UpdateStackInput
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockClientFactoryForRegion ¶ added in v0.8.0
func NewMockClientFactoryForRegion(region string) (*MockClientFactory, *MockCloudFormationOperations)
NewMockClientFactoryForRegion creates a MockClientFactory with MockCloudFormationOperations for a region
Types ¶
type ChangeSetInfo ¶
type ChangeSetInfo struct {
ChangeSetID string
Status string
Changes []ResourceChange
}
ChangeSetInfo contains information from AWS CloudFormation changeset
type ClientFactory ¶ added in v0.8.0
type ClientFactory interface {
// GetCloudFormationOperations returns CloudFormation operations for specified region
GetCloudFormationOperations(ctx context.Context, region string) (CloudFormationOperations, error)
// GetBaseConfig returns the shared AWS configuration (for debugging)
GetBaseConfig() aws.Config
// ValidateRegion checks if a region is valid (optional validation)
ValidateRegion(region string) error
}
ClientFactory creates AWS clients with proper region configuration
Example ¶
ExampleClientFactory demonstrates how to create and use the AWS client factory
package main
import (
"fmt"
)
func main() {
// Example of client factory usage
// ctx := context.Background()
// Create a client factory (would use actual AWS credentials in real usage)
// factory, _ := aws.NewClientFactory(ctx)
// Example of getting CloudFormation operations for a specific region
region := "us-east-1"
// cfOps, _ := factory.GetCloudFormationOperations(ctx, region)
fmt.Printf("ClientFactory would create operations for region: %s\n", region)
}
Output: ClientFactory would create operations for region: us-east-1
Example (ExtensibleDesign) ¶
ExampleClientFactory_extensibleDesign demonstrates how to extend for other AWS services
package main
import (
"fmt"
)
func main() {
// Example of how the client factory could be extended
fmt.Println("CloudFormation operations available")
fmt.Println("Future ClientFactory methods could include:")
fmt.Println("- GetS3Operations(ctx, region)")
fmt.Println("- GetEC2Operations(ctx, region)")
fmt.Println("- GetIAMOperations(ctx, region)")
}
Output: CloudFormation operations available Future ClientFactory methods could include: - GetS3Operations(ctx, region) - GetEC2Operations(ctx, region) - GetIAMOperations(ctx, region)
func NewClientFactory ¶ added in v0.8.0
func NewClientFactory(ctx context.Context) (ClientFactory, error)
NewClientFactory creates a client factory with shared authentication
type CloudFormationClient ¶
type CloudFormationClient interface {
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)
DeleteStack(ctx context.Context, params *cloudformation.DeleteStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error)
DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error)
ListStacks(ctx context.Context, params *cloudformation.ListStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ListStacksOutput, error)
ValidateTemplate(ctx context.Context, params *cloudformation.ValidateTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ValidateTemplateOutput, error)
GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, 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)
DeleteChangeSet(ctx context.Context, params *cloudformation.DeleteChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DeleteChangeSetOutput, error)
DescribeChangeSet(ctx context.Context, params *cloudformation.DescribeChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeChangeSetOutput, error)
DescribeStackEvents(ctx context.Context, params *cloudformation.DescribeStackEventsInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackEventsOutput, error)
}
CloudFormationClient defines the interface for CloudFormation client operations This allows for easier testing with mock implementations
type CloudFormationOperations ¶
type CloudFormationOperations interface {
DeployStack(ctx context.Context, input DeployStackInput) error
DeployStackWithCallback(ctx context.Context, input DeployStackInput, eventCallback func(StackEvent)) error
UpdateStack(ctx context.Context, input UpdateStackInput) error
DeleteStack(ctx context.Context, input DeleteStackInput) error
GetStack(ctx context.Context, stackName string) (*Stack, error)
ListStacks(ctx context.Context) ([]*Stack, error)
ValidateTemplate(ctx context.Context, templateBody string) error
StackExists(ctx context.Context, stackName string) (bool, error)
GetTemplate(ctx context.Context, stackName string) (string, error)
DescribeStack(ctx context.Context, stackName string) (*StackInfo, error)
ExecuteChangeSet(ctx context.Context, changeSetID string) error
DeleteChangeSet(ctx context.Context, changeSetID string) error
DescribeStackEvents(ctx context.Context, stackName string) ([]StackEvent, error)
WaitForStackOperation(ctx context.Context, stackName string, startTime time.Time, eventCallback func(StackEvent)) error
CreateChangeSetPreview(ctx context.Context, stackName string, template string, parameters map[string]string, capabilities []string) (*ChangeSetInfo, error)
CreateChangeSetForDeployment(ctx context.Context, stackName string, template string, parameters map[string]string, capabilities []string, tags map[string]string) (*ChangeSetInfo, error)
}
CloudFormationOperations defines the interface for CloudFormation operations
Example ¶
ExampleCloudFormationOperations demonstrates CloudFormation operations
package main
import (
"fmt"
"github.com/orien/stackaroo/internal/aws"
)
func main() {
// Example template structure
template := `{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket"
}
}
}`
// Example of deploy stack input structure
deployInput := aws.DeployStackInput{
StackName: "my-example-stack",
TemplateBody: template,
Parameters: []aws.Parameter{
{Key: "Environment", Value: "dev"},
},
Tags: map[string]string{
"Project": "stackaroo-example",
},
Capabilities: []string{"CAPABILITY_IAM"},
}
fmt.Printf("Stack deployment would use template with %d resources\n", 1)
fmt.Printf("Stack name: %s\n", deployInput.StackName)
}
Output: Stack deployment would use template with 1 resources Stack name: my-example-stack
type DefaultClientFactory ¶ added in v0.8.0
type DefaultClientFactory struct {
// contains filtered or unexported fields
}
DefaultClientFactory implements ClientFactory with caching and shared authentication
func (*DefaultClientFactory) GetBaseConfig ¶ added in v0.8.0
func (f *DefaultClientFactory) GetBaseConfig() aws.Config
GetBaseConfig returns the shared AWS configuration
func (*DefaultClientFactory) GetCloudFormationOperations ¶ added in v0.8.0
func (f *DefaultClientFactory) GetCloudFormationOperations(ctx context.Context, region string) (CloudFormationOperations, error)
GetCloudFormationOperations returns CloudFormation operations for the specified region
func (*DefaultClientFactory) ValidateRegion ¶ added in v0.8.0
func (f *DefaultClientFactory) ValidateRegion(region string) error
ValidateRegion performs basic region validation
type DefaultCloudFormationOperations ¶
type DefaultCloudFormationOperations struct {
// contains filtered or unexported fields
}
DefaultCloudFormationOperations provides CloudFormation-specific operations
func NewCloudFormationOperationsWithClient ¶
func NewCloudFormationOperationsWithClient(client CloudFormationClient) *DefaultCloudFormationOperations
NewCloudFormationOperationsWithClient creates operations with a custom client (for testing)
func (*DefaultCloudFormationOperations) CreateChangeSetForDeployment ¶
func (cf *DefaultCloudFormationOperations) CreateChangeSetForDeployment(ctx context.Context, stackName string, template string, parameters map[string]string, capabilities []string, tags map[string]string) (*ChangeSetInfo, error)
CreateChangeSetForDeployment creates a changeset for deployment (doesn't auto-delete)
func (*DefaultCloudFormationOperations) CreateChangeSetPreview ¶
func (cf *DefaultCloudFormationOperations) CreateChangeSetPreview(ctx context.Context, stackName string, template string, parameters map[string]string, capabilities []string) (*ChangeSetInfo, error)
CreateChangeSetPreview creates a CloudFormation changeset for preview, describes it, then deletes it
func (*DefaultCloudFormationOperations) DeleteChangeSet ¶
func (cf *DefaultCloudFormationOperations) DeleteChangeSet(ctx context.Context, changeSetID string) error
DeleteChangeSet deletes a CloudFormation changeset
func (*DefaultCloudFormationOperations) DeleteStack ¶
func (cf *DefaultCloudFormationOperations) DeleteStack(ctx context.Context, input DeleteStackInput) error
DeleteStack deletes a CloudFormation stack
func (*DefaultCloudFormationOperations) DeployStack ¶
func (cf *DefaultCloudFormationOperations) DeployStack(ctx context.Context, input DeployStackInput) error
DeployStack creates or updates a CloudFormation stack and waits for completion
func (*DefaultCloudFormationOperations) DeployStackWithCallback ¶
func (cf *DefaultCloudFormationOperations) DeployStackWithCallback(ctx context.Context, input DeployStackInput, eventCallback func(StackEvent)) error
DeployStackWithCallback creates or updates a CloudFormation stack and waits for completion, calling the provided callback for each event
func (*DefaultCloudFormationOperations) DescribeStack ¶
func (cf *DefaultCloudFormationOperations) DescribeStack(ctx context.Context, stackName string) (*StackInfo, error)
DescribeStack retrieves detailed information about a specific stack including template
func (*DefaultCloudFormationOperations) DescribeStackEvents ¶
func (cf *DefaultCloudFormationOperations) DescribeStackEvents(ctx context.Context, stackName string) ([]StackEvent, error)
DescribeStackEvents retrieves events for a CloudFormation stack
func (*DefaultCloudFormationOperations) ExecuteChangeSet ¶
func (cf *DefaultCloudFormationOperations) ExecuteChangeSet(ctx context.Context, changeSetID string) error
ExecuteChangeSet executes a CloudFormation changeset by ID, abstracting AWS SDK details
func (*DefaultCloudFormationOperations) GetStack ¶
func (cf *DefaultCloudFormationOperations) GetStack(ctx context.Context, stackName string) (*Stack, error)
GetStack retrieves information about a specific stack
func (*DefaultCloudFormationOperations) GetTemplate ¶
func (cf *DefaultCloudFormationOperations) GetTemplate(ctx context.Context, stackName string) (string, error)
GetTemplate retrieves the template for a CloudFormation stack
func (*DefaultCloudFormationOperations) ListStacks ¶
func (cf *DefaultCloudFormationOperations) ListStacks(ctx context.Context) ([]*Stack, error)
ListStacks returns a list of all CloudFormation stacks
func (*DefaultCloudFormationOperations) StackExists ¶
func (cf *DefaultCloudFormationOperations) StackExists(ctx context.Context, stackName string) (bool, error)
StackExists checks if a stack exists
func (*DefaultCloudFormationOperations) UpdateStack ¶
func (cf *DefaultCloudFormationOperations) UpdateStack(ctx context.Context, input UpdateStackInput) error
UpdateStack updates an existing CloudFormation stack
func (*DefaultCloudFormationOperations) ValidateTemplate ¶
func (cf *DefaultCloudFormationOperations) ValidateTemplate(ctx context.Context, templateBody string) error
ValidateTemplate validates a CloudFormation template
func (*DefaultCloudFormationOperations) WaitForStackOperation ¶
func (cf *DefaultCloudFormationOperations) WaitForStackOperation(ctx context.Context, stackName string, startTime time.Time, eventCallback func(StackEvent)) error
WaitForStackOperation waits for a CloudFormation stack operation to complete, calling the provided callback for each new event
type DeleteStackInput ¶
type DeleteStackInput struct {
StackName string
}
DeleteStackInput contains parameters for deleting a stack
type DeployStackInput ¶
type DeployStackInput struct {
StackName string
TemplateBody string
Parameters []Parameter
Tags map[string]string
Capabilities []string
}
DeployStackInput contains parameters for deploying a stack
type MockClientFactory ¶ added in v0.8.0
type MockClientFactory struct {
// contains filtered or unexported fields
}
MockClientFactory provides a test implementation of ClientFactory
func NewMockClientFactory ¶ added in v0.8.0
func NewMockClientFactory() *MockClientFactory
NewMockClientFactory creates a mock factory for testing
func NewMockClientFactoryWithOperations ¶ added in v0.8.0
func NewMockClientFactoryWithOperations(region string, ops CloudFormationOperations) *MockClientFactory
NewMockClientFactoryWithOperations creates a MockClientFactory and sets up operations for a region
func SetupMockFactoryForMultiRegion ¶ added in v0.8.0
func SetupMockFactoryForMultiRegion(regions map[string]CloudFormationOperations) *MockClientFactory
SetupMockFactoryForMultiRegion creates a factory with operations for multiple regions
func (*MockClientFactory) GetBaseConfig ¶ added in v0.8.0
func (m *MockClientFactory) GetBaseConfig() aws.Config
GetBaseConfig returns the mock base configuration
func (*MockClientFactory) GetCloudFormationOperations ¶ added in v0.8.0
func (m *MockClientFactory) GetCloudFormationOperations(ctx context.Context, region string) (CloudFormationOperations, error)
GetCloudFormationOperations returns mock operations for the specified region
func (*MockClientFactory) SetOperations ¶ added in v0.8.0
func (m *MockClientFactory) SetOperations(region string, ops CloudFormationOperations)
SetOperations sets mock operations for a specific region
func (*MockClientFactory) ValidateRegion ¶ added in v0.8.0
func (m *MockClientFactory) ValidateRegion(region string) error
ValidateRegion always returns nil for mock
type MockCloudFormationClient ¶ added in v0.3.0
MockCloudFormationClient implements the AWS CloudFormation service client interface for testing
func (*MockCloudFormationClient) CreateChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationClient) CreateChangeSet(ctx context.Context, params *cloudformation.CreateChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.CreateChangeSetOutput, error)
func (*MockCloudFormationClient) CreateStack ¶ added in v0.3.0
func (m *MockCloudFormationClient) CreateStack(ctx context.Context, params *cloudformation.CreateStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.CreateStackOutput, error)
func (*MockCloudFormationClient) DeleteChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationClient) DeleteChangeSet(ctx context.Context, params *cloudformation.DeleteChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DeleteChangeSetOutput, error)
func (*MockCloudFormationClient) DeleteStack ¶ added in v0.3.0
func (m *MockCloudFormationClient) DeleteStack(ctx context.Context, params *cloudformation.DeleteStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error)
func (*MockCloudFormationClient) DescribeChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationClient) DescribeChangeSet(ctx context.Context, params *cloudformation.DescribeChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeChangeSetOutput, error)
func (*MockCloudFormationClient) DescribeStackEvents ¶ added in v0.3.0
func (m *MockCloudFormationClient) DescribeStackEvents(ctx context.Context, params *cloudformation.DescribeStackEventsInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackEventsOutput, error)
func (*MockCloudFormationClient) DescribeStacks ¶ added in v0.3.0
func (m *MockCloudFormationClient) DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error)
func (*MockCloudFormationClient) ExecuteChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationClient) ExecuteChangeSet(ctx context.Context, params *cloudformation.ExecuteChangeSetInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ExecuteChangeSetOutput, error)
func (*MockCloudFormationClient) GetTemplate ¶ added in v0.3.0
func (m *MockCloudFormationClient) GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error)
func (*MockCloudFormationClient) ListStacks ¶ added in v0.3.0
func (m *MockCloudFormationClient) ListStacks(ctx context.Context, params *cloudformation.ListStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ListStacksOutput, error)
func (*MockCloudFormationClient) UpdateStack ¶ added in v0.3.0
func (m *MockCloudFormationClient) UpdateStack(ctx context.Context, params *cloudformation.UpdateStackInput, optFns ...func(*cloudformation.Options)) (*cloudformation.UpdateStackOutput, error)
func (*MockCloudFormationClient) ValidateTemplate ¶ added in v0.3.0
func (m *MockCloudFormationClient) ValidateTemplate(ctx context.Context, params *cloudformation.ValidateTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.ValidateTemplateOutput, error)
type MockCloudFormationOperations ¶ added in v0.3.0
MockCloudFormationOperations implements CloudFormationOperations for testing
func (*MockCloudFormationOperations) CreateChangeSetForDeployment ¶ added in v0.3.0
func (*MockCloudFormationOperations) CreateChangeSetPreview ¶ added in v0.3.0
func (m *MockCloudFormationOperations) CreateChangeSetPreview(ctx context.Context, stackName string, template string, parameters map[string]string, capabilities []string) (*ChangeSetInfo, error)
func (*MockCloudFormationOperations) DeleteChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationOperations) DeleteChangeSet(ctx context.Context, changeSetID string) error
func (*MockCloudFormationOperations) DeleteStack ¶ added in v0.3.0
func (m *MockCloudFormationOperations) DeleteStack(ctx context.Context, input DeleteStackInput) error
func (*MockCloudFormationOperations) DeployStack ¶ added in v0.3.0
func (m *MockCloudFormationOperations) DeployStack(ctx context.Context, input DeployStackInput) error
func (*MockCloudFormationOperations) DeployStackWithCallback ¶ added in v0.3.0
func (m *MockCloudFormationOperations) DeployStackWithCallback(ctx context.Context, input DeployStackInput, eventCallback func(StackEvent)) error
func (*MockCloudFormationOperations) DescribeStack ¶ added in v0.3.0
func (*MockCloudFormationOperations) DescribeStackEvents ¶ added in v0.3.0
func (m *MockCloudFormationOperations) DescribeStackEvents(ctx context.Context, stackName string) ([]StackEvent, error)
func (*MockCloudFormationOperations) ExecuteChangeSet ¶ added in v0.3.0
func (m *MockCloudFormationOperations) ExecuteChangeSet(ctx context.Context, changeSetID string) error
func (*MockCloudFormationOperations) GetTemplate ¶ added in v0.3.0
func (*MockCloudFormationOperations) ListStacks ¶ added in v0.3.0
func (m *MockCloudFormationOperations) ListStacks(ctx context.Context) ([]*Stack, error)
func (*MockCloudFormationOperations) StackExists ¶ added in v0.3.0
func (*MockCloudFormationOperations) UpdateStack ¶ added in v0.3.0
func (m *MockCloudFormationOperations) UpdateStack(ctx context.Context, input UpdateStackInput) error
func (*MockCloudFormationOperations) ValidateTemplate ¶ added in v0.3.0
func (m *MockCloudFormationOperations) ValidateTemplate(ctx context.Context, templateBody string) error
func (*MockCloudFormationOperations) WaitForStackOperation ¶ added in v0.3.0
func (m *MockCloudFormationOperations) WaitForStackOperation(ctx context.Context, stackName string, startTime time.Time, eventCallback func(StackEvent)) error
type NoChangesError ¶
type NoChangesError struct {
StackName string
}
NoChangesError indicates that a stack operation had no changes to apply
func (NoChangesError) Error ¶
func (e NoChangesError) Error() string
type ResourceChange ¶
type ResourceChange struct {
Action string // CREATE, UPDATE, DELETE
ResourceType string
LogicalID string
PhysicalID string
Replacement string // True, False, or Conditional
Details []string
}
ResourceChange represents a change to a CloudFormation resource
type Stack ¶
type Stack struct {
Name string
Status StackStatus
CreatedTime *time.Time
UpdatedTime *time.Time
Description string
Parameters map[string]string
Outputs map[string]string
Tags map[string]string
}
Stack represents a CloudFormation stack with essential information
type StackEvent ¶
type StackEvent struct {
EventId string
StackName string
LogicalResourceId string
PhysicalResourceId string
ResourceType string
Timestamp time.Time
ResourceStatus string
ResourceStatusReason string
}
StackEvent represents a CloudFormation stack event
type StackInfo ¶
type StackInfo struct {
Name string
Status StackStatus
CreatedTime *time.Time
UpdatedTime *time.Time
Description string
Parameters map[string]string
Outputs map[string]string
Tags map[string]string
Template string // The actual template content
}
StackInfo represents detailed CloudFormation stack information for diff operations
type StackStatus ¶
type StackStatus string
StackStatus represents the status of a CloudFormation stack
const ( StackStatusCreateInProgress StackStatus = "CREATE_IN_PROGRESS" StackStatusCreateComplete StackStatus = "CREATE_COMPLETE" StackStatusCreateFailed StackStatus = "CREATE_FAILED" StackStatusDeleteInProgress StackStatus = "DELETE_IN_PROGRESS" StackStatusDeleteComplete StackStatus = "DELETE_COMPLETE" StackStatusDeleteFailed StackStatus = "DELETE_FAILED" StackStatusUpdateInProgress StackStatus = "UPDATE_IN_PROGRESS" StackStatusUpdateComplete StackStatus = "UPDATE_COMPLETE" StackStatusUpdateFailed StackStatus = "UPDATE_FAILED" StackStatusUpdateRollbackInProgress StackStatus = "UPDATE_ROLLBACK_IN_PROGRESS" StackStatusUpdateRollbackComplete StackStatus = "UPDATE_ROLLBACK_COMPLETE" StackStatusUpdateRollbackFailed StackStatus = "UPDATE_ROLLBACK_FAILED" StackStatusRollbackInProgress StackStatus = "ROLLBACK_IN_PROGRESS" StackStatusRollbackComplete StackStatus = "ROLLBACK_COMPLETE" StackStatusRollbackFailed StackStatus = "ROLLBACK_FAILED" StackStatusReviewInProgress StackStatus = "REVIEW_IN_PROGRESS" StackStatusImportInProgress StackStatus = "IMPORT_IN_PROGRESS" StackStatusImportComplete StackStatus = "IMPORT_COMPLETE" StackStatusImportRollbackInProgress StackStatus = "IMPORT_ROLLBACK_IN_PROGRESS" StackStatusImportRollbackComplete StackStatus = "IMPORT_ROLLBACK_COMPLETE" StackStatusImportRollbackFailed StackStatus = "IMPORT_ROLLBACK_FAILED" )