Commit Graph
209 Commits
Author SHA1 Message Date
Priamo Germosen a9bea6567c fix(emr): give back a cluster's Kerberos realm, OS release, root volume, placement groups and logging settings (#9183)
RunJobFlow dropped the cluster's KerberosAttributes, OSReleaseLabel,
EbsRootVolumeIops, EbsRootVolumeThroughput, PlacementGroupConfigs,
LogEncryptionKmsKeyId, RepoUpgradeOnBoot and MonitoringConfiguration,
so DescribeCluster gave back none of them.

- DescribeCluster gives each back as it was asked for, the placement
  group configs as its PlacementGroups.
- OSReleaseLabel is the one asked for, else the latest Amazon Linux
  release DescribeReleaseLabel lists for the cluster's release, as "If
  no Amazon Linux release was specified, the default Amazon Linux
  release is shown in the response".
- RepoUpgradeOnBoot is SECURITY for a cluster with a custom AMI that
  names none, as "If omitted, the default is SECURITY".
- Of KerberosAttributes only the Realm is kept and given back, never a
  password, and a cluster without them answers an empty structure, as
  AWS does.
- A member the model requires, or a value outside its enum, is refused
  with the framework's ValidationException. So are two placement groups
  for one instance role, and one for the primary nodes of a cluster
  without three of them (three on-demand and no spot for a fleet), in
  the words AWS answers them with.
- As only the primary nodes take a placement group, with SPREAD or NONE,
  another role or strategy is refused, in Floci's words, and a group
  without a strategy gets SPREAD, as the Management Guide says.
- AWS::EMR::Cluster passes these properties to RunJobFlow rather than
  warning that they are not stored.
