mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
4afa7d8e9f5c716c4bf16af2eb0291f495ebc708
85
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ebae2ba0e0 |
feat(cloudformation): provision Cognito resource servers (#4832)
* feat(cloudformation): provision Cognito resource servers * fix(cloudformation): align rollback tests with deletion cleanup * fix(cloudformation): abandon exhausted Cognito replacement cleanup * fix(cloudformation): verify Cognito resource server ownership * test(cognito): use switch expression for ownership writers * fix(cloudformation): share optional resolution and delete cleanup hooks * fix(cognito): use resource server API addresses for stack lifecycle * fix(cloudformation): avoid repeated Cognito cleanup on stack deletion * fix(cloudformation): keep consumed resource server cleanup removed * fix(cloudformation): abandon exhausted Cognito cleanup * test(cloudformation): cover Cognito resource servers with AWS SDK * fix(cloudformation): validate Cognito scopes and replace missing servers * refactor(cloudformation): keep Cognito resource server change scoped |
||
|
|
f50437efba |
feat(cloudformation): provision AWS::BedrockAgentCore::Runtime, RuntimeEndpoint and Memory (#5226)
* feat(cloudformation): provision AWS::BedrockAgentCore::Runtime, RuntimeEndpoint and Memory The AgentCore control plane is emulated but had no CloudFormation provisioner, so the three types fell through to the generic stub that exposes only Arn and a template using Fn::GetAtt [Memory, MemoryArn] in an IAM policy failed the stack. BedrockAgentCoreCfnProvisioner maps every template property the services can store onto CreateAgentRuntime / CreateAgentRuntimeEndpoint / CreateMemory, publishes Ref as the registry schema's primaryIdentifier and Fn::GetAtt for every read-only property, updates in place when the create-only properties are unchanged and replaces otherwise, and deletes on stack teardown. Properties the emulated services have no model for are logged once at warn and listed in the docs. * fix(cloudformation): make AgentCore updates rollback-aware and authoritative Reachable through CfnProvisionerFixture (two-service inference arm). In-place updates snapshot the prior runtime, endpoint and memory configuration and tags, restore them on rollback, and delete a created entity when a later step of the same provision fails. The template is authoritative: UpdateAgentRuntime replaces the full configuration as AWS's PUT does (omitted authorizer, protocol and environment are cleared on the SDK path too), and the partial-update Memory and Endpoint calls get a replace-omitted overload for the provisioner. Nested AWS::NoValue members are omitted rather than stored blank, and the control service validates networkMode and serverProtocol with the API's ValidationException wording. * fix(cloudformation): accept AGUI runtimes and share the guarded provision helper The protocol check left out AGUI, which the AgentCore API and the Runtime schema allow, so an AG-UI runtime was refused through the API and in a stack. Ec2NetworkCfnProvisioner and BedrockAgentCoreCfnProvisioner carried the same guarded helper; it now lives on CfnRollback, taking the provisioner's in-place undo as a callback, and both use it. |
||
|
|
aff6f0eec4 |
fix(cloudformation): expand a SAM function's EventInvokeConfig (#5524)
* fix(cloudformation): expand a SAM function's EventInvokeConfig SAM's EventInvokeConfig was dropped, so a function declaring retries, a maximum event age or invoke destinations deployed with Lambda's defaults and no destination at all. It now expands as AWS's SAM translator expands it: an AWS::Lambda::EventInvokeConfig on $LATEST or the AutoPublishAlias alias, the inline role policy for each destination, the SQS queue or SNS topic SAM creates for a destination given only its Type, and SAM's conditions and error messages. The function's Condition, DeletionPolicy and UpdateReplacePolicy now reach every resource generated for it, as SAM passes them through. A condition naming another with anything but a string is rejected as CloudFormation rejects it, which also fails the template SAM produces for a conditional function with a conditional destination, as on AWS. * fix(cloudformation): resolve SSM parameters for the SAM transform and omit NoValue destinations CloudFormation resolves an AWS::SSM::Parameter::Value<String> parameter before it runs the SAM transform, so a destination Type taken from one is the stored value. The transform now gets the given parameter values over each Default, with SSM-typed parameters read from Parameter Store, wherever it runs. A Destination of AWS::NoValue passes through SAM unchanged and leaves its side without an ARN, which CloudFormation's validation rejects. The event invoke config provisioner resolved it to an empty string and stored that; it now omits AWS::NoValue, so the destination fails as the schema requires. * refactor: share SHA-1 as Digests.sha1 The SAM transform's generated condition names, EC2 key pair fingerprints and the SAML assertion name qualifier each made their own one-shot SHA-1 digest. They now share Digests.sha1 beside sha256. Also moves samTransformParameters above resolveSsmParameters' Javadoc, which it had been inserted beneath. |
||
|
|
991bf3ab9e |
fix(autoscaling): round-trip InstanceMaintenancePolicy, AvailabilityZoneDistribution, CapacityReservationSpecification, ServiceLinkedRoleARN, WeightedCapacity and EnabledMetrics (#5513)
* fix(autoscaling): round-trip InstanceMaintenancePolicy, AvailabilityZoneDistribution, CapacityReservationSpecification, ServiceLinkedRoleARN, WeightedCapacity and EnabledMetrics DescribeAutoScalingGroups dropped several members of the AutoScalingGroup shape that CreateAutoScalingGroup and UpdateAutoScalingGroup accept, so a client that set them read them back as absent and saw a permanent diff. - AsgOptionalFields gains ServiceLinkedRoleARN, InstanceMaintenancePolicy, AvailabilityZoneDistribution and CapacityReservationSpecification with its CapacityReservationTarget. The four-argument constructor stays, so existing call sites are unchanged. - MixedInstancesPolicy launch template overrides carry WeightedCapacity. - EnableMetricsCollection and DisableMetricsCollection are implemented, and DescribeAutoScalingGroups reports EnabledMetrics. - Validation follows the botocore model. MinHealthyPercentage 0 to 100 and MaxHealthyPercentage 100 to 200, both required, at most 100 apart, and -1 on both clears the policy. CapacityDistributionStrategy and CapacityReservationPreference enums. No target with preference none. CapacityReservationIds 1 to 255 characters matching [A-Za-z0-9-_/] and resource group ARNs 1 to 1600. ServiceLinkedRoleARN 1 to 1600 characters. WeightedCapacity 1 to 999 in at most 32 characters, set on every override or none. Granularity required and 1Minute. Known metric names only. - The AWS::AutoScaling::AutoScalingGroup provisioner passes the new properties and MetricsCollection through, and its update rollback snapshot restores them. It requires CapacityReservationPreference and each entry's Granularity as the resource schema does, and rejects an unknown metric before creating the group. - The Java SDK compatibility suite gains a round-trip case that sets every new member, reads it back through DescribeAutoScalingGroups, then clears the maintenance policy and the enabled metrics. * fix(autoscaling): route the metrics collection actions and close the review gaps EnableMetricsCollection and DisableMetricsCollection now route to Auto Scaling when a request carries no credential scope. Both hold the group lock, so concurrent calls keep each other's changes and a call racing a delete cannot write the group back. A failed stack update now clears the service-linked role, AZ distribution and capacity reservation when the group had none before. A blank ServiceLinkedRoleARN or WeightedCapacity in a template reaches the service's validation instead of reading as unset. The provisioner reuses the service's granularity rule and message. |
||
|
|
86b32584f3 |
feat(cloudformation): provision ElastiCache users and user groups (#5422)
* feat(cloudformation): provision ElastiCache users and user groups Add AWS::ElastiCache::User and AWS::ElastiCache::UserGroup provisioners with authentication mode handling, create-only UserName, membership deltas, engine changes and replacement on rename. * fix(cloudformation): address review findings for ElastiCache users and user groups - Require Engine property when provisioning AWS::ElastiCache::User - Reject invalid and conflicting AuthenticationMode combinations - Add setUserGroupMembers to atomically update group membership under lock - Require UserIds property when provisioning AWS::ElastiCache::UserGroup - Snapshot and restore User and UserGroup on stack update rollback - Tighten replaced subnet group deletion assertion in integration test * refactor(elasticache): share user authentication and user group update logic Move the AuthenticationMode / Passwords / NoPasswordRequired decision into UserAuthentication so the query handler and the CloudFormation provisioner no longer duplicate it. Make modifyUserGroup and setUserGroupMembers share one locked update path, and drop the concurrency test that passed without the lock. |
||
|
|
e8a300f4d5 |
fix(cloudformation): roll back a changed custom resource (#4941)
When a stack update sent a custom resource's handler an Update and the update then failed, Floci never told the handler. If a later resource failed, the rollback recorded "Rollback is not implemented for Custom::..." and the stack ended UPDATE_ROLLBACK_FAILED with the handler's change still applied. If the handler failed its own Update, Floci put the previous resource back in silence. In both cases CloudFormation sends the handler a second Update with the previous properties so it can undo the change. CustomResourceCfnProvisioner now snapshots the resource before an Update reaches its handler: the prior physical id, the old and the attempted properties, the region and the Data attributes, under the new CUSTOM_RESOURCE_UPDATE_SNAPSHOT_ATTR. A stale snapshot from an earlier update is dropped first, so an update that sends nothing needs no rollback. The ServiceToken is checked as Lambda's Invoke checks it before the snapshot is written, so an Update rejected before it reaches any handler is restored as before and sends no rollback request. While the snapshot is held, retainsFailedUpdateState answers true, so an Update the handler failed keeps its copy for the rollback walker instead of being restored over. Its rollbackUpdate spends the snapshot: - the physical id was kept: report UPDATE_IN_PROGRESS and send Update with the old properties as ResourceProperties and the attempted ones as OldResourceProperties, under the same physical id and stack id. On SUCCESS the Data attributes are replaced by the response's. A response naming another id is taken, and the id that was sent gets a best effort Delete with the attempted properties at once, since Floci has no rollback cleanup phase. - the handler replaced the resource: send a best effort Delete for the new id with the attempted properties and point the resource back at the old id and attributes, with no Update. CloudFormation sends this Delete in its cleanup phase; Floci sends it during the rollback. The old properties become the resource's own before the handler is called, as on AWS, which treats the rollback target as the resource's properties even when the handler fails it: a later DeleteStack sends them in its Delete and the next update sends them as OldResourceProperties. A FAILED answer throws with the handler's Reason, so the resource is UPDATE_FAILED and the stack UPDATE_ROLLBACK_FAILED, as on AWS, and the snapshot stays so a retry sends the same Update again. |
||
|
|
85e0061a6f |
feat(cloudformation): provision AWS::ApiGatewayV2::DomainName and ApiMapping (#5038)
* refactor(apigateway): move the v2 domain and API mapping rules into the service CreateDomainName and CreateApiMapping on /v2/domainnames kept their rules in ApiGatewayController: the one-configuration check, the refusal of inputs Floci does not emulate, the flattening onto the shared custom-domain store, the API and stage existence check, the mapping key conflict check, the API type the mapping is routed as, and the mapping id. A CloudFormation provisioner cannot reach a controller, so it would have had to copy them. They now live in ApiGatewayService. createV2DomainName validates the body and creates the domain; createApiMapping checks the API and stage, refuses a key that is taken and routes the mapping as the API's protocol type; getApiMapping, deleteApiMapping and apiMappingId follow. ApiGatewayService takes ApiGatewayV2Service for the API and stage lookup, so the whole rule sits in one place and a caller needs one service. Nothing on the v2 side depends on the v1 service, so this adds no cycle. Leaving the lookup in ApiGatewayV2Service was tried first, but then every caller had to resolve the API before calling into ApiGatewayService, and the rule was split across two classes again. The code is moved, not rewritten: messages, error codes, the order of the checks and the id scheme are unchanged, and the controller delegates. * feat(cloudformation): provision AWS::ApiGatewayV2::DomainName and ApiMapping Both types were left to the stub arm. A stack reported CREATE_COMPLETE, but no domain or mapping existed, Fn::GetAtt on the domain resolved to literals such as DomainResource.RegionalDomainName (so a Route 53 alias built from it pointed nowhere), and with allow-stub-unsupported-resource-types off the stack rolled back. ApiGatewayV2DomainCfnProvisioner creates them through the v2 rules in ApiGatewayService and injects only that service. Ref on a domain is its name and Fn::GetAtt returns DomainNameArn, RegionalDomainName and RegionalHostedZoneId as GetDomainName reports them. Ref on a mapping is its ApiMappingId, which is also its only attribute. Updates follow AWS. DomainName is the only createOnly property of either type, and everything else changes in place: the domain's configuration is replaced as a whole, as DomainNameConfigurations is on AWS, and a mapping's ApiId, Stage and ApiMappingKey change without a new id. To keep the id across a key change, a mapping now stores the apiMappingId it was given instead of deriving it from its key on every read. A record persisted before is still read under the derived id, and a new mapping gets the id it always had unless another mapping holds it. Deriving the id and documenting the difference was the first version; it was dropped because Ref changed where AWS keeps it, and the change set already reported the key change as an update. A replacement creates the new entity and leaves the displaced one to ReplacementCleanup, so it is deleted in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS, kept under UpdateReplacePolicy: Retain, and put back when a later resource fails the update. The first version deleted the old domain inside provision, as the v1 provisioner does, and a failed rename then ended in UPDATE_ROLLBACK_FAILED with the original domain and its mappings already gone. A mapping moved to another domain gets an id the displaced mapping does not hold, since two mappings under one physical id cannot be told apart, and the domain of each displaced id is recorded beside the cleanup. An in-place update snapshots what it changes, so a failed stack update restores it instead of ending in UPDATE_ROLLBACK_FAILED. CDK templates needed the v2 rules to match AWS in two more places. apigateway.DomainName with a multi-level basePath maps a REST API through AWS::ApiGatewayV2::ApiMapping, so a mapping now accepts a REST API stage. And the restrictions AWS documents for API mappings are enforced, in the API and in templates alike: no v2 call on an edge-optimized domain, with AWS's message; TLS_1_2 for an HTTP API or a multi-level key, which also keeps such a domain on TLS_1_2; no WebSocket API beside an HTTP or REST API; and AWS's key characters and length. The id-only delete accepts <ApiMappingId>|<DomainName>, the type's primary identifier, which is how Cloud Control names a mapping; a bare id still answers NotFoundException, so Cloud Control cannot report a delete that did not happen. The integration test deploys two templates aws-cdk-lib 2.272.0 synthesized, checked in with the app that produced them, and compat-cdk deploys the same shapes. * fix(apigateway): answer v2 domain and API mapping calls as API Gateway does The review of this PR found four places where Floci answered differently from API Gateway. Each was measured against API Gateway in eu-west-1 on 2026-10-04, with an imported certificate on a throwaway domain. An HTTP API custom domain is regional. CreateDomainName and UpdateDomainName with an endpoint type of PRIVATE, or one API Gateway does not know, give a REGIONAL domain, where Floci refused the first and stored the type on an update. EDGE is refused with "EDGE endpoint type is not supported for APIGatewayV2 domainName", not the message for v2 calls on an existing edge-optimized domain. API mapping keys are checked as API Gateway checks them, with its messages: a key does not end with '/', does not start with '/' or hold '//', holds letters, digits and $-_.+!*'(), between its levels, and is at most 300 characters. No key, an empty one, or on a create one of whitespace only, is the root; an update refuses whitespace only. Floci took "/" for the root and had its own message for the characters, without the comma. UpdateApiMapping and UpdateDomainName answer over the v2 HTTP API, not only from CloudFormation. What an UpdateApiMapping leaves out keeps its value. Cloud Control identifies an AWS::ApiGatewayV2::ApiMapping by the type's primary identifier, <ApiMappingId>|<DomainName>, while CloudFormation's Ref stays the bare id: CloudControlService derives the identifier from the desired state, as it already names primary identifier fields by type, and the provisioner deletes by it with the create-time attributes too. * fix(apigateway): refuse a v2 update of an edge domain, and recover a compound identifier whole The second review pass found three gaps in the previous commit. UpdateDomainName through the v2 API converted a v1-created edge-optimized domain to REGIONAL. The v2 API does not manage an edge-optimized domain, so the update is refused with the message every other v2 call on one gets, and the CloudFormation in-place update goes through the same check. A v2 UpdateDomainName without a configuration returned the domain unchanged without looking at the rest of the body, so a mutual TLS request was silently dropped. ApiGatewayService.updateV2DomainName now refuses what Floci does not emulate, and the edge-optimized domain, either way. Cloud Control's recovery of a create that finished just before a restart took the identifier after the last '|' of its key, which for an API mapping's <ApiMappingId>|<DomainName> left only the domain. It now takes everything after the key's third separator. A later review pass found four more points. UpdateApiMapping fills in what its body leaves out under the lock the update takes, so two partial updates of one mapping cannot write back each other's old values. A v2 domain's certificate is stored as the v1 API's regional certificate, which is what a regional domain reports through both APIs; a domain the v2 API wrote before still reports the one it holds until its configuration is replaced. The domain ARN both APIs and both CloudFormation provisioners build comes from ApiGatewayService.domainNameArn, the Cloud Control test waits with the awaitSuccess helper main has since gained, and requireMappingAllowed's javadoc is back on it. |
||
|
|
bfa9c2fbcc |
feat(cloudformation): provision Application Auto Scaling targets and policies (#5407)
* feat(cloudformation): provision Application Auto Scaling targets and policies AWS::ApplicationAutoScaling::ScalableTarget and ::ScalingPolicy had no provisioner, so a template that scales an ECS service failed on those two resources although the Application Auto Scaling service behind them, including the ECS capacity adjuster, was already there. This wires the two together. A scalable target has no name of its own: it is keyed by the triple of service namespace, resource id and scalable dimension, and CloudFormation's Ref is those three joined by a pipe. That composite is the physical id, which is also what a policy's ScalingTargetId carries when a template points one at the other with Ref, so the provisioner splits it back into the triple. A policy's Ref is its ARN rather than its name, so deleting one resolves the ARN through findPolicyByArn to recover the name and triple the service deletes by. Because the target's id is derived from the triple, changing any part of it replaces the target rather than updating it, so both types go through ReplacementCleanup to deregister what they displaced. Deletes tolerate only ObjectNotFoundException through CfnDeletes.safeDelete: a target takes its own policies with it, so a stack teardown reaches an already-deleted policy by ordinary ordering, while any other failure still surfaces as DELETE_FAILED. The properties each schema marks required are enforced rather than defaulted. MinCapacity and MaxCapacity on a target, and PolicyName and PolicyType on a policy, would otherwise register a target that never scales or accept a template CloudFormation itself rejects. The two scaling configuration blocks are parsed by the same code the PutScalingPolicy API path uses, extracted to ScalingConfigurationParser, since CloudFormation spells their members exactly as the API does. One parser means a template and an API call cannot disagree about what a policy means. ScheduledActions on a target is logged rather than dropped silently: Floci does not run scheduled scaling, and a template that scales on a clock should not look fully provisioned when nothing is scheduled. * fix(cloudformation): resolve intrinsics inside the scaling configuration blocks Review on #5407: the two scaling configuration blocks and SuspendedState reached the parser as raw template JSON, so an intrinsic inside one was never resolved. That is worse than it sounds, because an intrinsic is still a non-null node: hasNonNull passes and the value is read with asDouble, asText or asBoolean, which answer 0, "" and false. A policy written as TargetValue: !Ref TargetCpu registered as a policy targeting 0 percent rather than failing, a ResourceLabel built with Fn::Join arrived empty, and a flag behind Fn::If read false. Each block now goes through ctx.engine().resolveNode first, which is what AutoScalingScalingPolicyCfnProvisioner already does with its own block. Only nested objects were affected: the top-level properties were already read through ctx.resolveOptional, which resolves. A target's Tags were dropped as well, passed to the service as an empty map rather than read with ctx.resolveTags. ScheduledActions now carries a note in the generated resource-type table rather than only a warning in the log, so the gap is visible before someone wonders why their clock-based scaling never fires. * test(cloudformation): make the SuspendedState intrinsic test fail without its fix Review on #5407: anIntrinsicInsideSuspendedStateIsResolvedToo passed against the previous commit too. REFS had no Suspend entry, so the flag resolved to an empty string and read false either way, and assertNotNull held regardless because the raw block was already an object. The test pinned nothing. REFS now maps Suspend to true and the assertion is on isDynamicScalingInSuspended(), so it fails with expected: <true> but was: <false> when SuspendedState is read without resolveNode. The redundant copy of the properties node is gone. |
||
|
|
61fe304619 |
feat(cloudformation): provision CloudFront public keys, key groups and functions (#5390)
* fix(cloudfront): reject CreateFunction when the name already exists * feat(cloudformation): provision CloudFront public keys, key groups and functions * fix(cloudformation): validate CloudFront function properties and always drop its tags on delete * fix(cloudformation): require the CloudFront function comment and reuse resolveOptional |
||
|
|
475d230ebc |
feat(cloudformation): provision ElastiCache cache clusters and subnet groups (#5307)
* feat(cloudformation): provision ElastiCache cache clusters and subnet groups Add AWS::ElastiCache::CacheCluster and AWS::ElastiCache::SubnetGroup provisioners with Ref, Fn::GetAtt endpoint attributes, create-only replacement and update handling. Subnet group updates now carry tags through modifyCacheSubnetGroup, and Memcached clusters record their network type. * fix(elasticache): validate cluster name, rollback subnet groups and preserve memcached tags * fix(elasticache): align in-use error wire code and enforce schema required properties |
||
|
|
233d05eab1 |
docs(cloudformation): scope required AppSync resources (#4897)
The AppSync page did not say which AWS::AppSync resource types CloudFormation provisions, what Ref and Fn::GetAtt return for them, or what happens to the AppSync types Floci does not serve. A CDK app that deploys a GraphQL API had to read the provisioner to find out. The page now has a CloudFormation section. It lists the six provisioned types with their Ref value and Fn::GetAtt attributes, and the differences measured by deploying the same template to AWS and to Floci: Ref on GraphQLApi and ApiKey returns the id where AWS returns the ARN, GraphQLEndpointArn is not modeled, the URL and DNS attributes point at Floci, and AWS refuses Fn::GetAtt Id on a GraphQLSchema while Floci resolves it. It also states that a schema given only by S3 location and S3 code locations are refused, and that the remaining AppSync types are stubbed by default. The generated CloudFormation resource-type table gets a row note with the Ref difference and a link to that section. |
||
|
|
f248eb51af |
fix(cloudformation): send the stack's StackId to custom resources (#4861)
AWS documents StackId in every Create, Update and Delete request as the ARN of the stack that contains the custom resource, and handlers rely on it. #4973 now passes the engine's stack id and stashes it for Delete, but an engine with no stack ARN still leaks a non-ARN: Cloud Control's standalone engine uses the stack name as its id, so its custom resources got StackId "cloudcontrol". A stack id is now minted when there is no stack ARN to send. A resource created through Cloud Control has its minted id stashed at Create, so its Delete repeats it. A resource stashed by an earlier release with no __FlociStackId, or with a non-ARN one, gets a freshly minted ARN on Delete, because the delete path does not reach the stack. An integration test drives Create, Update and Delete through a mocked handler and checks the event's StackId against Ref AWS::StackId and DescribeStacks, including a nested stack's own id, and the docs say so. |
||
|
|
ee2d1a68a6 |
feat(cloudformation): pass Lambda DurableConfig through (#5218)
* feat(cloudformation): pass Lambda DurableConfig through AWS::Lambda::Function.DurableConfig reaches CreateFunction and UpdateFunctionConfiguration. As on AWS, a RetentionPeriodInDays the template leaves out is 14 on update too, a durable function created without Timeout gets min(ExecutionTimeout, 900), and adding or removing DurableConfig replaces the function. * test(terraform): cover aws_lambda_function durable_config The provider creates a durable function, reads it back without a diff, updates execution_timeout in place, and before destroy stops a RUNNING durable execution through ListDurableExecutionsByFunction, StopDurableExecution and GetDurableExecution. * fix(cloudformation): honor AWS::NoValue, cleared keys and large numbers in DurableConfig A DurableConfig that Fn::If removes with AWS::NoValue leaves the function plain. A KMSKeyArn the template leaves out or sets to "" clears the key, as CloudFormation does on AWS, since Lambda keeps a stored key when the update omits the member. A number beyond an integer reaches Lambda unchanged, so its range check rejects it. * fix(cloudformation): reject a DurableConfig that is not an object Only an intrinsic that resolves to AWS::NoValue removes DurableConfig. CloudFormation rejects a string, number or list in its schema check before the function is touched, so an update with one no longer replaces and deletes a durable function. * test(cloudformation): cover Lambda DurableConfig with the AWS SDK The CloudFormation and Lambda SDK clients create a durable function, update DurableConfig in place, and remove it by replacing the function. * fix(cloudformation): require ExecutionTimeout and known members in DurableConfig CloudFormation checks DurableConfig against the schema on update too: an update without ExecutionTimeout, or with a member the schema does not list, fails before the function is touched. Floci let such an update through and kept the old timeout. * refactor(cloudformation): look up a Lambda function once per deploy The name choice and the replacement decision now share one lookup and one durable check, so they cannot disagree. |
||
|
|
4be8309e8d |
feat(cloudformation): provision AWS::IoT::Authorizer (#4830)
* test(cloudformation): cover AWS::IoT::Authorizer against AWS * feat(cloudformation): provision AWS::IoT::Authorizer CloudFormation stubbed AWS::IoT::Authorizer with a fake ARN and created nothing. IotAuthorizerCfnProvisioner now creates a real authorizer through IotAuthorizerService. Ref is the authorizer name and Fn::GetAtt Arn the ARN. A missing AuthorizerFunctionArn fails with the registry's model validation error before any call. Status, EnableCachingForHttp, AuthorizerFunctionArn and the token settings update in place, sending only the declared properties, tags are reconciled, and a failed stack update restores them from a snapshot. Changing AuthorizerName or SigningDisabled replaces the authorizer and deletes the old one once the update commits; a replacement that keeps an explicit name is refused. Delete deactivates the authorizer first and tolerates one already gone. Closes #4822 * chore(cloudformation): move the IoT authorizer snapshot constant It sat at the same insertion point as other pull requests' snapshot constants, so they could not be merged together. * fix(cloudformation): treat only an empty intrinsic result as AWS::NoValue for IoT authorizers * fix(cloudformation): undo an IoT authorizer update whose tag reconcile fails * fix(cloudformation): report a SigningDisabled change on an IoT authorizer as a replacement * fix(cloudformation): create an IoT authorizer over a dispatcher stub and refuse declaring its generated name * fix(cloudformation): refuse an IoT authorizer boolean that is neither true nor false * fix(cloudformation): never delete a dispatcher stub's id in replacement cleanup * fix(cloudformation): tell a stub from a migrated resource and roll back a stub migration that kept its id * fix(cloudformation): name an unnamed IoT authorizer <LogicalId>_<12 chars> as CloudFormation does |
||
|
|
c6304a26c8 |
feat(cloudformation): provision AWS::Transfer::User (#5076)
* feat(cloudformation): provision AWS::Transfer::User Adds the user type to TransferCfnProvisioner with in-place update and replacement. * Fix #4655 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * docs: count the IAM SSH public key operations in the service matrix Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> --------- Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
108f2b54bf |
feat(eventbridge): add ApiDestination target support (#4702) (#5009)
* feat(eventbridge): add ApiDestination target support (#4702) - Add ApiDestination, ApiDestinationState, and HttpParameters models - Implement CRUD operations for API destinations in EventBridgeService - Add CreateApiDestination, DescribeApiDestination, UpdateApiDestination, DeleteApiDestination, ListApiDestinations actions in EventBridgeHandler - Support HttpParameters on targets in PutTargets and ListTargetsByRule - Implement HTTP delivery to API destinations in EventBridgeInvoker with connection auth and SSRF protection - Add CloudFormation provisioning for AWS::Events::ApiDestination in EventsCfnProvisioner - Update docs and tests * fix(eventbridge): harden ApiDestination delivery and CloudFormation lifecycle - Throw on delivery failure so TargetDispatcher retries 429/5xx and connection errors and dead-letters permanent failures - Enforce InvocationRateLimitPerSecond per destination - Run the OAuth client-credentials exchange for OAUTH_CLIENT_CREDENTIALS connections - Reject non-http(s) endpoints and wildcard hosts, encode path parameter values, keep the query before any fragment, and stop logging URLs that may carry secrets - Resolve destination and connection ARNs only when they match the stored ARN - Validate every UpdateApiDestination field before applying any of them - Paginate ListApiDestinations with Limit and NextToken - Keep HttpParameters on AWS::Events::Rule targets and roll back AWS::Events::ApiDestination updates from a snapshot * fix(eventbridge): keep connection credentials authoritative and require a valid endpoint host - Apply target headers and query parameters before the connection's so a target cannot override its credentials, and replace header names that differ only by case - Reject endpoints without a parsed host (for example https://:8080/path) - Sweep stale rate-limit windows once the map grows * fix(eventbridge): make the ApiDestination rate limit check atomic Count permits inside ConcurrentHashMap.compute on an immutable window so the stale-window sweep can no longer remove a window another delivery is using, which let concurrent deliveries exceed InvocationRateLimitPerSecond. * refactor(eventbridge): drop the in-service InMemoryStorage constructor and tidy tests - Remove the compatibility constructor that instantiated InMemoryStorage inside EventBridgeService; tests pass the ApiDestination store explicitly - Import classes instead of qualifying them inline in the ApiDestination integration test - Surface worker failures in the concurrent rate limit test by checking each Future * docs: correct the EventBridge and IAM operation counts in the service matrix |
||
|
|
2749cd6fcd |
feat(cognito): provision user group attachments (#4806)
* feat(cognito): provision user group attachments Serve AWS::Cognito::UserPoolUserToGroupAttachment through a new per-service provisioner. Ref is <UserPoolId>|<GroupName>|<Username>, as measured on AWS. Every property is createOnly, so a change replaces the membership and the old one is removed in cleanup; delete tolerates a membership that is already gone. * test(cognito): read stack outputs with XmlPath * fix(cognito): attach users to groups from their recorded parts, as AWS does * test(cognito): cover pipe group names and alias updates, delete seeded pools * fix(cognito): remove an unrecorded attachment named unambiguously by its id * test(cognito): pin that a failed rollback keeps the replacement's recorded parts * fix(docker): finish a failed tar copy's writer before retrying * test(docker): wait for each attempt's tar writer instead of racing it Restores RetryingTarCopier.copyStreamed to its state on main: joining a failed attempt's writer could block on a writer stalled outside the pipe. * docs(cloudformation): note the no-op delete of a short membership id The class Javadoc said an unrecorded id that does not split into exactly three parts is refused. An id of fewer parts names no membership and its delete does nothing; only more parts is refused. * fix(cloudformation): keep __Floci attributes out of Fn::GetAtt Provisioners keep private state under __Floci attribute keys. Fn::GetAtt and Fn::Sub resolved them like any attribute, so a template could read, for example, an attachment's recorded pool, group and username, while AWS resolves no such attribute. They now resolve as unresolved, like any attribute a type does not have. * docs(cloudformation): note that custom resource Data keys under __Floci are reserved |
||
|
|
99a6b4050c |
feat(redshift-serverless): add running workgroups and Data API WorkgroupName support (#5012)
* feat(redshift-serverless): add running workgroups and Data API WorkgroupName support Redshift Serverless workgroups get full CRUD (Create/Get/List/Update/Delete), tagging by ARN, and the AWS::RedshiftServerless::Namespace and ::Workgroup CloudFormation types with dotted Fn::GetAtt keys taken from the registry schema. A namespace has at most one workgroup, and DeleteNamespace is refused while one is attached. Each workgroup runs a PostgreSQL container behind an authenticating proxy, sharing the managers and the proxy port pool with provisioned Redshift. Add GetCredentials, accept WorkgroupName (name or ARN) in the Redshift Data API, and push a changed namespace adminUserPassword down to the running backend. The runtime is re-attached when Floci restarts. Not covered: snapshots, usage limits, endpoint access, and COPY/UNLOAD/Spectrum on workgroups. * fix(redshift-serverless): stop the runtime when workgroup creation fails after it started If persisting the workgroup record failed after the container and proxy were already running, the runtime was left behind with no record. createWorkgroup now stops it (best effort) and releases the endpoint on the failure path. Fix the CloudFormation error for a NamespaceName change: suggesting a new WorkgroupName can never succeed because a namespace holds only one workgroup. * fix(redshift-serverless): reset omitted CloudFormation properties and order startup observers When UpdateStack drops a property from the template, the provisioner now sends its default (BaseCapacity, EnhancedVpcRouting, PubliclyAccessible, Port, TrackName, PricePerformanceTarget) instead of keeping the stored value, which matches CloudFormation semantics. MaxCapacity has no default and keeps its stored value. Give the workgroup StartupEvent observer a @Priority after RedshiftService so every persisted cluster has reserved its proxy port before workgroups restore theirs. Also remove an unused import and move DEFAULT_DATABASE to the top of RedshiftContainerManager. * fix(redshift-serverless): address review findings on password rotation and namespace updates - Roll the backend password back when a rotation cannot be completed or stored, and apply it last so validation failures never leave the backend ahead of the stored namespace. - Keep a workgroup endpoint reserved when its runtime cannot be stopped during clear(). - Reject an in-place DbName change in CloudFormation, since it is fixed at creation. - Reset an omitted KmsKeyId and DefaultIamRoleArn on CloudFormation updates. * fix(redshift-serverless): keep rollback failures from masking errors and drop stale GetAtt role - Do not reset the proxy password when the role restore fails, and attach restore failures to the original exception instead of replacing it. - Remove Namespace.DefaultIamRoleArn from the stack resource when an update no longer declares a default role. * docs: correct the Redshift Serverless operation count in the service matrix * fix(redshift-serverless): expose Workgroup.ConfigParameters through Fn::GetAtt * fix(redshift-serverless): parse ConfigParameters resolved from a GetAtt attribute * docs(redshift-serverless): list every unsupported operation group |
||
|
|
66f04cde25 |
feat(eventbridge): provision AWS::Events::Archive (#4818)
* fix(eventbridge): make UpdateArchive a partial update UpdateArchive reset the event pattern to null and the retention to 0 whenever a request omitted them. On AWS an omitted Description, EventPattern or RetentionDays keeps the stored value, an empty Description or EventPattern clears it, and RetentionDays 0 sets 0. * feat(eventbridge): provision AWS::Events::Archive CloudFormation stubbed AWS::Events::Archive with a fake ARN and created nothing. EventsArchiveCfnProvisioner now creates a real archive through EventBridgeService. Ref is the archive name and Fn::GetAtt Arn the archive ARN. ArchiveName is generated when omitted and kept across updates. Description, EventPattern and RetentionDays update in place, sending only the properties the template declares, and a failed stack update restores them from a snapshot. Changing SourceArn or ArchiveName, or dropping an explicit name, replaces the archive and deletes the displaced one once the update commits. A replacement that keeps an explicit name is refused with CloudFormation's custom-named resource error before any change. KmsKeyIdentifier is ignored. Closes #4815 * fix(eventbridge): reject an archive source that is not an existing bus of the account and region CreateArchive now checks EventSourceArn as AWS does, before the archive name: a bus in another account fails with AccessDeniedException, one in another region with ValidationException, and a bus that does not exist with ResourceNotFoundException. The AWS::Events::Archive provisioner goes through the same service call, so a stack can no longer reach CREATE_COMPLETE with an archive that could never capture an event. * test(eventbridge): roll back an in-place archive update when a later resource fails A stack update changes an archive's description and retention in place, then fails on a second archive whose source bus does not exist. The stack ends UPDATE_ROLLBACK_COMPLETE, DescribeArchive shows the original values and the second archive was never created. The golden case passes on AWS and is mirrored in the Floci integration test. * fix(cloudformation): refuse declaring a generated archive name explicitly Adding ArchiveName with the name CloudFormation generated for an unnamed archive asks AWS to replace the archive under the same custom name, which it refuses with the custom-named resource error and rolls the stack back. Floci took the in-place path and reached UPDATE_COMPLETE; the existing refusal now also fires when the previous name was generated. * fix(cloudformation): provision a real archive when updating a stack whose archive was stubbed A stack created before AWS::Events::Archive had a provisioner holds the dispatcher's stub, whose physical id names no archive. Its next update now creates the archive instead of failing to describe that id, and the stub id is left to the replacement cleanup. * fix(eventbridge): validate archive description, pattern and retention as CreateArchive and UpdateArchive do CreateArchive and UpdateArchive now reject a description over 512 characters, an event pattern over 4096 characters and a negative retention with the ValidationException AWS returns, all violations reported together. The check runs before the source, existence and duplicate checks, so it also fails the AWS::Events::Archive resource in a stack. |
||
|
|
2c544fdb9f |
feat(cloudformation): provision AWS::ApiGatewayV2::VpcLink (#5008)
* feat(apigatewayv2): implement UpdateVpcLink and VPC link tagging * feat(cloudformation): provision AWS::ApiGatewayV2::VpcLink * fix(cloudformation): keep VPC link and integration connection state on updates * fix(cloudformation): restore the integration connection when its own update fails |
||
|
|
ae0a591bb1 |
feat(cognito): provision user pool users (#4805)
* feat(cognito): provision user pool users Add a CloudFormation provisioner for AWS::Cognito::UserPoolUser. Ref is the username Cognito reports (the sub in an email-as-username pool). Every property is createOnly: a changed custom-named user is refused as on AWS, any other change replaces the user, and each delete targets the pool the user was created in. * fix(cognito): refuse a RESEND user pool user that already exists * fix(cognito): keep the user's pool out of Fn::GetAtt * fix(cognito): keep only owed users in the pool record |
||
|
|
9e178d77a0 |
feat(wafv2): provision web ACL associations (#4804)
* feat(wafv2): provision web ACL associations WafV2CfnProvisioner now serves AWS::WAFv2::WebACLAssociation with Ref ResourceArn|WebACLArn, as measured on AWS. Any property change replaces the pair through ReplacementCleanup. Delete disassociates only while the resource still uses that ACL, so cleanup of an old pair keeps the new one. Rollback re-associates the restored pair. * test(wafv2): cover ResourceArn replacement and read stack outputs with XmlPath |
||
|
|
bcb50b765f |
feat(cloudformation): provision Transfer Family servers (#4809)
* feat(cloudformation): provision Transfer Family servers * fix(cloudformation): clear Transfer update snapshot after success * test(cloudformation): cover Transfer tag rollback * fix(cloudformation): match Transfer server return values |
||
|
|
a338a430cc |
feat(cloudformation): provision Cloud Map namespaces and services (#4599)
* feat(cloudformation): provision Cloud Map namespaces and services AWS::ServiceDiscovery::PrivateDnsNamespace, PublicDnsNamespace, HttpNamespace and Service were stubbed, so a stack reported them created while nothing existed in Cloud Map and Fn::GetAtt resolved to literals. CloudMapCfnProvisioner creates them through CloudMapService. Ref returns the id; Fn::GetAtt exposes Id and Arn, HostedZoneId on a DNS namespace and Name on a service. An unnamed service is named <LogicalId>-<12 chars>, as measured on AWS. Description, DnsConfig, HealthCheckConfig and Tags update in place; a createOnly change replaces the resource through ReplacementCleanup, and a rolled-back replacement restores the createOnly record. A Ref to a Number parameter is coerced back to a JSON number for DnsRecords TTL and FailureThreshold. Closes #4596 * fix(cloudformation): roll back in-place Cloud Map updates An in-place namespace or service update followed by a later resource failing left the Cloud Map changes live and the stack in UPDATE_ROLLBACK_FAILED, since rollbackUpdate only undid replacements. The provisioner now keeps the description, DnsConfig, HealthCheckConfig and tags an in-place update overwrites and puts them back on rollback; a committed update drops the snapshot. * fix(cloudmap): reject DNS record type changes on service update UpdateService only changes the TTLs of a service's existing DNS records on AWS. An in-place CloudFormation update that changes the record types, or gives a DnsConfig to a service without one, now fails with InvalidInput instead of being applied, so it rolls back like on AWS and a rollback never has to remove a DnsConfig. * fix(cloudmap): accept only TTL changes in a service DnsConfig update UpdateService carries only DnsRecords on AWS and CloudFormation does not support a RoutingPolicy update. Comparing the record types as a set let a RoutingPolicy change or an added record of the same type through; the requested and stored DnsConfig now have to match apart from the TTLs. * fix(cloudmap): ignore DNS record order in a service DnsConfig update A TTL-only update that listed the same records in another order was rejected. The comparison now uses the sorted record types, so counts, types and RoutingPolicy still have to match. * test(cloudformation): restore a real HealthCheckConfig in the Cloud Map rollback test The in-place rollback test went from a null health check config to null, so dropping it from the snapshot would have passed. |
||
|
|
560de5c13f |
fix(tagging): find resources by the tags their own service holds (#4563)
* fix(tagging): list resources by the tags their own service holds
GetResources, GetTagKeys and GetTagValues merge the tagging store with every
ResourceProvider, so SQS, Lambda and Logs tags are discoverable. Resource type
filters now parse colon and leading-slash ARNs (function:f, log-group:x, /apikeys/k),
and TagResources/UntagResources write through to the owning TagHandler.
* fix(apigateway): expose tagged resources and API key tags to the tagging API
ApiGatewayService is a ResourceProvider for REST APIs, stages, API keys, usage plans and
domain names, and ApiGatewayTagHandler serves /apikeys/<id> ARNs, so GetResources finds
API Gateway resources by tag and tagging-API writes land on the API key itself.
* fix(cloudformation): forward AWS::Lambda::Function Tags
CreateFunction now receives the template Tags; an in-place UpdateStack untags dropped keys and retags the desired set, mirroring SqsCfnProvisioner.
* fix(tagging): scope global-ARN resources by region and clamp stale page tokens
Provider resources with an empty ARN region use their own region, stale page tokens
past the end return an empty page, and provider tags are copied inside the skip guard.
* test(compat): discover SQS, Lambda, Logs and API Gateway resources by tag
* docs(tagging): describe owning-service discovery
* fix(tagging): forward tags only for resources the owning service lists
* fix(apigateway): report the calling account and tag usage plans
* docs(cloudformation): note Lambda tag reconciliation on update
* fix(tagging): match declared resource types and scope owner writes to the request
API Gateway API key and usage plan ARNs must now name the key or plan at the
start of the resource part, so a nested /apikeys/ segment no longer tags the key.
* fix(tagging): match AWS type filters, regions and failure codes
Compared against a live AWS account: type filters, IAM listing, cross-region
TagResources and FailedResourcesMap entries now answer as AWS does.
* fix(cloudformation): keep Lambda tags added outside the template
* fix(tagging): route TagResources to V1 tag handlers too
* fix(apigateway): reject sub-resource ARNs when tagging a REST API
* fix(tagging): write tagging API tags through to SQS, Lambda and Logs
TagResources and UntagResources now reach the queue, function or log group's own tags through TagHandler beans qualified @TaggingApiOnly, so ListQueueTags, Lambda ListTags and Logs ListTagsForResource show them. The qualifier keeps these handlers off the /tags/{arn} and /v1/tags/{arn} paths, since each service defines tags in its own protocol.
* fix(cloudformation): forward SSM parameter tags
AWS::SSM::Parameter now applies its Tags after the overwriting put. On UpdateStack only the keys the previous template set and the new one drops are removed, tracked in the internal FlociSsmTemplateTagKeys attribute, so tags added outside the template are kept.
* fix(tagging): hide tagging-store copies of global resources
GetResources no longer lists an IAM role or user tagged through TagResources, since AWS never lists global resources.
* fix(tagging): reject every wildcard log group ARN
TagResources and UntagResources now send a log group ARN ending in :* to CloudWatch Logs even when the group does not exist, so it is rejected as in AWS instead of stored.
* fix(tagging): clear store tags on every untag
UntagResources now removes the keys from the tagging store for every ARN, even one the owning service rejects, so a copy stored earlier can always be cleared.
* fix(cloudformation): tag an adopted Lambda function
When CreateFunction conflicts and the provisioner adopts the existing function, the template's tags are now applied to it.
* fix(apigateway): tag only exact domain and stage ARNs
A domain or stage segment nested elsewhere in an API Gateway ARN, such as /restapis/<id>/domainnames/<d>, is now rejected instead of tagging that domain or stage.
* fix(cloudformation): leave an adopted Lambda function's tags alone
Adoption uses the existing function as it is, as before, so a function outside the stack keeps its tags.
* fix(cloudformation): record no template tag keys for an adopted Lambda function
An adopted function keeps its own tags, so a later update adds the template's tags without removing any it never set.
* fix(tagging): never list IAM ARNs from the tagging store
A role tagged through TagResources stays hidden after DeleteRole, as AWS never lists IAM resources.
* fix(tagging): fail a write when an owning service cannot be read
A provider that fails while routing TagResources or UntagResources now returns InternalServiceException instead of writing the tagging store and reporting success.
* fix(tagging): fail only unresolved ARNs when a provider cannot be read
A provider failure no longer fails the whole TagResources or UntagResources call; only ARNs whose owner could not be resolved are reported in FailedResourcesMap.
* fix(tagging): report another account's ARN instead of storing it
TagResources and UntagResources report an ARN from another account in FailedResourcesMap with AccessDeniedException, as AWS reports it per ARN, and never write it to the tagging store.
* fix(tagging): keep stored tags for an ARN an untag could not resolve
UntagResources leaves the tagging store unchanged for an ARN it reports as unresolved or from another account; an ARN its owner rejected is still cleared.
* fix(tagging): fail an unresolved ARN only when its own service cannot be read
A provider failure now only affects unlisted ARNs of the services that provider declares.
* fix(tagging): copy stored tags under the writers' lock
GetResources, GetTagKeys and GetTagValues no longer race a concurrent TagResources on a stored mapping.
* fix(apigateway): reject reserved tags when tagging a usage plan
TagResources on a usage plan now refuses floci:override-id as the other API Gateway tag paths do, instead of dropping it and reporting success.
* fix(apigateway): reject tag ARNs with an account or another region
The /tags path now answers an ARN with an account segment with BadRequestException and one naming another region with NotFoundException, as AWS does, instead of resolving the id in the caller's region.
* fix(ssm,lambda): reject tag keys outside the AWS pattern
AddTagsToResource, PutParameter, TagResource and CreateFunction now reject a tag key outside the AWS pattern or 1 to 128 characters with ValidationException, as AWS does, which also keeps the CloudFormation managed-key attributes lossless.
* fix(ssm,lambda): validate CloudFormation tag keys before changing the resource
* docs(tagging): say every handled ARN ending in :* reaches its service
* fix(tagging): read a negative pagination token as the first page
|
||
|
|
60d112542d |
fix(cloudformation): delete UPDATE_FAILED resources on DeleteStack (#4470)
* fix(cloudformation): delete UPDATE_FAILED resources on DeleteStack A failed update whose rollback cannot restore a resource leaves it UPDATE_FAILED with its physical id and the stack in UPDATE_ROLLBACK_FAILED. DeleteStack only walked CREATE_COMPLETE, UPDATE_COMPLETE and DELETE_FAILED resources, plus UPDATE_FAILED ones whose provisioner opted in, so every other failed resource was skipped without an event and the stack still reached DELETE_COMPLETE, leaving the role, log group or bucket behind. Delete every UPDATE_FAILED resource that has a physical id. Delete a CREATE_FAILED resource only when the provisioner marked its entity as created by the stack, as the create rollback does, since a failed create can name an entity that existed before. Closes #4467 * test(cloudformation): clean up the outside log group when the test fails * docs(cloudformation): list the resource statuses DeleteStack deletes * fix(cloudformation): mark a failed nested stack the operation created as stack-owned A nested stack whose child fails during creation came back CREATE_FAILED with the child's stack id but no ownership marker, so neither the create rollback nor DeleteStack deleted the child stack. * test(cloudformation): clean up the stack, role and log group when the test fails * docs(cloudformation): update the hasPendingRollbackCleanup javadoc now that DeleteStack no longer calls it |
||
|
|
4abba5a218 |
fix(lambda): preserve CloudFormation event source mapping options (#4316)
AWS::Lambda::EventSourceMapping now forwards MaximumBatchingWindowInSeconds, MaximumRetryAttempts, MaximumRecordAgeInSeconds, BisectBatchOnFunctionError, FilterCriteria, DestinationConfig and ScalingConfig to LambdaService, so a stack-created mapping matches an API-created one. On UpdateStack each of these that the template omits is sent as null, which clears it. ParallelizationFactor and TumblingWindowInSeconds are not modeled and remain ignored; the resource-type table notes this. Fixes #4313 |
||
|
|
34f4f72e82 |
fix(cloudformation): pass Lambda hot-reload code through to the Lambda service (#4093)
* fix(cloudformation): pass Lambda hot-reload code through to the Lambda service
AWS::Lambda::Function code of {S3Bucket: hot-reload, S3Key: /host/path} is
Lambda's bind-mount hot-reload convention: the bucket is a marker and the key
is a directory on the Docker host. The provisioner probed S3 for the pair
before calling CreateFunction, so no such object existed and the stack failed
with a ValidationError (or, with allow-stub-lambda-code on, quietly deployed
the stub handler).
Skip the S3 probe for the hot-reload bucket and hand the Code map to
LambdaService unchanged, which keeps enforcing hot-reload enablement, the
absolute-path rule and the allow-list, and reports its own error as the
resource status reason. Record a hot-reload code identity so a redeploy with
the same path is a no-op, and compare adopted functions by host path since a
hot-reload function carries no S3 bucket or key.
* fix(cloudformation): canonicalise the hot-reload code identity
LambdaService stores a hot-reload host path normalised (#4053), while the
provisioner recorded the raw template key as the code identity and compared
adopted functions against it. A template that spelled the same directory with
a trailing slash or a ".." segment, or a function adopted from a direct
CreateFunction, therefore looked like a code change and triggered an
UpdateFunctionCode that mounted the same directory again.
Build the identity from, and compare against, the normalised path. The raw key
still goes to Lambda so its validation and error messages are unchanged. Also
cover the documented SAM CodeUri form, s3://hot-reload//abs/path, through the
transform.
|
||
|
|
67f06c3ac9 |
feat(cloudformation): list a deleted stack and report its DeletionTime (#4246)
* feat(cloudformation): list a deleted stack and report its DeletionTime A deleted stack is already retained so DescribeStacks and DescribeStackEvents keep answering for it by stack id after the delete, but the record they answer with was incomplete in two ways. It carried no deletion time, so DescribeStacks reported DELETE_COMPLETE with nothing saying when. Stack now has a deletionTime, set as the stack reaches DELETE_COMPLETE from the same service clock the retention window uses, and the query handler emits DeletionTime wherever AWS does. ListStacks omitted deleted stacks entirely. AWS keeps one there as DELETE_COMPLETE long after DescribeStacks has stopped answering for it by name, which is how a client reconciles what it deployed against what is left, and a StackStatusFilter of DELETE_COMPLETE selects exactly those. Retained stacks are now merged into the listing, still scoped to the caller's account and region and still dropped once the window passes. A name reused after a delete lists twice, once per stack id, as it does on AWS. Resource Explorer reads the live map directly and is unaffected. Restores deleted-stack-retention-seconds to application.yml, which #849 dropped in a merge: the knob kept working on its @WithDefault, but the repository YAML is the source of truth for what a deployment actually runs. Pinned in the test YAML too, since the retention tests advance the clock past that exact window. Nothing here changes how a delete runs, and it does not make a multi-stack cdk destroy work: that client polls a destroy entirely by stack name, so a record retained by stack id, these two members included, never enters its path. DeleteStack does already return before the delete finishes, and the stack does pass through DELETE_IN_PROGRESS, but the whole delete completes in roughly 15ms, well inside one poll interval, so a client that starts watching when it issues the delete finds the stack gone by name on its first poll. Giving a deleting stack an observable window is separate work. * fix(cloudformation): set a stack's deletion time before publishing the status Stack.status is volatile and is documented as the publishing write of a deploy: a reader that observes a terminal status is guaranteed to observe every write that preceded it. deletionTime was assigned after it, outside that guarantee, so a DescribeStacks running concurrently with the last step of a delete could observe DELETE_COMPLETE while deletionTime was still null and answer with no DeletionTime element at all. Assigning it first puts it inside the same happens-before edge as the rest of the delete. The window is nanoseconds wide and no test can land in it reliably, so this carries none; the ordering rule is the thing being fixed, and the comment records it so the next edit here keeps it. * fix(cloudformation): retain a deleted stack before it leaves the live map The handover at the end of a delete removed the stack from the live map, wrote its removal through to storage, and only then retained it as deleted. A ListStacks landing between the removal and the retention found it in neither map and dropped it from the listing, though the stack both existed a moment ago and is retained a moment later. Retaining before removing closes that window. The stack is then briefly in both maps, which is harmless: they hold the same Stack, and listStacks now reduces by stack id, so it is listed exactly once throughout. Nothing else reads both maps, since resolveStackForDescribe consults the retained one only after the live lookup has missed. Greptile reported the listing could also show the stack twice. It could not: the old order removed before it inserted, so the two maps never overlapped. The duplicate only becomes possible with this ordering, which is why the reduction comes with it. The test drives 60 deletes with four concurrent listings each. It fails on every run against the old ordering and passes on every run against this one. It pins the retention window open through a profile: the window is measured on the test MutableClock, which advances on every read, and the pollers would otherwise expire the retained record themselves. * style(cloudformation): order the Stream import with the rest of java.util java.util.stream.Stream landed between java.util.regex and java.util.concurrent when it was added. It now follows both, the order AGENTS.md asks for. Only the line this branch introduced moves; the block's older irregularities are left where they are. * fix(cloudformation): read the live stacks before creating the deleted-stack view Retaining a stack before removing it keeps it in at least one map at every instant, but listStacks built both of its views up front, the retained one first and the live one after. A ConcurrentHashMap view reflects the table at some point at or since its own creation and is not guaranteed to reflect a modification made after it, so the retained view, created before the retain, need never show the stack, while the live view, created after the remove, can already miss it. A listing landing there loses the stack in both, which is the window the retain-before-remove ordering was meant to close. Traversing the retained view second does not help: creation bounds the guarantee, not traversal. The maps are now read one after the other instead of through a concatenated pipeline, the live one first and in full, so the retained view is created after any remove the live pass could have missed, and therefore after the retain that preceded it. The reduction by stack id stays: the overlap it covers is real. No test. The fault is the absence of a JDK guarantee rather than a behaviour: these views do in practice reflect a later put, so the old ordering passes every time and nothing can force it not to. The existing listing-race test still covers the retain-before-remove ordering this rests on. The java.util.stream.Stream import goes with Stream.concat, which the change removes. * test(cloudformation): stop the listing-race pollers on every exit path The pollers were stopped after awaitDeleted returned, so a throw from the delete or the wait left four non-daemon threads spinning on listStacks for the rest of the run. That holds the test JVM open and buries the failure that caused it under a hang, which is a far worse thing to debug than the failure itself. Shutdown moves into a finally, so a failing delete stops them on its way out. Each join is bounded and a thread still alive afterwards is interrupted and recorded, with the poller loop now checking its own interrupt flag so that interrupt is not merely decorative. The check that they all stopped is asserted after the try and never inside the finally, where it would replace whatever the delete threw with its own failure. The threads are daemons as a backstop, so a future edit that throws somewhere nothing throws today still cannot wedge the suite. Also replaces an assertTrue(false, ...) in the wait helper with fail(...), which says the same thing and reads as what it is. Noted here rather than slipped in. |
||
|
|
28ca34ad6c |
fix(cloudformation): apply an S3 bucket's declared configuration and its policy (#3950)
S3CfnProvisioner translated CorsConfiguration and VersioningConfiguration and nothing else, and AWS::S3::BucketPolicy took a physical id and stopped, so a stack reported CREATE_COMPLETE for a bucket with no lifecycle, no public-access block, no default encryption, no tags and no policy. PublicAccessBlockConfiguration, LifecycleConfiguration, BucketEncryption and Tags are now translated into the XML their S3 API calls take and handed to the same service methods, so they are validated and stored exactly as a direct PutBucket* would be. The policy document has its intrinsics resolved and is put on the bucket. The policy's physical id is the bucket name, as the registry schema's primaryIdentifier declares, and deleting the resource removes the policy, tolerating a bucket the stack already deleted. The class javadoc names the properties that are covered and those still dropped. Closes #3947 |
||
|
|
8af15a71c4 |
fix(cloudformation): remove the login profile when deleting an IAM user (#3975)
Since login profiles became real state, DeleteUser returns DeleteConflict while one exists, so deleting a stack whose AWS::IAM::User was given a password out of band ended in DELETE_FAILED. The provisioner now deletes the login profile before the user, tolerating a user that has none. The resource-type table notes that the template LoginProfile and PermissionsBoundary properties are ignored. |
||
|
|
d9a4db0290 |
fix(cloudformation): provision Cognito user pool groups (#3695)
* fix(cloudformation): provision Cognito user pool groups Create and reconcile user pool groups, and namespace custom schema attributes while preserving standard attributes. * fix(cloudformation): keep a generated Cognito group name across updates GroupName is optional, and provision generated a fresh stand-in on every call. Because provision is also the update path, the second UpdateStack derived a different name, took the create branch and left the group the stack already owned orphaned behind it. Use ProvisionContext.stablePhysicalName so the prior physical id is reused when the template does not name the group, and reusesPriorEntity for the create-or-update choice, which is the pairing that keeps a stable name from turning an update into a duplicate create. |
||
|
|
0142d443ac |
feat(cloudformation): provision CloudWatch log streams (#3869)
* feat(cloudformation): provision CloudWatch log streams * fix(cloudformation): preserve conditional log stream name omission --------- Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com> |
||
|
|
22b0627245 |
test(compat): assert recorded metric filter publishing through the SDK modules (#3809)
* feat(logs): add metric filters with per-event metric publication Implements PutMetricFilter, DescribeMetricFilters, DeleteMetricFilter and TestMetricFilter on the CloudWatch Logs JSON 1.1 handler, backed by a filter pattern engine for term, space-delimited and JSON patterns. The grammar is checked against 148 TestMetricFilter cases recorded from AWS, kept as fixtures under src/test/resources/cloudwatchlogs and recaptured with the opt-in script under tools/aws-capture/cloudwatchlogs. Validation follows the observed AWS wire behavior: the five regex-bearing filters per log group quota is shared with subscription filters through one canonical backend monitor, a filter pattern may hold at most two regular expressions, defaultValue must be a JSON number, DescribeMetricFilters requires metricName and metricNamespace together in both directions, and TestMetricFilter reports one-based event numbers with an empty public extractedValues map for JSON patterns. Ingested events publish samples into CloudWatch Metrics per event at the event timestamp: matching events contribute the extracted or literal value, non-matching events contribute defaultValue, dimensions are all-or-none, and system dimensions only attach to matching events. Failed publications are retried from a bounded queue of 10,000 samples with stable publication ids. Resettable gains beforeReset and afterReset default hooks so the metric filter publisher can pause and drain before a state reset wipes storage and resume afterwards. EmulatorInfoController.performReset is serialized and calls the hooks around the existing container teardown and storage wipe, running afterReset in a finally block so a failed wipe cannot leave a publisher paused. The GetMetricStatistics and GetMetricData Query responses now carry the CloudWatch namespace so both read paths return the same samples. * feat(cloudformation): provision AWS::Logs::MetricFilter Adds LogsMetricFilterCfnProvisioner for creates, in-place updates, name changes and deletes. Ref and PhysicalResourceId are the filter name alone, as observed on AWS; the log group is kept as private resource metadata. A replacement deletes the old filter before creating the new one, matching the DELETE then CREATE event order AWS emits, and a failed replacement recreates the previous definition on rollback. Every mutation records an APPLIED, NOT_APPLIED or UNKNOWN outcome under the service lock so a failed or ambiguous call can never authorize deleting or overwriting a filter the stack does not own. Ownership that cannot be proven is resolved conservatively before the next mutation. The engine gains three small provisioner hooks that this type needs and others may reuse: - ProvisionContext carries a progress consumer so a provisioner can emit the intermediate DELETE_IN_PROGRESS and DELETE_COMPLETE events of a delete-first replacement while provision is still running. - rollbackUpdate(resource, progress) lets a provisioner restore its own previous state during UPDATE_ROLLBACK and report the steps as events. - hasPendingRollbackCleanup and retainsFailedUpdateState let a provisioner tell the engine that an UPDATE_FAILED resource still holds its own rollback snapshot, so the engine neither restores the previous resource over it nor refuses a later DeleteStack. Both default to false; only this provisioner overrides them. The type is listed in supported-resource-types.tsv, the generated resource table and CfnProvisionerFixture, with unit, integration, storage reload and SDK coverage. * docs(logs): document metric filters and the AWS verification record Describes the metric filter operations, publication semantics and CloudFormation support in docs/services/cloudwatch.md and adds cloudwatch-metric-filters-verification.md, the record of what was observed on AWS in eu-west-1, with which tools, and where each recorded fixture came from. Registers the handler and the verification page with the docs tooling and teaches the service inventory test to count facet pages. * feat(logs): publish metric filter samples off the PutLogEvents thread PutLogEvents evaluated each filter and wrote one CloudWatch Metrics sample per filter and event on the request thread while holding the filter-store monitor, up to a million writes for a maximal request, so ingestion latency depended on the Metrics sink and every PutMetricFilter waited behind the whole batch. The request thread now only evaluates the group's filters as they are at ingestion and hands the resulting immutable samples, with their stable publication ids, to a bounded queue of 100,000 samples. The existing single worker drains it and writes one sample per monitor acquisition, so a PutMetricFilter or a reset waits for at most one write. A batch that does not fit the queue is written inline on the request thread rather than dropped. Failed writes still land in the 10,000 sample retry map with the same ids and cadence as before. Reset pauses the worker, discards queued and failed samples and bumps a generation counter so a batch taken before the reset is never written into the wiped store. Shutdown drains the queue before storage shuts down and clears the retry map only after the worker has terminated. Samples ingested while Metrics is disabled are discarded at startup. Integration and SDK tests poll for the sample, as they would against AWS. * test(compat): assert recorded metric filter publishing through the SDK modules Extends the Java compatibility module with the publishing scenarios recorded from AWS: mixed defaults and quiet traffic, extraction and ordinary dimension series, system dimensions on matches only, and a Sum alarm driven by quiet defaults. Each series is read through the SDK's CloudWatch JSON protocol and again as a signed legacy Query request, so GetMetricStatistics and GetMetricData agree on every sample, timestamp, unit and dimension set. Expected values come from module-local copies of the root fixture metric-filter-publishing-aws.json. MetricFilterFixturePackagingTest checks the Java copy loads from the classpath and the root CloudWatchLogsMetricFilterFixturePackagingTest fails when either SDK module copy drifts from the root file. The Python module gains tests/metric_filter_replay.py, an opt-in replay of the same scenarios against a Floci endpoint or, with explicit profile, region and write acknowledgement, against AWS. Its logic is covered offline by tests/test_metric_filter_replay.py with the network blocked. Both module Dockerfiles are unchanged: the Java image already runs the whole suite and the Python image already copies tests/. * test(compat): assert every recorded statistic and poll for published samples The SDK publishing assertions compared only Sum and SampleCount although the AWS fixture also records Minimum and Maximum for the default-value scenarios. Both the SDK JSON reads and the signed legacy Query reads now assert every statistic the fixture carries, on GetMetricStatistics and GetMetricData. Publication now happens shortly after PutLogEvents returns, so present series are polled and absent series are asserted only after a later positive control of the same filter is visible, which the publisher's ordering guarantees. The read window ends at second 59 so a sample stamped on the following minute is never in scope. The live replay's Region check names the commercial partition explicitly. botocore already defaults get_available_regions to partition_name="aws", so GovCloud and China Regions were rejected before; the offline test now pins it. * test(compat): keep the metric filter SDK test on the Java 17 API of the compat image List.getLast() is Java 21; the sdk-test-java image compiles with Temurin 17. |
||
|
|
2ee3aa67c0 |
feat(apigateway): support Gateway Responses on REST APIs (#3326) (#3585)
Add the PutGatewayResponse / GetGatewayResponse / GetGatewayResponses /
UpdateGatewayResponse / DeleteGatewayResponse family, keyed per REST API by
responseType across the 21 AWS types. Uncustomised types are reported with
defaultResponse=true, their AWS default statusCode and the default
{"message":$context.error.messageString} template; UpdateGatewayResponse
patches /statusCode, /responseParameters/<name> and
/responseTemplates/<content-type>, and DeleteGatewayResponse restores the
default.
ImportRestApi and PutRestApi read the x-amazon-apigateway-gateway-responses
extension, and AWS::ApiGateway::GatewayResponse is provisioned by a new
CloudFormation provisioner whose Ref / Fn::GetAtt Id is
<restApiId>-<responseType>.
On the execute plane every gateway-generated answer (unmatched path or
method, AWS_IAM and Lambda authorizer rejections, missing API key, request
validation, unsupported media type, integration configuration errors and
Lambda proxy failures) resolves the customisation for its type, then
DEFAULT_4XX / DEFAULT_5XX, and applies the configured statusCode, the
gatewayresponse.header.* parameters (static, method.request.*, context.*,
stageVariables.*) and the response templates, with $context.error.* exposed
to VTL. An expired SigV4 signature selects EXPIRED_TOKEN and a malformed or
mismatching one INVALID_SIGNATURE, as AWS keeps those two contracts apart.
This is what puts Access-Control-Allow-Origin on a browser-visible
401/403/400 so the frontend can read the real status instead of a CORS
failure. Without a customisation every answer is unchanged.
Closes #3326
|
||
|
|
e5bd8be405 |
feat(redshift): provision AWS::Redshift::Cluster through CloudFormation (#3427)
* feat(cloudformation): provision AWS::Redshift::Cluster (create path) * feat(cloudformation): AWS::Redshift::Cluster update and replacement * feat(cloudformation): force replacement on Redshift cluster createOnly property change * feat(cloudformation): force replacement on Redshift cluster DBName change * feat(cloudformation): provision Redshift parameter, subnet and security groups * chore(cloudformation): register Redshift provisioner in inventory and docs * test(cloudformation): end-to-end AWS::Redshift::Cluster stack * docs(redshift): document CloudFormation cluster provisioning * test(cloudformation): assert ClusterSubnetGroupNotFound error code on subnet group deletion * fix(cloudformation): correct attribute handling for Redshift security group provisioning * fix(cloudformation): apply Redshift parameter group Parameters and fix docs ClusterParameterGroup silently dropped Properties.Parameters on both create and update instead of calling ModifyClusterParameterGroup, and did not replace the entity when Description or ParameterGroupFamily changed, even though AWS marks both as replacement properties. Also remove the Id GetAtt claim from the Cluster docs: neither the provisioner nor AWS's own schema expose it for AWS::Redshift::Cluster. |
||
|
|
55ada9b8a3 |
feat(cloudformation): provision the AppSync resource types (#3424)
Adds AppSyncCfnProvisioner, serving AWS::AppSync::GraphQLApi, GraphQLSchema, DataSource, FunctionConfiguration, Resolver and ApiKey. Without it a template's AppSync resources fall to the dispatcher's stub arm, which reports CREATE_COMPLETE while creating nothing and resolves Fn::GetAtt to the literal "LogicalId.Attr". Two things are not simple property mapping. The AppSync control plane is REST-JSON with camelCase members, so every property is lower-camelised on the way in, with DynamoDBConfig as the one member that does not follow the rule (it is dynamodbConfig). And schema creation is asynchronous: while it is PROCESSING every other call for that API is refused with a 409, so the GraphQLSchema resource waits for a terminal status before completing, as CloudFormation does. Also carries the service-layer changes the provisioner needs: a PIPELINE resolver reaches its data through pipelineConfig and names no data source, which createResolver refused outright; CreateFunction and UpdateFunction now keep the runtime a JS resolver declares; and UpdateFunction applies a new name, which a CloudFormation rename goes through. |
||
|
|
10becc593f |
feat(cloudformation): provision AWS::Lambda::Url (#3423)
A function URL in a template was falling to the stub arm, so a stack exported the literal string "LogicalId.FunctionUrl" in place of a URL and nothing was listening on it. The physical id is the FunctionArn the URL is attached to, the alias ARN when Qualifier names one, which is the registry schema's primary identifier and enough to address the config again since a qualified ARN parses back into function and qualifier. TargetFunctionArn and Qualifier are create-only, so an update that moves the URL creates against the new function and removes the one it displaced. |
||
|
|
460aa0718e |
feat(cloudwatch): provision AWS::CloudWatch::Dashboard (#3231)
* feat(cloudwatch): provision AWS::CloudWatch::Dashboard The dashboard name is the physical id, generated when the template gives none and kept across updates. An update with the same name puts the body again and drives the tags to the template's set, since PutDashboard leaves an existing dashboard's tags alone. A changed name creates the new dashboard and leaves the displaced one to the ReplacementCleanup record, which deletes it once the update commits or restores it on rollback. The body may be written as a JSON object in the template and is stored as the string the API takes. The CloudWatch docs now list the dashboard and tag actions the handlers already serve. * fix(cloudwatch): roll back in-place dashboard updates and replace a dashboard whose explicit name is dropped An in-place update keeps the body and tags it replaces on the resource, or the fact that the dashboard did not exist, and a failed stack update puts them back in full. The name mode is recorded as the Logs provisioner does, so a template that drops an explicit DashboardName gets a generated name and a replacement, as on AWS, while an unnamed dashboard keeps its generated name. The Tags list is checked against the schema's cap of 50 on every provision, since the tag operations an update reconciles through do not enforce it. The integration test reads stack events with XmlParser. * fix(cloudwatch): keep the dashboard rollback snapshot until the restore succeeds A restore that throws left no snapshot behind, so the next rollback attempt reported success without restoring anything. The snapshot is now spent only after the body and tags are back. * fix(cloudwatch): unwind a dashboard update that failed after it changed the body An in-place update puts the body and then reconciles the tags. When the tag calls failed, the exception left the dashboard carrying the new body while CloudFormationService put the resource the stack held before the attempt back in its place. That object never carried the snapshot taken by the attempt, so the walker marked it restored and skipped rollbackUpdate: the stack reported a completed rollback over a dashboard that still had the update's body, or a half reconciled set of tags. The mutating calls now unwind themselves through rollbackUpdate, the way IotDomainConfigurationCfnProvisioner unwinds a replacement, and report the resource restored. An unwind that cannot put the body back keeps the snapshot and records the failure on the resource, so the stack ends in UPDATE_ROLLBACK_FAILED rather than claiming the prior dashboard is intact, and the original failure is still what the stack reports. Tests: anInPlaceUpdateThatFailedOnItsTagsPutsTheBodyBack, anUnwoundInPlaceUpdateIsMarkedRestored, anUnwindThatCannotRestoreIsReportedAsARollbackFailure. * fix(cloudwatch): record a dashboard unwind failure before joining it to the update failure The unwind repeats the tag call the update just made, so a service that keeps failing hands the unwind the very exception that interrupted the update. Throwable.addSuppressed rejects a throwable suppressed under itself, and that IllegalArgumentException escaped the unwind before the rollback failure was recorded: the dispatcher reported "Self-suppression not permitted" as the resource failure, no failure attribute reached the stored resource, and the stack ended UPDATE_ROLLBACK_COMPLETE over a dashboard whose tags were never put back. The failure attribute is now written first and the two exceptions are joined only when they differ, as PipesCfnProvisioner does. Two stack-level tests drive the whole path through CloudFormationService with a spied CloudWatchDashboardsService, the way CloudFormationPipesCleanupIntegrationTest does: a one-off tag failure ends in UPDATE_ROLLBACK_COMPLETE with the prior body and tags live, a persistent one in UPDATE_ROLLBACK_FAILED naming the dashboard and carrying the unwind's reason. Tests: anUnwindThatFailsWithTheUpdatesOwnExceptionIsStillRecorded, anUpdateThatFailedOnItsTagsPutsTheDashboardBackAndTheStackRollsBackCleanly, aFailedRestoreLeavesTheStackInUpdateRollbackFailedNamingTheDashboard. |
||
|
|
895adce214 |
fix(cloudformation): provision CloudFront policies and origin access controls (#3228)
* fix(cloudformation): provision CloudFront policies and origin access controls AWS::CloudFront::ResponseHeadersPolicy, CachePolicy, OriginRequestPolicy and OriginAccessControl had no provisioner, so the dispatcher's stub arm reported CREATE_COMPLETE with a synthetic id and a distribution that referenced it failed with "The specified response headers policy does not exist." A new CloudFrontCfnProvisioner creates each type through CloudFrontService: the physical id is the service id, Fn::GetAtt exposes Id and LastModifiedTime (Id only for the origin access control, per the registry schemas), updates go through the service's etag-guarded update, and deletes tolerate only the type's own not-found code so an in-use policy fails the stack delete as on AWS. The response headers configuration is reshaped into the flattened form the service's codec stores through the new ResponseHeadersPolicyConfigCodec.fromItemsTree. Closes #2441 * fix(cloudfront): reject deleting a cache or origin request policy in use DeleteCachePolicy declares CachePolicyInUse and DeleteOriginRequestPolicy declares OriginRequestPolicyInUse, both 409 sender faults, and both are documented as refusing the delete while the policy is attached to a cache behavior. Floci checked only two of the four policy-shaped types: deleteResponseHeadersPolicy and deleteOriginAccessControl raised their in-use errors, while these two deleted unconditionally once the etag matched. A policy still referenced by a distribution could be removed, leaving that distribution pointing at something that no longer existed. Both now raise the modeled error after the etag check, matching the ordering the other two deletes already use. Cache, origin request and response headers policies all hang off the same two places, a distribution's default cache behavior and its ordered ones, so the three near-identical scans collapse into one helper that differs only in which id it reads. The per-distribution association count keeps its own entry point, since it asks about one config at a time and can be handed a distribution with none. Found while reviewing the CloudFormation provisioner in this PR, which was already written for this: its delete tolerates only NoSuch<Type>, so it fails the stack correctly now that the service raises the in-use error. The CloudFormation integration test covers that end to end: it attaches both policies to a distribution and still deletes the stack cleanly, because CloudFormation removes the distribution before the policies it references. Four tests: a cache policy attached to a default behavior and to an ordered one, an origin request policy in use, and an unattached policy still deleting. * test(cloudformation): parse stack outputs with XmlParser The CloudFront policies integration test pulled Outputs out of the DescribeStacks response with two regular expressions over <member> and <OutputValue> blocks. XmlParser.extractPairs already does exactly this, and seventeen sibling CloudFormation integration tests define the same one-line helper over it, so the twelve-line version was reinventing a shared utility. It also matches the repo's rule against parsing XML with regex. Behaviour is unchanged, including the failure message that names the missing key. * fix(cloudformation): roll back a recreated CloudFront policy on a failed update When an update finds the prior policy or origin access control already deleted out of band, the provisioner recreates it under a new physical id. If a later resource then failed the stack update, the rollback left that new object behind: the engine only deletes resources the update ADDED, inside the previous == null branch of rollbackUpdatedResources, so an existing resource that merely acquired a new physical id fell through to the "Rollback is not implemented" arm, which deletes nothing. ReplacementCleanup already models exactly this, and CognitoCfnProvisioner wires it for the same situation, so the provisioner records the displaced entity after each provision and delegates the cleanup hooks and rollbackUpdate to it. A rollback now names the prior id again with the attributes it carried and deletes the object the failed update created. The physical id changes here only when the prior object was already gone, since prior() returns the entity whenever the service still knows it, so the recorded displaced entity is always one that no longer exists and its cleanup delete is a no-op tolerated by the type's not-found code. The hooks are still needed, or a recorded entity would stay owed a delete forever. An in-place update keeps its physical id, so nothing is recorded and rollbackUpdate answers false: putting a committed in-place change back needs a configuration snapshot this provisioner does not keep, the same limitation AWS::Cognito::UserPool has. A test pins that so it stays a decision. Raised by the review on this PR. My first reply argued the finding did not hold, generalising from the create path; that was wrong for this one, and the correction is on the thread. |
||
|
|
fd3c4d9ab6 |
feat(cloudtrail): support AdvancedEventSelectors and CloudFormation Trail provisioning (#2720)
* feat(cloudtrail): support AdvancedEventSelectors in PutEventSelectors and S3 capture Adds AdvancedEventSelector/AdvancedFieldSelector models, JSON wiring through PutEventSelectors/GetEventSelectors, mutual-exclusivity enforcement against basic EventSelectors, and field-selector evaluation (Equals/NotEquals/StartsWith/NotStartsWith/EndsWith/NotEndsWith) in the S3 data-event capture path. Lets a trail exclude its own log-delivery bucket via resources.ARN NotStartsWith, avoiding the CloudTrail circular-logging cost problem. Basic-selector behavior is unchanged. * feat(cloudtrail): add CloudFormation provisioner for AWS::CloudTrail::Trail Handles create/update/delete of AWS::CloudTrail::Trail via CloudTrailService, applies EventSelectors or AdvancedEventSelectors (mutually exclusive, same JSON shapes as PutEventSelectors), starts logging when IsLogging is true, and sets the trail ARN as the resource's physical id and Arn attribute. Delete is idempotent when the trail is already gone. * feat(cloudtrail): implement ListTrails and trail tagging Adds ListTrails (returns Name/TrailARN/HomeRegion for trails visible in the region, including multi-region trails), plus AddTags/ListTags backed by per-trail stored state, keyed by trail name or ARN. * fix(cloudtrail): emit data events for the trail's own log deliveries CloudTrailLogWriter.flushTrail() wrote delivered log files via a direct S3Service.putObject() call, bypassing S3Controller.emitCloudTrailEvent() - the only place that recorded an S3 data event. A trail whose selector matched its own destination bucket (the exact circular-logging config from upstream issue #1192 / PR #1194) never saw its own deliveries, so the emulator could prove the dangerous config was live but not reproduce the loop it causes. flushTrail now calls cloudTrailService.emitS3DataEvent() after each delivery, so internal writes are evaluated against selectors identically to API-driven ones. Closes issues/0034. * docs: mark issue 0034 fixed * fix(cloudtrail): resources.type reflects actual S3 resource, not hardcoded object Advanced selector matching hardcoded resources.type to AWS::S3::Object for every event, so an object-scoped AdvancedEventSelectors exclusion (the real-world fix for the issue 0034 self-delivery loop) still let bucket-level calls like ListObjects through against the excluded bucket. Now derived per event from whether an object key is present. Live-verified on 1160-ct: loop confirmed unbounded and compounding with external writes, then confirmed stopped by the real AdvancedEventSelectors remediation, with this gap found and closed in the same pass. Details in issues/0034 and issues/0035. * docs(0034): add raw delivery-size timeline from 1160-ct verification Per-cycle size data showing the burst-compounding and the fix-stop point concretely, not just summarized. * fix(cloudtrail): match delete() to current CfnResourceProvisioner signature Upstream/main dropped the accountId parameter from CfnResourceProvisioner.delete() since this branch was originally authored; the provisioner never used accountId in its body, so the fix is a straight signature match with no behavior change. * docs(cloudtrail): regen action table and register CFN Trail resource type New ListTrails/AddTags/ListTags actions and the CloudFormation AWS::CloudTrail::Trail resource type need doc entries per the repo's docs-check gate. * fix(cloudtrail): enforce AddTags 200-tag list limit Botocore's AddTagsRequest.TagsList models a 200-item max (service-2.json, cloudtrail 2013-11-01); the handler accepted an unbounded list. RED test added first (addTagsRejectsMoreThanTwoHundredTags), confirmed failing (200 instead of 400), then fixed by rejecting oversized lists with TagsLimitExceededException, matching AWS's modeled error for AddTags. * fix(cloudformation): close two audit-control gaps in CloudTrailCfnProvisioner Local code review flagged two HIGH findings in the new CFN provisioner: - physicalId was only set after selector validation and startLogging succeeded, so a create that failed on the mutually-exclusive EventSelectors/AdvancedEventSelectors check left a real trail with no recorded physical id for the engine to clean up. Now set immediately after createTrail returns. - update only called startLogging when IsLogging was explicitly true, never stopLogging when it was explicitly false, so a template setting IsLogging: false on a currently-logging trail silently left logging enabled. RED tests confirmed both failures against the pre-fix code, then GREEN after the fix (6/6 provisioner tests, 51/51 CloudTrail suite). * docs(issues): ledger deferred CloudTrail local-review findings MEDIUM/LOW findings from the local code-review pass, plus a few inherited-not-ours items on code this branch didn't touch, that are real but out of scope for the CFN provisioner / advanced-selectors PR. * style(cloudtrail): brace unbraced conditionals in ListTrails and event-matching traversal Per AGENTS.md style rule (always use braces in conditionals). * fix(cloudtrail): avoid NPE on List.of(trailName) when TrailName is missing PutEventSelectors/GetEventSelectors called List.of(trailName) with a possibly-null trailName before findTrailOrThrow could validate it, throwing an NPE (500 InternalFailure) instead of the modeled TrailNotFoundException. Guard the lookup so the null flows through to the existing validation. * fix(cloudtrail): do not re-queue records on self-delivery emission failure flushTrail wrapped the self-delivery emitS3DataEvent call in the same try/catch as the S3 write. A failure there re-queued records that were already durably written, causing the next flush to redeliver the same batch. Split the write and the emission into separate try blocks so only a write failure triggers requeue. * docs(cloudformation): register AWS::CloudTrail::Trail in the resource-type inventory CfnResourceInventoryTest and the docs-sync resource-type table both derived from supported-resource-types.tsv, which never picked up CloudTrailCfnProvisioner's registration. * docs(issues): drop fork-local ledger files from the PR Per maintainer review, the issues/ ledger entries are fork-local tracking notes and are kept out of the upstream contribution. * fix(cloudformation): wire CloudTrailCfnProvisioner into CfnProvisionerFixture CfnProvisionerFixtureTest.everyProvisionerIsReachableThroughThePublicBuilderOrExplicitlyExempt failed because CloudTrailCfnProvisioner had no field, setter, or construction arm in the test fixture, so a test naming CloudTrailService would silently fall through to the stub arm instead of exercising the real provisioner. Add cloudTrailService field, cloudTrail(CloudTrailService) setter, and the discovered.add(new CloudTrailCfnProvisioner(...)) construction arm, mirroring the existing Route53Service wiring. * fix(cloudtrail): drop em-dashes from new test comments per AGENTS.md style check * fix(cloudtrail): reject mixed basic and advanced selectors with InvalidEventSelectorsException PutEventSelectors does not model InvalidParameterCombinationException; the error it declares for an invalid selector combination is InvalidEventSelectorsException (botocore cloudtrail/2013-11-01). Both the JSON handler and the AWS::CloudTrail::Trail provisioner now throw that code, and the integration test pins it. Also braces the remaining one-line conditionals in matchesAdvancedFieldSelector. |
||
|
|
af42564cb3 |
feat(lambda): provision AWS::Lambda::EventInvokeConfig (#3230)
* feat(lambda): provision AWS::Lambda::EventInvokeConfig The physical id is the registry schema's composite FunctionName|Qualifier identifier. A create puts the configuration, an update with the same identity applies the template's settings through the merge-style update call, and a changed function or qualifier is a replacement whose displaced configuration the ReplacementCleanup record deletes once the update commits or restores on rollback. The schema's MaximumRetryAttempts and MaximumEventAgeInSeconds bounds are checked before any call, as CloudFormation validates them before the handler runs. The Lambda docs now list the five event invoke config operations, which the page wrongly called not implemented, and say that asynchronous invocations do not yet apply the settings. * fix(lambda): update the event invoke config in place for equivalent names and roll back in-place changes A short name and the function's ARN address one configuration, so an update that changes between them updates in place under the prior physical id instead of recording a replacement whose cleanup would delete that one configuration. An in-place update keeps the settings it replaces on the resource, and a failed stack update puts them back in full. DestinationConfig is resolved before it is looked at, so a conditional that resolves to AWS::NoValue is omitted rather than sent as an empty destination set. The integration test reads stack events with XmlParser. * fix(lambda): keep the event invoke config rollback snapshot until the restore succeeds A restore that throws left no snapshot behind, so the next rollback attempt reported success without restoring anything. The snapshot is now spent only after the settings are back. |
||
|
|
0321ae0ac8 |
refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner (#3164)
* refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner
Batch 3 of the CloudFormationResourceProvisioner split. AWS::Cognito::UserPool and
AWS::Cognito::UserPoolClient join the provisioner that already owns UserPoolDomain;
the two arms, their switch cases, the type-list entries, the Cognito-only
resolveStringMapOrNull helper and the CognitoService dependency leave the monolith.
Behaviour is preserved except for what the split's conventions require:
- the create/update branch reads ctx.isUpdate() instead of the resource's physical
id, which provision overwrites as it runs
- deletes go through CfnDeletes.safeDelete tolerating only ResourceNotFoundException;
a pool that still has a domain keeps failing the stack delete with
InvalidParameterException, as on AWS
- the client also exposes Name, the read-only attribute the registry schema declares
(ClientName stays for now), so CfnSchemaCoverageTest needs no gaps row
- the ReplacementCleanup hooks are wired for both types; nothing replaces yet, so
they are inert until create-only properties are honoured
The unit test covers both types with a mocked service: request map and generated
names, update carrying the prior id, the exact attribute sets, positional client
arguments, and delete tolerance. The domain delete path now branches on type first,
since a pool resource also carries a UserPoolId attribute.
* fix(cloudformation): replace a Cognito user pool client when its create-only properties change
UserPoolId and GenerateSecret are createOnlyProperties in the AWS::Cognito::UserPoolClient
registry schema: on AWS a change to either creates a new client and deletes the old one
after the update commits. The provisioner passed the new pool id to UpdateUserPoolClient,
which fails with ResourceNotFoundException because a client is only found through the
pool that owns it, and a changed GenerateSecret was silently ignored since the update
call has no such parameter.
The provisioner now looks the prior client up by id, updates in place only when both
create-only properties are unchanged, and otherwise creates the replacement; the
ReplacementCleanup record deletes the displaced client once the update completes or
restores it on rollback. A prior client that is already gone is created anew. The by-id
describeUserPoolClient overload is new on CognitoService, mirroring its delete pair.
* fix(cloudformation): resolve Cognito UserPoolTags as the map the schema declares
AWS::Cognito::UserPool.UserPoolTags is an object (the type's tagProperty), not the
[{Key, Value}] list most types carry. The provisioner parsed it with the list helper,
which yields nothing for a map, so the tags only reached the service through the raw
property map, where a non-string tag value arrives as a number. The tags are now
resolved as a string map and put explicitly, on create and on update.
* fix(cloudformation): give Fn::GetAtt ProviderName on a Cognito user pool AWS's shape
The attribute returned the pool name. On AWS it is cognito-idp.<region>.amazonaws.com/<pool id>,
the value templates feed into an identity pool's CognitoIdentityProviders (CDK derives the
same string in UserPool.fromUserPoolArn). ProviderURL deliberately stays Floci's local
issuer, <base-url>/<pool id>, since that is the iss of the tokens Floci mints and a template
wiring it into a JWT authorizer must validate locally; the generated resource-type table
now says so.
* fix(cognito): apply PoolName on UpdateUserPool so a CloudFormation rename takes effect
UpdateUserPoolRequest carries PoolName in the service model and AWS::Cognito::UserPool
lists UserPoolName as updatable in place, but updateUserPool only ran populateUserPool,
which never sets the name, so a renamed pool kept its old name through both the API and
a stack update. The service now applies a non-blank PoolName.
The provisioner sends PoolName on update only when the template names the pool: an
unnamed pool keeps the name its first execution generated instead of being renamed to a
freshly generated one on every update.
* fix(cloudformation): expose only the schema's attributes on a Cognito user pool client
The AWS::Cognito::UserPoolClient registry schema declares ClientId, Name and ClientSecret
as its read-only properties. ClientName is a request property, not an attribute; on AWS
Fn::GetAtt Client.ClientName fails template validation, so no working template depends on
it. It is dropped in favour of Name.
* fix(cloudformation): validate Cognito user pool client properties instead of dropping them
A non-integer AccessTokenValidity, IdTokenValidity or RefreshTokenValidity was parsed to
null and silently ignored, so the template's intent was lost without a word. The
provisioner now fails the resource with ValidationError "Value of property X must be an
integer.", as the ECS provisioner does for DesiredCount. UserPoolId, the schema's one
required property, is likewise rejected when missing rather than passed through as null.
* test(cloudformation): cover Cognito user pool client replacement end to end
Through the CloudFormation API: a client moved to another pool and one whose
GenerateSecret flips are each replaced, with the displaced client gone once the update
completes; a rename updates the client in place; Fn::GetAtt Name and the pool's
ProviderName carry their AWS shapes; deleting the stack removes client and pools.
* fix(cloudformation): drop a stale ClientSecret attribute when a replacement client has none
The engine hands an update the prior attributes, and the provisioner only wrote
ClientSecret when the new client had one, so replacing a secret-bearing client with
GenerateSecret: false left the displaced client's secret readable through Fn::GetAtt.
The attribute is now removed when the client has no secret; rollback still restores it
from the cleanup record's snapshot.
* fix(cloudformation): refuse a Cognito client replacement that would reuse the prior client id
AWS client ids are random, so a replacement never collides with the client it replaces.
Under Floci's floci:override-cognito-client-id tag the id follows the client name, and a
replacement that kept the name (a GenerateSecret flip, or a move to a pool with the same
override) was created under the prior id: the store overwrote the prior client, the cleanup
record saw an unchanged id and recorded nothing, and the update could not be rolled back.
Neither overwriting nor delete-then-create can preserve the prior client, so the update is
now refused with ValidationError before anything changes and the stack rolls back intact.
CognitoService gains deterministicClientIdFor(userPoolId, clientName), sharing the id rule
with createUserPoolClient; the provisioner compares it with the prior id in the replacement
branch only.
* fix(cloudformation): refuse a Cognito client whose derived id another client already holds
The round-1 guard compared the derived id only with the client being replaced. Under
floci:override-cognito-client-id the store is keyed by client id alone, so a name whose
derived id belongs to any other client, in this pool or another, would overwrite that client
on create, and neither the cleanup record nor rollback knows about it. The guard now refuses
whenever an existing client holds the derived id, on a fresh create as well as a replacement.
* fix(cloudformation): make the deterministic Cognito client-id guard atomic and ignore orphaned records
Two gaps in the round-2 guard. CloudFormationService runs stack operations on a cached
thread pool and CognitoService's client store write is unconditional, so two stacks could
both find a derived id free and the later create overwrote the earlier stack's client; the
existence check and the create now run under one lock whenever the id is derived from the
name. And deleting a user pool does not remove its clients yet (#2949 adds that), so a client
of a deleted pool kept its derived id and the guard refused a legitimate create in another
pool; a holder whose pool no longer exists is now treated as a stale record the create may
take over. Random ids take neither path.
|
||
|
|
631df1dc01 |
feat(cloudformation): provision AWS::Backup::BackupVault (#3125)
Per-service provisioner over BackupService. Ref and Fn::GetAtt BackupVaultName are the vault name and Fn::GetAtt BackupVaultArn its ARN. The name is the physical id and createOnly, so an unnamed vault keeps its generated name across updates instead of getting a second vault, and a rename is refused as a replacement. EncryptionKeyArn is createOnly as well. BackupVaultTags are driven to the template's set on update, untagging dropped keys since TagResource only adds. Stack deletion deletes the vault and leaves the non-empty-vault refusal to surface as on AWS. The docs generator gains a label and row position for the new AWS::Backup namespace. Ported from lex00/floci#118. Tracked in lex00/floci#192. |
||
|
|
3a4982c294 |
feat(cloudformation): provision AWS::ApiGateway::UsagePlan and UsagePlanKey (#3123)
* feat(cloudformation): provision AWS::ApiGateway::UsagePlan and UsagePlanKey Per-service provisioner over ApiGatewayService. A plan's Ref and Fn::GetAtt Id are the plan id. Every plan property is mutable, so an update patches name and description in place and adds or removes API stages as the template moves them. Tags are driven to the template's desired state through the new replaceUsagePlanTags. A key's Ref and Fn::GetAtt Id are <keyId>:<usagePlanId>, as on AWS. All three of its properties are createOnly, so a change to any of them is refused as a replacement rather than re-associating a different key under the old id. The composite id is what lets delete find the association without scanning every plan. Stack deletion removes the plan and the association and tolerates either being gone already. Ported from lex00/floci#118. Tracked in lex00/floci#192. * fix(cloudformation): validate usage plan key properties and survive a recreated plan An association only counts as still there while its plan does. deleteUsagePlan leaves associations behind, and a plan recreated after an out-of-band delete has a new id, so the stale association no longer reads the new UsagePlanId as a rename. KeyType must be API_KEY and both ids must be present, per the registry schema, and a non-list ApiStages is refused instead of read as empty. replaceUsagePlanTags strips the reserved id-override tags the way createUsagePlan does rather than refusing them. * fix(cloudformation): check a usage plan key's KeyId even while recovering drift The createOnly checks sat behind the association lookup, so a template that changed KeyId while its plan was missing created an association for the new key instead of refusing the change. KeyId is checked against the prior composite id either way now. UsagePlanId stays conditional, since a plan recreated after an out-of-band delete legitimately has a new id. |
||
|
|
17af9590c7 |
feat(cloudformation): provision AWS::AutoScaling::ScalingPolicy (#3124)
* feat(cloudformation): provision AWS::AutoScaling::ScalingPolicy Per-service provisioner over AutoScalingService. Ref and Fn::GetAtt Arn are the policy ARN and Fn::GetAtt PolicyName the generated name, since the type has no PolicyName property. PutScalingPolicy is an upsert keyed by group and name, so an update reuses the name recorded at create time and rewrites the policy in place. AutoScalingGroupName is createOnly, so moving the policy to another group is refused as a replacement rather than left behind on the old group. Omitted ScalingAdjustment and Cooldown take the Query handler's defaults. Ported from lex00/floci#118. Tracked in lex00/floci#192. * fix(cloudformation): scope the scaling policy lookup to its group Policy names are unique only within a group. The update path now looks for the recorded name on the template's group first and treats a same-named policy on another group as a move only when it is not there, so an unrelated group's policy cannot block a valid update. * fix(cloudformation): take a scaling policy's identity from its recorded group Finding the recorded name on the group the template asks for read the destination group's own same-named policy as this resource, so a move overwrote that policy and orphaned the original. The group is recorded on the resource at create time and compared directly instead, which drops both DescribePolicies lookups. A resource provisioned before the attribute existed has no prior group and keeps the previous behaviour. |
||
|
|
cbde58f238 |
feat(cloudformation): provision AWS::ApiGateway::ApiKey (#3122)
* feat(cloudformation): provision AWS::ApiGateway::ApiKey Per-service provisioner over ApiGatewayService. Ref and Fn::GetAtt APIKeyId both yield the key id. Description, Enabled and Tags update in place. Name, Value and GenerateDistinctId are createOnly, so a change to any of them is refused as a replacement rather than applied to the existing key. A template that omits Name keeps its generated name across updates instead of minting a second key. Stack deletion deletes the key and tolerates one already gone. ApiGatewayService gains replaceApiKeyTags so an update can drop a tag the template no longer declares. Ported from lex00/floci#118. Tracked in lex00/floci#192. * fix(cloudformation): keep an API key's create-time reserved tags across updates replaceApiKeyTags checked the whole desired map against the reserved list, so a key created with a reserved floci tag could never change an ordinary tag afterwards. Only a reserved tag that is new or changed is an update-time override attempt and is refused now. Adds a test that dropping Description from the template clears it on the key. |
||
|
|
ba3dd657b6 |
feat(cloudformation): provision AWS::SNS::TopicPolicy (#3126)
Adds the type to SnsCfnProvisioner beside Topic and Subscription. A topic policy is not an entity of its own: it writes the Policy attribute of every topic the template lists, so re-applying on UpdateStack is what an update means. The document goes through resolveJsonAttribute like FilterPolicy, so a Ref to a topic inside Resource resolves to the ARN. The physical id is synthetic and stays put across updates, as AWS::SQS::QueuePolicy does, and Ref and Fn::GetAtt Id both return it. An empty Topics list or a missing PolicyDocument is refused. Delete touches nothing, as with QueuePolicy. Ported from lex00/floci#118. Tracked in lex00/floci#192. |
||
|
|
41022d09fb |
feat(cloudformation): support service-managed stacksets (#3055)
* feat(cloudformation): support service-managed stacksets * fix(cloudformation): restrict service-managed account targeting * docs(cloudformation): sync resource type table * fix(cloudformation): align service-managed stackset contracts * test(cloudformation): isolate stackset organization fixture * fix(cloudformation): preserve stackset update handling after rebase * fix(cloudformation): preserve stackset OU deletion targets * fix(cloudformation): preserve overlapping stackset targets * fix(cloudformation): reconcile stackset deployment targets |
||
|
|
dec348d382 |
feat(iot): provision AWS::IoT::Thing, Policy and TopicRule (#3014)
* feat(iot): provision AWS::IoT::Thing, Policy and TopicRule CloudFormation now creates, updates and deletes things, policies and topic rules through the existing IoT operations. Ref returns the name; Fn::GetAtt returns the thing ARN and id, the policy ARN and id (the name, as on AWS) and the rule ARN. Attribute payloads are replaced in place, a changed policy document becomes a new default version, a rule is replaced in place, and a rename replaces the entity. The topic rule payload is handed to the service in the API's own shape. A policy is detached from its principals before it is deleted. * test(iot): keep policy variables verbatim in a stack-created policy * fix(iot): cap a policy at five versions and prune the oldest on a stack update CreatePolicyVersion refuses a sixth version with VersionsLimitExceededException (HTTP 409), as AWS does, and every policy version write runs under one lock so racing creates cannot slip past the check. A stack update with a changed document now does what the AWS CloudFormation handler does when the service refuses: it deletes the oldest version, after moving the default to the newest when the oldest is the default, and creates the new version again. Before this change the versions of a policy updated by a stack piled up without limit. * fix(iot): keep pruning when another version fills the slot before the retry The prune and the retry are separate calls, so another client could create a version between them and the single retry failed the stack update. The provisioner now prunes and tries again, up to as many times as a policy has versions, before it gives up. * fix(iot): delete the oldest policy version in one step under the version lock A stack update pruning a full policy selected the oldest version, moved the default and deleted it in separate service calls, so a direct client could delete or promote that version in between and the stale delete failed the update. The selection, the default move and the delete are now one step in IotService under the version lock; the provisioner only asks for it and retries. * fix(iot): make room for a policy version in one step and lock the policy delete A policy persisted before the cap can hold more than five versions, and the one-version prune then needed one failed stack update per four surplus versions. The service now deletes the oldest versions until one more fits, in one step under the lock, and the provisioner asks for that. DeletePolicy takes the same lock: a version created in the middle of a delete used to put the policy back after the delete had returned. The limit error now carries the message AWS sends, and the tolerated limit error is logged at debug level. * docs(cloudformation): regenerate the resource-type table after the rebase onto main |