cloudformation

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 91 Imported by: 0

README

CloudFormation

Parity grade: A · SDK aws-sdk-go-v2/service/cloudformation@v1.71.7 · last audited 2026-07-23 (514ddad6)

Coverage

Metric Value
Operations audited 67 (65 ok, 2 partial)
Feature families 12 (12 ok)
Known gaps 4
Deferred items 2
Resource leaks clean
Known gaps
  • changeset_diff.go requiresRecreation() models only a curated subset of AWS resource types' replacement-forcing properties (documented in-code as intentional partial coverage, not a regression) — expanding this table is future work, not tracked separately from gopherstack-e5h
  • SetTypeConfiguration accepts configuration for any type name without requiring prior registration (intentional permissiveness for first-party AWS types — see ops: SetTypeConfiguration note); real AWS models TypeNotFoundException here but this emulator doesn't track the full built-in-type catalog (bd: gopherstack-e5h)
  • BatchDescribeTypeConfigurations never populates the real output's Errors/UnprocessedTypeConfigurations fields — every requested identifier is always reported as resolved (bd: gopherstack-e5h)
  • StackSets deployment-target math (ListStackSetAutoDeploymentTargets/ImportStacksToStackSet) uses a synthetic per-account-as-OU placeholder rather than real Organizations OU-hierarchy simulation — deliberate, code-commented simplification (bd: gopherstack-e5h)
Deferred
  • StackSets SERVICE_MANAGED/OU-based auto-deployment semantics beyond the synthetic per-account-as-OU placeholder — real Organizations-hierarchy simulation is a materially larger feature than a spot-fix; DetectStackSetDrift's per-instance accuracy was fixed this pass (bd: gopherstack-e5h)
  • Stack Refactor business-logic depth: ExecuteStackRefactor is a pure status-flip (verified this pass) and does NOT actually move StackResource entries between the stacks named in StackDefinitions/ResourceMappings; ListStackRefactorActions' MOVE-only action modeling and real resource-mapping semantics are unimplemented. Wire/error shape for all 5 ops is correct (see families: stack_refactor) — this is a genuine missing feature, not a bug, and a full implementation (parsing ResourceMapping definitions, migrating resource state across b.resources[stackID] maps, updating both stacks' templates) was judged too large to safely rush in this pass (bd: gopherstack-e5h)

More

Documentation

Index

Constants

View Source
const (
	MockAccountID = config.DefaultAccountID
	MockRegion    = config.DefaultRegion
)

Variables

View Source
var (
	ErrStackNotFound            = errors.New("stack with id does not exist")
	ErrStackAlreadyExists       = errors.New("stack already exists")
	ErrChangeSetNotFound        = errors.New("change set not found")
	ErrChangeSetExists          = errors.New("change set already exists")
	ErrChangeSetAlreadyExecuted = errors.New("change set has already been executed")
	ErrResourceNotFound         = errors.New("resource not found in stack")
	ErrExportNotFound           = errors.New("export with given name not found")
	ErrDuplicateExport          = errors.New("export already exists and is owned by another stack")
	ErrExportInUse              = errors.New("export cannot be removed while it is in use by another stack")
	ErrChangeSetNotExecutable   = errors.New("change set is not in an executable status")
	ErrDriftDetectionNotFound   = errors.New("drift detection not found")
	ErrStackSetNotFound         = errors.New("stack set not found")
	ErrStackSetAlreadyExists    = errors.New("stack set already exists")
	ErrStackSetNotEmpty         = errors.New(
		"stack set is not empty: delete all stack instances before deleting the stack set",
	)
	ErrStackInstanceNotFound      = errors.New("stack instance not found")
	ErrStackInstanceAlreadyExists = errors.New(
		"stack instance already exists in this account/region",
	)
	ErrGeneratedTemplateNotFound = errors.New("generated template not found")
	ErrResourceScanNotFound      = errors.New("resource scan not found")
	ErrOperationNotFound         = errors.New("operation not found in stack set")
	ErrOperationNotRunning       = errors.New("operation is not in RUNNING state")
	ErrTypeNotFound              = errors.New("type not found")
	ErrTypeVersionNotFound       = errors.New("type version not found")
	ErrRegistrationTokenNotFound = errors.New("registration token not found")
	ErrPublisherNotFound         = errors.New("publisher not found")
	ErrInvalidRoleARN            = errors.New("invalid IAM role ARN format")
	ErrInsufficientCapabilities  = errors.New(
		"requires capabilities: CAPABILITY_IAM or CAPABILITY_NAMED_IAM",
	)
	ErrStackRefactorNotFound = errors.New("stack refactor not found")
)
View Source
var (
	// ErrUnresolvedGetAtt mirrors AWS "Template error: instance of Fn::GetAtt
	// references undefined resource <Logical>".
	ErrUnresolvedGetAtt = errors.New("Fn::GetAtt references undefined resource")
	// ErrUnresolvedSubRef mirrors AWS "Template error: instance of Fn::Sub
	// references undefined resource <Logical>".
	ErrUnresolvedSubRef = errors.New("Fn::Sub references undefined resource")
	// ErrUnsupportedResourceType mirrors AWS "Resource type <Type> is not
	// supported / Unrecognized resource type".
	ErrUnsupportedResourceType = errors.New("unsupported resource type")
)

Intrinsic-validation errors. These are raised by a pre-flight pass over the parsed template (before any resource is provisioned) so that a template that references a missing resource, uses an unsupported resource type, or leaves an unsupported intrinsic unresolved fails the stack with an AWS-accurate StatusReason instead of silently succeeding.

View Source
var (
	// ErrFunctionNameRequired is returned when FunctionName is missing from Lambda::Permission.
	ErrFunctionNameRequired = errors.New("FunctionName is required for Lambda::Permission")
	// ErrRestAPIIDRequired is returned when RestApiId is missing from ApiGateway::Stage.
	ErrRestAPIIDRequired = errors.New("RestApiId is required for ApiGateway::Stage")
	// ErrInvalidShardCountType is returned when a Kinesis ShardCount property has an unexpected type.
	ErrInvalidShardCountType = errors.New("invalid ShardCount type in Kinesis stream template")
	// ErrShardCountOutOfRange is returned when a Kinesis ShardCount is outside the allowed range.
	ErrShardCountOutOfRange = errors.New("ShardCount out of range for Kinesis stream")
)

Sentinel errors for CloudFormation resource creation validation.

View Source
var ErrDynamicRefFailed = errors.New("dynamic reference resolution failed")

ErrDynamicRefFailed is returned when a dynamic reference cannot be resolved.

View Source
var ErrEmptyTemplate = errors.New("template body is empty")

ErrEmptyTemplate is returned when a template body is empty.

View Source
var ErrForEach = errors.New("invalid Fn::ForEach")

ErrForEach is returned when an Fn::ForEach block is malformed.

View Source
var ErrInvalidLayerVersionARN = errors.New("invalid or missing LayerVersionArn")

ErrInvalidLayerVersionARN is returned when a LayerVersionArn property is missing or malformed.

View Source
var ErrParameterValidation = errors.New("parameter validation failed")

ErrParameterValidation is returned when a parameter value fails AllowedValues validation.

View Source
var ErrTerminationProtectionEnabled = errors.New("stack termination protection is enabled")

ErrTerminationProtectionEnabled is returned when deleting a termination-protected stack.

Functions

func ResolveDynamicRefsInTemplate

func ResolveDynamicRefsInTemplate(ctx context.Context, tmpl *Template, resolver DynamicRefResolver) error

ResolveDynamicRefsInTemplate walks all resource properties in tmpl and replaces any {{resolve:ssm:...}} or {{resolve:secretsmanager:...}} references with their resolved values. Returns a descriptive error (wrapping ErrDynamicRefFailed) if any reference cannot be resolved. If resolver is nil the function is a no-op.

func ResolveParameters

func ResolveParameters(tmpl *Template, overrides []Parameter) map[string]string

ResolveParameters merges template defaults with provided overrides.

func ResolveValue

func ResolveValue(v any, params map[string]string, physicalIDs map[string]string) string

ResolveValue resolves a CloudFormation property value, handling intrinsic functions.

func ValidateParameters

func ValidateParameters(tmpl *Template, resolved map[string]string) error

ValidateParameters checks parameter values against AllowedValues, AllowedPattern, MinValue/MaxValue (Number type), and MinLength/MaxLength (String type) constraints.

func ValidateRoleARN

func ValidateRoleARN(roleARN string) error

ValidateRoleARN checks that the provided role ARN is syntactically valid. Returns ErrInvalidRoleARN if the ARN does not match the expected IAM role format.

Types

type AccountGateResult

type AccountGateResult struct {
	FunctionArn string `xml:"FunctionArn,omitempty"`
	Status      string `xml:"Status,omitempty"` // SUCCEEDED / FAILED / SKIPPED
}

AccountGateResult holds the result of the account gate function execution.

type AccountLimit

type AccountLimit struct {
	Name  string `xml:"Name"  json:"name"`
	Value int    `xml:"Value" json:"value"`
}

AccountLimit holds a single CloudFormation account limit.

type AutoDeployment added in v1.2.0

type AutoDeployment struct {
	Enabled                      bool `json:"enabled,omitempty"`
	RetainStacksOnAccountRemoval bool `json:"retainStacksOnAccountRemoval,omitempty"` //nolint:lll // AWS-compatible JSON field name exceeds line limit
}

AutoDeployment describes whether a service-managed StackSet automatically deploys to Organizations accounts added to a target organization/OU.

type AutoDeploymentTarget

type AutoDeploymentTarget struct {
	OrganizationalUnitID string   `xml:"OrganizationalUnitId,omitempty"`
	Regions              []string `xml:"Regions>member,omitempty"`
}

AutoDeploymentTarget represents a deployment target for a SERVICE_MANAGED StackSet.

