cloudformation

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 114 Imported by: 0

README

CloudFormation

Parity grade: A · SDK aws-sdk-go-v2/service/cloudformation@v1.76.1 · last audited 2026-09-25 (54869319e)

Coverage

Metric Value
PARITY entries audited 73 (72 ok, 1 partial)
Feature families 18 (18 ok)
Known gaps 11
Deferred items 0
Resource leaks clean
Known gaps
  • ListTypes Filters.PublisherId and ListStackRefactors ExecutionStatusFilter are not evaluated: types store no publisher and refactor summaries hold one merged Status; Filters.Category AWS_TYPES always matches nothing since no Amazon-published types are cataloged.
  • changeset_diff.go requiresRecreation() covers only a curated subset of resource types' replacement-forcing properties; expanding it is ongoing work (gopherstack-e5h).
  • SetTypeConfiguration accepts configuration for any type name without prior registration, intentionally, since first-party AWS types are not fully cataloged (gopherstack-e5h).
  • StackSets DeploymentTargets.AccountsUrl is accepted but not fetched: no S3 client is wired for it, same gap as TemplateURL elsewhere (gopherstack-g7b5).
  • ImportStacksToStackSet accepts OrganizationalUnitIds but does not stamp OrganizationalUnitId on imported instances: choosing the OU for each imported stack needs an account-to-OU membership lookup against Organizations, which this backend does not consult.
  • StackSetOperations complete synchronously as SUCCEEDED (RUNNING/STOPPING unreachable): the service has no clock- or janitor-driven lifecycle (gopherstack-b3pm).
  • Stack policy enforcement leaves NotAction/NotResource unevaluated (AWS's two-axis default-deny model) and treats Replacement Conditionally as Update:Replace; StackPolicyURL is not fetched (no S3 client) (gopherstack-cqy3).
  • No nested-stack change-set or public-extension version machinery exists, so these stay unmodeled: CreateChangeSet IncludeNestedStacks (nested stacks are created from inline TemplateBody only, TemplateURL is never fetched, so there is no nested template to diff), UpdateStack RetainExceptOnCreate, RollbackStack RoleARN, ActivateType MajorVersion/VersionBump/TypeNameAlias (no public extension version catalog) (gopherstack-xhu2t).
  • ListResourceScanRelatedResources always returns an empty list: no cross-resource relationship graph is computed for a scan, so MaxResults/Resources have nothing to page or seed from (re-verified 2026-10-03; the output also still uses plain-string members, not ScannedResource).
  • SAM transform (AWS::Serverless-2016-10-31) still unexpanded: HttpApi Auth/Domain/DefinitionBody/DefinitionUri/PropagateTags and HttpApi event Auth, Api event RequestParameters/RequestModel/ApiKeyRequired/AWS_IAM authorizers/UsagePlan/ResourcePolicy/Domain, Cognito AuthorizationScopes, ScheduleV2 DeadLetterConfig Type SQS (queue generation), SAM policy templates, Application/Connector/GraphQLApi/WebSocketApi, DeploymentPreference, FunctionUrlConfig, EventInvokeConfig, StateMachine Events. All fail the stack/change set with an explicit reason, never silently dropped.
  • SAM HttpApi emits separate AWS::ApiGatewayV2::Integration/Route resources (Integration/Route) instead of the OpenAPI Body real SAM generates, and SAM S3 events omit the Bucket DependsOn Permission edge (it would be circular here); logical IDs for those extras differ from real SAM.

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",
	)
	ErrCannotDeregisterDefaultVersion = errors.New(
		"can't deregister the default version of a type while other active versions exist",
	)
	ErrStackRefactorNotFound = errors.New("stack refactor not found")
	ErrStackPolicyDenied     = errors.New("update action denied by stack policy")
	ErrHookResultNotFound    = errors.New("hook result not found")
	// ErrCancelUpdateStackInvalidState is returned by CancelUpdateStack when
	// the stack is not in UPDATE_IN_PROGRESS state. Real AWS: "You can
	// cancel only stacks that are in the UPDATE_IN_PROGRESS state".
	ErrCancelUpdateStackInvalidState = errors.New("can only cancel stacks that are in the UPDATE_IN_PROGRESS state")
	// ErrRollbackStackInvalidState is returned by RollbackStack for a stack that is not CREATE_FAILED.
	ErrRollbackStackInvalidState = errors.New("can only roll back stacks that are in the CREATE_FAILED state")
	// ErrResourceTypeNotAllowed is returned when a template resource's Type
	// doesn't match any pattern in the caller's optional ResourceTypes
	// allowlist (CreateStackInput.ResourceTypes/UpdateStackInput.ResourceTypes/
	// CreateChangeSetInput.ResourceTypes).
	ErrResourceTypeNotAllowed = errors.New("resource type is not in the allowed ResourceTypes list")
	// ErrChangeSetTypeMismatch is returned when CreateChangeSetInput's
	// ChangeSetType conflicts with whether the target stack actually exists
	// (CREATE against an existing stack, or UPDATE against a missing one --
	// api_op_CreateChangeSet.go: "You can't use the UPDATE type to create a
	// change set for a new stack or the CREATE type to create a change set
	// for an existing stack").
	ErrChangeSetTypeMismatch = errors.New("ChangeSetType does not match whether the stack exists")
	// ErrChangeSetTypeUnsupported is returned for CreateChangeSetInput.
	// ChangeSetType=IMPORT, which this backend does not model (no
	// resources-to-import machinery exists).
	ErrChangeSetTypeUnsupported = errors.New("ChangeSetType IMPORT is not supported")
)
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")
	// ErrUnsupportedGetAttAttribute mirrors AWS "Template error: resource <X>
	// does not support attribute type <Y> in Fn::GetAtt".
	ErrUnsupportedGetAttAttribute = errors.New("does not support attribute 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 (
	// ErrOrganizationsNotWired is returned when a SERVICE_MANAGED deployment
	// target names an OU but no Organizations backend has been wired.
	ErrOrganizationsNotWired = errors.New("no Organizations service wired for OU-based deployment targets")

	// ErrOrganizationsAccessNotActive is returned when OU-based deployment
	// targets are used before ActivateOrganizationsAccess.
	ErrOrganizationsAccessNotActive = errors.New(
		"organizations trusted access is not activated: call ActivateOrganizationsAccess first",
	)

	// ErrServiceManagedRequired is returned when OU-based deployment targets
	// are used against a non-SERVICE_MANAGED StackSet.
	ErrServiceManagedRequired = errors.New(
		"OU-based deployment targets require a SERVICE_MANAGED StackSet",
	)
)
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 ErrCircularDependency = errors.New("Circular dependency between resources")