2026-11-22 01:54:11 -04:00
Priamo Germosen 0171af4bce fix(emr): give back the subnets, zones, instance profile and security groups a cluster asked for (#9180)
DescribeCluster's Ec2InstanceAttributes kept only the key name, subnet,
zone and managed security groups. The JobFlowRole, the instance fleets'
Ec2SubnetIds and Placement.AvailabilityZones, and the additional master
and slave security groups that RunJobFlow took were dropped, so a client
reading the cluster back, as Terraform's aws_emr_cluster does, saw none
of them.

- IamInstanceProfile is the JobFlowRole, "The IAM role that was
  specified when the cluster was launched".
- RequestedEc2SubnetIds and RequestedEc2AvailabilityZones are the ones
  requested, an empty list when none was, as AWS gives them. The subnet
  is the one Ec2SubnetId names, else the first of Ec2SubnetIds, and the
  zone the one Placement names, else the first of its AvailabilityZones.
- A request naming both subnets and zones is refused with
  ValidationException, as "RequestedEc2SubnetIDs and
  RequestedEc2AvailabilityZones cannot be specified together".
- AdditionalMasterSecurityGroups and AdditionalSlaveSecurityGroups are
  the ones given, and a list member of another JSON type is refused
  with SerializationException.
- AWS::EMR::Cluster no longer warns that Instances' Ec2SubnetIds and
  additional security groups are not stored.
2026-11-22 00:48:38 -04:00
Priamo Germosen cff222a6f1 fix(emr): keep instance fleets' launch and resize specifications, and modify their configs (#9168)
An instance fleet dropped the LaunchSpecifications, ResizeSpecifications
and Context that RunJobFlow and AddInstanceFleet gave it, and
ModifyInstanceFleet changed its target capacities alone, ignoring the
ResizeSpecifications, InstanceTypeConfigs and Context it took.

- A fleet keeps its LaunchSpecifications, ResizeSpecifications and
  Context, and ListInstanceFleets gives them back.
- ModifyInstanceFleet changes the ResizeSpecifications, InstanceTypeConfigs
  and Context it gives. The configs replace the fleet's own, as the
  Management Guide warns that "Not including fields can result in
  overwriting specifications you declared at launch", and must name
  every instance type the fleet has, as "You must include all instance
  types that are part of your instance fleet in the modify request". A
  request that leaves one out is refused with InvalidRequestException.
  Its configs are checked as AddInstanceFleet checks them, and on both
  calls specifications that are not an object, or a Context that is not
  a string, are refused with SerializationException.
- AWS::EMR::Cluster no longer warns that a fleet's launch and resize
  specifications are not stored, and AWS::EMR::InstanceFleetConfig now
  applies a change to InstanceTypeConfigs or ResizeSpecifications in
  place rather than warning. A rollback puts them back, but not an
  instance type the update added, which every later request must
  include, nor resize specifications where the fleet had none, which no
  request can clear. The update is checked as ModifyInstanceFleet checks
  its request, before anything changes, and dropped configs or resize
  specifications are kept.
2026-11-21 20:29:04 -04:00
Priamo GermosenandChuck Swanberg 543a236747 feat(cloudformation): provision Verified Permissions policy stores, templates and policies (#9162)
A template declaring AWS::VerifiedPermissions::PolicyStore, PolicyTemplate or Policy failed its stack
as unsupported, although Floci serves the API behind them. VerifiedPermissionsCfnProvisioner now
provisions the three over VerifiedPermissionsService.

A policy store answers Ref with its id and sets Arn, PolicyStoreId and EncryptionState; its schema is
put once the store stands, and deletion protection is turned on only after that, so a store whose
schema the Cedar sidecar refuses is still removed. A template answers Ref with
PolicyStoreId|PolicyTemplateId and a policy with its id alone, as the Template Reference documents
each; a policy's store is found from its id, and Cloud Control names a policy
PolicyId|PolicyStoreId. PolicyStoreId is create-only on both, and a template or a policy is replaced
in the new store when the engine says the update replaces it. A schema, Description,
DeletionProtection or Name the template drops is cleared, what the stack never declared is left as
the service has it, and a create leaves out an optional field the template does not give. An update
of a stack from before this provisioner, which holds the dispatcher's stub, creates the entity.

An in-place change of a store, a template or a static policy is snapshotted first, so a step that
fails is undone and a later resource failing the update puts it back. A store's settings are
written before its schema, its tags are reconciled only over the keys the stack owns, and a change
of its EncryptionSettings is refused, since Verified Permissions sets encryption at create. Cloud
Control's model names a store by PolicyStoreId and a template by PolicyTemplateId.

Co-authored-by: Chuck Swanberg <cswanberg@mad-swan.com>
2026-11-21 19:47:19 -04:00
Priamo Germosen 5a912d5263 fix(emr): keep instance groups' volumes, AMI and shrink policy, and list instances' volumes and public address (#9163)
An instance group dropped the EbsConfiguration and CustomAmiId that
RunJobFlow and AddInstanceGroups gave it, and ModifyInstanceGroups its
ShrinkPolicy, and ListInstances gave no instance an EbsVolumes or a
PublicIpAddress.

- A group keeps its EbsConfiguration and CustomAmiId, and
  ListInstanceGroups gives them back as its EbsBlockDevices, one per
  volume named /dev/sdb on as a fleet's are, its EbsOptimized and its
  CustomAmiId, under the same limit of 25 volumes per instance.
- ModifyInstanceGroups keeps a group's ShrinkPolicy, which
  ListInstanceGroups gives back, and a shrink it comes with follows its
  InstanceResizePolicy: the instances it names to terminate end first,
  then the group's last instances, passing the protected ones. They end
  as EC2InstanceIdsToTerminate ends them, so their ids are not taken
  again, and a later entry for the same group counts from what an
  earlier one leaves. An id to terminate that is not a running instance
  of the group is refused, as EC2InstanceIdsToTerminate refuses it, and
  so is a shrink the protected instances leave short.
- ListInstances gives each instance the PublicIpAddress its
  PublicDnsName names, in 203.0.113.0/24 for a cluster's first 254
  instances and in 100.64.0.0/10 past them, and an EbsVolumes entry for
  each device its group or instance type config gives it, with volume
  ids that differ between clusters. A group's instances' EC2
  descriptions give its CustomAmiId as their image.
- AWS::EMR::Cluster no longer warns that a group's EbsConfiguration and
  CustomAmiId are not stored.
2026-11-21 19:32:36 -04:00
Priamo Germosen 5db8d098e7 feat(cloudformation): provision EMR steps, instance groups and instance fleets (#9159)
A template can now create AWS::EMR::Step, AWS::EMR::InstanceGroupConfig
and AWS::EMR::InstanceFleetConfig. None was served, so the stack
reported CREATE_COMPLETE with nothing behind it. EmrCfnProvisioner adds
them through AddJobFlowSteps, AddInstanceGroups and AddInstanceFleet,
reading each as those calls read their requests, from methods EmrHandler
now shares, and against the registry schemas, now in the vendored
property types.

- A step's Ref and Id are its id, and its LogUri and EncryptionKeyArn
  are its StepMonitoringConfiguration. Every property is create-only,
  so a change adds a new step, and a step stays in its cluster's
  history when deleted, as the schema's delete handler calls nothing.
- An instance group's Ref and InstanceGroupId are its id. Its
  InstanceCount and AutoScalingPolicy change in place, and the delete
  removes its policy and shrinks it to nothing, as a group cannot be
  removed from its cluster.
- An instance fleet's Ref and InstanceFleetId are its id. Its target
  capacities change in place through ModifyInstanceFleet, and a change
  to InstanceTypeConfigs or ResizeSpecifications is accepted with a
  warning and not applied, as Floci's ModifyInstanceFleet changes the
  capacities alone. The delete shrinks it to nothing.
- A create-only change adds a new group or fleet; a later resource's
  failure, or a failure of the update itself, puts back what it had
  changed; and a group or fleet whose cluster has ended is left alone.

A group's role and a fleet's type must be TASK, the one value the
template reference allows, and a delete shrinks one once its cluster
is running or waiting, waiting for one still starting, and removes a
policy the group has.
2026-11-21 18:36:49 -04:00
Priamo Germosen 546770ab69 feat(cloudformation): provision AWS::EMR::Cluster (#9156)
A template can now create an EMR cluster. It was not served, so the
stack reported CREATE_COMPLETE with nothing behind it. EmrCfnProvisioner
creates it through RunJobFlow, reading the template as RunJobFlow reads
its request, from a method EmrHandler now shares.

- The properties are read as model validation reads them, against the
  registry schema, now in the vendored property types, and a template
  that sets the read-only Id or MasterPublicDNS is refused.
- Ref is the cluster id; Fn::GetAtt gives Id and MasterPublicDNS.
- The master, core and task groups or fleets become RunJobFlow's
  InstanceGroups or InstanceFleets with their roles, a configuration's
  ConfigurationProperties its Properties, and a step's StepProperties
  its Properties. The create completes once the cluster is waiting or
  running, and a cluster that terminates first fails it and is
  terminated again, its termination protection cleared first.
- The properties, and members of Instances, its groups and its fleets,
  that Floci's RunJobFlow keeps nothing of are accepted with a warning,
  and recorded as ignored. Task groups and fleets need unique names, as
  the reference says, and a cluster that ran its steps and ended came
  up, so its create completes.
- An update applies in place what the reference and the update handler
  let change: AutoTerminationPolicy, ManagedScalingPolicy,
  StepConcurrencyLevel, VisibleToAllUsers, TerminationProtected,
  UnhealthyNodeReplacement, a core or task group's InstanceCount and
  AutoScalingPolicy, a core or task fleet's target capacities, and the
  tag keys the stack owns. They are compared with the values the stack
  last applied, resolved, so one a parameter changes counts. Any other
  change, within Instances included, replaces the cluster: the master
  group's count and the master fleet's capacities among them, which
  the API refuses to change.
- A later resource's failure, or a failure of the update itself, puts
  back what it had applied. A terminated cluster fails an update, and a
  termination-protected one refuses the delete, as TerminateJobFlows
  does.
2026-11-21 17:31:03 -04:00
Priamo Germosen 1fe555fbc2 feat(cloudformation): provision EMR security configurations, Studios and session mappings (#9152)
A template can now create AWS::EMR::SecurityConfiguration,
AWS::EMR::Studio and AWS::EMR::StudioSessionMapping. None was served,
so the stack reported CREATE_COMPLETE with nothing behind it. They go
through the services the EMR API uses, and the properties are read as
model validation reads them, against the registry schemas, now in the
vendored property types.

- A security configuration's Ref is its name, generated when the
  template gives none; its JSON is taken as an object or its text. Both
  properties are create-only, so a change replaces it, and one that
  keeps a template's own name is refused, as for every custom-named
  resource.
- A Studio's Ref is its id; Fn::GetAtt gives StudioId, Arn and Url, and
  a template that sets one of them is refused. UpdateStudio applies the
  Name, Description, SubnetIds and DefaultS3Location the template
  changes, and the tags change for the keys the stack owns. A change to
  IdpAuthUrl or IdpRelayStateParameterName is accepted with a warning
  and not applied, as no Studio API changes them, and a create-only
  change replaces the Studio.
- A session mapping's Ref is StudioId|IdentityType|IdentityName, its
  primary identifier; SessionPolicyArn updates in place, and another
  identity replaces it.
- A later resource's failure, or a failure of the update itself, puts
  back what the update changed, but a Studio's added subnets, which
  UpdateStudio cannot take away. A gone resource fails an update and
  counts as deleted.

Two shared fixes go with them. Model validation now looks for a schema
pattern in a value, as the validator CloudFormation runs does, instead
of matching the whole value, so a Studio named with spaces passes. And
CreateSecurityConfiguration, from the API or a stack, refuses a
configuration that is no JSON object, which a cluster naming it could
not read.
2026-11-21 16:34:12 -04:00
Paulo CostaandPriamo bd58181a41 feat(cloudformation): provision AWS::Events::Connection (#7718)
* feat(cloudformation): provision AWS::Events::Connection
* feat(cloudformation): roll back an AWS::Events::Connection updated in place
* feat(cloudformation): address review of the Connection provisioner
* fix(cloudformation): match AWS when an AWS::Events::Connection drops a description
* fix(cloudformation): clear a stale Connection rollback snapshot before any check
* test(cloudformation): add AWS::Events::Connection's change-exempt row

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-11-21 15:55:42 -04:00
Priamo Germosen 5b9e842cd9 feat(cloudformation): provision AWS::EMRContainers::VirtualCluster (#9150)
A template can now create an EMR on EKS virtual cluster. It was not
served, so the stack reported CREATE_COMPLETE with nothing behind it.
The provisioner goes through the service the EMR on EKS API uses, and
does what AWS's own resource handler does:

- The properties are read as the handler's model validation reads them,
  against the registry schema, now in the vendored property types, and
  a template that sets the read-only Arn or Id is refused in the
  handler's words.
- Ref is the virtual cluster id; Fn::GetAtt gives Id and Arn.
- A create sends Name, ContainerProvider, SecurityConfigurationId,
  SessionEnabled and the tags to CreateVirtualCluster.
- Every property but the tags is create-only: a change replaces the
  virtual cluster, and the old one is terminated once the update
  commits.
- A tag change drives the tags to the template's, removing any other
  but an aws: one; a later resource's failure, or a failure of the
  change itself, puts them back.
- An update of a virtual cluster that is terminated or gone fails as
  the handler's does, and the delete of one is taken as done.
2026-11-21 15:03:44 -04:00
Priamo Germosen 858bf8d2db feat(cloudformation): provision AWS::EMRServerless::Application (#9148)
A template can now create an EMR Serverless application. It was not
served, so the stack reported CREATE_COMPLETE with nothing behind it.
The provisioner goes through the services the EMR Serverless API uses,
so a stack and a direct call see the same application, and it does what
AWS's own resource handler does:

- The properties are read as the handler's model validation reads them,
  against the registry schema, now in the vendored property types; an
  Architecture outside its enum and a read-only ApplicationId or Arn
  are refused.
- Ref is the application id; Fn::GetAtt gives ApplicationId and Arn.
- A create sends every property to CreateApplication, the Key/Value
  lists of InitialCapacity and LogTypeMap as the API's maps.
- An update sends UpdateApplication the settings the template changed
  and drives the tags to the template's, removing any other. A dropped
  setting stays as it is, but for InitialCapacity, which the handler
  sends as an empty map, and so clears.
- Name and Type are create-only: a change replaces the application, and
  the old one is deleted once the update commits.
- A later resource's failure puts back the settings and tags the update
  changed; a failure of the update itself puts back what it had changed
  by then, nothing when UpdateApplication refused it, and a restore that
  fails keeps its snapshot for ContinueUpdateRollback.
- Neither an update nor a delete stops a STARTED application, so one
  the API refuses fails the resource, as on AWS.

The vendored create-only properties and schema surface also take AWS's
new AWS::CertificateManager::Certificate properties, RootHierarchyType
and CertificateUsage, which their drift checks on this change asked
for; the ACM provisioner accepts and ignores both.
2026-11-21 13:59:46 -04:00
Oleksandr Nikolaichuk 9b19f17fe7 fix(cloudformation): update an EKS cluster's logging, authentication mode and endpoint access in place (#8871)
* fix(cloudformation): update an EKS cluster's logging, authentication mode and endpoint access in place
* test(cloudformation): pin an EKS cluster's config updated in place and rolled back
* fix(cloudformation): fail an EKS cluster update that drops its subnet or security group list
* test(cloudformation): pin a refused EKS subnet or security group change
* fix(cloudformation): restore only the EKS cluster settings an update changed
* test(cloudformation): pin an EKS rollback that keeps settings the update did not change
2026-11-21 09:37:14 -04:00
Matheus André e725ed6e9a feat(cloudformation): store Tags on AWS::BedrockAgentCore::RuntimeEndpoint (#8510)
The provisioner passes the endpoint's resolved tags to CreateAgentRuntimeEndpoint,
reconciles tag-only changes and removals in place without touching the endpoint
configuration, and restores the prior tags on a failed update and on stack rollback.
The runtime, endpoint and memory reconcile their tags through CfnRollback.reconcileTags.

A failed undo's snapshot is carried onto the restored resource by the new
CfnRollback.carryFailedUndoSnapshot, now shared by AppConfig, AppSync, the REST API,
ELBv2 and Bedrock AgentCore, so ContinueUpdateRollback retries the restore.

The RuntimeEndpoint Tags gap row and the "accepted and not stored" notes are removed.

Closes #7893
2026-11-21 09:18:38 -04:00
Jonathan Morley 16ca3a5a7d fix(cloudformation): provision AWS::CodeDeploy::Application (#8882) 2026-11-20 22:10:47 -04:00
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