type BackendsProvider

type BackendsProvider interface {
	GetDynamoDBHandler() service.Registerable
	GetS3Handler() service.Registerable
	GetSQSHandler() service.Registerable
	GetSNSHandler() service.Registerable
	GetSSMHandler() service.Registerable
	GetKMSHandler() service.Registerable
	GetSecretsManagerHandler() service.Registerable
	GetLambdaHandler() service.Registerable
	GetEventBridgeHandler() service.Registerable
	GetStepFunctionsHandler() service.Registerable
	GetCloudWatchLogsHandler() service.Registerable
	GetAPIGatewayHandler() service.Registerable
	GetIAMHandler() service.Registerable
	GetEC2Handler() service.Registerable
	GetKinesisHandler() service.Registerable
	GetCloudWatchHandler() service.Registerable
	GetRoute53Handler() service.Registerable
	GetElastiCacheHandler() service.Registerable
	GetSchedulerHandler() service.Registerable
	GetRDSHandler() service.Registerable
	GetECSHandler() service.Registerable
	GetECRHandler() service.Registerable
	GetRedshiftHandler() service.Registerable
	GetOpenSearchHandler() service.Registerable
	GetFirehoseHandler() service.Registerable
	GetRoute53ResolverHandler() service.Registerable
	GetSWFHandler() service.Registerable
	GetAppSyncHandler() service.Registerable
	GetSESHandler() service.Registerable
	GetACMHandler() service.Registerable
	GetCognitoIDPHandler() service.Registerable
	// Phase-3 handlers
	GetEKSHandler() service.Registerable
	GetEFSHandler() service.Registerable
	GetBatchHandler() service.Registerable
	GetCloudFrontHandler() service.Registerable
	GetAutoscalingHandler() service.Registerable
	GetAPIGatewayV2Handler() service.Registerable
	GetCodeBuildHandler() service.Registerable
	GetGlueHandler() service.Registerable
	GetNeptuneHandler() service.Registerable
	GetKafkaHandler() service.Registerable
	GetTransferHandler() service.Registerable
	GetCloudTrailHandler() service.Registerable
	GetCodePipelineHandler() service.Registerable
	GetIoTHandler() service.Registerable
	GetPipesHandler() service.Registerable
	GetEMRHandler() service.Registerable
	GetBedrockHandler() service.Registerable
	GetBedrockRuntimeHandler() service.Registerable
	GetMemoryDBHandler() service.Registerable
	GetCloudControlHandler() service.Registerable
	GetCeHandler() service.Registerable
	GetDMSHandler() service.Registerable
	GetCodeArtifactHandler() service.Registerable
	GetCodeConnectionsHandler() service.Registerable
	GetCodeCommitHandler() service.Registerable
	GetCodeDeployHandler() service.Registerable
	GetCodeStarConnectionsHandler() service.Registerable
	GetDynamoDBStreamsHandler() service.Registerable
	GetElasticbeanstalkHandler() service.Registerable
	GetDocDBHandler() service.Registerable
	GetFISHandler() service.Registerable
	GetIdentityStoreHandler() service.Registerable
	GetCognitoIdentityHandler() service.Registerable
	GetWafv2Handler() service.Registerable
	GetELBv2Handler() service.Registerable
	GetBackupHandler() service.Registerable
	GetGlobalConfig() *config.GlobalConfig
}

BackendsProvider is a private interface to extract service backends for resource creation.

type Change

type Change struct {
	Type           string         `xml:"Type"           json:"type"`
	ResourceChange ResourceChange `xml:"ResourceChange" json:"resourceChange"`
}

Change represents a single change in a change set.

type ChangeSet

type ChangeSet struct {
	CreationTime          time.Time              `xml:"CreationTime"                    json:"creationTime"`
	RollbackConfiguration *RollbackConfiguration `xml:"RollbackConfiguration,omitempty" json:"rollbackConfiguration,omitempty"` //nolint:lll // AWS-compatible JSON field name exceeds line limit
	ChangeSetID           string                 `xml:"ChangeSetId"                     json:"changeSetID"`
	ChangeSetName         string                 `xml:"ChangeSetName"                   json:"changeSetName"`
	StackID               string                 `xml:"StackId"                         json:"stackID"`
	StackName             string                 `xml:"StackName"                       json:"stackName"`
	Status                string                 `xml:"Status"                          json:"status"`
	StatusReason          string                 `xml:"StatusReason,omitempty"          json:"statusReason,omitempty"`
	ExecutionStatus       string                 `xml:"ExecutionStatus,omitempty"       json:"executionStatus,omitempty"`
	ChangeSetType         string                 `xml:"ChangeSetType,omitempty"         json:"changeSetType,omitempty"`
	Description           string                 `xml:"Description,omitempty"           json:"description,omitempty"`
	TemplateBody          string                 `xml:"-"                               json:"templateBody,omitempty"`
	Parameters            []Parameter            `xml:"-"                               json:"parameters,omitempty"`
	Changes               []Change               `xml:"-"                               json:"changes,omitempty"`
	Capabilities          []string               `xml:"-"                               json:"capabilities,omitempty"`
}

ChangeSet represents a CloudFormation change set.

type ChangeSetHook

type ChangeSetHook struct {
	InvocationPoint   string `xml:"InvocationPoint,omitempty"` // PRE_PROVISION
	FailureMode       string `xml:"FailureMode,omitempty"`     // FAIL / WARN
	TypeName          string `xml:"TypeName,omitempty"`
	TypeVersionID     string `xml:"TypeVersionId,omitempty"`
	TypeConfigVersion string `xml:"TypeConfigVersionId,omitempty"`
}

ChangeSetHook holds a single hook invocation for a change set.

type ChangeSetSummary

type ChangeSetSummary struct {
	ChangeSetID   string    `xml:"ChangeSetId"`
	ChangeSetName string    `xml:"ChangeSetName"`
	StackID       string    `xml:"StackId"`
	StackName     string    `xml:"StackName"`
	Status        string    `xml:"Status"`
	CreationTime  time.Time `xml:"CreationTime"`
	Description   string    `xml:"Description,omitempty"`
}

ChangeSetSummary is a brief summary of a change set.

type DriftDetectionStatus

type DriftDetectionStatus struct {
	Timestamp                 time.Time `xml:"Timestamp"                       json:"timestamp"`
	StackID                   string    `xml:"StackId"                         json:"stackID"`
	StackDriftDetectionID     string    `xml:"StackDriftDetectionId"           json:"stackDriftDetectionID"`
	StackDriftStatus          string    `xml:"StackDriftStatus"                json:"stackDriftStatus"`
	DetectionStatus           string    `xml:"DetectionStatus"                 json:"detectionStatus"`
	DetectionStatusReason     string    `xml:"DetectionStatusReason,omitempty" json:"detectionStatusReason,omitempty"`
	DriftedStackResourceCount int       `xml:"DriftedStackResourceCount"       json:"driftedStackResourceCount"`
}

DriftDetectionStatus holds the status of a stack drift detection operation.

type DynamicRefResolver

type DynamicRefResolver interface {
	// ResolveSSMParameter retrieves an SSM plain-text or StringList parameter value.
	ResolveSSMParameter(ctx context.Context, name string) (string, error)
	// ResolveSSMSecureParameter retrieves an SSM SecureString parameter with decryption.
	ResolveSSMSecureParameter(ctx context.Context, name string) (string, error)
	// ResolveSecret retrieves a Secrets Manager secret value.
	// jsonKey may be empty; if non-empty the secret is parsed as JSON and the key is extracted.
	ResolveSecret(ctx context.Context, secretID, jsonKey string) (string, error)
}

DynamicRefResolver is the interface for resolving CloudFormation dynamic references.

func NewDynamicRefResolver

func NewDynamicRefResolver(backends *ServiceBackends) DynamicRefResolver

NewDynamicRefResolver returns a DynamicRefResolver backed by the SSM and SecretsManager handlers in the given ServiceBackends. Returns nil when backends is nil.

type Export

type Export struct {
	ExportingStackID string `xml:"ExportingStackId" json:"exportingStackID"`
	Name             string `xml:"Name"             json:"name"`
	Value            string `xml:"Value"            json:"value"`
}

Export represents a cross-stack export (from ListExports).

type GeneratedTemplate

type GeneratedTemplate struct {
	GeneratedTemplateID   string `xml:"GeneratedTemplateId,omitempty"   json:"generatedTemplateID,omitempty"`
	GeneratedTemplateName string `xml:"GeneratedTemplateName,omitempty" json:"generatedTemplateName,omitempty"`
	Status                string `xml:"Status,omitempty"                json:"status,omitempty"`
	TemplateBody          string `xml:"-"                               json:"templateBody,omitempty"`
}

GeneratedTemplate holds a CloudFormation generated template.

type Handler

type Handler struct {
	Backend StorageBackend
}

Handler is the Echo HTTP service handler for CloudFormation operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new CloudFormation handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this CloudFormation instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the Action from the form.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the StackName from the form.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns all supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher for CloudFormation query-protocol requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type HookResult

type HookResult struct {
	Token      string
	HookStatus string // IN_PROGRESS / SUCCEEDED / FAILED / SKIPPED
	ErrorCode  string
}

HookResult holds the result of a CloudFormation hook invocation.

type InMemoryBackend

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

InMemoryBackend is a concurrency-safe in-memory CloudFormation backend.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new empty CloudFormation backend.

func NewInMemoryBackendWithConfig

func NewInMemoryBackendWithConfig(
	accountID, region string,
	creator *ResourceCreator,
) *InMemoryBackend

NewInMemoryBackendWithConfig creates a new backend with the given config and resource creator.

func (*InMemoryBackend) ActivateOrganizationsAccess

func (b *InMemoryBackend) ActivateOrganizationsAccess() error