ErrCircularDependency mirrors CloudFormation's real CreateStack/UpdateStack validation failure for a dependency cycle among a template's resources, whether the cycle is declared via DependsOn or inferred from a Ref/Fn::GetAtt/Fn::Sub reference: "Circular dependency between resources: [A, B]".

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 ErrInvalidCallAs = errors.New("invalid CallAs value")

ErrInvalidCallAs is returned for a CallAs value outside its documented SELF/DELEGATED_ADMIN enum, or for DELEGATED_ADMIN against a StackSet whose PermissionModel isn't SERVICE_MANAGED.

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 ErrSAMTransform = errors.New("transform " + samTransformName + " failed with: " +
	"Invalid Serverless Application Specification document")

ErrSAMTransform is returned when a SAM template cannot be expanded.

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. It has no resourceTypes map of its own -- resolveGetAtt falls back to the physIDResourceTypeKey side channel in physicalIDs instead (see physIDResourceTypeKey), and accountID/region/stackName come from the same side channel when present.

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 ActivateTypeOptions

type ActivateTypeOptions struct {
	AutoUpdate       *bool
	ExecutionRoleArn string
	LogGroupName     string
	LogRoleArn       string
}

ActivateTypeOptions carries ActivateTypeInput's AutoUpdate, ExecutionRoleArn and LoggingConfig members.

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
	GetResilienceHubHandler() service.Registerable
	GetServiceDiscoveryHandler() service.Registerable
	GetAWSConfigHandler() service.Registerable
	GetSageMakerHandler() service.Registerable
	GetAthenaHandler() service.Registerable
	GetDataSyncHandler() service.Registerable
	GetAppConfigHandler() service.Registerable
	GetMacie2Handler() service.Registerable
	GetGuardDutyHandler() service.Registerable
	GetAccessAnalyzerHandler() service.Registerable
	GetAmplifyHandler() service.Registerable
	GetKinesisVideoHandler() service.Registerable
	GetECRPublicHandler() service.Registerable
	GetKafkaConnectHandler() service.Registerable
	GetGlobalConfig() *config.GlobalConfig
}

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

type BatchDescribeTypeConfigurationsError added in v1.3.1

type BatchDescribeTypeConfigurationsError struct {
	TypeConfigurationIdentifier *TypeConfigurationIdentifier `xml:"TypeConfigurationIdentifier,omitempty"`
	ErrorCode                   string                       `xml:"ErrorCode,omitempty"`
	ErrorMessage                string                       `xml:"ErrorMessage,omitempty"`
}

BatchDescribeTypeConfigurationsError reports a per-identifier failure (types.go:147).

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
	Description           string                 `xml:"Description,omitempty"           json:"description,omitempty"`
	TemplateBody          string                 `xml:"-"                               json:"templateBody,omitempty"`
	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"`
	ChangeSetID           string                 `xml:"ChangeSetId"                     json:"changeSetID"`
	ChangeSetName         string                 `xml:"ChangeSetName"                   json:"changeSetName"`
	Changes               []Change               `xml:"-"                               json:"changes,omitempty"`
	Capabilities          []string               `xml:"-"                               json:"capabilities,omitempty"`
	Tags                  []Tag                  `xml:"-"                               json:"tags,omitempty"`
	Parameters            []Parameter            `xml:"-"                               json:"parameters,omitempty"`
	// ResourceTypes/DisableValidation are CreateChangeSetInput members and
	// NotificationARNs/RoleARN are applied to the stack on ExecuteChangeSet;
	// none are part of DescribeChangeSetOutput's wire shape.
	RoleARN           string   `xml:"-" json:"roleARN,omitempty"`
	ResourceTypes     []string `xml:"-" json:"resourceTypes,omitempty"`
	NotificationARNs  []string `xml:"-" json:"notificationARNs,omitempty"`
	DisableValidation bool     `xml:"-" json:"disableValidation,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"`
	StatusReason    string    `xml:"StatusReason,omitempty"`
	ExecutionStatus string    `xml:"ExecutionStatus,omitempty"`
	CreationTime    time.Time `xml:"CreationTime"`
	Description     string    `xml:"Description,omitempty"`
}

ChangeSetSummary is a brief summary of a change set.

type CreateChangeSetOptions

