operation

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const SDKRetryMaxAttempts = 3
View Source
const StackNameRule = `^arn:aws:cloudformation:[^:]*:[0-9]*:stack/([^/]*)/.*$`

Variables

View Source
var StackNameRuleRegExp = regexp.MustCompile(StackNameRule)

Except xxInProgress StackStatusDeleteComplete is not included because DescribeStacks does not return a DELETE_COMPLETE stack.

Functions

This section is empty.

Types

type BackupVaultOperator

type BackupVaultOperator struct {
	// contains filtered or unexported fields
}

func NewBackupVaultOperator

func NewBackupVaultOperator(client client.IBackup) *BackupVaultOperator

func (*BackupVaultOperator) AddResource

func (o *BackupVaultOperator) AddResource(resource *types.StackResourceSummary)

func (*BackupVaultOperator) DeleteBackupVault

func (o *BackupVaultOperator) DeleteBackupVault(ctx context.Context, backupVaultName *string) error

func (*BackupVaultOperator) DeleteResources

func (o *BackupVaultOperator) DeleteResources(ctx context.Context) error

func (*BackupVaultOperator) GetResourcesLength

func (o *BackupVaultOperator) GetResourcesLength() int

type CloudFormationStackOperator added in v0.9.0

type CloudFormationStackOperator struct {
	// contains filtered or unexported fields
}

func NewCloudFormationStackOperator added in v0.9.0

func NewCloudFormationStackOperator(config aws.Config, client client.ICloudFormation, targetResourceTypes []string) *CloudFormationStackOperator

func (*CloudFormationStackOperator) AddResource added in v0.9.0

func (o *CloudFormationStackOperator) AddResource(resource *types.StackResourceSummary)

func (*CloudFormationStackOperator) DeleteCloudFormationStack added in v0.9.0

func (o *CloudFormationStackOperator) DeleteCloudFormationStack(ctx context.Context, stackName *string, isRootStack bool, operatorManager IOperatorManager) error

func (*CloudFormationStackOperator) DeleteResources added in v0.9.0

func (o *CloudFormationStackOperator) DeleteResources(ctx context.Context) error

func (*CloudFormationStackOperator) GetResourcesLength added in v0.9.0

func (o *CloudFormationStackOperator) GetResourcesLength() int

func (*CloudFormationStackOperator) GetSortedStackNames added in v1.6.0

func (o *CloudFormationStackOperator) GetSortedStackNames(ctx context.Context, stackNames []string) ([]string, error)

func (*CloudFormationStackOperator) ListStacksFilteredByKeyword added in v0.9.0

func (o *CloudFormationStackOperator) ListStacksFilteredByKeyword(ctx context.Context, keyword *string) ([]string, error)

type CustomOperator

type CustomOperator struct {
	// contains filtered or unexported fields
}

func NewCustomOperator

func NewCustomOperator() *CustomOperator

func (*CustomOperator) AddResource

func (o *CustomOperator) AddResource(resource *types.StackResourceSummary)

func (*CustomOperator) DeleteResources

func (o *CustomOperator) DeleteResources(ctx context.Context) error

Implicit implements (these resources will be deleted on its own)

func (*CustomOperator) GetResourcesLength

func (o *CustomOperator) GetResourcesLength() int

type EcrRepositoryOperator added in v0.9.0

type EcrRepositoryOperator struct {
	// contains filtered or unexported fields
}

func NewEcrRepositoryOperator added in v0.9.0

func NewEcrRepositoryOperator(client client.IEcr) *EcrRepositoryOperator

func (*EcrRepositoryOperator) AddResource added in v0.9.0

func (o *EcrRepositoryOperator) AddResource(resource *types.StackResourceSummary)

func (*EcrRepositoryOperator) DeleteEcrRepository added in v0.9.0

func (o *EcrRepositoryOperator) DeleteEcrRepository(ctx context.Context, repositoryName *string) error

func (*EcrRepositoryOperator) DeleteResources added in v0.9.0

func (o *EcrRepositoryOperator) DeleteResources(ctx context.Context) error