func (*InMemoryBackend) ActivateType

func (b *InMemoryBackend) ActivateType(typeName, typeArn string) error

func (*InMemoryBackend) BatchDescribeTypeConfigurations

func (b *InMemoryBackend) BatchDescribeTypeConfigurations(
	typeConfigIdentifiers []string,
) ([]TypeConfigurationDetail, error)

func (*InMemoryBackend) CancelUpdateStack

func (b *InMemoryBackend) CancelUpdateStack(_ context.Context, nameOrID string) error

CancelUpdateStack cancels an in-progress stack update. If the stack is in UPDATE_IN_PROGRESS state, it transitions to UPDATE_ROLLBACK_COMPLETE.

func (*InMemoryBackend) ContinueUpdateRollback

func (b *InMemoryBackend) ContinueUpdateRollback(_ context.Context, nameOrID string) error

ContinueUpdateRollback continues the rollback for a stack that is in ROLLBACK_IN_PROGRESS or UPDATE_ROLLBACK_IN_PROGRESS state.

func (*InMemoryBackend) CreateChangeSet

func (b *InMemoryBackend) CreateChangeSet(
	_ context.Context,
	stackName, changeSetName, templateBody, description string,
	params []Parameter,
	capabilities []string,
) (*ChangeSet, error)

CreateChangeSet creates a change set for a stack.

func (*InMemoryBackend) CreateGeneratedTemplate

func (b *InMemoryBackend) CreateGeneratedTemplate(
	name string,
	resourceIDs []string,
) (*GeneratedTemplate, error)

func (*InMemoryBackend) CreateNestedStack

func (b *InMemoryBackend) CreateNestedStack(
	ctx context.Context,
	name, _, templateBody string,
	params []Parameter,
) (string, error)

CreateNestedStack implements NestedStackCreator. Must be called while b.mu is held by caller.

func (*InMemoryBackend) CreateStack

func (b *InMemoryBackend) CreateStack(
	ctx context.Context,
	name, templateBody string,
	params []Parameter,
	opts StackOptions,
) (*Stack, error)

CreateStack creates a new stack from a template.

func (*InMemoryBackend) CreateStackInstances

func (b *InMemoryBackend) CreateStackInstances(
	ctx context.Context,
	stackSetName string,
	accounts, regions []string,
) (string, error)

func (*InMemoryBackend) CreateStackRefactor

func (b *InMemoryBackend) CreateStackRefactor(
	description string,
	stackDefinitions []string,
) (string, error)

func (*InMemoryBackend) CreateStackSet

func (b *InMemoryBackend) CreateStackSet(
	name, description, templateBody string,
	opts StackSetOptions,
) (*StackSet, error)

func (*InMemoryBackend) DeactivateOrganizationsAccess

func (b *InMemoryBackend) DeactivateOrganizationsAccess() error

func (*InMemoryBackend) DeactivateType

func (b *InMemoryBackend) DeactivateType(typeName, typeArn string) error

func (*InMemoryBackend) DeleteChangeSet

func (b *InMemoryBackend) DeleteChangeSet(stackName, changeSetName string) error

DeleteChangeSet removes a change set.

func (*InMemoryBackend) DeleteGeneratedTemplate

func (b *InMemoryBackend) DeleteGeneratedTemplate(id string) error

func (*InMemoryBackend) DeleteNestedStack

func (b *InMemoryBackend) DeleteNestedStack(ctx context.Context, stackID string) error

DeleteNestedStack implements NestedStackCreator. Must be called while b.mu is held by caller.

func (*InMemoryBackend) DeleteStack

func (b *InMemoryBackend) DeleteStack(ctx context.Context, nameOrID string) error

func (*InMemoryBackend) DeleteStackInstances

func (b *InMemoryBackend) DeleteStackInstances(
	ctx context.Context,
	stackSetName string,
	accounts, regions []string,
) (string, error)

func (*InMemoryBackend) DeleteStackSet

func (b *InMemoryBackend) DeleteStackSet(name string) error

func (*InMemoryBackend) DeregisterType

func (b *InMemoryBackend) DeregisterType(typeArn string) error

func (*InMemoryBackend) DescribeAccountLimits

func (b *InMemoryBackend) DescribeAccountLimits() []AccountLimit

DescribeAccountLimits returns the CloudFormation account limits for this mock.

func (*InMemoryBackend) DescribeChangeSet

func (b *InMemoryBackend) DescribeChangeSet(stackName, changeSetName string) (*ChangeSet, error)

DescribeChangeSet returns details for a change set.

func (*InMemoryBackend) DescribeChangeSetHooks

func (b *InMemoryBackend) DescribeChangeSetHooks(_, _ string) ([]ChangeSetHook, error)

func (*InMemoryBackend) DescribeEvents

func (b *InMemoryBackend) DescribeEvents(
	stackName, nextToken string,
) (page.Page[StackEvent], error)

func (*InMemoryBackend) DescribeGeneratedTemplate

func (b *InMemoryBackend) DescribeGeneratedTemplate(id string) (*GeneratedTemplate, error)

func (*InMemoryBackend) DescribeOrganizationsAccess

func (b *InMemoryBackend) DescribeOrganizationsAccess() (string, error)

func (*InMemoryBackend) DescribePublisher

func (b *InMemoryBackend) DescribePublisher(publisherID string) (string, error)

func (*InMemoryBackend) DescribeResourceScan

func (b *InMemoryBackend) DescribeResourceScan(scanID string) (*ResourceScan, error)

func (*InMemoryBackend) DescribeStack

func (b *InMemoryBackend) DescribeStack(nameOrID string) (*Stack, error)

DescribeStack returns details for a single stack.

func (*InMemoryBackend) DescribeStackDriftDetectionStatus

func (b *InMemoryBackend) DescribeStackDriftDetectionStatus(detectionID string) (*DriftDetectionStatus, error)

DescribeStackDriftDetectionStatus returns the status of a drift detection operation.

func (*InMemoryBackend) DescribeStackEvents

func (b *InMemoryBackend) DescribeStackEvents(
	nameOrID, nextToken string,
) (page.Page[StackEvent], error)

DescribeStackEvents returns paginated events for a stack, most recent first.

func (*InMemoryBackend) DescribeStackInstance

func (b *InMemoryBackend) DescribeStackInstance(
	stackSetName, account, region string,
) (*StackInstance, error)

func (*InMemoryBackend) DescribeStackRefactor

func (b *InMemoryBackend) DescribeStackRefactor(stackRefactorID string) (string, error)

func (*InMemoryBackend) DescribeStackResource

func (b *InMemoryBackend) DescribeStackResource(
	nameOrID, logicalID string,
) (*StackResource, error)

DescribeStackResource returns details for a single resource in a stack.

func (*InMemoryBackend) DescribeStackResourceDrifts

func (b *InMemoryBackend) DescribeStackResourceDrifts(nameOrID string) ([]StackResourceDrift, error)

DescribeStackResourceDrifts returns drift information for all resources in a stack. Uses per-resource drift statuses from DetectStackDrift when available; falls back to the legacy SimulateDrift DRIFTED flag for backward compatibility.

func (*InMemoryBackend) DescribeStackResources

func (b *InMemoryBackend) DescribeStackResources(nameOrID string) ([]StackResource, error)

DescribeStackResources returns all resources for a stack (or matching a physical resource ID).

func (*InMemoryBackend) DescribeStackSet

func (b *InMemoryBackend) DescribeStackSet(name string) (*StackSet, error)

func (*InMemoryBackend) DescribeStackSetOperation

func (b *InMemoryBackend) DescribeStackSetOperation(
	stackSetName, operationID string,
) (*StackSetOperation, error)

func (*InMemoryBackend) DescribeType

func (b *InMemoryBackend) DescribeType(typeName, arn, versionID string) (*TypeDetails, error)

DescribeType returns detailed information about a registered CloudFormation type. Lookup is by typeName, arn, or versionID — at least one must be non-empty.

func (*InMemoryBackend) DescribeTypeRegistration

func (b *InMemoryBackend) DescribeTypeRegistration(registrationToken string) (string, error)

func (*InMemoryBackend) DetectStackDrift

func (b *InMemoryBackend) DetectStackDrift(nameOrID string) (string, error)