type CreateChangeSetOptions struct {
	// ChangeSetType mirrors CreateChangeSetInput.ChangeSetType
	// (api_op_CreateChangeSet.go): "" defers to this backend's existing
	// stack-existence inference (CREATE if the stack doesn't exist, UPDATE
	// if it does); an explicit CREATE/UPDATE that conflicts with reality is
	// rejected (ErrChangeSetTypeMismatch); IMPORT is rejected outright
	// (ErrChangeSetTypeUnsupported -- no resources-to-import machinery
	// exists in this backend).
	ChangeSetType string
	// ResourceTypes/DisableValidation mirror CreateChangeSetInput's own
	// fields (api_op_CreateChangeSet.go:192,254); stored on the ChangeSet
	// and applied when ExecuteChangeSet calls CreateStack/UpdateStack,
	// same as Capabilities.
	RollbackConfiguration *RollbackConfiguration
	RoleARN               string
	ResourceTypes         []string
	NotificationARNs      []string
	DisableValidation     bool
}

CreateChangeSetOptions groups CreateChangeSet's optional fields beyond name/template/params/capabilities/tags.

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
	// contains filtered or unexported fields
}

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) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

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) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings whose resource creator provisions into that region's service backends.

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) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

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; other regions ride in an additive "regions" key.

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, opts ActivateTypeOptions) (string, error)

func (*InMemoryBackend) CancelUpdateStack

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

CancelUpdateStack cancels an in-progress stack update, transitioning it to UPDATE_ROLLBACK_COMPLETE. Real AWS: "You can cancel only stacks that are in the UPDATE_IN_PROGRESS state".

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,
	tags []Tag,
	opts CreateChangeSetOptions,
) (*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,
	parentID string,
) (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, ouIDs, regions []string,
	filterType string,
) (string, error)

func (*InMemoryBackend) CreateStackRefactor

func (b *InMemoryBackend) CreateStackRefactor(
	description string,
	stackDefinitions []StackDefinition,
	resourceMappings []ResourceMapping,
	enableStackCreation bool,
) (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(idOrName 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, ouIDs, regions []string,
	retainStacks bool,
	filterType string,
) (string, error)

func (*InMemoryBackend) DeleteStackSet

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

func (*InMemoryBackend) DeregisterType

func (b *InMemoryBackend) DeregisterType(typeName, typeArn, versionID string) error

DeregisterType deprecates a type or a single version of it (cloudformation@v1.76.1 api_op_DeregisterType.go doc comment). With no versionID it deprecates the whole type. With a versionID: deregistering the default version while other active versions exist is rejected; deregistering the last active version (including the only version) deprecates the whole type along with it.

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,
	failedOnly bool,
) (page.Page[StackEvent], error)

func (*InMemoryBackend) DescribeGeneratedTemplate

func (b *InMemoryBackend) DescribeGeneratedTemplate(idOrName 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) (*StackRefactor, 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, string, string, error)

DescribeTypeRegistration returns the registration's ProgressStatus and, per the real DescribeTypeRegistrationOutput.TypeArn doc comment ("For registration requests with a ProgressStatus of other than COMPLETE, this will be null"), its TypeArn -- populated here since every registration this mock creates is immediately COMPLETE.

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) (*StackResourceDrift, error)

DetectStackResourceDrift synchronously detects drift for a single resource in a stack and returns its full StackResourceDrift record. Unlike DetectStackDrift, this operation has no asynchronous detection-ID phase: AWS returns the drift record directly (api_op_DetectStackResourceDrift.go, aws-sdk-go-v2 v1.76.1).

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,
	disableRollback, retainExceptOnCreate bool,
) 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(ctx context.Context, stackRefactorID string) error

ExecuteStackRefactor moves each mapped resource out of its source stack's resource table and into its destination stack's — observable afterward through DescribeStackResources on both stacks.

func (*InMemoryBackend) GetChangeSetTemplate

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

GetChangeSetTemplate returns the template stored on a change set, addressed by name (with stackName) or by ARN.

func (*InMemoryBackend) GetGeneratedTemplate

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

func (*InMemoryBackend) GetHookResult

func (b *InMemoryBackend) GetHookResult(hookResultID 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) (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(
	maxResults int, 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, nextToken string, maxResults int,
) (page.Page[ScannedResource], error)

func (*InMemoryBackend) ListResourceScans

func (b *InMemoryBackend) ListResourceScans(
	maxResults int, nextToken, scanTypeFilter 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 string, maxResults int, nextToken string,
	filter ListStackInstancesFilter,
) (page.Page[StackInstance], error)

func (*InMemoryBackend) ListStackRefactorActions

func (b *InMemoryBackend) ListStackRefactorActions(
	stackRefactorID string, maxResults int, nextToken string,
) (page.Page[StackRefactorAction], error)

ListStackRefactorActions returns a stack refactor's actions, paginated by MaxResults/NextToken (real query-protocol form fields, api_op_ListStackRefactorActions.go).

func (*InMemoryBackend) ListStackRefactors

func (b *InMemoryBackend) ListStackRefactors(
	maxResults int, nextToken string,
) (page.Page[StackRefactorSummary], error)

ListStackRefactors returns stack refactors, paginated by MaxResults/NextToken (real query-protocol form fields, api_op_ListStackRefactors.go). Snapshot (not All) for a deterministic, sortable-by-RefactorID order -- required for stable pagination.

func (*InMemoryBackend) ListStackRefactorsFiltered

func (b *InMemoryBackend) ListStackRefactorsFiltered(
	maxResults int, nextToken string, executionStatuses []string,
) (page.Page[StackRefactorSummary], error)

ListStackRefactorsFiltered keeps only refactors whose ExecutionStatus is in executionStatuses (all when empty).

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, maxResults int, nextToken string,
) (page.Page[AutoDeploymentTarget], error)