func (*EcrRepositoryOperator) GetResourcesLength added in v0.9.0

func (o *EcrRepositoryOperator) GetResourcesLength() int

type IOperator

type IOperator interface {
	AddResource(resource *types.StackResourceSummary)
	GetResourcesLength() int
	DeleteResources(ctx context.Context) error
}

type IOperatorCollection

type IOperatorCollection interface {
	SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)
	GetLogicalResourceIds() []string
	GetOperators() []IOperator
	RaiseUnsupportedResourceError() error
}

type IOperatorManager

type IOperatorManager interface {
	SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)
	CheckResourceCounts() error
	GetLogicalResourceIds() []string
	DeleteResourceCollection(ctx context.Context) error
}

type IamRoleOperator added in v0.9.0

type IamRoleOperator struct {
	// contains filtered or unexported fields
}

func NewIamRoleOperator added in v0.9.0

func NewIamRoleOperator(client client.IIam) *IamRoleOperator

func (*IamRoleOperator) AddResource added in v0.9.0

func (o *IamRoleOperator) AddResource(resource *types.StackResourceSummary)

func (*IamRoleOperator) DeleteIamRole added in v0.9.0

func (o *IamRoleOperator) DeleteIamRole(ctx context.Context, roleName *string) error

func (*IamRoleOperator) DeleteResources added in v0.9.0

func (o *IamRoleOperator) DeleteResources(ctx context.Context) error

func (*IamRoleOperator) GetResourcesLength added in v0.9.0

func (o *IamRoleOperator) GetResourcesLength() int

type MockIOperator added in v0.9.0

type MockIOperator struct {
	// contains filtered or unexported fields
}

MockIOperator is a mock of IOperator interface.

func NewMockIOperator added in v0.9.0

func NewMockIOperator(ctrl *gomock.Controller) *MockIOperator

NewMockIOperator creates a new mock instance.

func (*MockIOperator) AddResource added in v0.9.0

func (m *MockIOperator) AddResource(resource *types.StackResourceSummary)

AddResource mocks base method.

func (*MockIOperator) DeleteResources added in v0.9.0

func (m *MockIOperator) DeleteResources(ctx context.Context) error

DeleteResources mocks base method.

func (*MockIOperator) EXPECT added in v0.9.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIOperator) GetResourcesLength added in v0.9.0

func (m *MockIOperator) GetResourcesLength() int

GetResourcesLength mocks base method.

type MockIOperatorCollection added in v0.9.0

type MockIOperatorCollection struct {
	// contains filtered or unexported fields
}

MockIOperatorCollection is a mock of IOperatorCollection interface.

func NewMockIOperatorCollection added in v0.9.0

func NewMockIOperatorCollection(ctrl *gomock.Controller) *MockIOperatorCollection

NewMockIOperatorCollection creates a new mock instance.

func (*MockIOperatorCollection) EXPECT added in v0.9.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIOperatorCollection) GetLogicalResourceIds added in v0.9.0

func (m *MockIOperatorCollection) GetLogicalResourceIds() []string

GetLogicalResourceIds mocks base method.

func (*MockIOperatorCollection) GetOperators added in v0.9.0

func (m *MockIOperatorCollection) GetOperators() []IOperator

GetOperators mocks base method.

func (*MockIOperatorCollection) RaiseUnsupportedResourceError added in v0.9.0

func (m *MockIOperatorCollection) RaiseUnsupportedResourceError() error

RaiseUnsupportedResourceError mocks base method.

func (*MockIOperatorCollection) SetOperatorCollection added in v0.9.0

func (m *MockIOperatorCollection) SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)

SetOperatorCollection mocks base method.

type MockIOperatorCollectionMockRecorder added in v0.9.0

type MockIOperatorCollectionMockRecorder struct {
	// contains filtered or unexported fields
}

MockIOperatorCollectionMockRecorder is the mock recorder for MockIOperatorCollection.

func (*MockIOperatorCollectionMockRecorder) GetLogicalResourceIds added in v0.9.0