DetectStackDrift initiates drift detection for all resources in a stack. It compares deployed resource state against the current template and returns DRIFTED/MODIFIED/DELETED when divergence is found (#12).

func (*InMemoryBackend) DetectStackResourceDrift

func (b *InMemoryBackend) DetectStackResourceDrift(nameOrID, logicalID string) (string, error)

DetectStackResourceDrift initiates drift detection for a specific resource in a stack. It compares the resource's deployed properties against the template (#12).

func (*InMemoryBackend) DetectStackSetDrift

func (b *InMemoryBackend) DetectStackSetDrift(stackSetName string) (string, error)

func (*InMemoryBackend) EstimateTemplateCost

func (b *InMemoryBackend) EstimateTemplateCost(_ string, _ []Parameter) (string, error)

EstimateTemplateCost returns a mock cost estimation URL.

func (*InMemoryBackend) ExecuteChangeSet

func (b *InMemoryBackend) ExecuteChangeSet(
	ctx context.Context,
	stackName, changeSetName string,
) error

ExecuteChangeSet applies a change set to a stack. Only a change set whose ExecutionStatus is AVAILABLE can be executed — e.g. a change set created with no actual changes is FAILED/UNAVAILABLE and AWS rejects execution of it with InvalidChangeSetStatus. On success, AWS deletes every other change set associated with the stack because none remain valid against the now-updated template; this backend clears the whole per-stack change-set map to match.

func (*InMemoryBackend) ExecuteStackRefactor

func (b *InMemoryBackend) ExecuteStackRefactor(stackRefactorID string) error

func (*InMemoryBackend) GetGeneratedTemplate

func (b *InMemoryBackend) GetGeneratedTemplate(id string) (string, error)

func (*InMemoryBackend) GetHookResult

func (b *InMemoryBackend) GetHookResult(hookResultToken string) (string, error)

func (*InMemoryBackend) GetStackPolicy

func (b *InMemoryBackend) GetStackPolicy(nameOrID string) (string, error)

GetStackPolicy returns the stack policy for the given stack. Returns an empty string if no policy has been set.

func (*InMemoryBackend) GetTemplate

func (b *InMemoryBackend) GetTemplate(nameOrID string) (string, error)

GetTemplate returns the template body for a stack.

func (*InMemoryBackend) GetTemplateSummary

func (b *InMemoryBackend) GetTemplateSummary(templateBody, stackName string) (*TemplateSummary, error)

GetTemplateSummary returns summary information about a template body or an existing stack's template.

func (*InMemoryBackend) ImportStacksToStackSet

func (b *InMemoryBackend) ImportStacksToStackSet(stackSetName string, stackIDs []string) error

func (*InMemoryBackend) ListAll

func (b *InMemoryBackend) ListAll() []*Stack

ListAll returns all stacks (for dashboard).

func (*InMemoryBackend) ListChangeSets

func (b *InMemoryBackend) ListChangeSets(
	stackName, nextToken string,
) (page.Page[ChangeSetSummary], error)

ListChangeSets returns paginated summaries of change sets for a stack.

func (*InMemoryBackend) ListExports

func (b *InMemoryBackend) ListExports(nextToken string) (page.Page[Export], error)

ListExports returns all exported output values across all stacks.

func (*InMemoryBackend) ListGeneratedTemplates

func (b *InMemoryBackend) ListGeneratedTemplates(
	nextToken string,
) (page.Page[GeneratedTemplate], error)

func (*InMemoryBackend) ListHookResults

func (b *InMemoryBackend) ListHookResults(hookResultToken, _ string) ([]HookResult, error)

func (*InMemoryBackend) ListImports

func (b *InMemoryBackend) ListImports(exportName, nextToken string) (page.Page[string], error)

ListImports returns the names of stacks that import the given export.

func (*InMemoryBackend) ListResourceScanRelatedResources

func (b *InMemoryBackend) ListResourceScanRelatedResources(
	scanID string,
	_ []string,
) ([]string, error)

func (*InMemoryBackend) ListResourceScanResources

func (b *InMemoryBackend) ListResourceScanResources(scanID, _ string) ([]ScannedResource, error)

func (*InMemoryBackend) ListResourceScans

func (b *InMemoryBackend) ListResourceScans(nextToken string) (page.Page[ResourceScan], error)

func (*InMemoryBackend) ListStackInstanceResourceDrifts

func (b *InMemoryBackend) ListStackInstanceResourceDrifts(
	stackSetName, _, account, region string,
) ([]StackResourceDrift, error)

func (*InMemoryBackend) ListStackInstances

func (b *InMemoryBackend) ListStackInstances(
	stackSetName, nextToken string,
) (page.Page[StackInstance], error)

func (*InMemoryBackend) ListStackRefactorActions

func (b *InMemoryBackend) ListStackRefactorActions(
	stackRefactorID string,
) ([]StackRefactorAction, error)

func (*InMemoryBackend) ListStackRefactors

func (b *InMemoryBackend) ListStackRefactors(_ string) ([]StackRefactorSummary, error)

func (*InMemoryBackend) ListStackResources

func (b *InMemoryBackend) ListStackResources(
	nameOrID, nextToken string,
) (page.Page[StackResourceSummary], error)

ListStackResources returns paginated summaries of all resources in a stack.

func (*InMemoryBackend) ListStackSetAutoDeploymentTargets

func (b *InMemoryBackend) ListStackSetAutoDeploymentTargets(
	stackSetName string,
) ([]AutoDeploymentTarget, error)

func (*InMemoryBackend) ListStackSetOperationResults

func (b *InMemoryBackend) ListStackSetOperationResults(
	stackSetName, operationID, _ string,
) ([]StackSetOperationResult, error)

func (*InMemoryBackend) ListStackSetOperations

func (b *InMemoryBackend) ListStackSetOperations(
	stackSetName, nextToken string,
) (page.Page[StackSetOperationSummary], error)

func (*InMemoryBackend) ListStackSets

func (b *InMemoryBackend) ListStackSets(nextToken string) (page.Page[StackSetSummary], error)

func (*InMemoryBackend) ListStacks

func (b *InMemoryBackend) ListStacks(
	statusFilter []string,
	nextToken string,
) (page.Page[StackSummary], error)

ListStacks returns paginated stack summaries, optionally filtered by status.

func (*InMemoryBackend) ListTypeRegistrations

func (b *InMemoryBackend) ListTypeRegistrations(typeName, _ string) ([]string, error)

func (*InMemoryBackend) ListTypeVersions

func (b *InMemoryBackend) ListTypeVersions(typeName, _ string) ([]string, error)

func (*InMemoryBackend) ListTypes

func (b *InMemoryBackend) ListTypes(_ string) ([]TypeSummary, error)

func (*InMemoryBackend) PublishType

func (b *InMemoryBackend) PublishType(typeName string) error

func (*InMemoryBackend) RecordHandlerProgress

func (b *InMemoryBackend) RecordHandlerProgress(bearerToken, operationStatus string) error

func (*InMemoryBackend) RecordResourceMutation

func (b *InMemoryBackend) RecordResourceMutation(
	nameOrID, logicalID string,
	liveProps map[string]any,
) error

RecordResourceMutation records an out-of-band change to a deployed resource's live configuration. This models a resource whose actual state was modified outside CloudFormation (for example a direct call to the underlying service). After this call, DetectStackDrift reports the resource as MODIFIED with the precise property differences between the template (expected) and the recorded live state (actual).

func (*InMemoryBackend) RegisterPublisher

func (b *InMemoryBackend) RegisterPublisher(connectionArn string) (string, error)

func (*InMemoryBackend) RegisterType

func (b *InMemoryBackend) RegisterType(typeName, _ string) (string, error)

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) RollbackStack

func (b *InMemoryBackend) RollbackStack(_ context.Context, nameOrID string) error

func (*InMemoryBackend) SetStackPolicy

func (b *InMemoryBackend) SetStackPolicy(nameOrID, policy string) error

SetStackPolicy sets the stack policy for the given stack.

func (*InMemoryBackend) SetTypeConfiguration

func (b *InMemoryBackend) SetTypeConfiguration(typeName, configuration string) error

func (*InMemoryBackend) SetTypeDefaultVersion

func (b *InMemoryBackend) SetTypeDefaultVersion(typeArn, version string) error

func (*InMemoryBackend) SignalResource

func (b *InMemoryBackend) SignalResource(stackName, logicalID, uniqueID, status string) error

func (*InMemoryBackend) SimulateDrift

func (b *InMemoryBackend) SimulateDrift(stackName string) error

SimulateDrift marks all resources of a stack as DRIFTED for testing purposes. This is a test-only helper not part of the StorageBackend interface.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StackSetRegions added in v1.2.0

func (b *InMemoryBackend) StackSetRegions(name string) []string

StackSetRegions returns the deduplicated, sorted list of Amazon Web Services Regions the given StackSet currently has stack instances deployed in, matching real DescribeStackSetResult.StackSet.Regions. This is derived live from b.stackInstances rather than stored on the StackSet record itself -- storing it directly would create a second source of truth that could drift out of sync with the actual instances (same rationale as the driftByStackID reverse index rebuilt in Restore).

func (*InMemoryBackend) StartResourceScan

func (b *InMemoryBackend) StartResourceScan() (string, error)

func (*InMemoryBackend) StopStackSetOperation

func (b *InMemoryBackend) StopStackSetOperation(stackSetName, operationID string) error

func (*InMemoryBackend) TestType

func (b *InMemoryBackend) TestType(typeName, typeArn string) (string, error)

func (*InMemoryBackend) UpdateGeneratedTemplate

func (b *InMemoryBackend) UpdateGeneratedTemplate(id, name string) error

func (*InMemoryBackend) UpdateStack

func (b *InMemoryBackend) UpdateStack(
	ctx context.Context,
	nameOrID, templateBody string,
	params []Parameter,
	opts StackOptions,
) (*Stack, error)

UpdateStack updates an existing stack.

func (*InMemoryBackend) UpdateStackInstances

func (b *InMemoryBackend) UpdateStackInstances(
	stackSetName string,
	accounts, regions []string,
) (string, error)

func (*InMemoryBackend) UpdateStackSet

func (b *InMemoryBackend) UpdateStackSet(
	name, description, templateBody string,
	opts StackSetOptions,
) (*StackSet, error)

func (*InMemoryBackend) UpdateTerminationProtection

func (b *InMemoryBackend) UpdateTerminationProtection(nameOrID string, enable bool) error

func (*InMemoryBackend) ValidateTemplate

func (b *InMemoryBackend) ValidateTemplate(templateBody string) (*TemplateSummary, error)

type MacroRecord

type MacroRecord struct {
	Name        string
	FunctionARN string
	Description string
}

MacroRecord stores a registered CloudFormation macro.

type MacroRegistry

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

MacroRegistry stores registered CloudFormation macros.

func NewMacroRegistry

func NewMacroRegistry() *MacroRegistry

NewMacroRegistry creates an empty MacroRegistry.

func (*MacroRegistry) Get

func (r *MacroRegistry) Get(name string) *MacroRecord

Get returns the macro record for name, or nil if not found.

func (*MacroRegistry) InvokeMacro

func (r *MacroRegistry) InvokeMacro(
	ctx context.Context,
	lambdaBackend *lambdabackend.Handler,
	macroName string,
	fragmentJSON []byte,
	params map[string]string,
) ([]byte, error)