ListStackSetAutoDeploymentTargets returns a StackSet's automatic deployment targets, paginated by MaxResults/NextToken (real query-protocol form fields, api_op_ListStackSetAutoDeploymentTargets.go).

func (*InMemoryBackend) ListStackSetOperationResults

func (b *InMemoryBackend) ListStackSetOperationResults(
	stackSetName, operationID string, maxResults int, nextToken string, statuses []string,
) (page.Page[StackSetOperationResult], error)

ListStackSetOperationResults returns per-account/region operation results, paginated by MaxResults/NextToken (real query-protocol form fields, api_op_ListStackSetOperationResults.go).

func (*InMemoryBackend) ListStackSetOperations

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

func (*InMemoryBackend) ListStackSets

func (b *InMemoryBackend) ListStackSets(
	maxResults int, nextToken, status 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, _, registrationStatusFilter string, maxResults int, nextToken string,
) (page.Page[string], error)

ListTypeRegistrations returns registration tokens, paginated by MaxResults/NextToken (real query-protocol form fields, serializers.go's awsAwsquery_serializeOpDocumentListTypeRegistrationsInput). Snapshot (not All) for a deterministic, sortable-by-Token order -- required for stable pagination across calls. ListTypeRegistrations: registrationStatusFilter mirrors ListTypeRegistrationsInput.RegistrationStatusFilter (default IN_PROGRESS, api_op_ListTypeRegistrations.go); every registration this backend creates completes synchronously (see DescribeTypeRegistration's own doc comment), so filtering by COMPLETE matches every registration and IN_PROGRESS/FAILED match none, honestly reflecting that this backend never produces those states rather than fabricating an in-progress window. The Type (RESOURCE/MODULE/HOOK) filter remains unimplemented -- TypeRegistrationRecord doesn't track a type kind at all, a separate, pre-existing gap.

func (*InMemoryBackend) ListTypeVersions

func (b *InMemoryBackend) ListTypeVersions(
	typeName, deprecatedStatus string, maxResults int, nextToken string,
) (page.Page[string], error)

ListTypeVersions defaults to LIVE versions only, matching ListTypeVersionsInput's DeprecatedStatus field ("The default is LIVE", cloudformation@v1.76.1 api_op_ListTypeVersions.go). Paginated by MaxResults/NextToken (real query-protocol form fields, serializers.go's awsAwsquery_serializeOpDocumentListTypeVersionsInput).

func (*InMemoryBackend) ListTypes

func (b *InMemoryBackend) ListTypes(
	visibilityFilter, provisioningTypeFilter, typeNamePrefix string, maxResults int, nextToken string,
) (page.Page[TypeSummary], error)

ListTypes returns registered/activated types, paginated by MaxResults/NextToken (real query-protocol form fields, ListTypes serializers.go:9145-9153). visibilityFilter/provisioningTypeFilter mirror ListTypesInput's own Visibility/ProvisioningType fields; an empty filter imposes no constraint (the documented default: PRIVATE for Visibility, unfiltered for ProvisioningType).

func (*InMemoryBackend) ListTypesFiltered

func (b *InMemoryBackend) ListTypesFiltered(opts ListTypesOptions) (page.Page[TypeSummary], error)

ListTypesFiltered is ListTypes with the Type, Filters.Category and DeprecatedStatus filters.

func (*InMemoryBackend) PublishType

func (b *InMemoryBackend) PublishType(typeName string) (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(
	ctx context.Context, nameOrID string, retainExceptOnCreate bool,
) (*Stack, error)

RollbackStack rolls a CREATE_FAILED stack back: every resource it managed to create is deleted (Retain/Snapshot ones too when retainExceptOnCreate), per RollbackStackInput.RetainExceptOnCreate.

func (*InMemoryBackend) SetOrganizationsDirectory added in v1.3.1

func (b *InMemoryBackend) SetOrganizationsDirectory(d OrganizationsDirectory)

SetOrganizationsDirectory wires an OrganizationsDirectory so SERVICE_MANAGED StackSet operations can expand OU-based deployment targets against the real Organizations hierarchy. Passing nil disables OU-based deployment targets. Intended to be called once during service wiring, before the backend serves traffic.

func (*InMemoryBackend) SetStackPolicy

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

SetStackPolicy sets the stack policy for the given stack. The policy body is validated as a well-formed stack policy document (see stack_policy_eval.go), so a malformed policy is rejected here rather than silently never being enforced by UpdateStack.

func (*InMemoryBackend) SetTypeConfiguration

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

func (*InMemoryBackend) SetTypeDefaultVersion

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

SetTypeDefaultVersion identifies the type by Arn, or by TypeName when Arn is empty (SetTypeDefaultVersionInput allows either -- api_op_SetTypeDefaultVersion.go: "Arn" or "TypeName"+"Type"; the aws_cloudformation_type resource always sends TypeName, never Arn).

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(types []string) (string, error)

StartResourceScan starts a scan, limited to the given resource types when non-empty.

func (*InMemoryBackend) StopStackSetOperation

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

func (*InMemoryBackend) TestType

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

TestType starts a test run for a registered extension. versionID mirrors TestTypeInput.VersionId (api_op_TestType.go: "You can specify the version id with either Arn, or with TypeName and Type. If you don't specify a version, CloudFormation uses the default version"); when given, it is validated as a real registered version of the target type rather than silently ignored.

func (*InMemoryBackend) UpdateGeneratedTemplate

func (b *InMemoryBackend) UpdateGeneratedTemplate(idOrName, name string) (*GeneratedTemplate, 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, ouIDs, regions []string,
	filterType string,
) (string, error)

func (*InMemoryBackend) UpdateStackSet

func (b *InMemoryBackend) UpdateStackSet(
	name, description, templateBody string,
	opts StackSetOptions,
) (*StackSet, string, 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 ListStackInstancesFilter

type ListStackInstancesFilter struct {
	StackInstanceAccount string
	StackInstanceRegion  string
	DriftStatus          string
	LastOperationID      string
}

ListStackInstancesFilter holds ListStackInstancesInput's optional narrowing members (cloudformation@v1.76.1 api_op_ListStackInstances.go): StackInstanceAccount/StackInstanceRegion match exactly, and Filters entries with Name DRIFT_STATUS/LAST_OPERATION_ID match against the instance's own DriftStatus/LastOperationID. DETAILED_STATUS is accepted on the wire but not enforced here -- this backend has no separate detailed status distinct from Status (see StackInstance in models.go), and DetailedStatus's real values (PENDING/RUNNING/SUCCEEDED/FAILED/...) don't correspond to StackInstanceStatus's (CURRENT/OUTDATED/INOPERABLE), so mapping one onto the other would fabricate data rather than filter it.

type ListTypesOptions

type ListTypesOptions struct {
	Visibility, ProvisioningType, TypeNamePrefix, NextToken string
	Type, Category, DeprecatedStatus                        string
	MaxResults                                              int
}

ListTypesOptions carries ListTypesInput's filter members. Category is Filters.Category (REGISTERED/ACTIVATED/THIRD_PARTY/AWS_TYPES); DeprecatedStatus defaults to LIVE.

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,
		parentID string,
	) (string, error)
	DeleteNestedStack(ctx context.Context, stackID string) error
}

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

