CloudFormation
Parity grade: A · SDK aws-sdk-go-v2/service/cloudformation@v1.82.0 · last audited 2026-10-09 (54869319e)
Category: Management & Governance · View PARITY.md on GitHub · All Services
In-memory CloudFormation. Stacks provision real resources in the other Gopherstack services, with change sets, nested stacks, StackSets, drift detection, custom resources and rollback.
Quick start
export AWS_ENDPOINT_URL=http://localhost:8000
aws cloudformation create-stack --stack-name my-stack --template-body \
'{"AWSTemplateFormatVersion":"2010-09-09","Resources":{"MyBucket":{"Type":"AWS::S3::Bucket"}}}'
aws cloudformation describe-stacks --stack-name my-stack
aws cloudformation list-stack-resources --stack-name my-stack
aws cloudformation describe-stack-events --stack-name my-stack
aws cloudformation create-change-set --stack-name my-stack --change-set-name c1 \
--template-body file://v2.json
aws cloudformation execute-change-set --stack-name my-stack --change-set-name c1
aws cloudformation delete-stack --stack-name my-stackSupported operations
| Area | Operations |
|---|---|
| Stacks | CreateStack, UpdateStack, DeleteStack, DescribeStacks, ListStacks, DescribeStackEvents, DescribeEvents, UpdateTerminationProtection, CancelUpdateStack, ContinueUpdateRollback, RollbackStack, SignalResource |
| Resources | DescribeStackResource, DescribeStackResources, ListStackResources |
| Templates | GetTemplate, GetTemplateSummary, ValidateTemplate, EstimateTemplateCost |
| Change sets | CreateChangeSet, DescribeChangeSet, ExecuteChangeSet, DeleteChangeSet, ListChangeSets, DescribeChangeSetHooks |
| Exports | ListExports, ListImports |
| Stack policy | SetStackPolicy, GetStackPolicy |
| Drift | DetectStackDrift, DetectStackResourceDrift, DescribeStackDriftDetectionStatus, DescribeStackResourceDrifts |
| StackSets | Create/Update/Delete/Describe/ListStackSet(s), Create/Update/Delete/ListStackInstances, DescribeStackInstance, DetectStackSetDrift, ListStackSetOperations, DescribeStackSetOperation, StopStackSetOperation, ListStackSetOperationResults, ListStackSetAutoDeploymentTargets, ImportStacksToStackSet, ListStackInstanceResourceDrifts |
| Generated templates and scans | Create/Update/Delete/Describe/Get/ListGeneratedTemplate(s), StartResourceScan, DescribeResourceScan, ListResourceScans, ListResourceScanResources, ListResourceScanRelatedResources |
| Stack refactors | CreateStackRefactor, DescribeStackRefactor, ExecuteStackRefactor, ListStackRefactors, ListStackRefactorActions |
| Type registry | DescribeType, ActivateType, DeactivateType, RegisterType, DeregisterType, PublishType, SetTypeDefaultVersion, SetTypeConfiguration, BatchDescribeTypeConfigurations, ListTypes, ListTypeVersions, ListTypeRegistrations, DescribeTypeRegistration, TestType, RegisterPublisher, DescribePublisher |
| Hooks | GetHookResult, ListHookResults, RecordHandlerProgress |
| Organizations | Activate/Deactivate/DescribeOrganizationsAccess |
| Account | DescribeAccountLimits |
Template features: Ref, Fn::GetAtt, Fn::Sub, Fn::Join, Fn::Split, Fn::Select, Fn::FindInMap, Fn::If, Fn::Equals, Fn::And, Fn::Or, Fn::Not, Fn::ImportValue, Fn::GetAZs, Fn::Cidr, Fn::Length, Fn::ToJsonString, Fn::ForEach, Fn::Transform, and the AWS SAM transform (AWS::Serverless-2016-10-31). Output Export.Name values are importable by other stacks and removed when the owning stack is deleted.
Configuration
| Flag | Env | Default | Purpose |
|---|---|---|---|
--cloudformation-provisioning-delay | GOPHERSTACK_CFN_PROVISIONING_DELAY | 300ms | Time each stack step stays *_IN_PROGRESS. 0 completes stacks instantly |
--cloudformation-validate-properties | GOPHERSTACK_CLOUDFORMATION_VALIDATE_PROPERTIES | true | Reject unknown, wrong-typed and missing required resource properties. Disable with --no-cloudformation-validate-properties |
Differences from AWS
WARNING
Resource types are checked by service namespace only. A type whose service is unknown fails with Unrecognized resource types. An unmodelled resource type of a known service is accepted but creates no backing resource.
- Nested property types are not validated, and registry-only conditional requirements are not modelled.
- Custom resources (
Custom::*,AWS::CloudFormation::CustomResource) wait up to 30 s for a Lambda response. - Change-set replacement detection covers a curated subset of resource types. Resource property schemas are not part of the AWS SDK.
- Stack policy:
Replacement: Conditionallyis treated asUpdate:Replace. The logical-ID and resource-type default-deny rule is not modelled. - Not modelled:
CreateChangeSetIncludeNestedStacks, and the effect ofActivateTypeMajorVersion/VersionBump. - Nested stacks and StackSet instances are provisioned and deleted in one step inside the parent, not per resource.
- SAM:
AWS::Serverless::CapacityProvider,NetworkConnector,MicrovmImage,WebFunction, andApplicationwith a Serverless Application Repository location are not expanded. The APIDeploymenthash is SHA-1 over the sorted swagger JSON, so IDs differ from real SAM. ListResourceScanRelatedResourcesalways returns an empty list.
Parity & Coverage
| Metric | Value |
|---|---|
| PARITY entries audited | 73 (72 ok, 1 partial) |
| Feature families | 19 (19 ok) |
| Known gaps | 6 |
| Structural gaps (can't be emulated) | 2 |
| Deferred items | 0 |
| Resource leaks | clean |
Known Gaps
- Resource-type strictness is by service namespace only: an AWS::Svc::Res whose Svc is unknown to the spec fixture and the provisioner fails with "Template format error: Unrecognized resource types: [X]" (cfn_resource_services.json, generated by cmd/cfnattrgen), but an unmodelled resource of a known service still falls through to the stub path because the committed spec fixture lists types with attributes only. Property schemas are checked only at the primitive level (nested property types are not walked) and the resource spec marks required keys per legacy spec, so registry-only conditional requirements are not modeled; Rules AWS-specific parameter types resolve only for AWS::EC2::VPC/Subnet/SecurityGroup::Id (Fn::RefAll/ValueOf/ValueOfAll attributes per the Rule functions page: DefaultNetworkAcl, DefaultSecurityGroup, AvailabilityZone, VpcId, Tags.<key>); other AWS-specific types yield empty lists. The Parameter-constraint, Rules-assertion and Unrecognized-parameter-type wordings are best-effort recollections of CloudFormation text, not SDK-verifiable.
- Async provisioning of nested stacks and StackSet instances is not per resource: a nested AWS::CloudFormation::Stack is provisioned and deleted at once inside the parent's step and only settles on later steps (the parent resource fails with "Embedded stack <id> was not successfully created" from that eager run), and StackSet instance child stacks are provisioned inside the unit (their StackInstanceStatus window is per batch). ContinueUpdateRollback accepts the NestedStackName.ResourceLogicalID skip form only for an embedded stack of the target stack that is itself UPDATE_ROLLBACK_FAILED; nested-stack updates are not modelled, so no embedded stack can reach that state. The RetainResources/DeletionMode validation wording is a best-effort recollection.
- Stack policy: Replacement Conditionally is treated as Update:Replace (deliberate, not an AWS-documented rule), and AWS's separate logical-ID/resource-type default-deny note is not modeled; NotAction/NotResource follow plain inversion (gopherstack-cqy3).
- No nested-stack change-set or public-extension version machinery exists, so these stay unmodeled: CreateChangeSet IncludeNestedStacks (no nested-stack diff machinery) and the effect of ActivateType MajorVersion/VersionBump (validated for range, enum and exclusivity, but there is no public extension version catalog to select or bump a version in) (gopherstack-xhu2t).
- SAM transform (AWS::Serverless-2016-10-31) still unexpanded: AWS::Serverless::CapacityProvider, NetworkConnector, MicrovmImage and WebFunction (their AWS::Lambda:😗 target types are not modelled by the stack engine); Application with a Serverless Application Repository Location (ApplicationId + SemanticVersion; use CreateCloudFormationTemplate and a URL Location); the translator's opt-in passthrough_metadata mode; HttpApi events that target an AWS::Serverless::Api; a user resource named ServerlessRestApi being replaced by the implicit API. Expanded but not provisioned by the stack engine: AWS::ApiGateway::DomainNameV2, BasePathMappingV2 and DomainNameAccessAssociation (PRIVATE REST custom domains) and AWS::AppSync::ApiCache and DomainNameApiAssociation (GraphQLApi Cache and DomainName) fail the stack as unsupported resource types. Unsupported SAM resources fail the stack/change set with an explicit reason, never silently dropped.
- The Api Deployment hash is SHA-1 over sorted JSON of the swagger (SAM hashes Python's insertion-ordered dict repr), so Deployment<hash> ids differ from real SAM while keeping the same sensitivity to changes; template Parameter values are not visible to the transform, so Refs to Parameters are resolved to Defaults only where SAM resolves them (Domain, Auth, BinaryMediaTypes, layer properties, DeploymentPreference Type and PassthroughCondition, event destinations) and kept live elsewhere; AWS::Region is substituted only for GetTemplate TemplateStage=Processed.
Structural Gaps
These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.
- changeset_diff.go requiresRecreation() covers a curated subset of resource types' replacement-forcing properties: CloudFormation resource property schemas are not part of aws-sdk-go-v2, so the full set cannot be derived (gopherstack-e5h).
- 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.
Audited Operations
73 audited operations
| Operation | Wire | Errors | State | Persist |
|---|---|---|---|---|
CreateStack | ok | ok | ok | ok |
UpdateStack | ok | ok | ok | ok |
DeleteStack | ok | ok | ok | ok |
DescribeStacks | ok | ok | ok | ok |
UpdateTerminationProtection | ok | ok | ok | ok |
SetStackPolicy | ok | ok | ok | ok |
GetStackPolicy | ok | ok | ok | ok |
ListStacks | ok | ok | ok | ok |
DescribeStackEvents | ok | ok | ok | ok |
GetTemplate | ok | ok | ok | ok |
DescribeStackResource | ok | ok | ok | ok |
ListStackResources | ok | ok | ok | ok |
DescribeStackResources | ok | ok | ok | ok |
ListExports | ok | ok | ok | ok |
ListImports | ok | ok | ok | ok |
CreateChangeSet | ok | ok | ok | ok |
DescribeChangeSet | ok | ok | ok | ok |
ExecuteChangeSet | ok | ok | ok | ok |
DeleteChangeSet | ok | ok | ok | ok |
ListChangeSets | ok | ok | ok | ok |
DescribeType | ok | ok | ok | ok |
CreateStackSet | ok | ok | ok | ok |
UpdateStackSet | ok | ok | ok | ok |
DeleteStackSet | ok | ok | ok | ok |
DescribeStackSet | ok | ok | ok | ok |
ListStackSets | ok | ok | ok | ok |
CreateStackInstances | ok | ok | ok | ok |
DeleteStackInstances | fixed | ok | fixed | ok |
UpdateStackInstances | ok | ok | ok | ok |
ListStackInstances | ok | ok | ok | ok |
DescribeStackInstance | ok | ok | ok | ok |
DetectStackDrift | ok | ok | ok | ok |
DetectStackResourceDrift | ok | ok | ok | ok |
DescribeStackDriftDetectionStatus | ok | ok | ok | ok |
DescribeStackResourceDrifts | ok | ok | ok | ok |
DetectStackSetDrift | ok | ok | ok | ok |
ListStackSetOperations | ok | ok | ok | ok |
DescribeStackSetOperation | ok | ok | ok | ok |
StopStackSetOperation | ok | ok | ok | ok |
ListStackSetOperationResults | ok | ok | ok | ok |
ListStackSetAutoDeploymentTargets | ok | ok | ok | ok |
ImportStacksToStackSet | ok | ok | ok | ok |
CreateStackRefactor | fixed | ok | fixed | ok |
DescribeStackRefactor | ok | ok | ok | ok |
ExecuteStackRefactor | ok | ok | ok | ok |
ListStackRefactors | ok | ok | ok | ok |
ListStackRefactorActions | ok | ok | ok | ok |
CreateGeneratedTemplate | ok | ok | ok | ok |
UpdateGeneratedTemplate | ok | ok | ok | ok |
DeleteGeneratedTemplate | ok | ok | ok | ok |
DescribeGeneratedTemplate | ok | ok | ok | ok |
GetGeneratedTemplate | ok | ok | ok | ok |
ListGeneratedTemplates | ok | ok | ok | ok |
StartResourceScan | ok | ok | ok | ok |
DescribeResourceScan | ok | ok | ok | ok |
ListResourceScans | ok | ok | ok | ok |
ListResourceScanResources | ok | ok | ok | ok |
ListResourceScanRelatedResources | ok | ok | ok | ok |
ActivateType | fixed | ok | ok | ok |
DeactivateType | fixed | ok | ok | ok |
RegisterType | ok | ok | ok | ok |
DeregisterType | ok | ok | ok | ok |
PublishType | ok | ok | ok | ok |
SetTypeDefaultVersion | ok | ok | ok | ok |
SetTypeConfiguration | ok | partial | ok | ok |
BatchDescribeTypeConfigurations | ok | ok | ok | ok |
TestType | ok | ok | ok | ok |
ListTypes | ok | ok | ok | ok |
ListTypeVersions | ok | ok | ok | ok |
ListTypeRegistrations | ok | ok | ok | ok |
DescribeTypeRegistration | ok | ok | ok | ok |
RegisterPublisher | ok | ok | ok | ok |
DescribePublisher | ok | ok | ok | ok |
Audited Feature Families
| Feature Family | Status |
|---|---|
resource_provisioning | ok |
update_reconciliation | ok |
exports_imports | ok |
error_code_mapping | ok |
drift_detection | ok |
nested_stacks | ok |
stacksets | ok |
stack_refactor | ok |
generated_templates | ok |
resource_scans | ok |
type_registry | ok |
yaml_short_form_intrinsics | ok |
stack_policy_enforcement | ok |
timestamps | ok |
ecr_repository_empty_on_delete | ok |
directconnect_resources | ok |
call_as | ok |
disable_rollback_and_retain_except_on_create | ok |
type_registry_filters_and_registration | ok |