InvokeMacro invokes a registered macro Lambda to transform a template fragment. fragmentJSON is the JSON-encoded fragment; params are the template parameter values. Returns the transformed fragment JSON, or fragmentJSON unmodified if the macro Lambda is unavailable.

type ManagedExecution added in v1.2.0

type ManagedExecution struct {
	Active bool `json:"active,omitempty"`
}

ManagedExecution describes whether StackSets performs non-conflicting operations concurrently for a StackSet.

type NestedStackCreator

type NestedStackCreator interface {
	CreateNestedStack(
		ctx context.Context,
		name, templateURL, templateBody string,
		params []Parameter,
	) (string, error)
	DeleteNestedStack(ctx context.Context, stackID string) error
}

NestedStackCreator is a callback used to create and delete nested CloudFormation stacks.

type Output

type Output struct {
	OutputKey   string `xml:"OutputKey"             json:"outputKey"`
	OutputValue string `xml:"OutputValue"           json:"outputValue"`
	Description string `xml:"Description,omitempty" json:"description,omitempty"`
	ExportName  string `xml:"ExportName,omitempty"  json:"exportName,omitempty"`
}

Output is a CloudFormation stack output.

type Parameter

type Parameter struct {
	ParameterKey     string `xml:"ParameterKey"               json:"parameterKey"`
	ParameterValue   string `xml:"ParameterValue,omitempty"   json:"parameterValue,omitempty"`
	ResolvedValue    string `xml:"ResolvedValue,omitempty"    json:"resolvedValue,omitempty"`
	UsePreviousValue bool   `xml:"UsePreviousValue,omitempty" json:"usePreviousValue,omitempty"`
	NoEcho           bool   `xml:"-"                          json:"noEcho,omitempty"`
}

Parameter is a CloudFormation stack parameter.

type ParameterDeclaration

type ParameterDeclaration struct {
	ParameterKey          string   `xml:"ParameterKey"                    json:"parameterKey"`
	ParameterType         string   `xml:"ParameterType"                   json:"parameterType"`
	DefaultValue          string   `xml:"DefaultValue,omitempty"          json:"defaultValue,omitempty"`
	Description           string   `xml:"Description,omitempty"           json:"description,omitempty"`
	ConstraintDescription string   `xml:"ConstraintDescription,omitempty" json:"constraintDescription,omitempty"`
	AllowedPattern        string   `xml:"AllowedPattern,omitempty"        json:"allowedPattern,omitempty"`
	AllowedValues         []string `xml:"AllowedValues>member,omitempty"  json:"allowedValues,omitempty"`
	NoEcho                bool     `xml:"NoEcho,omitempty"                json:"noEcho,omitempty"`
}

ParameterDeclaration describes a parameter declared in a CloudFormation template.

type PropertyDifference

type PropertyDifference struct {
	PropertyPath   string `xml:"PropertyPath"   json:"propertyPath"`
	ExpectedValue  string `xml:"ExpectedValue"  json:"expectedValue"`
	ActualValue    string `xml:"ActualValue"    json:"actualValue"`
	DifferenceType string `xml:"DifferenceType" json:"differenceType"`
}

PropertyDifference describes a single property-level difference between the expected (template) state and the actual (live) state of a stack resource.

type Provider

type Provider struct{}

Provider implements service.Provider for the CloudFormation service.

func (*Provider) Init

Init initializes the CloudFormation service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type Publisher

type Publisher struct {
	PublisherID   string
	ConnectionArn string
	Status        string // VERIFIED / UNVERIFIED
}

Publisher holds publisher registration info.

type RegisteredType

type RegisteredType struct {
	TypeArn        string
	TypeName       string
	Type           string // RESOURCE / MODULE / HOOK
	VersionID      string
	DefaultVersion string
	Status         string // COMPLETE / IN_PROGRESS / FAILED / DEPRECATED
	Configuration  string
	IsActivated    bool
	IsPublished    bool
}

RegisteredType holds registration info for a CloudFormation type.

type RegisteredTypeVersion

type RegisteredTypeVersion struct {
	TypeArn   string
	VersionID string
	Status    string // COMPLETE / DEPRECATED
	IsDefault bool
}

RegisteredTypeVersion holds version-level info for a registered type.

type ResourceChange

type ResourceChange struct {
	Action       string                 `xml:"Action"                       json:"action"`
	LogicalID    string                 `xml:"LogicalResourceId"            json:"logicalID"`
	PhysicalID   string                 `xml:"PhysicalResourceId,omitempty" json:"physicalID,omitempty"`
	ResourceType string                 `xml:"ResourceType"                 json:"resourceType"`
	Replacement  string                 `xml:"Replacement,omitempty"        json:"replacement,omitempty"`
	Scope        []string               `xml:"Scope,omitempty"              json:"scope,omitempty"`
	Details      []ResourceChangeDetail `xml:"Details,omitempty"            json:"details,omitempty"`
}

ResourceChange describes a resource-level change.

type ResourceChangeDetail

type ResourceChangeDetail struct {
	Target       *ResourceTargetDefinition `xml:"Target,omitempty"       json:"target,omitempty"`
	Evaluation   string                    `xml:"Evaluation,omitempty"   json:"evaluation,omitempty"`
	ChangeSource string                    `xml:"ChangeSource,omitempty" json:"changeSource,omitempty"`
}

ResourceChangeDetail describes a single property-level detail of a resource change, mirroring the AWS CloudFormation ResourceChangeDetail shape.

type ResourceCreator

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

ResourceCreator creates and deletes cloud resources.

func NewResourceCreator

func NewResourceCreator(backends *ServiceBackends) *ResourceCreator

NewResourceCreator returns a ResourceCreator backed by the given services.

func (*ResourceCreator) Create

func (rc *ResourceCreator) Create(
	ctx context.Context,
	logicalID, resourceType string,
	props map[string]any,
	params map[string]string,
	physicalIDs map[string]string,
) (string, error)

Create creates a resource and returns its physical ID.

func (*ResourceCreator) Delete

func (rc *ResourceCreator) Delete(
	ctx context.Context,
	resourceType, physicalID string,
	props map[string]any,
) error

Delete deletes a resource by type and physical ID.

func (*ResourceCreator) Update

func (rc *ResourceCreator) Update(
	ctx context.Context,
	logicalID, resourceType, physicalID string,
	newProps, oldProps map[string]any,
) error

Update sends an Update lifecycle event to CFN extensibility resource types (Custom::*, AWS::CloudFormation::CustomResource). For other resource types it is a no-op — the backend's updateResources handles them via property overwrite.

func (*ResourceCreator) WithNestedStackCreator

func (rc *ResourceCreator) WithNestedStackCreator(nsc NestedStackCreator)

WithNestedStackCreator sets the callback used to create/delete nested stacks.

type ResourceScan

type ResourceScan struct {
	ResourceScanID      string  `xml:"ResourceScanId,omitempty"      json:"resourceScanID,omitempty"`
	Status              string  `xml:"Status,omitempty"              json:"status,omitempty"`
	PercentageCompleted float64 `xml:"PercentageCompleted,omitempty" json:"percentageCompleted,omitempty"`
}

ResourceScan holds the status of a resource scan.

type ResourceTargetDefinition

type ResourceTargetDefinition struct {
	Attribute          string `xml:"Attribute,omitempty"          json:"attribute,omitempty"`
	Name               string `xml:"Name,omitempty"               json:"name,omitempty"`
	RequiresRecreation string `xml:"RequiresRecreation,omitempty" json:"requiresRecreation,omitempty"`
}

ResourceTargetDefinition identifies the property targeted by a change detail and whether changing it requires the resource to be recreated (replaced).

type RollbackConfiguration

type RollbackConfiguration struct {
	RollbackTriggers        []RollbackTrigger `xml:"RollbackTriggers>member,omitempty" json:"rollbackTriggers,omitempty"`
	MonitoringTimeInMinutes int               `xml:"MonitoringTimeInMinutes,omitempty" json:"monitoringTime,omitempty"`
}

RollbackConfiguration holds rollback trigger configuration for a stack.

type RollbackTrigger

type RollbackTrigger struct {
	ARN  string `xml:"Arn"  json:"arn"`
	Type string `xml:"Type" json:"type"`
}

RollbackTrigger defines a CloudWatch alarm ARN used as a rollback trigger.

type ScannedResource

type ScannedResource struct {
	ResourceType       string `xml:"ResourceType,omitempty"`
	ResourceIdentifier string `xml:"ResourceIdentifier>member,omitempty"`
	StackID            string `xml:"StackId,omitempty"`
	ManagedByStack     bool   `xml:"ManagedByStack,omitempty"`
}

ScannedResource represents a single resource discovered during a resource scan.

type ServiceBackends