type OrganizationsDirectory added in v1.3.1

type OrganizationsDirectory interface {
	ResolveAccountIDsUnderParent(parentID string) ([]string, error)
}

OrganizationsDirectory resolves the account IDs beneath an OU or root, for SERVICE_MANAGED StackSet deployment-target expansion (DeploymentTargets. OrganizationalUnitIds). Satisfied structurally by organizations.InMemoryBackend.ResolveAccountIDsUnderParent.

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 {
	AutoUpdate       *bool
	VersionID        string
	Type             string
	TypeArn          string
	DefaultVersion   string
	Status           string
	Configuration    string
	TypeName         string
	ExecutionRoleArn string
	LogGroupName     string
	LogRoleArn       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 ResilienceHubBackend added in v1.3.1

type ResilienceHubBackend interface {
	CreateResilienceHubApp(
		name, description, assessmentSchedule, policyArn string, tags map[string]string,
	) (string, error)
	SetResilienceHubAppTemplate(appArn, templateBody string) error
	AddResilienceHubAppResourceMappings(appArn string, mappings []ResilienceHubResourceMapping) error
	DeleteResilienceHubApp(appArn string, forceDelete bool) error
	CreateResilienceHubResiliencyPolicy(
		name, tier, description, dataLocationConstraint string,
		policy map[string]ResilienceHubFailurePolicy,
		tags map[string]string,
	) (string, error)
	DeleteResilienceHubResiliencyPolicy(policyArn string) error
}

ResilienceHubBackend is the subset of the ResilienceHub service backend that AWS::ResilienceHub::App/ResiliencyPolicy provisioning needs. Declared locally instead of depending on *resiliencehub.Handler directly, for the same import-cycle reason as the types above; services/resiliencehub's Handler implements this interface structurally (see services/resiliencehub/handler_cfn_provision.go).

type ResilienceHubFailurePolicy added in v1.3.1

type ResilienceHubFailurePolicy struct {
	RtoInSecs int32
	RpoInSecs int32
}

ResilienceHubFailurePolicy is one AWS::ResilienceHub::ResiliencyPolicy PolicyMap entry's FailurePolicy value (RTO/RPO in seconds).

type ResilienceHubResourceMapping added in v1.3.1

type ResilienceHubResourceMapping struct {
	MappingType          string
	PhysicalResourceID   string
	PhysicalResourceType string
	ResourceName         string
	LogicalStackName     string
	TerraformSourceName  string
	EksSourceName        string
}

ResilienceHubResourceMapping is one AWS::ResilienceHub::App ResourceMapping entry, using CloudFormation's own property names (see aws-properties-resiliencehub-app-resourcemapping.html), not resiliencehub's wire names. Declared here rather than imported from services/resiliencehub because that package already imports cloudformation (for its own CfnStack resource-mapping resolution) -- importing it back would cycle.

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,
	stackPhysicalIDs map[string]string,
) error

Delete deletes a single resource by type and physical ID. An already-gone target counts as deleted, as CloudFormation's handler contract treats NotFound on delete.

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 ResourceLocation added in v1.3.1

type ResourceLocation struct {
	StackName         string
	LogicalResourceID string
}

ResourceLocation identifies a resource by stack and logical ID (aws-sdk-go-v2 cloudformation/types.ResourceLocation, types.go:1178).

type ResourceMapping added in v1.3.1

type ResourceMapping struct {
	Source      ResourceLocation
	Destination ResourceLocation
}

ResourceMapping is the source/destination pair ExecuteStackRefactor moves a resource along (types.ResourceMapping, types.go:1195).

type ResourceScan