func (mr *MockIOperatorCollectionMockRecorder) GetLogicalResourceIds() *gomock.Call

GetLogicalResourceIds indicates an expected call of GetLogicalResourceIds.

func (*MockIOperatorCollectionMockRecorder) GetOperators added in v0.9.0

func (mr *MockIOperatorCollectionMockRecorder) GetOperators() *gomock.Call

GetOperators indicates an expected call of GetOperators.

func (*MockIOperatorCollectionMockRecorder) RaiseUnsupportedResourceError added in v0.9.0

func (mr *MockIOperatorCollectionMockRecorder) RaiseUnsupportedResourceError() *gomock.Call

RaiseUnsupportedResourceError indicates an expected call of RaiseUnsupportedResourceError.

func (*MockIOperatorCollectionMockRecorder) SetOperatorCollection added in v0.9.0

func (mr *MockIOperatorCollectionMockRecorder) SetOperatorCollection(stackName, stackResourceSummaries interface{}) *gomock.Call

SetOperatorCollection indicates an expected call of SetOperatorCollection.

type MockIOperatorManager added in v0.9.0

type MockIOperatorManager struct {
	// contains filtered or unexported fields
}

MockIOperatorManager is a mock of IOperatorManager interface.

func NewMockIOperatorManager added in v0.9.0

func NewMockIOperatorManager(ctrl *gomock.Controller) *MockIOperatorManager

NewMockIOperatorManager creates a new mock instance.

func (*MockIOperatorManager) CheckResourceCounts added in v0.9.0

func (m *MockIOperatorManager) CheckResourceCounts() error

CheckResourceCounts mocks base method.

func (*MockIOperatorManager) DeleteResourceCollection added in v0.9.0

func (m *MockIOperatorManager) DeleteResourceCollection(ctx context.Context) error

DeleteResourceCollection mocks base method.

func (*MockIOperatorManager) EXPECT added in v0.9.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIOperatorManager) GetLogicalResourceIds added in v0.9.0

func (m *MockIOperatorManager) GetLogicalResourceIds() []string

GetLogicalResourceIds mocks base method.

func (*MockIOperatorManager) SetOperatorCollection added in v0.9.0

func (m *MockIOperatorManager) SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)

SetOperatorCollection mocks base method.

type MockIOperatorManagerMockRecorder added in v0.9.0

type MockIOperatorManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockIOperatorManagerMockRecorder is the mock recorder for MockIOperatorManager.

func (*MockIOperatorManagerMockRecorder) CheckResourceCounts added in v0.9.0

func (mr *MockIOperatorManagerMockRecorder) CheckResourceCounts() *gomock.Call

CheckResourceCounts indicates an expected call of CheckResourceCounts.

func (*MockIOperatorManagerMockRecorder) DeleteResourceCollection added in v0.9.0

func (mr *MockIOperatorManagerMockRecorder) DeleteResourceCollection(ctx interface{}) *gomock.Call

DeleteResourceCollection indicates an expected call of DeleteResourceCollection.

func (*MockIOperatorManagerMockRecorder) GetLogicalResourceIds added in v0.9.0

func (mr *MockIOperatorManagerMockRecorder) GetLogicalResourceIds() *gomock.Call

GetLogicalResourceIds indicates an expected call of GetLogicalResourceIds.

func (*MockIOperatorManagerMockRecorder) SetOperatorCollection added in v0.9.0

func (mr *MockIOperatorManagerMockRecorder) SetOperatorCollection(stackName, stackResourceSummaries interface{}) *gomock.Call

SetOperatorCollection indicates an expected call of SetOperatorCollection.

type MockIOperatorMockRecorder added in v0.9.0

type MockIOperatorMockRecorder struct {
	// contains filtered or unexported fields
}

MockIOperatorMockRecorder is the mock recorder for MockIOperator.

func (*MockIOperatorMockRecorder) AddResource added in v0.9.0

func (mr *MockIOperatorMockRecorder) AddResource(resource interface{}) *gomock.Call