type ServiceBackends struct {
	DynamoDB        *ddbbackend.DynamoDBHandler
	S3              *s3backend.S3Handler
	SQS             *sqsbackend.Handler
	SNS             *snsbackend.Handler
	SSM             *ssmbackend.Handler
	KMS             *kmsbackend.Handler
	SecretsManager  *secretsmanagerbackend.Handler
	Lambda          *lambdabackend.Handler
	EventBridge     *ebbackend.Handler
	StepFunctions   *sfnbackend.Handler
	CloudWatchLogs  *cwlogsbackend.Handler
	APIGateway      *apigwbackend.Handler
	IAM             *iambackend.Handler
	EC2             *ec2backend.Handler
	Kinesis         *kinesisbackend.Handler
	CloudWatch      *cloudwatchbackend.Handler
	Route53         *route53backend.Handler
	ElastiCache     *elasticachebackend.Handler
	Scheduler       *schedulerbackend.Handler
	RDS             *rdsbackend.Handler
	ECS             *ecsbackend.Handler
	ECR             *ecrbackend.Handler
	Redshift        *redshiftbackend.Handler
	OpenSearch      *opensearchbackend.Handler
	Firehose        *firehosebackend.Handler
	Route53Resolver *route53resolverbackend.Handler
	SWF             *swfbackend.Handler
	AppSync         *appsyncbackend.Handler
	SES             *sesbackend.Handler
	ACM             *acmbackend.Handler
	CognitoIDP      *cognitoidpbackend.Handler
	CognitoIdentity *cognitoidentitybackend.Handler
	// Phase-3 backends
	EKS            *eksbackend.Handler
	EFS            *efsbackend.Handler
	Batch          *batchbackend.Handler
	CloudFront     *cloudfrontbackend.Handler
	Autoscaling    *autoscalingbackend.Handler
	APIGatewayV2   *apigatewayv2backend.Handler
	CodeBuild      *codebuildbackend.Handler
	Glue           *gluebackend.Handler
	DocDB          *docdbbackend.Handler
	Neptune        *neptunebackend.Handler
	Kafka          *kafkabackend.Handler
	Transfer       *transferbackend.Handler
	CloudTrail     *cloudtrailbackend.Handler
	CodePipeline   *codepipelinebackend.Handler
	IoT            *iotbackend.Handler
	Pipes          *pipesbackend.Handler
	EMR            *emrbackend.Handler
	MemoryDB       *memorydb.Handler
	BedrockRuntime *bedrockruntime.Handler
	// Phase-4 backends
	ELBv2  *elbv2backend.Handler
	WAFv2  *wafv2backend.Handler
	Backup *backupbackend.Handler
	// Phase-5 backends
	AppAutoScaling *appautoscalingbackend.Handler
	// CFN extensibility
	WaitConditions *WaitConditionStore
	MacroRegistry  *MacroRegistry
	AccountID      string
	Region         string
}

ServiceBackends holds references to all service backends.

type SignalRecord

type SignalRecord struct {
	UniqueID string
	Status   string
}

SignalRecord holds a single resource signal.

type Stack

type Stack struct {
	// RollbackConfiguration uses a long AWS-compatible JSON field name; line length accepted.
	RollbackConfiguration       *RollbackConfiguration `xml:"RollbackConfiguration,omitempty"   json:"rollbackConfiguration,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	CreationTime                time.Time              `xml:"CreationTime"                      json:"creationTime"`
	LastUpdatedTime             *time.Time             `xml:"LastUpdatedTime,omitempty"         json:"lastUpdatedTime,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	DeletionTime                *time.Time             `xml:"DeletionTime,omitempty"            json:"deletionTime,omitempty"`    //nolint:lll // goimports struct-tag alignment exceeds line limit.
	StackID                     string                 `xml:"StackId"                           json:"stackID"`
	StackName                   string                 `xml:"StackName"                         json:"stackName"`
	Description                 string                 `xml:"Description,omitempty"             json:"description,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	StackStatus                 string                 `xml:"StackStatus"                       json:"stackStatus"`
	StackStatusReason           string                 `xml:"StackStatusReason,omitempty"       json:"stackStatusReason,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	RoleARN                     string                 `xml:"RoleARN,omitempty"                 json:"roleARN,omitempty"`
	TemplateBody                string                 `xml:"-"                                 json:"templateBody,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	ParentID                    string                 `xml:"ParentId,omitempty"                json:"parentID,omitempty"`
	RootID                      string                 `xml:"RootId,omitempty"                  json:"rootID,omitempty"`
	Parameters                  []Parameter            `xml:"Parameters>member,omitempty"       json:"parameters,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	Outputs                     []Output               `xml:"Outputs>member,omitempty"          json:"outputs,omitempty"`
	Tags                        []Tag                  `xml:"Tags>member,omitempty"             json:"tags,omitempty"`
	Capabilities                []string               `xml:"Capabilities>member,omitempty"     json:"capabilities,omitempty"`      //nolint:lll // goimports struct-tag alignment exceeds line limit.
	NotificationARNs            []string               `xml:"NotificationARNs>member,omitempty" json:"notificationARNs,omitempty"`  //nolint:lll // goimports struct-tag alignment exceeds line limit.
	TimeoutInMinutes            int                    `xml:"TimeoutInMinutes,omitempty"        json:"timeoutInMinutes,omitempty"`  //nolint:lll // goimports struct-tag alignment exceeds line limit.
	EnableTerminationProtection bool                   `xml:"EnableTerminationProtection"       json:"enableTerminationProtection"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	DisableRollback             bool                   `xml:"DisableRollback,omitempty"         json:"disableRollback,omitempty"`   //nolint:lll // goimports struct-tag alignment exceeds line limit.
}

Stack represents a CloudFormation stack.

type StackEvent

type StackEvent struct {
	Timestamp            time.Time `xml:"Timestamp"                      json:"timestamp"`
	EventID              string    `xml:"EventId"                        json:"eventID"`
	StackID              string    `xml:"StackId"                        json:"stackID"`
	StackName            string    `xml:"StackName"                      json:"stackName"`
	LogicalResourceID    string    `xml:"LogicalResourceId"              json:"logicalResourceID"`
	PhysicalResourceID   string    `xml:"PhysicalResourceId,omitempty"   json:"physicalResourceID,omitempty"`
	ResourceType         string    `xml:"ResourceType"                   json:"resourceType"`
	ResourceStatus       string    `xml:"ResourceStatus"                 json:"resourceStatus"`
	ResourceStatusReason string    `xml:"ResourceStatusReason,omitempty" json:"resourceStatusReason,omitempty"`
}

StackEvent is a single event in a stack's history.

type StackInstance

type StackInstance struct {
	StackSetID      string `xml:"StackSetId,omitempty"      json:"stackSetID,omitempty"`
	StackSetName    string `xml:"StackSetName,omitempty"    json:"stackSetName,omitempty"`
	StackID         string `xml:"StackId,omitempty"         json:"stackID,omitempty"`
	Account         string `xml:"Account,omitempty"         json:"account,omitempty"`
	Region          string `xml:"Region,omitempty"          json:"region,omitempty"`
	Status          string `xml:"Status,omitempty"          json:"status,omitempty"`
	StatusReason    string `xml:"StatusReason,omitempty"    json:"statusReason,omitempty"`
	DriftStatus     string `xml:"DriftStatus,omitempty"     json:"driftStatus,omitempty"`
	LastOperationID string `xml:"LastOperationId,omitempty" json:"lastOperationID,omitempty"`
}

StackInstance represents an instance of a StackSet in a specific account/region.

type StackOptions

type StackOptions struct {
	RollbackConfiguration *RollbackConfiguration
	RoleARN               string
	OnFailure             string // DELETE | ROLLBACK | DO_NOTHING
	Capabilities          []string
	NotificationARNs      []string
	Tags                  []Tag
	TimeoutInMinutes      int
	DisableRollback       bool
}

type StackRefactor

type StackRefactor struct {
	RefactorID       string
	Description      string
	Status           string // CREATE_IN_PROGRESS / CREATE_COMPLETE / EXECUTE_IN_PROGRESS / EXECUTE_COMPLETE
	StackDefinitions []string
}

StackRefactor holds info about a stack refactor operation.

type StackRefactorAction

type StackRefactorAction struct {
	Action             string `xml:"Action,omitempty"`
	Description        string `xml:"Description,omitempty"`
	StackName          string `xml:"StackName,omitempty"`
	LogicalResourceID  string `xml:"LogicalResourceId,omitempty"`
	PhysicalResourceID string `xml:"PhysicalResourceId,omitempty"`
	ResourceType       string `xml:"ResourceType,omitempty"`
}

StackRefactorAction is a single action performed during a stack refactor.

type StackRefactorSummary

type StackRefactorSummary struct {
	StackRefactorID string `xml:"StackRefactorId"`
	Status          string `xml:"Status,omitempty"`
	Description     string `xml:"Description,omitempty"`
}

StackRefactorSummary is a brief summary of a stack refactor operation.

type StackResource

type StackResource struct {
	Timestamp      time.Time      `json:"timestamp"`
	Properties     map[string]any `json:"properties,omitempty"`
	LogicalID      string         `json:"logicalID"`
	PhysicalID     string         `json:"physicalID"`
	Type           string         `json:"type"`
	Status         string         `json:"status"`
	StackID        string         `json:"stackID"`
	StackName      string         `json:"stackName"`
	DeletionPolicy string         `json:"deletionPolicy,omitempty"`
}

StackResource represents a resource within a stack.

type StackResourceDrift

type StackResourceDrift struct {
	Timestamp                time.Time            `xml:"Timestamp"                    json:"timestamp"`
	StackID                  string               `xml:"StackId"                      json:"stackID"`
	LogicalResourceID        string               `xml:"LogicalResourceId"            json:"logicalResourceID"`
	PhysicalResourceID       string               `xml:"PhysicalResourceId,omitempty" json:"physicalResourceID,omitempty"`
	ResourceType             string               `xml:"ResourceType"                 json:"resourceType"`
	StackResourceDriftStatus string               `xml:"StackResourceDriftStatus"     json:"stackResourceDriftStatus"`
	ExpectedProperties       string               `xml:"ExpectedProperties,omitempty" json:"expectedProperties,omitempty"`
	ActualProperties         string               `xml:"ActualProperties,omitempty"   json:"actualProperties,omitempty"`
	PropertyDifferences      []PropertyDifference `xml:"PropertyDifferences"          json:"propertyDifferences,omitempty"`
}

StackResourceDrift holds drift information for a single stack resource.

type StackResourceSummary

type StackResourceSummary struct {
	Timestamp            time.Time `xml:"LastUpdatedTimestamp"           json:"timestamp"`
	LogicalResourceID    string    `xml:"LogicalResourceId"              json:"logicalResourceID"`
	PhysicalResourceID   string    `xml:"PhysicalResourceId,omitempty"   json:"physicalResourceID,omitempty"`
	ResourceType         string    `xml:"ResourceType"                   json:"resourceType"`
	ResourceStatus       string    `xml:"ResourceStatus"                 json:"resourceStatus"`
	ResourceStatusReason string    `xml:"ResourceStatusReason,omitempty" json:"resourceStatusReason,omitempty"`
}

StackResourceSummary is a brief summary of a resource within a stack (for ListStackResources).

type StackSet

type StackSet struct {
	AutoDeployment        *AutoDeployment   `xml:"-"                     json:"autoDeployment,omitempty"`
	ManagedExecution      *ManagedExecution `xml:"-"                     json:"managedExecution,omitempty"`
	StackSetID            string            `xml:"StackSetId"            json:"stackSetID"`
	StackSetName          string            `xml:"StackSetName"          json:"stackSetName"`
	Description           string            `xml:"Description,omitempty" json:"description,omitempty"`
	Status                string            `xml:"Status"                json:"status"`
	TemplateBody          string            `xml:"-"                     json:"templateBody,omitempty"`
	StackSetARN           string            `xml:"-"                     json:"stackSetARN,omitempty"`
	AdministrationRoleARN string            `xml:"-"                     json:"administrationRoleARN,omitempty"` //nolint:lll // AWS-compatible JSON field name exceeds line limit
	ExecutionRoleName     string            `xml:"-"                     json:"executionRoleName,omitempty"`
	PermissionModel       string            `xml:"-"                     json:"permissionModel,omitempty"`
	Capabilities          []string          `xml:"-"                     json:"capabilities,omitempty"`
	Parameters            []Parameter       `xml:"-"                     json:"parameters,omitempty"`
	Tags                  []Tag             `xml:"-"                     json:"tags,omitempty"`
	OrganizationalUnitIDs []string          `xml:"-"                     json:"organizationalUnitIDs,omitempty"` //nolint:lll // AWS-compatible JSON field name exceeds line limit
}

StackSet represents a CloudFormation StackSet.

type StackSetOperation

type StackSetOperation struct {
	CreatedAt    time.Time
	OperationID  string
	StackSetName string
	Action       string // CREATE_INSTANCES / UPDATE_INSTANCES / DELETE_INSTANCES / UPDATE / DETECT_DRIFT / IMPORT
	Status       string // RUNNING / SUCCEEDED / STOPPED / STOPPING / FAILED
}

StackSetOperation represents a StackSet operation (create/update/delete instances, etc.).

type StackSetOperationResult

type StackSetOperationResult struct {
	AccountGateResult *AccountGateResult `xml:"AccountGateResult,omitempty"`
	Account           string             `xml:"Account,omitempty"`
	Region            string             `xml:"Region,omitempty"`
	Status            string             `xml:"Status,omitempty"` // SUCCEEDED / FAILED / CANCELLED / PENDING / RUNNING
	StatusReason      string             `xml:"StatusReason,omitempty"`
}

StackSetOperationResult holds per-account/region result for a StackSet operation.

type StackSetOperationSummary

type StackSetOperationSummary struct {
	CreationTime time.Time `xml:"CreationTime,omitempty"`
	OperationID  string    `xml:"OperationId"`
	Action       string    `xml:"Action"`
	Status       string    `xml:"Status"`
}

StackSetOperationSummary is a brief summary of a StackSet operation.

type StackSetOptions added in v1.2.0

type StackSetOptions struct {
	AutoDeployment        *AutoDeployment
	ManagedExecution      *ManagedExecution
	AdministrationRoleARN string
	ExecutionRoleName     string
	PermissionModel       string
	Capabilities          []string
	Parameters            []Parameter
	Tags                  []Tag
	OrganizationalUnitIDs []string
}

StackSetOptions holds the optional fields accepted by CreateStackSet and UpdateStackSet beyond name/description/templateBody, mirroring the shape of StackOptions for regular stacks.

type StackSetSummary

type StackSetSummary struct {
	StackSetID   string `xml:"StackSetId"`
	StackSetName string `xml:"StackSetName"`
	Status       string `xml:"Status"`
	Description  string `xml:"Description,omitempty"`
}

StackSetSummary is a brief summary of a StackSet.

type StackSummary

type StackSummary struct {
	CreationTime time.Time  `xml:"CreationTime"           json:"creationTime"`
	DeletionTime *time.Time `xml:"DeletionTime,omitempty" json:"deletionTime,omitempty"`
	StackID      string     `xml:"StackId"                json:"stackID"`
	StackName    string     `xml:"StackName"              json:"stackName"`
	StackStatus  string     `xml:"StackStatus"            json:"stackStatus"`
}

StackSummary is a brief summary of a stack for ListStacks.

type StorageBackend

type StorageBackend interface {
	CreateStack(
		ctx context.Context,
		name, templateBody string,
		params []Parameter,
		opts StackOptions,
	) (*Stack, error)
	UpdateStack(
		ctx context.Context,
		nameOrID, templateBody string,
		params []Parameter,
		opts StackOptions,
	) (*Stack, error)
	DeleteStack(ctx context.Context, nameOrID string) error
	DescribeStack(nameOrID string) (*Stack, error)
	ListStacks(statusFilter []string, nextToken string) (page.Page[StackSummary], error)
	DescribeStackEvents(nameOrID, nextToken string) (page.Page[StackEvent], error)
	DescribeStackResource(nameOrID, logicalID string) (*StackResource, error)
	ListStackResources(nameOrID, nextToken string) (page.Page[StackResourceSummary], error)
	DescribeStackResources(nameOrID string) ([]StackResource, error)
	ListExports(nextToken string) (page.Page[Export], error)
	ListImports(exportName, nextToken string) (page.Page[string], error)
	CreateChangeSet(
		ctx context.Context,
		stackName, changeSetName, templateBody, description string,
		params []Parameter,
		capabilities []string,
	) (*ChangeSet, error)
	DescribeChangeSet(stackName, changeSetName string) (*ChangeSet, error)
	ExecuteChangeSet(ctx context.Context, stackName, changeSetName string) error
	DeleteChangeSet(stackName, changeSetName string) error
	ListChangeSets(stackName, nextToken string) (page.Page[ChangeSetSummary], error)
	GetTemplate(nameOrID string) (string, error)
	ListAll() []*Stack
	// Drift detection
	DetectStackDrift(nameOrID string) (string, error)
	DetectStackResourceDrift(nameOrID, logicalID string) (string, error)
	DescribeStackDriftDetectionStatus(detectionID string) (*DriftDetectionStatus, error)
	DescribeStackResourceDrifts(nameOrID string) ([]StackResourceDrift, error)
	// Stack policy
	SetStackPolicy(nameOrID, policy string) error
	GetStackPolicy(nameOrID string) (string, error)
	// Template analysis
	GetTemplateSummary(templateBody, stackName string) (*TemplateSummary, error)
	EstimateTemplateCost(templateBody string, params []Parameter) (string, error)
	// Stack management
	ContinueUpdateRollback(ctx context.Context, nameOrID string) error
	CancelUpdateStack(ctx context.Context, nameOrID string) error
	DescribeAccountLimits() []AccountLimit
	// Stack Sets
	CreateStackSet(name, description, templateBody string, opts StackSetOptions) (*StackSet, error)
	UpdateStackSet(name, description, templateBody string, opts StackSetOptions) (*StackSet, error)
	DeleteStackSet(name string) error
	DescribeStackSet(name string) (*StackSet, error)
	StackSetRegions(name string) []string
	ListStackSets(nextToken string) (page.Page[StackSetSummary], error)
	CreateStackInstances(
		ctx context.Context,
		stackSetName string,
		accounts, regions []string,
	) (string, error)
	DeleteStackInstances(
		ctx context.Context,
		stackSetName string,
		accounts, regions []string,
	) (string, error)
	UpdateStackInstances(stackSetName string, accounts, regions []string) (string, error)
	ListStackInstances(stackSetName, nextToken string) (page.Page[StackInstance], error)
	DescribeStackInstance(stackSetName, account, region string) (*StackInstance, error)
	DetectStackSetDrift(stackSetName string) (string, error)
	ListStackSetOperations(
		stackSetName, nextToken string,
	) (page.Page[StackSetOperationSummary], error)
	DescribeStackSetOperation(stackSetName, operationID string) (*StackSetOperation, error)
	StopStackSetOperation(stackSetName, operationID string) error
	ListStackSetOperationResults(
		stackSetName, operationID, nextToken string,
	) ([]StackSetOperationResult, error)
	ListStackSetAutoDeploymentTargets(stackSetName string) ([]AutoDeploymentTarget, error)
	ImportStacksToStackSet(stackSetName string, stackIDs []string) error
	ListStackInstanceResourceDrifts(
		stackSetName, operationID, account, region string,
	) ([]StackResourceDrift, error)
	// Generated templates
	CreateGeneratedTemplate(name string, resources []string) (*GeneratedTemplate, error)
	UpdateGeneratedTemplate(id, name string) error
	DeleteGeneratedTemplate(id string) error
	DescribeGeneratedTemplate(id string) (*GeneratedTemplate, error)
	GetGeneratedTemplate(id string) (string, error)
	ListGeneratedTemplates(nextToken string) (page.Page[GeneratedTemplate], error)
	// Resource scans
	StartResourceScan() (string, error)
	DescribeResourceScan(scanID string) (*ResourceScan, error)
	ListResourceScans(nextToken string) (page.Page[ResourceScan], error)
	ListResourceScanResources(scanID, nextToken string) ([]ScannedResource, error)
	ListResourceScanRelatedResources(scanID string, resources []string) ([]string, error)
	// Type management
	ActivateType(typeName, typeArn string) error
	DeactivateType(typeName, typeArn string) error
	RegisterType(typeName, schemaHandlerPackage string) (string, error)
	DeregisterType(arn string) error
	PublishType(typeName string) error
	SetTypeDefaultVersion(arn, version string) error
	SetTypeConfiguration(typeName, configuration string) error
	BatchDescribeTypeConfigurations(
		typeConfigIdentifiers []string,
	) ([]TypeConfigurationDetail, error)
	ListTypes(nextToken string) ([]TypeSummary, error)
	ListTypeVersions(typeName, nextToken string) ([]string, error)
	ListTypeRegistrations(typeName, nextToken string) ([]string, error)
	DescribeTypeRegistration(registrationToken string) (string, error)
	DescribeType(typeName, arn, versionID string) (*TypeDetails, error)
	TestType(typeName, arn string) (string, error)
	RegisterPublisher(connectionArn string) (string, error)
	DescribePublisher(publisherID string) (string, error)
	// Stack refactor
	CreateStackRefactor(description string, stackDefinitions []string) (string, error)
	DescribeStackRefactor(stackRefactorID string) (string, error)
	ExecuteStackRefactor(stackRefactorID string) error
	ListStackRefactors(nextToken string) ([]StackRefactorSummary, error)
	ListStackRefactorActions(stackRefactorID string) ([]StackRefactorAction, error)
	// Org access
	ActivateOrganizationsAccess() error
	DeactivateOrganizationsAccess() error
	DescribeOrganizationsAccess() (string, error)
	// Misc
	SignalResource(stackName, logicalID, uniqueID, status string) error
	RollbackStack(ctx context.Context, stackName string) error
	RecordHandlerProgress(bearerToken, operationStatus string) error
	GetHookResult(hookResultToken string) (string, error)
	ListHookResults(hookResultToken, nextToken string) ([]HookResult, error)
	DescribeChangeSetHooks(stackName, changeSetName string) ([]ChangeSetHook, error)
	DescribeEvents(stackName, nextToken string) (page.Page[StackEvent], error)
	UpdateTerminationProtection(stackName string, enable bool) error
	ValidateTemplate(templateBody string) (*TemplateSummary, error)
}

type Tag

type Tag struct {
	Key   string `xml:"Key"   json:"key"`
	Value string `xml:"Value" json:"value"`
}

Tag is a CloudFormation resource tag.

type Template

type Template struct {
	Parameters               map[string]TemplateParameter `json:"Parameters"               yaml:"Parameters"`
	Resources                map[string]TemplateResource  `json:"Resources"                yaml:"Resources"`
	Outputs                  map[string]TemplateOutput    `json:"Outputs"                  yaml:"Outputs"`
	Mappings                 map[string]any               `json:"Mappings"                 yaml:"Mappings"`
	Conditions               map[string]any               `json:"Conditions"               yaml:"Conditions"`
	AWSTemplateFormatVersion string                       `json:"AWSTemplateFormatVersion" yaml:"AWSTemplateFormatVersion"`
	Description              string                       `json:"Description"              yaml:"Description"`
	// Transform is the top-level Transform section (e.g. AWS::Serverless-2016-10-31,
	// or a macro name/list of macro names). Per real CloudFormation semantics its
	// wire representation is either a single string or a list of strings; the
	// custom Unmarshal(JSON|YAML) below normalizes both to a []string.
	Transform []string `json:"Transform" yaml:"Transform"`
}

Template represents a parsed CloudFormation template.

func ParseTemplate

func ParseTemplate(body string) (*Template, error)

ParseTemplate parses a CloudFormation template from a JSON or YAML string.

func (*Template) UnmarshalJSON added in v1.2.0

func (t *Template) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Template so the top-level Transform key can be either a JSON string or a JSON array of strings, per the real CloudFormation template schema.

func (*Template) UnmarshalYAML added in v1.2.0

func (t *Template) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for Template, mirroring UnmarshalJSON's string-or-list normalization for the top-level Transform key.

type TemplateOutput

type TemplateOutput struct {
	Value       any                   `json:"Value"       yaml:"Value"`
	Export      *TemplateOutputExport `json:"Export"      yaml:"Export"`
	Description string                `json:"Description" yaml:"Description"`
}

TemplateOutput represents a CloudFormation template output.

type TemplateOutputExport

type TemplateOutputExport struct {
	Name any `json:"Name" yaml:"Name"`
}

TemplateOutputExport holds the export name for a template output.

type TemplateParameter

type TemplateParameter struct {
	Default               any      `json:"Default"               yaml:"Default"`
	MaxValue              *float64 `json:"MaxValue"              yaml:"MaxValue"`
	MinValue              *float64 `json:"MinValue"              yaml:"MinValue"`
	MaxLength             *int     `json:"MaxLength"             yaml:"MaxLength"`
	MinLength             *int     `json:"MinLength"             yaml:"MinLength"`
	Type                  string   `json:"Type"                  yaml:"Type"`
	Description           string   `json:"Description"           yaml:"Description"`
	AllowedPattern        string   `json:"AllowedPattern"        yaml:"AllowedPattern"`
	ConstraintDescription string   `json:"ConstraintDescription" yaml:"ConstraintDescription"`
	AllowedValues         []string `json:"AllowedValues"         yaml:"AllowedValues"`
	NoEcho                bool     `json:"NoEcho"                yaml:"NoEcho"`
}

TemplateParameter represents a CloudFormation template parameter.

type TemplateResource

type TemplateResource struct {
	Properties     map[string]any `json:"Properties"     yaml:"Properties"`
	Type           string         `json:"Type"           yaml:"Type"`
	DeletionPolicy string         `json:"DeletionPolicy" yaml:"DeletionPolicy"`
	DependsOn      []string       `json:"-"              yaml:"-"`
}

TemplateResource represents a CloudFormation template resource. DependsOn may be a single resource name (string) or a list of names ([]string).

func (*TemplateResource) UnmarshalJSON

func (r *TemplateResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for TemplateResource so that DependsOn can be either a JSON string or a JSON array of strings.

func (*TemplateResource) UnmarshalYAML

func (r *TemplateResource) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for TemplateResource.

type TemplateSummary

type TemplateSummary struct {
	Description   string                 `xml:"Description,omitempty"          json:"description,omitempty"`
	Parameters    []ParameterDeclaration `xml:"Parameters>member,omitempty"    json:"parameters,omitempty"`
	ResourceTypes []string               `xml:"ResourceTypes>member,omitempty" json:"resourceTypes,omitempty"`
}

TemplateSummary holds summary information about a CloudFormation template.

type TypeConfigurationDetail

type TypeConfigurationDetail struct {
	TypeArn                string `xml:"TypeArn,omitempty"`
	TypeName               string `xml:"TypeName,omitempty"`
	Alias                  string `xml:"Alias,omitempty"`
	Configuration          string `xml:"Configuration,omitempty"`
	IsDefaultConfiguration bool   `xml:"IsDefaultConfiguration,omitempty"`
}

TypeConfigurationDetail holds configuration detail for a CloudFormation type.

type TypeDetails

type TypeDetails struct {
	TypeName           string `xml:"TypeName,omitempty"`
	TypeArn            string `xml:"Arn,omitempty"`
	Type               string `xml:"Type,omitempty"`
	Visibility         string `xml:"Visibility,omitempty"`
	Status             string `xml:"TypeVersionStatus,omitempty"`
	Description        string `xml:"Description,omitempty"`
	Schema             string `xml:"Schema,omitempty"`
	VersionID          string `xml:"VersionId,omitempty"`
	DefaultVersionID   string `xml:"DefaultVersionId,omitempty"`
	PublisherID        string `xml:"PublisherId,omitempty"`
	DeprecatedStatus   string `xml:"DeprecatedStatus,omitempty"`
	IsActivated        bool   `xml:"IsActivated,omitempty"`
	IsDefaultVersion   bool   `xml:"IsDefaultVersion,omitempty"`
	IsActivatableInOrg bool   `xml:"IsActivatableInOrg,omitempty"`
}

TypeDetails holds full detail about a registered CloudFormation type, returned by DescribeType.

type TypeRegistrationRecord

type TypeRegistrationRecord struct {
	Token    string
	TypeName string
	TypeArn  string
	Status   string // COMPLETE / IN_PROGRESS / FAILED
}

TypeRegistrationRecord holds the state of a type registration request.

type TypeSummary

type TypeSummary struct {
	TypeName    string `xml:"TypeName,omitempty"`
	TypeArn     string `xml:"TypeArn,omitempty"`
	Type        string `xml:"Type,omitempty"`
	Visibility  string `xml:"Visibility,omitempty"`
	Description string `xml:"Description,omitempty"`
}

TypeSummary holds a brief summary of a CloudFormation type.

type WCSignal

type WCSignal struct {
	UniqueID string
	Status   string
	Data     string
	Reason   string
}

WCSignal is a single signal received by a WaitConditionHandle.

type WaitConditionStore

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

WaitConditionStore manages wait condition signals independently of the CFN backend mutex. It uses its own mutex so signals can be injected from goroutines that don't hold the CFN lock.

func NewWaitConditionStore

func NewWaitConditionStore() *WaitConditionStore

NewWaitConditionStore creates a new empty WaitConditionStore.

func (*WaitConditionStore) Signal

func (s *WaitConditionStore) Signal(token string, sig WCSignal)

Signal records a signal for the given handle token and wakes any waiting callers.

func (*WaitConditionStore) Wait

func (s *WaitConditionStore) Wait(
	ctx context.Context,
	token string,
	count int,
	emulatorTimeout time.Duration,
) error

Wait blocks until at least count SUCCESS signals have been received for token, or until ctx is cancelled, or until emulatorTimeout elapses (in which case it succeeds anyway — no real workload is running in the emulator).

Source Files

Jump to

Keyboard shortcuts

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