type ResourceScan struct {
	ResourceScanID string `xml:"ResourceScanId,omitempty" json:"resourceScanID,omitempty"`
	Status         string `xml:"Status,omitempty"         json:"status,omitempty"`
	// ScanType mirrors types.ResourceScanSummary.ScanType (FULL|PARTIAL) --
	// StartResourceScan (generated_templates.go) always performs a full
	// scan, so this backend only ever produces "FULL".
	ScanType            string  `xml:"ScanType,omitempty"            json:"scanType,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 map[string]string `xml:"-"`
	StackID            string            `xml:"StackId,omitempty"`
	ManagedByStack     bool              `xml:"ManagedByStack,omitempty"`
}

ScannedResource represents a single resource discovered during a resource scan. ResourceIdentifier is a map (schema primary-identifier name -> value) on the wire, not a scalar (cloudformation@v1.76.1 types/types.go:1470) -- it is marshaled separately in the handler, hence "xml:-" here.

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
	// ResilienceHub is declared as a local interface, not a concrete
	// *resiliencehub.Handler, to avoid an import cycle -- see
	// ResilienceHubBackend's doc comment in resources_resiliencehub.go.
	ResilienceHub    ResilienceHubBackend
	ServiceDiscovery *servicediscoverybackend.Handler
	CodeDeploy       *codedeploybackend.Handler
	AWSConfig        *awsconfigbackend.Handler
	SageMaker        *sagemakerbackend.Handler
	Athena           *athenabackend.Handler
	CodeArtifact     *codeartifactbackend.Handler
	// Phase-6 backends
	DataSync       *datasyncbackend.Handler
	AppConfig      *appconfigbackend.Handler
	Macie2         *macie2backend.Handler
	GuardDuty      *guarddutybackend.Handler
	AccessAnalyzer *accessanalyzerbackend.Handler
	Amplify        *amplifybackend.Handler
	// Phase-7 backends
	KinesisVideo *kinesisvideobackend.Handler
	ECRPublic    *ecrpublicbackend.Handler
	KafkaConnect *kafkaconnectbackend.Handler
	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.
	// ResourceAttrs stashes Fn::GetAtt side-channel values not derivable from
	// PhysicalID+Type alone (e.g. CodeArtifact Domain's Name), so delete-time
	// resolution sees them too -- see extractAttrStash (gopherstack-9e44r).
	ResourceAttrs               map[string]string `xml:"-"                                 json:"resourceAttrs,omitempty"`
	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 StackDefinition

type StackDefinition struct {
	StackName    string
	TemplateBody string
	TemplateURL  string
}

StackDefinition is a stack being refactored, keyed by StackName (types.StackDefinition, cloudformation@v1.76.1 types/types.go). When EnableStackCreation is set, ExecuteStackRefactor creates any mapping destination stack that doesn't already exist from its TemplateBody here.

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 {
	// LastDriftCheckTimestamp is set by DetectStackSetDrift (types.go:1862 on
	// both StackInstance and StackInstanceSummary); nil until a drift check
	// has run for this instance, matching the real "NULL if never checked"
	// semantics.
	LastDriftCheckTimestamp *time.Time `xml:"LastDriftCheckTimestamp,omitempty" json:"lastDriftCheckTimestamp,omitempty"`
	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"`
	// OrganizationalUnitID is set only for SERVICE_MANAGED instances created
	// via a DeploymentTargets OU expansion (types.go:1836+ OrganizationalUnitId).
	OrganizationalUnitID string `xml:"OrganizationalUnitId,omitempty" json:"organizationalUnitID,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
	// StackPolicyDuringUpdateBody, when non-empty, overrides the stack's
	// stored policy for this UpdateStack call only (UpdateStackInput's
	// StackPolicyDuringUpdateBody, api_op_UpdateStack.go:223) -- it is never
	// persisted to the stack's stored policy.
	StackPolicyDuringUpdateBody string
	// StackPolicyBody is stored as the stack's policy on Create/UpdateStack.
	StackPolicyBody  string
	Capabilities     []string
	NotificationARNs []string
	Tags             []Tag
	// ResourceTypes is the optional per-call allowlist of resource type
	// wildcard patterns (CreateStackInput.ResourceTypes,
	// api_op_CreateStack.go): when non-empty, every resource Type in the
	// template must match one of its patterns or the operation fails. Not
	// persisted on the stack -- each Create/UpdateStack call supplies its own.
	ResourceTypes               []string
	TimeoutInMinutes            int
	DisableRollback             bool
	EnableTerminationProtection bool
	// DisableValidation skips the pre-deployment intrinsics validation pass
	// (validateIntrinsics) this backend runs before provisioning/updating
	// resources (CreateStackInput.DisableValidation, api_op_CreateStack.go:
	// "Set to true to disable pre-deployment validations ... Default: false").
	DisableValidation bool
	// RetainExceptOnCreate, when true, forces rollbackCreateResources to
	// delete newly-created resources during a CreateStack rollback even when
	// they carry DeletionPolicy=Retain/Snapshot (CreateStackInput.
	// RetainExceptOnCreate, api_op_CreateStack.go: "When set to true, newly
	// created resources are deleted when the operation rolls back. This
	// includes newly created resources marked with a deletion policy of
	// Retain. Default: false" -- i.e. the default already honors
	// DeletionPolicy on rollback).
	RetainExceptOnCreate bool
}

type StackRefactor

type StackRefactor struct {
	RefactorID          string
	Description         string
	Status              string // StackRefactorStatus: CREATE_COMPLETE once created
	ExecutionStatus     string `json:"ExecutionStatus,omitempty"` // AVAILABLE until executed, then EXECUTE_COMPLETE
	ResourceMappings    []ResourceMapping
	StackDefinitions    []StackDefinition
	EnableStackCreation bool
}

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"`
	ResourceMapping    ResourceMapping `xml:"-"`
}