AddResource indicates an expected call of AddResource.

func (*MockIOperatorMockRecorder) DeleteResources added in v0.9.0

func (mr *MockIOperatorMockRecorder) DeleteResources(ctx interface{}) *gomock.Call

DeleteResources indicates an expected call of DeleteResources.

func (*MockIOperatorMockRecorder) GetResourcesLength added in v0.9.0

func (mr *MockIOperatorMockRecorder) GetResourcesLength() *gomock.Call

GetResourcesLength indicates an expected call of GetResourcesLength.

type OperatorCollection

type OperatorCollection struct {
	// contains filtered or unexported fields
}

func NewOperatorCollection

func NewOperatorCollection(config aws.Config, operatorFactory *OperatorFactory, targetResourceTypes []string) *OperatorCollection

func (*OperatorCollection) GetLogicalResourceIds

func (c *OperatorCollection) GetLogicalResourceIds() []string

func (*OperatorCollection) GetOperators

func (c *OperatorCollection) GetOperators() []IOperator

func (*OperatorCollection) RaiseUnsupportedResourceError

func (c *OperatorCollection) RaiseUnsupportedResourceError() error

func (*OperatorCollection) SetOperatorCollection

func (c *OperatorCollection) SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)

type OperatorFactory

type OperatorFactory struct {
	// contains filtered or unexported fields
}

func NewOperatorFactory

func NewOperatorFactory(config aws.Config) *OperatorFactory

func (*OperatorFactory) CreateBackupVaultOperator

func (f *OperatorFactory) CreateBackupVaultOperator() *BackupVaultOperator

func (*OperatorFactory) CreateCloudFormationStackOperator added in v0.9.0

func (f *OperatorFactory) CreateCloudFormationStackOperator(targetResourceTypes []string) *CloudFormationStackOperator

func (*OperatorFactory) CreateCustomOperator

func (f *OperatorFactory) CreateCustomOperator() *CustomOperator

func (*OperatorFactory) CreateEcrRepositoryOperator added in v0.9.0

func (f *OperatorFactory) CreateEcrRepositoryOperator() *EcrRepositoryOperator

func (*OperatorFactory) CreateIamRoleOperator added in v0.9.0

func (f *OperatorFactory) CreateIamRoleOperator() *IamRoleOperator

func (*OperatorFactory) CreateS3BucketOperator added in v0.9.0

func (f *OperatorFactory) CreateS3BucketOperator() *S3BucketOperator

type OperatorManager

type OperatorManager struct {
	// contains filtered or unexported fields
}

func NewOperatorManager

func NewOperatorManager(operatorCollection IOperatorCollection) *OperatorManager

func (*OperatorManager) CheckResourceCounts

func (m *OperatorManager) CheckResourceCounts() error

func (*OperatorManager) DeleteResourceCollection

func (m *OperatorManager) DeleteResourceCollection(ctx context.Context) error

func (*OperatorManager) GetLogicalResourceIds

func (m *OperatorManager) GetLogicalResourceIds() []string

func (*OperatorManager) SetOperatorCollection

func (m *OperatorManager) SetOperatorCollection(stackName *string, stackResourceSummaries []types.StackResourceSummary)

type S3BucketOperator added in v0.9.0

type S3BucketOperator struct {
	// contains filtered or unexported fields
}

func NewS3BucketOperator added in v0.9.0

func NewS3BucketOperator(client client.IS3) *S3BucketOperator

func (*S3BucketOperator) AddResource added in v0.9.0

func (o *S3BucketOperator) AddResource(resource *types.StackResourceSummary)

func (*S3BucketOperator) DeleteResources added in v0.9.0

func (o *S3BucketOperator) DeleteResources(ctx context.Context) error

func (*S3BucketOperator) DeleteS3Bucket added in v0.9.0

func (o *S3BucketOperator) DeleteS3Bucket(ctx context.Context, bucketName *string) error

func (*S3BucketOperator) GetResourcesLength added in v0.9.0

func (o *S3BucketOperator) GetResourcesLength() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL