Skip to content

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 ​

bash
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-stack

Supported operations ​

AreaOperations
StacksCreateStack, UpdateStack, DeleteStack, DescribeStacks, ListStacks, DescribeStackEvents, DescribeEvents, UpdateTerminationProtection, CancelUpdateStack, ContinueUpdateRollback, RollbackStack, SignalResource
ResourcesDescribeStackResource, DescribeStackResources, ListStackResources
TemplatesGetTemplate, GetTemplateSummary, ValidateTemplate, EstimateTemplateCost
Change setsCreateChangeSet, DescribeChangeSet, ExecuteChangeSet, DeleteChangeSet, ListChangeSets, DescribeChangeSetHooks
ExportsListExports, ListImports
Stack policySetStackPolicy, GetStackPolicy
DriftDetectStackDrift, DetectStackResourceDrift, DescribeStackDriftDetectionStatus, DescribeStackResourceDrifts
StackSetsCreate/Update/Delete/Describe/ListStackSet(s), Create/Update/Delete/ListStackInstances, DescribeStackInstance, DetectStackSetDrift, ListStackSetOperations, DescribeStackSetOperation, StopStackSetOperation, ListStackSetOperationResults, ListStackSetAutoDeploymentTargets, ImportStacksToStackSet, ListStackInstanceResourceDrifts
Generated templates and scansCreate/Update/Delete/Describe/Get/ListGeneratedTemplate(s), StartResourceScan, DescribeResourceScan, ListResourceScans, ListResourceScanResources, ListResourceScanRelatedResources
Stack refactorsCreateStackRefactor, DescribeStackRefactor, ExecuteStackRefactor, ListStackRefactors, ListStackRefactorActions
Type registryDescribeType, ActivateType, DeactivateType, RegisterType, DeregisterType, PublishType, SetTypeDefaultVersion, SetTypeConfiguration, BatchDescribeTypeConfigurations, ListTypes, ListTypeVersions, ListTypeRegistrations, DescribeTypeRegistration, TestType, RegisterPublisher, DescribePublisher
HooksGetHookResult, ListHookResults, RecordHandlerProgress
OrganizationsActivate/Deactivate/DescribeOrganizationsAccess
AccountDescribeAccountLimits

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 ​

FlagEnvDefaultPurpose
--cloudformation-provisioning-delayGOPHERSTACK_CFN_PROVISIONING_DELAY300msTime each stack step stays *_IN_PROGRESS. 0 completes stacks instantly
--cloudformation-validate-propertiesGOPHERSTACK_CLOUDFORMATION_VALIDATE_PROPERTIEStrueReject 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: Conditionally is treated as Update:Replace. The logical-ID and resource-type default-deny rule is not modelled.
  • Not modelled: CreateChangeSet IncludeNestedStacks, and the effect of ActivateType MajorVersion/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, and Application with a Serverless Application Repository location are not expanded. The API Deployment hash is SHA-1 over the sorted swagger JSON, so IDs differ from real SAM.
  • ListResourceScanRelatedResources always returns an empty list.

Parity & Coverage ​

MetricValue
PARITY entries audited73 (72 ok, 1 partial)
Feature families19 (19 ok)
Known gaps6
Structural gaps (can't be emulated)2
Deferred items0
Resource leaksclean

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
OperationWireErrorsStatePersist
CreateStackokokokok
UpdateStackokokokok
DeleteStackokokokok
DescribeStacksokokokok
UpdateTerminationProtectionokokokok
SetStackPolicyokokokok
GetStackPolicyokokokok
ListStacksokokokok
DescribeStackEventsokokokok
GetTemplateokokokok
DescribeStackResourceokokokok
ListStackResourcesokokokok
DescribeStackResourcesokokokok
ListExportsokokokok
ListImportsokokokok
CreateChangeSetokokokok
DescribeChangeSetokokokok
ExecuteChangeSetokokokok
DeleteChangeSetokokokok
ListChangeSetsokokokok
DescribeTypeokokokok
CreateStackSetokokokok
UpdateStackSetokokokok
DeleteStackSetokokokok
DescribeStackSetokokokok
ListStackSetsokokokok
CreateStackInstancesokokokok
DeleteStackInstancesfixedokfixedok
UpdateStackInstancesokokokok
ListStackInstancesokokokok
DescribeStackInstanceokokokok
DetectStackDriftokokokok
DetectStackResourceDriftokokokok
DescribeStackDriftDetectionStatusokokokok
DescribeStackResourceDriftsokokokok
DetectStackSetDriftokokokok
ListStackSetOperationsokokokok
DescribeStackSetOperationokokokok
StopStackSetOperationokokokok
ListStackSetOperationResultsokokokok
ListStackSetAutoDeploymentTargetsokokokok
ImportStacksToStackSetokokokok
CreateStackRefactorfixedokfixedok
DescribeStackRefactorokokokok
ExecuteStackRefactorokokokok
ListStackRefactorsokokokok
ListStackRefactorActionsokokokok
CreateGeneratedTemplateokokokok
UpdateGeneratedTemplateokokokok
DeleteGeneratedTemplateokokokok
DescribeGeneratedTemplateokokokok
GetGeneratedTemplateokokokok
ListGeneratedTemplatesokokokok
StartResourceScanokokokok
DescribeResourceScanokokokok
ListResourceScansokokokok
ListResourceScanResourcesokokokok
ListResourceScanRelatedResourcesokokokok
ActivateTypefixedokokok
DeactivateTypefixedokokok
RegisterTypeokokokok
DeregisterTypeokokokok
PublishTypeokokokok
SetTypeDefaultVersionokokokok
SetTypeConfigurationokpartialokok
BatchDescribeTypeConfigurationsokokokok
TestTypeokokokok
ListTypesokokokok
ListTypeVersionsokokokok
ListTypeRegistrationsokokokok
DescribeTypeRegistrationokokokok
RegisterPublisherokokokok
DescribePublisherokokokok

Audited Feature Families ​

Feature FamilyStatus
resource_provisioningok
update_reconciliationok
exports_importsok
error_code_mappingok
drift_detectionok
nested_stacksok
stacksetsok
stack_refactorok
generated_templatesok
resource_scansok
type_registryok
yaml_short_form_intrinsicsok
stack_policy_enforcementok
timestampsok
ecr_repository_empty_on_deleteok
directconnect_resourcesok
call_asok
disable_rollback_and_retain_except_on_createok
type_registry_filters_and_registrationok

Released under the MIT License.