StackRefactorAction is a single action performed during a stack refactor. StackName/LogicalResourceID/ResourceType are retained for internal/JSON use only (json tags omitted here as this type predates that convention) -- types.StackRefactorAction (types.go:2118) has no such top-level members; the real wire shape nests source/destination under ResourceMapping.

type StackRefactorSummary

type StackRefactorSummary struct {
	StackRefactorID string `xml:"StackRefactorId"`
	Status          string `xml:"Status,omitempty"`
	ExecutionStatus string `xml:"ExecutionStatus,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>member"   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 is one of the real StackSetOperationAction values: CREATE /
	// UPDATE / DELETE / DETECT_DRIFT. IMPORT is not a real value either
	// (gopherstack-n3zi).
	Action string
	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:"CreationTimestamp,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 {
	AutoDeployment   *AutoDeployment   `xml:"-"`
	ManagedExecution *ManagedExecution `xml:"-"`
	StackSetID       string            `xml:"StackSetId"`
	StackSetName     string            `xml:"StackSetName"`
	Status           string            `xml:"Status"`
	Description      string            `xml:"Description,omitempty"`
	PermissionModel  string            `xml:"-"`
}

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"`
	LastUpdatedTime     *time.Time `xml:"LastUpdatedTime,omitempty"     json:"lastUpdatedTime,omitempty"`
	StackID             string     `xml:"StackId"                       json:"stackID"`
	StackName           string     `xml:"StackName"                     json:"stackName"`
	StackStatus         string     `xml:"StackStatus"                   json:"stackStatus"`
	StackStatusReason   string     `xml:"StackStatusReason,omitempty"   json:"stackStatusReason,omitempty"`
	ParentID            string     `xml:"ParentId,omitempty"            json:"parentID,omitempty"`
	RootID              string     `xml:"RootId,omitempty"              json:"rootID,omitempty"`
	TemplateDescription string     `xml:"TemplateDescription,omitempty" json:"templateDescription,omitempty"` //nolint:lll // AWS-compatible JSON field name exceeds line limit
}

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,
		tags []Tag,
		opts CreateChangeSetOptions,
	) (*ChangeSet, error)
	DescribeChangeSet(stackName, changeSetName string) (*ChangeSet, error)
	GetChangeSetTemplate(stackName, changeSetName string) (string, error)
	ExecuteChangeSet(
		ctx context.Context, stackName, changeSetName string, disableRollback, retainExceptOnCreate bool,
	) 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) (*StackResourceDrift, 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, string, error)
	DeleteStackSet(name string) error
	DescribeStackSet(name string) (*StackSet, error)
	StackSetRegions(name string) []string
	ListStackSets(maxResults int, nextToken, status string) (page.Page[StackSetSummary], error)
	CreateStackInstances(
		ctx context.Context,
		stackSetName string,
		accounts, ouIDs, regions []string,
		filterType string,
	) (string, error)
	DeleteStackInstances(
		ctx context.Context,
		stackSetName string,
		accounts, ouIDs, regions []string,
		retainStacks bool,
		filterType string,
	) (string, error)
	UpdateStackInstances(stackSetName string, accounts, ouIDs, regions []string, filterType string) (string, error)
	ListStackInstances(
		stackSetName string, maxResults int, nextToken string, filter ListStackInstancesFilter,
	) (page.Page[StackInstance], error)
	DescribeStackInstance(stackSetName, account, region string) (*StackInstance, error)
	DetectStackSetDrift(stackSetName string) (string, error)
	ListStackSetOperations(
		stackSetName string, maxResults int, nextToken string,
	) (page.Page[StackSetOperationSummary], error)
	DescribeStackSetOperation(stackSetName, operationID string) (*StackSetOperation, error)
	StopStackSetOperation(stackSetName, operationID string) error
	ListStackSetOperationResults(
		stackSetName, operationID string, maxResults int, nextToken string, statuses []string,
	) (page.Page[StackSetOperationResult], error)
	ListStackSetAutoDeploymentTargets(
		stackSetName string, maxResults int, nextToken string,
	) (page.Page[AutoDeploymentTarget], error)
	ImportStacksToStackSet(stackSetName string, stackIDs []string) (string, error)
	ListStackInstanceResourceDrifts(
		stackSetName, operationID, account, region string,
	) ([]StackResourceDrift, error)
	// Generated templates
	CreateGeneratedTemplate(name string, resources []string) (*GeneratedTemplate, error)
	UpdateGeneratedTemplate(id, name string) (*GeneratedTemplate, error)
	DeleteGeneratedTemplate(id string) error
	DescribeGeneratedTemplate(id string) (*GeneratedTemplate, error)
	GetGeneratedTemplate(id string) (string, error)
	ListGeneratedTemplates(maxResults int, nextToken string) (page.Page[GeneratedTemplate], error)
	// Resource scans
	StartResourceScan(types []string) (string, error)
	DescribeResourceScan(scanID string) (*ResourceScan, error)
	ListResourceScans(maxResults int, nextToken, scanTypeFilter string) (page.Page[ResourceScan], error)
	ListResourceScanResources(scanID, nextToken string, maxResults int) (page.Page[ScannedResource], error)
	ListResourceScanRelatedResources(scanID string, resources []string) ([]string, error)
	// Type management
	ActivateType(typeName, typeArn string, opts ActivateTypeOptions) (string, error)
	DeactivateType(typeName, typeArn string) error
	RegisterType(typeName, schemaHandlerPackage string) (string, error)
	DeregisterType(typeName, typeArn, versionID string) error
	PublishType(typeName string) (string, error)
	SetTypeDefaultVersion(arn, typeName, version string) error
	SetTypeConfiguration(typeName, configuration string) (string, error)
	BatchDescribeTypeConfigurations(
		identifiers []TypeConfigurationIdentifier,
	) ([]TypeConfigurationDetail, []BatchDescribeTypeConfigurationsError, []TypeConfigurationIdentifier)
	ListTypes(
		visibilityFilter, provisioningTypeFilter, typeNamePrefix string, maxResults int, nextToken string,
	) (page.Page[TypeSummary], error)
	ListTypesFiltered(opts ListTypesOptions) (page.Page[TypeSummary], error)
	ListTypeVersions(
		typeName, deprecatedStatus string, maxResults int, nextToken string,
	) (page.Page[string], error)
	ListTypeRegistrations(
		typeName, typeFilter, registrationStatusFilter string, maxResults int, nextToken string,
	) (page.Page[string], error)
	DescribeTypeRegistration(registrationToken string) (status, typeArn, typeVersionArn string, err error)
	DescribeType(typeName, arn, versionID string) (*TypeDetails, error)
	TestType(typeName, arn, versionID string) (string, error)
	RegisterPublisher(connectionArn string) (string, error)
	DescribePublisher(publisherID string) (string, error)
	// Stack refactor
	CreateStackRefactor(
		description string,
		stackDefinitions []StackDefinition,
		resourceMappings []ResourceMapping,
		enableStackCreation bool,
	) (string, error)
	DescribeStackRefactor(stackRefactorID string) (*StackRefactor, error)
	ExecuteStackRefactor(ctx context.Context, stackRefactorID string) error
	ListStackRefactors(maxResults int, nextToken string) (page.Page[StackRefactorSummary], error)
	ListStackRefactorsFiltered(
		maxResults int, nextToken string, executionStatuses []string,
	) (page.Page[StackRefactorSummary], error)
	ListStackRefactorActions(
		stackRefactorID string, maxResults int, nextToken string,
	) (page.Page[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, retainExceptOnCreate bool) (*Stack, 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, failedOnly bool) (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"`
	CapabilitiesReason string                 `xml:"CapabilitiesReason,omitempty"        json:"capabilitiesReason,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
	Parameters         []ParameterDeclaration `xml:"Parameters>member,omitempty"         json:"parameters,omitempty"`
	ResourceTypes      []string               `xml:"ResourceTypes>member,omitempty"      json:"resourceTypes,omitempty"`
	Capabilities       []string               `xml:"Capabilities>member,omitempty"       json:"capabilities,omitempty"`
	DeclaredTransforms []string               `xml:"DeclaredTransforms>member,omitempty" json:"declaredTransforms,omitempty"` //nolint:lll // goimports struct-tag alignment exceeds line limit.
}

TemplateSummary holds summary information about a CloudFormation template.

type TypeConfigurationDetail

type TypeConfigurationDetail struct {
	Arn                    string `xml:"Arn,omitempty"`
	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 TypeConfigurationIdentifier added in v1.3.1

type TypeConfigurationIdentifier struct {
	Type                   string `xml:"Type,omitempty"`
	TypeArn                string `xml:"TypeArn,omitempty"`
	TypeConfigurationAlias string `xml:"TypeConfigurationAlias,omitempty"`
	TypeConfigurationArn   string `xml:"TypeConfigurationArn,omitempty"`
	TypeName               string `xml:"TypeName,omitempty"`
}

TypeConfigurationIdentifier identifies a type configuration in a BatchDescribeTypeConfigurations request or response (types.go:3360).

type TypeDetails

type TypeDetails struct {
	AutoUpdate         *bool  `xml:"-"`
	DefaultVersionID   string `xml:"DefaultVersionId,omitempty"`
	DeprecatedStatus   string `xml:"DeprecatedStatus,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"`
	TypeName           string `xml:"TypeName,omitempty"`
	Type               string `xml:"Type,omitempty"`
	LogRoleArn         string `xml:"-"`
	PublisherID        string `xml:"PublisherId,omitempty"`
	LogGroupName       string `xml:"-"`
	ExecutionRoleArn   string `xml:"-"`
	TypeArn            string `xml:"Arn,omitempty"`
	IsActivatableInOrg bool   `xml:"IsActivatableInOrg,omitempty"`
	IsDefaultVersion   bool   `xml:"IsDefaultVersion,omitempty"`
	IsActivated        bool   `xml:"IsActivated,omitempty"`
}

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

type TypeRegistrationRecord

type TypeRegistrationRecord struct {
	Token     string
	TypeName  string
	TypeArn   string
	VersionID 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"`
	DefaultVersionID string `xml:"DefaultVersionId,omitempty"`
	IsActivated      bool   `xml:"IsActivated,omitempty"`
}

TypeSummary holds a brief summary of a CloudFormation type. Visibility is computed for filtering (see ListTypes) but, like every field below with an xml tag no handler actually serializes, is not itself wire-visible on the real ListTypesOutput.TypeSummary shape (confirmed against awsAwsquery_deserializeDocumentTypeSummary, cloudformation@v1.76.1 deserializers.go).

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