Commit Graph
195 Commits
Author SHA1 Message Date
Suja Shaj 3e1fe3c8b6 fix(cloudformation): resolve an RDS instance's previous template as it was deployed (#9058) 2026-11-19 20:55:19 -04:00
Oleksandr Nikolaichuk 99a13cf067 test(cloudformation): hold every resource type to the engine's property changes or an exempt row (#8988) 2026-11-19 18:53:42 -04:00
mrfelek 573cb9e9b7 fix(cloudformation): keep stack sets with their instances and operations in their Region (#8987) 2026-11-19 11:41:49 -04:00
Oleksandr Nikolaichuk 5a0529ba31 fix(cloudformation): update an API Gateway stage in place and delete it with the stack (#8851)
An AWS::ApiGateway::Stage was created again on every stack update, dropping stage variables set outside the stack. It is now patched in place for DeploymentId and Description and restored on rollback. A StageName change replaces it, and a RestApiId change moves it: the stage left on the old API is deleted through the lifecycle records once the update commits, with its delete events, unless UpdateReplacePolicy: Retain keeps it. A new stage whose name is already taken on the API is refused with "Stage already exists", and the stage is deleted with the stack.
2026-11-19 10:36:39 -04:00
glorfindel33 9e65c12f8c fix(cloudformation): use bus|rule as the physical id of an Events rule on a custom bus (#8864) 2026-11-18 13:58:05 -04:00
Oleksandr Nikolaichuk 29fc72d156 fix(cloudformation): update an API Gateway authorizer in place and replace it on a RestApiId change (#8841) 2026-11-18 08:06:09 -04:00
Oleksandr Nikolaichuk f082117a85 fix(cloudformation): create an EKS cluster with its VPC, logging and access settings (#8747)
As the next step of #6606, an AWS::EKS::Cluster is now created with its ResourcesVpcConfig, Logging and AccessConfig, a replacement included, and ClusterSecurityGroupId resolves through Fn::GetAtt. A template naming a subnet that does not exist fails the stack, as on AWS, and an EnabledTypes entry with no Type fails the resource. An in-place change to the three is logged and not applied until Floci has UpdateClusterConfig. CreateCluster now also refuses subnets from two VPCs, a PublicAccessCidrs entry that is not a CIDR, and an IPv6 block on an IPv4 cluster, and runs every check before it creates the cluster security group, so a refused request leaves no group behind for a stack's VPC rollback.
2026-11-18 07:35:25 -04:00
Jimmy Liu Jia 6bde4e6bb3 fix(cloudformation): provision Bedrock application inference profiles (#8772) 2026-11-17 21:08:02 -04:00
Oleksandr Nikolaichuk 523eba559e fix(cloudformation): create an EKS cluster with its encryption and network settings, a replacement included (#8739) 2026-11-17 18:53:23 -04:00
Oleksandr Nikolaichuk 790b93e739 fix(cloudformation): update a KMS key in place unless the engine says it must be replaced (#8718)
An AWS::KMS::Key update created a new key every time and left the old one enabled. The key now keeps its id: Description, KeyPolicy, Enabled, EnableKeyRotation and Tags are updated in place, keeping tags added outside the stack, and a failed stack update puts them back. A changed KeySpec, KeyUsage, Origin or MultiRegion fails the update, as the AWS::KMS::Key reference says. Create now honors KeyPolicy, Enabled, EnableKeyRotation, Origin and MultiRegion, and a key that a failed create or update leaves behind is scheduled for deletion.

Part of #6606
2026-11-17 16:33:26 -04:00
Oleksandr Nikolaichuk 9c9792a019 fix(cloudformation): update an EKS nodegroup in place unless the engine says it must be replaced (#8734)
An AWS::EKS::Nodegroup update no longer creates another nodegroup. One that changes no create-only property keeps its name and ARN, and its stack-managed tags are reconciled while tags added outside the stack stay; a failed update puts them back. A change to a property the registry marks create-only replaces the nodegroup and deletes the old one once the update commits. EksService cannot apply the other mutable properties, so the cluster and the nodegroup accept any change the engine reports beyond Tags with a warning. The nodegroup is created with its template tags, and a rolled-back replacement puts back the tag-key records of the entity it restores.

Part of #6606
2026-11-17 12:59:49 -04:00
Oleksandr Nikolaichuk a221e18838 fix(cloudformation): update an EKS cluster in place unless the engine says it must be replaced (#8730)
An AWS::EKS::Cluster update used to create another cluster every time, so an unnamed cluster left the old one behind and a named one failed. The cluster now keeps its name on an update the engine does not mark as a replacement, and the tags the last deployment wrote are reconciled from a recorded key list, leaving tags added outside the stack alone. A change to a create-only property (Name, RoleArn, EncryptionConfig, BootstrapSelfManagedAddons, OutpostConfig, AccessConfig.BootstrapClusterCreatorAdminPermissions or the network family and CIDR) replaces the cluster and deletes the old one once the update commits, and a failed update puts the tags or the prior cluster back. A Version change is accepted with a warning and not applied. EventBridge's tag reconcile now shares CfnRollback.reconcileTags.

Part of #6606
2026-11-17 09:07:49 -04:00
Jimmy Liu Jia 5f77b841a2 feat(cloudformation): provision SES event destinations (#8620)
* feat(cloudformation): provision SES event destinations
* fix(cloudformation): validate SES event destination replacements
* fix(cloudformation): apply SES event destination review feedback
* test(cloudformation): use shared stack waits for SES event destinations
2026-11-16 17:08:48 -04:00
Jimmy Liu Jia a35fcfd9da feat(cloudformation): forward ECS task volumes and mounts (#8601)
* feat(cloudformation): forward ECS task volumes and mounts
* fix(cloudformation): share ECS volume parsing and validate mounts
* fix(ecs): share volume validation across API and CloudFormation
2026-11-16 15:38:28 -04:00
Jackson Price 8ad3e2b419 fix(cloudformation): replace changed launch configurations safely (#8599)
* fix(cloudformation): replace changed launch configurations safely
* fix(autoscaling): guard launch configuration replacement races
* fix(cloudformation): reuse replacement decisions and valid fixtures
2026-11-16 14:29:15 -04:00
Jimmy Liu Jia 3e0cd437d7 feat(cloudformation): provision SES configuration sets (#8551)
* feat(cloudformation): provision SES configuration sets
* refactor(cloudformation): simplify SES configuration set provisioning
2026-11-16 08:40:08 -04:00
Maxence LEFEBVRE 9e05c07bfc feat(cloudformation): provision ElastiCache replication groups (#8448)
CloudFormation now provisions AWS::ElastiCache::ReplicationGroup instead
of completing the stack with no cache behind it. The group is created
through the ElastiCache service, Ref returns its id, and Fn::GetAtt
exposes the configuration endpoint for a cluster-mode group or the
primary, reader and per-node read endpoints otherwise. A create-only
change replaces the group, an explicit ReplicationGroupId that stays the
same is refused, and an update that reuses the group warns only about the
properties it ignores.

Optional booleans in the ElastiCache, IoT authorizer, API Gateway API key
and StackSet provisioners are read through
ProvisionContext.resolveOptionalBoolean, which refuses a value that is
neither true nor false instead of reading it as false.

Closes #8447
2026-11-15 11:40:48 -04:00
Priamo Germosen 0f223224ce fix(cloudformation): check CloudFormation requests on the resources they name, from the generated request resources (#8426)
CloudFormation was not read by the request-resources generator, so under IAM
enforcement every CloudFormation request was checked on *: a grant scoped to a
stack or a stack set was refused, and a deny scoped to one never applied.
cloudformation now moves into NAMESPACES (100 operations). One rule is fixed:
an account member named after another record's shape names that record's
account, not the type's (StackInstanceAccount is a StackInstance's), so a
stack instance call is checked on its stack set in the caller's account.

A stack or a stack set named by its name is checked on the ARN CloudFormation
minted for it, which CloudFormationStoredResourceArns finds, reading only, or
with its id open when it does not exist yet. A request naming its stack by
no StackName (a change set by its ARN alone, DescribeStackResources by
PhysicalResourceId alone) stays on *, as the generated data gives it.
DescribeStackSet now returns StackSetARN, which botocore gives and Floci
left out, in the Region of the request naming it.
2026-11-15 09:59:32 -04:00
Oleksandr Nikolaichuk 4de81e8370 fix(cloudformation): keep an ECS service's desired count when an update leaves it out (#8279)
An AWS::ECS::Service update that left DesiredCount out set the service
back to 1. AWS omits it from the update ("For existing services, if a
desired count is not specified, it is omitted from the operation"), so a
count set through UpdateService now stays. A new service without it
still starts at 1, and a rollback puts the count back only when the
update sent one.
2026-11-14 17:46:51 -04:00
Jackson PriceandAndre Kurait da23f42d11 fix(cloudformation): delete published Lambda versions with their stacks (#8371)
An AWS::Lambda::Version resource reported its deletion but left the
version published. CloudFormation now deletes the version through
Lambda's qualified DeleteFunction when the stack is deleted, the
resource leaves the template, or its creation rolls back, unless its
DeletionPolicy retains it. $LATEST and other versions stay, an
already-missing version counts as deleted, and an alias still pointing
at the version fails the delete until it is removed. A placeholder,
unqualified or alias identity is never turned into a whole-function
delete.

The SDK regressions use the shared CfnStackWaits, now with an SDK
deleteStack that follows the stack id, and AwsSdkErrors for their error
checks.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-14 17:30:23 -04:00
Priamo Germosen 0816789e30 feat(cloudformation): provision AWS::ElasticLoadBalancingV2::ListenerCertificate (#8353)
CDK's ApplicationListener.addCertificates puts the first certificate on
the listener and emits one ListenerCertificate for each extra one. Floci
had no provisioner for the type, so it was stubbed as CREATE_COMPLETE and
did nothing; since the default certificate is held apart from the
listener's certificate list, such a listener came up with an empty list
and served none of its SNI certificates.

ElbV2CfnProvisioner serves the type now. Create adds the declared
certificates to the listener's list, as AddListenerCertificates does, and
delete removes the ones the resource added, recorded per physical id
because the id alone cannot carry them. Certificates updates in place, as
the resource reference says: the certificates the template gains are
added, then the ones it drops removed, and a failed update puts both back.
ListenerArn is create-only, so a change replaces the resource: the
certificates go onto the new listener, and come off the old one once the
update commits.

CloudFormation publishes no format for the resource's identifier, so Ref
returns <ListenerArn>|<suffix>.

AWS's published resource schemas have moved since the vendored tables
were last synced: AWS::Lambda::Function gained AcceleratorConfig and
RuntimeConfig, and AWS::ECS::TaskDefinition TrustedExecutionConfiguration.
That fails the online check of those tables, which this change runs, so
cfn-property-types.json and schema-surface.tsv are synced from AWS here,
and the three new properties are recorded as accepted and ignored.
2026-11-14 15:02:33 -04:00
Oleksandr Nikolaichuk b4b659bd88 fix(cloudformation): replace exactly what the change set says for AppConfig profiles and ElastiCache clusters (#8204) 2026-11-13 17:00:32 -04:00
Kal Cramer f1a6260a94 feat(cloudformation): add AWS::EFS::FileSystem, MountTarget and AccessPoint (#8074)
A template can now create the three EFS types. They are provisioned
through EfsService, so a stack and a direct API call see the same
file systems, mount targets and access points.

- Ref and Fn::GetAtt resolve for every type.
- Updates change ThroughputMode, ProvisionedThroughputInMibps,
  BackupPolicy, LifecyclePolicies, FileSystemPolicy,
  FileSystemProtection and tags in place; create-only properties
  replace the resource, and a failed update puts back what it changed.
- Backups are off on create unless BackupPolicy is ENABLED or the file
  system is One Zone, and ThroughputMode provisioned requires
  ProvisionedThroughputInMibps.
- Required properties are validated from the registry schema.

Ref #7972
2026-11-13 16:30:10 -04:00
Mario Toffia 6341708315 fix(cloudformation): delete a custom resource a committed update replaced (#8223) 2026-11-13 16:05:42 -04:00
Suja Shaj 7d7c87338f fix(cloudformation): register a target group's Targets and keep them in step on update (#8199) 2026-11-13 08:27:19 -04:00
soreavisandPriamo Germosen b2fa3e0cfb fix(organizations): apply PutResourcePolicy tags only on creation (#8174)
PutResourcePolicy replaced the tag set of an existing resource policy
whenever the request carried Tags. The model says tags apply only to
the initial creation of the resource policy and that the call throws
otherwise. It now applies Tags only when it creates the policy and
answers InvalidInputException for Tags on an existing one, before it
changes anything. The model names no error for this case;
InvalidInputException is the one it lists for invalid request values.
An empty Tags list has no tags to apply and is accepted.

The CloudFormation provisioner relied on the old replace to converge
the Tags of AWS::Organizations::ResourcePolicy on update. An update now
leaves Tags out of PutResourcePolicy and converges them through
TagResource and UntagResource by the rp- ID, as the provisioner does
for OUs, accounts and policies and as AWS's own handler does.

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-11-12 22:18:32 -04:00
Tyler Webb c6361cab91 feat(eventbridge): create partner event buses from EventSourceName (#7968)
* feat(eventbridge): create partner event buses from EventSourceName

CreateEventBus and AWS::Events::EventBus now accept EventSourceName. The
bus takes the source's name, so Name must equal it and must match
aws.partner/<partner>/<source>. Floci does not model partner event
sources, so any well-formed source name is accepted without one being
created or activated first.

A partner bus name contains slashes, so rule lookups for a bus no longer
match the rules of a bus nested under its name, and a rule ARN on a
partner bus resolves its bus and rule name from the last slash.

* test(eventbridge): cover partner event buses

Covers creating a partner bus from its EventSourceName, a name that
differs from the source or is not a partner name, rules, targets, tags
and PutEvents on the bus by name and by ARN, nested partner buses
keeping their rules apart, deletion, and the CloudFormation resource.

* refactor(eventbridge): resolve rule ARNs from the first slash again

ruleKey joins the bus and rule name with a slash, so splitting a rule
ARN at the first or the last slash finds the same stored rule. The
original split is kept, and the test that only exercised the changed
split goes with it; tagging a rule on a custom bus by ARN stays covered
by the existing tag tests.

* fix(eventbridge): validate rule names in PutRule

PutRule accepted any name, so a name holding a slash was stored under a
key that ListRules, PutEvents and DeleteEventBus no longer treat as a
rule of that bus, and could collide with a rule on a nested partner bus.
Rule names now match [\.\-_A-Za-z0-9]+ and are at most 64 characters,
as AWS models them, and a missing or out-of-pattern name fails with
ValidationException. The CloudFormation AWS::Events::Rule resource
creates its rule through the same PutRule path.

* fix(cloudformation): reject a Policy or malformed source on a partner event bus

An AWS::Events::EventBus with EventSourceName now checks the source name
against aws.partner/<partner>/<source> in the provisioner, so a
malformed one fails with ValidationError like the resource's other
checks rather than with the service's ValidationException. A Policy
given with EventSourceName is rejected with ValidationError before the
bus is created, since Floci never applies a resource policy to a bus
whose name holds a slash.

* fix(eventbridge): answer partner and rule name violations in AWS's shape

CreateEventBus with EventSourceName and PutRule now report a bad name
the way AWS's validation layer does, through SmithyValidationErrors:
"1 validation error detected: Value '...' at 'name' failed to satisfy
constraint: ...", naming the length, pattern or missing member that
failed. A partner bus with no Name now gets the required-member error
rather than a name mismatch. The partner source pattern is one public
constant on EventBridgeService, which the CloudFormation provisioner
now uses too.

* fix(eventbridge): refuse PutPermission and RemovePermission on a partner bus

Both operations model the bus as NonPartnerEventBusName, so AWS refuses
a partner bus there. Floci stored the policy, but never applied a
resource policy to a bus whose name holds a slash, so the statement had
no effect. They now fail with ValidationException in AWS's validation
shape, and an AWS::Events::EventBusPolicy on a partner bus fails the
stack the same way.

* fix(cloudformation): let an update change a partner bus's EventSourceName

Once a bus exists its Name is fixed, and a Name change is already
refused as a replacement, so EventSourceName carries nothing more on an
update. An UpdateStack that drops, adds or changes it while keeping
Name used to be validated as if it were creating the bus and failed;
it now updates the bus in place. Whether the bus is a partner bus is
read from its name, so a Policy on one is still refused when the
template stops naming its source.

* test(eventbridge): cover nested-bus PutEvents, partner rule tags and CFN rules

PutEvents on a partner bus does not fire the rules of a bus nested under
its name, a rule on a partner bus is tagged and listed by its ARN, and
an AWS::Events::Rule names a partner bus in EventBusName and goes with
the stack.

* docs(eventbridge): note partner bus permissions, PutEvents and the rule-name upgrade

* fix(cloudformation): validate a supplied EventSourceName on an event bus update

An update that keeps the bus's Name skipped EventSourceName entirely, so
a malformed source, one that does not match Name, or one newly added to
a custom bus was accepted. When the template supplies EventSourceName it
is now checked the way creation checks it; leaving it out still updates
the bus in place.

* fix(eventbridge): let a legacy slash-named rule block DeleteEventBus

DeleteEventBus only counted rules whose name held no slash, so a bus
whose only rule was a legacy slash-named one could be deleted, orphaning
the rule; a scheduled one kept firing after a restart. Every rule stored
under the bus now blocks the delete, except the rules of an existing
nested partner bus, which share the key prefix but belong to that bus.

* fix(eventbridge): validate rule names in the rule and target operations

Only PutRule checked the rule name, so DeleteRule, EnableRule,
DisableRule, PutTargets, RemoveTargets and ListTargetsByRule took a
name like a/b and looked it up by key, which on a partner bus could
reach a rule of a nested bus. They now answer a ValidationException the
way PutRule does. A legacy slash-named rule that is stored on the bus
named in the request is still reachable by its exact name, so it can
have its targets removed and be deleted.

* refactor(eventbridge): split a rule ARN at its last slash

A rule name holds no slash, so the bus is everything before the last
one. Splitting at the first slash found the same stored rule, since the
key joins bus and rule with a slash, but left RuleRef's bus and rule
wrong for a rule on a partner bus such as
rule/aws.partner/example.com/acct/r1.

* docs(eventbridge): describe legacy slash-named rules and EventSourceName updates

A legacy slash-named rule is hidden from ListRules and PutEvents but
still reachable by its exact name and blocks DeleteEventBus, and the
other rule operations now validate the name. On a CloudFormation update
a supplied EventSourceName is validated as on creation.

* fix(eventbridge): keep every persisted rule reachable by its exact name

PutRule did not validate rule names before, so a stored rule can be longer
than 64 characters or contain a space, colon or at sign. Skip name validation
whenever a rule with that exact name is stored on the requested bus, not only
for slashed names, so such a rule can still have its targets removed, be
disabled and be deleted, and no longer blocks DeleteEventBus forever.

* fix(eventbridge): name the rule member in target operation validation errors

PutTargets, RemoveTargets and ListTargetsByRule take the rule name in their
Rule member, so report a rejected name at 'rule' as AWS does instead of
at 'name'.

* fix(eventbridge): validate the rule name in DescribeRule

DescribeRule now applies the same rule name check as the other rule
operations, so a malformed name fails with ValidationException instead of
ResourceNotFoundException, while a persisted rule stays describable by its
exact name.

* fix(eventbridge): resolve a legacy slashed rule ARN on a custom bus

Splitting a rule ARN at its last slash finds rules on partner buses but
misses a rule persisted with a slash in its name on a custom bus, such as
rule/foo/team/r1. When no rule is stored for the last-slash split, fall back
to the first-slash split if the rule stored there belongs to that bus, so
TagResource, UntagResource and ListTagsForResource reach it again.

* refactor(eventbridge): decide DeleteEventBus by each rule's own bus

Count a stored rule against the bus being deleted when its eventBusName is
that bus, rather than inferring ownership from whether a nested bus exists
under the rule key's prefix.

* docs(cloudformation): note that AWS replaces a bus whose EventSourceName is dropped

* test(eventbridge): cover legacy slashed rules on a custom bus

Exercise the rule and target operations on a slash-named rule persisted on a
custom bus, and check that a slashed name stored for a different bus is still
rejected by every rule and target operation.

* refactor(eventbridge): split a rule ARN at its last slash only

A rule's store key joins the bus and rule name with a slash, so splitting
rule/foo/team/r1 at its first or last slash names the same stored rule. The
first-slash fallback could never find a rule the last-slash lookup missed;
drop it and resolve the ARN without a store lookup.

* test(eventbridge): pin the error a removed legacy slashed rule returns

Once the stored rule is gone, DescribeRule validates its slashed name again and
fails with ValidationException. Assert that code, and that the rule left the
store, instead of any AwsException.

* fix(cloudformation): treat a gone legacy-named rule as deleted

A stack created before rule names were validated can hold a rule whose name
PutRule now rejects. Once that rule is gone, ListTargetsByRule validates the
name and fails with ValidationException, so DeleteStack ended DELETE_FAILED.
Check whether the rule is stored first, through a new
EventBridgeService.ruleExists that skips name validation, and treat a missing
rule as already deleted.

* docs(eventbridge): spell out what a legacy slashed rule can still do

A slashed rule on the default bus can't be tagged by ARN, since rule/team/rule-1
reads as rule rule-1 on bus team; it stays reachable by exact name for the rule
and target operations only. A stack holding a legacy-named rule can still be
deleted, but an UpdateStack touching it fails because PutRule rejects the name.

* fix(eventbridge): report the length violation of a long partner bus name on permission calls

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

* test(cloudformation): drop the section divider above the partner bus provisioner tests

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

* docs(eventbridge): ground the partner bus permission rejection in the API model

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

* fix(eventbridge): keep a partner bus off a legacy rule that shares its key

A rule key joins the bus and rule name with a slash, so a slash-named rule
persisted by an earlier version on a custom bus named aws.partner (for
example example.com/orders/r1) has the same key as rule r1 on partner bus
aws.partner/example.com/orders. Rule lookups, ListRules and PutEvents now
check the stored rule's bus, so the partner bus neither lists, fires nor
manages that rule, and PutRule on the partner bus is rejected rather than
taking over the legacy rule's tags and targets.

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

* test(eventbridge): keep Step Functions target rule names within the 64 character limit

PutRule now rejects rule names longer than 64 characters, as AWS does. The
Step Functions integration test built names from a 16 character prefix, the
suffix and a UUID, so the missing-target rule name reached 67 characters and
PutRule rejected it before the test ran. Use a shorter prefix.

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

* fix(eventbridge): check a permission call's bus name against the modeled 256 character limit

PutPermission and RemovePermission type EventBusName as NonPartnerEventBusName, which the model bounds at 1 to 256 characters with pattern [\.\-_A-Za-z0-9]+. The partner bus check used the 64 character rule name limit, so a partner bus name of 65 to 256 characters drew a length violation AWS does not report.

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>

---------

Signed-off-by: Tyler Webb <tyler.webb@verkada.com>
2026-11-12 19:03:15 -04:00
Oleksandr Nikolaichuk 195a036b63 fix(cloudformation): clear dropped API Gateway v2 route and authorizer settings (#7992) 2026-11-11 10:49:06 -04:00
Oleksandr Nikolaichuk 55bb5c0f6e fix(cloudformation): clear dropped descriptions and the trail key prefix (#7884) 2026-11-11 09:17:46 -04:00
Suja Shaj 3d3e94dcc6 fix(cloudformation): give a DB instance its security groups and encryption (#7867)
An AWS::RDS::DBInstance created through CloudFormation never received
its VPCSecurityGroups or StorageEncrypted, so describe-db-instances
showed neither. Both now reach the instance on create.

A stack update that changes the groups moves the instance to them in
place, and one that drops them puts a standalone instance on its VPC's
default group, as AWS does; a cluster member keeps its groups. A
rollback puts the previous groups back. StorageEncrypted can only be
set at create, so changing or dropping it replaces the instance: the
old one is deleted once the update commits and kept when it rolls
back. A custom-named instance refuses the change, as on AWS.

Part of #7603

The rollback test of a security group change now starts from two groups
and from none, as well as from one, so a saved list that kept only its
last group, or saved nothing for an instance that had none, fails it.
The line that saves the list now creates the array first, which reads
more plainly.

The docs and the encryption record's Javadoc now say that an instance
created before StorageEncrypted was applied, whose template sets it
through a parameter, does not see a change made only through that
parameter on its first update, as Ec2Tags.ownedKeys already notes for
tags.

The DB instance and DB cluster arms refuse a custom-named replacement
through CfnExceptions.customNamedReplacement, and the private copy is
gone.

The DB cluster's createOnly record and the AssociatedRoles record are
CreateOnlyInputs constants now, beside the DB instance's encryption
record, so all three are read, written, put back on a rollback and
cleared on commit through it. The attribute names are unchanged, so a
stack created before keeps its records, and an update that leaves the
cluster record as it was still saves no copy of it.

One thing changes with it: the roles record an update overwrites is now
saved every time, where it used to be saved only when no saved copy was
there. A committed in-place update used to leave that copy on the
resource, so a stack from then could have its roles record rolled back
to an older one by the first update that fails; a test covers it.

The encryption record's Javadoc and the docs now say that the previous
template resolves on the update, so a change made only through a
parameter, or anything else the update changes, is not seen.

An update whose template changed a cluster member's VPCSecurityGroups
moved the member to the new groups. On AWS the handler sends that change
to ModifyDBInstance and RDS refuses it for a member, whose groups are
its cluster's, so the update fails. It now fails the same way, with
InvalidParameterCombination and RDS's message, before anything on the
instance changes.

The change is read from the template, as AWS's handler reads it, so a
member whose list stays the same still updates, including one a stack
created before Floci applied the groups. Refusing the property outright
would fail a list that matches the cluster's, which the schema allows.
2026-11-11 00:49:50 -04:00
galsuchetzky-act 09ac552cf7 feat(cloudformation): provision AWS::CloudFormation::StackSet (#7244)
Create, update and delete StackSet resources and their instances through the existing StackSet service. Preserve current main's asynchronous automatic deployment and stable tag reads while reconciling the resource's declared account and organizational-unit targets and Regions.

Return StackSetId for Ref and Fn::GetAtt and cover the provisioner lifecycle with integration tests. OperationPreferences, CallAs and ParameterOverrides remain unsupported.
2026-11-10 08:54:32 -04:00
Mario Toffia 8b48aafd44 fix(cloudformation): update the tags of an AWS::Events::EventBus in place (#7799)
* fix(cloudformation): update the tags of an AWS::Events::EventBus in place

A tag-only UpdateStack of an event bus was refused with "Updating
AWS::Events::EventBus Description, Tags, or Policy is not supported until
transactional rollback is available." and rolled back, so a template that
bumps a version tag could not be deployed.

The bus the stack already owns now takes the template's tags: a key the
stack set and the template dropped is untagged, a tag added outside the
stack stays, as measured on AWS. The tags of the keys the update touches
are snapshotted first, and rollbackUpdate puts them and the tracked keys
back when a later resource fails the update. Description and Policy
changes are still refused.

Closes #7796

* fix(cloudformation): keep a failed event bus tag update for its rollback

A tag call that fails after the bus's tags started changing left the
engine restoring the previous resource and marking it rolled back, so
the half-applied tags stayed. retainsFailedUpdateState now keeps an
attempt that carries the tag snapshot, and the rollback walker restores
it through rollbackUpdate, as the SSM parameter provisioner does.

* test(cloudformation): read EventBridge answers through callEventBridge

* refactor(cloudformation): share the tag snapshot of an update with SSM

The event bus recorded and read back the tags of an update the same way
the SSM parameter does. CfnRollback now holds that pair, putTagSnapshot,
snapshotTagKeys and snapshotTags, in the same tagKeys and tags fields, so
a snapshot an SSM update already stored still reads. The bus reconciles
its tags from the managed keys and the desired tags, as SSM's
reconcileTags does, so its update and rollback no longer each work out
the keys to remove.

* fix(cloudformation): read a null tag value back as null from a tag snapshot

* refactor(cloudformation): read the event bus update snapshot through CfnRollback

rollbackEventBusUpdate parsed its snapshot by hand, which is what
CfnRollback.updateSnapshot does; it now uses that and still reports
false when the bus carries no snapshot. The CloudFormation docs say
event bus tags now update in place on UpdateStack, keeping tags added
outside the stack, and go back when a later resource fails the update.
2026-11-10 08:17:17 -04:00
Charles Swanberg 2a3dbb1aa4 fix(cloudformation): send a stack's status changes to the default bus, with their request token (#7053)
Floci sent no event as a stack's status changed, so a rule on `CloudFormation Stack Status Change`
never fired, and whatever starts on one, a deploy waiting for its stack to finish among them, never
started. It also dropped `ClientRequestToken`, which is how a consumer ties an event to the
operation that caused it.

- CloudFormation User Guide, "Using Amazon EventBridge with CloudFormation": events go to the
  default bus, "guaranteed to be delivered, and they might be delivered out of order".
  https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/eventbridge-integration.html
- CloudFormation User Guide, "CloudFormation stack status change event detail": the envelope,
  `stack-id`, `status-details`, and "All events that are initiated by a given stack operation are
  assigned the same client request token".
  https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/event-detail-stack-status-change.html

The pages say nothing of nested stacks, and their sample shows an empty token. Rules read on a real
account on 2026-10-30, for a root nesting one stack, showed one event per status. Through a create
change set, an update change set and DeleteStack, each with its own token, the root's events carried
their operation's token but for REVIEW_IN_PROGRESS, which had no key, and the nested stack's had no
key at all. Through a create and an update that failed in the nested stack, the root's rollback
statuses carried the create's or the update's token, the nested stack's again had no key, neither the
root's CREATE_FAILED nor any UPDATE_FAILED reached the bus, and the nested stack's failed create was
CREATE_FAILED and then DELETE_IN_PROGRESS and DELETE_COMPLETE, with no ROLLBACK_* status. Floci now
records and sends that: a nested stack records CREATE_IN_PROGRESS or UPDATE_IN_PROGRESS as its
operation starts, its failed create ends in CREATE_FAILED for its parent's rollback to delete, without
the "Rollback requested by user." CloudFormation's reason did not carry, and an update's first rollback
passes through UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS. An operation given no token leaves the key
out too.

Two cases were not read and no test asserts them: a failure in the root's own resource with the
nested stack healthy, and a delete that fails. They send CloudFormation's documented statuses from the
same code. UPDATE_COMPLETE_CLEANUP_IN_PROGRESS stays where Floci has cleanup to do, though
CloudFormation sent it on every update. A template Floci cannot execute at all still ends a root in
CREATE_FAILED and sends it, so that stack's end is not silent; the reading has no such path.

CloudFormationService.addEvent is the one place a status is recorded, so it queues an event for a
stack's own record, and CloudFormationEventPublisher delivers them in order on one daemon thread. A
status can be recorded under the stack's lock in stacks.compute and delivery calls a rule's targets
before it returns, so delivering in place would hold that lock and the operation for as long as the
targets take. A failed path records its event before it writes the status, so delivery waits a
moment for that write. The queue is in memory: an event still in it when Floci stops is dropped and
counted in the log, and is not sent on the next start.

The query handler hands each operation's token to the service, which sets it on the stack before the
operation's first record and clears it where the operation has none. It is not persisted.

test(cloudformation): an update failing outside a resource sends no UPDATE_FAILED

An update that fails before any resource, on an SSM parameter or a template that fails at execute,
goes straight to its rollback, and CloudFormation sends no UPDATE_FAILED, as for a failure in a
resource. On 2.4.0 the failed-execute path already sends none, so this commit carries the test alone
that keeps it so: the bus hears UPDATE_IN_PROGRESS, the rollback's statuses and nothing else, each
with the operation's request token.

(test cherry picked from commit 9314dad130116c5d4c809072800c787a4d640446, whose code change 2.4.0
makes moot)

fix(cloudformation): roll back a failed nested create's RetainExceptOnCreate, and send a start only once it runs

A nested stack's failed create is deleted by its parent's rollback through the
ordinary delete path, which kept what RetainExceptOnCreate marks. The delete of
a child in CREATE_FAILED now carries the create-rollback flag, so those
resources go as they did when the child rolled itself back, and a nested case
in CloudFormationDeletionPolicyIntegrationTest keeps it so.

The status an operation starts with is recorded under the stack's lock but
sent by the operation as its first act, so an operation the executor refuses
sends nothing. A successful create or update records its completion before
the terminal status is exposed, as the failed paths do, so the event carries
the operation's own token and not a later request's.

The publisher test waits for the worker to be sleeping or stopped instead of a
fixed 200 ms, and the status events test has one wait loop for the root's and
the nested stack's events.

fix(cloudformation): a delete deferred behind a running create sends its own token

A DeleteStack accepted while an execution runs waits for it, and until now
only its retain list waited: when the execution ended and the delete began,
the stack still held the execution's token, so DELETE_IN_PROGRESS and
DELETE_COMPLETE went out with it. The deferred delete now keeps its token
beside what it retains, and the stack takes it as the delete starts.
aDeleteLandingMidCreateCarriesItsOwnToken holds a custom resource's Create
open, lands the delete, and reads the tokens on the bus; it was red before.

The stale Javadoc above awaitEvents goes.

The mid-create test stubbed the ServiceToken Lambda and PUT the response itself,
which CustomResourceProbe already does. The probe takes a hold: the requests a
predicate matches wait before they are answered until the test releases them,
and the test reads when one has arrived. The status events test holds the
Create that way.
2026-11-09 20:58:07 -04:00
Oleksandr Nikolaichuk 7ca797ff22 fix(cloudformation): clear dropped ECS service settings (#7780)
An update that drops DeploymentConfiguration from an AWS::ECS::Service now clears it. A dropped CapacityProviderStrategy or ServiceRegistries keeps the stored value, and a declared empty list clears either. A failed stabilisation puts the prior values back, and a deployment configuration the service did not have is put back as none.

Signed-off-by: Oleksandr Nikolaichuk <sekator778@gmail.com>
2026-11-09 09:06:12 -04:00
galsuchetzky-act 01c84245a7 fix(cloudformation): deploy a service-managed stack set to accounts that join or leave its targets (#7243) 2026-11-08 18:01:22 -04:00
Suja Shaj e27a307622 fix(cloudformation): give an instance its launch template's instance profile (#7761)
An AWS::EC2::Instance that names a launch template took the template's
image, type, key and metadata options but never its IamInstanceProfile,
so describe-instances showed no profile. When the instance declares no
profile of its own, it now launches with the template's, resolved the
same way RunInstances resolves it. The instance's own profile still wins.

A stack update that moves the instance to a template version naming
another profile, or none, changes or removes the profile in place, and a
dropped LaunchTemplate removes the profile it supplied. A rollback of an
update that changed the profile, whether the instance or its template
declared it, now puts the previous profile back instead of ending
UPDATE_ROLLBACK_FAILED.

Part of #7603
2026-11-08 05:25:15 -04:00
Oleksandr Nikolaichuk 3c66249375 fix(cloudformation): clear dropped stage variables and instance user data (#7736) 2026-11-07 09:56:25 -04:00
Oleksandr Nikolaichuk 0cb45a86df fix(cloudformation): keep NAT gateway secondary addresses the stack never declared (#7669)
* fix(cloudformation): keep NAT gateway secondary addresses the stack never declared

* test(cloudformation): keep NAT gateway secondary addresses the stack never declared

* fix(cloudformation): a null NAT gateway secondary property counts as not declared

* test(cloudformation): a null NAT gateway secondary property counts as not declared
2026-11-06 09:28:00 -04:00
Oleksandr Nikolaichuk fd29b4aa32 test(cloudformation): record and ratchet what a dropped property does (#7599) 2026-11-05 16:21:36 -04:00
galsuchetzky-act 918ce95b53 fix(cloudformation): list a service-managed stack set's targets and tags in DescribeStackSet (#7242)
AWS returns a stack set's tags and the recorded root and OU deployment targets of a service-managed stack set. Read the same saved targets that ListStackSetAutoDeploymentTargets reports.

Replace the tag map on UpdateStackSet instead of clearing and refilling a map that a concurrent DescribeStackSet may be reading. Copy the request's tags so the published map is independent of later request changes.

Cover both response members, an update interleaved with tag iteration, and request-map isolation with regression tests.

Use the shared account-scoped InMemoryStorageFactory for the added regression tests instead of a private factory copy.
2026-11-05 13:38:13 -04:00
Mario Toffia a19b296f06 fix(cloudformation): store stack policies and return them (#7552)
* fix(cloudformation): store stack policies and return them

* test(cloudformation): remove the stack policy test bucket after use

* fix(cloudformation): apply a stack policy with its stack operation

UpdateStack now stores its policy when the update commits, before UPDATE_COMPLETE is published, and CreateStack when execution starts. A policy-only update no longer leaves its change set FAILED. SetStackPolicy checks the stack state again under the stack lock after reading a StackPolicyURL.

* fix(cloudformation): apply a creation policy when the create is claimed

* fix(cloudformation): keep a rejected policy-only update executable

* fix(cloudformation): assign a stack policy when its change set is created

* test(cloudformation): stop the stack policy test's executor

* test(cloudformation): round-trip stack policies through persistent storage

* test(cloudformation): build the stack policy requests on CfnRequests

* test(cloudformation): construct CloudFormationService through one shared fixture

* fix(cloudformation): refuse a missing or malformed StackName in the stack policy actions

SetStackPolicy and GetStackPolicy looked a missing StackName up as the
stack named "null". Both now validate StackName first, as AWS does,
with the checks ContinueUpdateRollback already applies.
2026-11-05 04:43:20 -04:00
Ronald Li 🛠️ d280f451fa fix(cloudformation): roll back an AWS::EC2::SecurityGroup updated in place (#7562) 2026-11-04 22:37:06 -04:00
Ronald Li 🛠️ cfbf86b8a1 fix(cloudformation): keep tags added outside the stack on EC2 VPCs, security groups and instances (#7534) 2026-11-04 18:17:51 -04:00
Mario Toffia b35e51374c feat(cloudformation): provision signing profiles and code signing configs (#7546) 2026-11-04 18:11:33 -04:00
Oleksandr Nikolaichuk 0c3af7dc4b fix(cloudformation): roll back an AppSync update when a later resource fails (#7186)
A failed stack update left AppSync entities changed or cleared by the update:
the provisioner had no rollbackUpdate, so the stack ended in
UPDATE_ROLLBACK_FAILED with "Rollback is not implemented".

Before an in-place update of a GraphQL API, data source, function, resolver or
API key, the provisioner records the members the update can change or clear.
The service applies an update member by containsKey, so replaying them puts
back both the changed and the cleared values. An update that fails part way
undoes itself through CfnRollback.guarded, and a failed undo keeps the
snapshot for ContinueUpdateRollback.

GraphQLSchema and a replaced AppSync resource are not covered.

tagResource, untagResource and putEnvironmentVariables change the stored API in place while updateGraphqlApi saves a copy, so a copy could overwrite a tag or variable written in between. Every method that writes a store now holds the service monitor, as startSchemaCreation does, and startSchemaCreation checks the API under it too. refreshGraphqlApiUris refreshes the stored API under the monitor instead of putting the instance it read earlier.
2026-11-04 16:25:04 -04:00
Jackson Price 31451dfff3 fix(cloudformation): preserve mapped list values (#7511) 2026-11-04 14:05:30 -04:00
Ronald Li 🛠️ dbbf22957f fix(cloudformation): apply an AWS::EC2::FlowLog's Tags (#7490) 2026-11-04 06:49:14 -04:00
mokamoto12 8b756a3467 fix(cloudformation): apply KinesisStreamSpecification on AWS::DynamoDB::Table (#7464)
* fix(cloudformation): apply KinesisStreamSpecification on AWS::DynamoDB::Table

The property was accepted and ignored, so a stack that declared it got a
table whose item changes never reached the stream.

The declared stream becomes the table's active Kinesis streaming
destination on create and update. Removing a block the previous template
declared turns it off, and a stack that never declared it leaves
destinations set outside it alone. The in-place update snapshot of a
stack that manages the destinations records them, so a failed update
puts them back as they were.

A change of ApproximateCreationDateTimePrecision alone updates the active
destination in place, as CloudFormation does with one
UpdateKinesisStreamingDestination call, so forwarding never stops and
records already captured are still delivered.

A block that is not an object fails template validation, as
TimeToLiveSpecification does, rather than reading as a removed block
that turns forwarding off.

A StreamArn the destination cannot use fails the table as the AWS handler
does, and the table this attempt created is deleted. One under 37
characters fails EnableKinesisStreamingDestination's validation. One that
is not a Kinesis stream ARN, such as the stream name Ref returns, or one
naming a stream that does not exist fails as NotStabilized.

DynamoDbTableAccess gains enable, disable and update operations for the
destination. DynamoDB Local has no Kinesis forwarding, so that backend
leaves the table as it is and logs a warning. CloudFormation still checks
StreamArn there as AWS does; only the forwarding is skipped.

* fix(cloudformation): match Kinesis destinations by their whole stream ARN

A destination was looked up by the last segment of its StreamArn in the
table's account and region, so an ARN for another account, region or
resource type that ended in a local stream's name forwarded to that
stream. KinesisService.describeStreamByArn now finds a stream only by its
exact ARN. NativeDynamoDbTableService uses it, so the public
EnableKinesisStreamingDestination action reports such an ARN as not
found, and CloudFormation fails the table as NotStabilized.

The DynamoDB Local backend looks the stream up the same way before it
skips forwarding, so a template naming a missing stream fails there too.

A declared StreamArn the table already forwards to now goes through the
same template checks as a new one; only the rollback restore skips them.
2026-11-03 23:10:27 -04:00
Ruslan Sovinskyy 4ba9a55a3a feat(cloudformation): provision event bus v2 and subscriber (#7260) 2026-11-03 17:27:11 -04:00
Rashen Anupama fad0493169 fix(cloudformation): propagate tags to nested stacks (#7383) 2026-11-03 16:47:32 -04:00