mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
225233c19256b4e62f7c43e0131d3cf5d2d263dd
26
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b76eadc98e |
docs(cloudformation): generate the supported resource-type table (#2739)
The "Supported Resource Types" table was hand-maintained, and had drifted: ten provisioned types were undocumented, including the whole CloudFront row, Lambda's Permission/MicrovmImage/NetworkConnector, RDS DBProxy and DBProxyTargetGroup, ECS capacity providers, EC2 VPCEndpoint and ApiGatewayV2 Authorizer. Generate it from the provisioner inventory TSV that CfnResourceInventoryTest already pins to the CDI-resolved registry, so the table cannot drift from what Floci actually provisions. Wired into docs-sync and docs-check, with the inventory path added to the workflow filters: it lives under src/test/resources, which src/main/** did not cover, so a slice that moved a type between owners would have skipped the gate. The table is prose as much as data, so presentation stays configurable in cfn_resource_types.yaml: service labels, curated type order (types not listed there are appended alphabetically, so a new type still appears), per-type notes, and extra_types for capabilities that are real but are not provisioner types, each needing a stated reason. Nested Stack and the Custom::* wildcard are the two such entries; the wildcard cannot be an inventory type because the registry is keyed by exact type. The generator reads the TSV rather than the Java because several provisioners return Set.of(CONSTANT, CONSTANT) from resourceTypes(), which a source regex only partly sees. Also flags two things cheaply, before anyone waits on a Quarkus boot: a provisioner missing @ApplicationScoped, and a type claimed by both the legacy switch and a provisioner. |
||
|
|
8a705d0aae |
feat(cloudformation): provision WAFv2 web ACLs and AWS Config rules (#2701)
* feat: provision WAFv2 web ACLs
* feat: provision AWS Config rules
* fix: adapt provisioners to current 3-arg CfnResourceProvisioner.delete()
* fix: preserve new-resource tracking when replacement cleanup fails, and stop dropping inline-object InputParameters
Local code review (review-local.ts) flagged two ordering bugs on the replacement
path in both provisioners: the new resource's physicalId/attributes were only
recorded after the old resource's delete call succeeded, so a delete failure
(e.g. WAFAssociatedItemException, or a Config rule still referenced elsewhere)
left the stack tracking the old resource while the newly created one leaked
untracked. Both now record the new resource first and treat old-resource
cleanup failure as non-fatal, matching the existing precedent in
Ec2LaunchTemplateCfnProvisioner.
Also fixed AWS::Config::ConfigRule.InputParameters being silently dropped
when a template supplies it as an inline JSON object (the common case) rather
than a pre-stringified JSON string: JsonNode.asText() returns empty string
for object nodes.
* fix(cloudformation): preserve intrinsic-resolved JSON fields on WAFv2 WebACL, log tolerated replacement-cleanup failures, add GetAtt coverage
raw() in WafV2CfnProvisioner used JsonNode#isEmpty(), which is true for every
scalar node, so any field CloudFormationTemplateEngine#resolveNode collapsed
into a TextNode (e.g. an Fn::Join-built DefaultAction) silently became null
instead of the literal JSON text. Mirror ConfigCfnProvisioner's existing
isTextual()-aware handling.
Also log (previously fully swallowed) exceptions when replacement cleanup of
the superseded WAFv2 WebACL or Config rule fails, so a leaked old resource is
diagnosable, and add an integration test asserting the exact Fn::GetAtt keys
for both provisioners resolve through CloudFormation to the real resource.
Config's PutConfigRule call being unconditional on every provision is correct
AWS upsert semantics ("Adds or updates" per the Config API), not a missing
create/update branch.
|
||
|
|
08e532ab1a |
feat(cloudformation): CDK Provider-framework custom resources and changeset/SSM param fidelity (#2688)
* feat(cloudformation): changeset diffs, stack params, SSM attributes CDK's deploy loop reads all three: DescribeChangeSet now returns computed Add/Modify/Remove resource changes instead of an empty list (an empty list makes CDK skip ExecuteChangeSet on updates), DescribeStacks echoes the stack's merged parameters, and AWS::SSM::Parameter resources expose Value/Type/Name attributes so Fn::GetAtt resolves the bootstrap version (cherry picked from commit 80ac80063e84ef1be977fe625334e722cc1ed8bb) * feat(cloudformation): resolve SSM-typed stack parameters AWS::SSM::Parameter::Value<String> template parameters resolve through SSM for the stack's account and region; missing parameters fail with the real ValidationError message. Landing Zone Accelerator's security and logging stacks depend on this typed-parameter resolution. The IAM password-policy and S3 replication-config changes from the same source commit ship separately in the iam and s3 branches. (cherry picked from commit 10dbabbf5e31d763a398fc1fff16ab0484958af0) * feat(cloudformation): drive CDK Provider framework custom resources The CDK Provider framework defers its ResponseURL callback to a Step Functions waiter that polls framework.isComplete on a Retry cadence until the resource is ready. The custom-resource provisioner only waited the synchronous single-lambda budget for a ResponseURL PUT, so the waiter-driven PUT never landed. A framework.onEvent ServiceToken is now awaited on a bounded async budget so that PUT is captured; onEvent-only and single-lambda resources are unchanged. The engine-side half of the original commit -- a Task-only Retry implementation for the ASL executor (ErrorEquals/IntervalSeconds/ MaxAttempts/BackoffRate/MaxDelaySeconds) -- is dropped here: upstream #2455 ("feat(sfn): support Retry policies in Task, Parallel, and Map states") landed a broader Retry implementation independently (Task, Parallel, and Map states; JitterStrategy; $$.State.RetryCount; Retry-before-Catch ordering), a strict superset of what this commit needed. The full stepfunctions suite (411 tests) is green against it on this branch, and CustomResourceProviderFrameworkTest (a hermetic test of the provisioner's own detect-and-wait logic, no Step Functions involved) is unaffected by the drop. (cherry picked from commit 5b3502d8c9dddf3766ca3f94fe7f146042dc00fd) * docs(cloudformation): document CDK provisioning Documents the CDK Provider-framework custom-resource support and folds its cross-reference into upstream's existing "Retry policies" section in step-functions.md rather than duplicating it with a separate "State Retry" section (upstream #2455 already documents the Retry engine itself). * feat(cloudformation): budget custom-resource waits by idleness, not total time The async custom-resource wait was a fixed 3-minute total budget. That is a property of the emulator, but the time a CDK provider-framework resource needs is a property of the work: Custom::CreateOrganizationAccounts creates exactly one account per 15s waiter poll, so a 3-account org finishes in ~45s while a 15-account org needs ~195s. Past the budget the Lambda is guillotined mid- success -- the accounts all exist, but the resource reports CREATE_FAILED, the stack rolls back, and CDK's readback then surfaces the misleading "NoStack: CloudFormationStack object does not hold a stack". Measure idleness instead. The provisioner already embeds its callback token in the ResponseURL it puts on every event, and the framework echoes that event into each framework.isComplete poll, so a poll arriving at LambdaService is proof of progress for a specific pending resource. Each poll resets the budget, which makes the wait proportional to the work without CloudFormation needing to know what the work is -- and a genuinely hung resource still fails after 3 idle minutes exactly as before. CustomResourceLiveness lives in core.common so the Lambda service can report progress without depending on CloudFormation; the dependency already runs the other way. (cherry picked from commit 14087c992ebb75d109999153a9e8af7e3c2d79f4) (cherry picked from commit 51349e4e017ed08d90e6e71212414e2f306c826b) * fix(cloudformation): call the caller-scoped getStackOrThrow overload that exists The changeset-diff commit re-derived onto main carried a call to a three-arg getStackOrThrow(name, region, accountId) overload that only existed on the account-scoping commit deliberately skipped as superseded by upstream. Upstream's resolveStack already scopes to the caller's account, so the two-arg form is equivalent and compiles. * fix(cloudformation): honour an arrived custom-resource response past its budget A synchronous custom-resource handler PUTs to the ResponseURL from inside the invoke the provisioner is blocked on, so its response can already be delivered by the time await() is entered. Two independent flaws then threw it away. The idle clock started at register(), before the invoke. A provider-framework onEvent-only handler that took 75s to return -- two nested cold container starts -- had spent its 10s CR_RESPONSE_TIMEOUT six times over before await was reached, so the very first deadline check was already negative. Idleness of the wait cannot include time the handler spent working; the clock now starts when the caller starts waiting. The deadline guard also threw without ever consulting the future, so a response that had completed it was discarded as a timeout. Observed on AccessAnalyzerServiceLinkedRoleCreateServiceLinkedRoleResource: the handler logged its response at 15:52:11.768 and the resource was failed 24ms later. An arrived response outranks the clock. Both are pinned by red-first tests. The existing idle-timeout guarantees are unchanged: nothing arriving still times out, and a resource that stops reporting liveness still dies on schedule from its last touch. (cherry picked from commit 7dc8bbca7d47b2a029b5656a89421a556b8296be) (cherry picked from commit 77b71b31a634ae27d7460a078b52dac250d67dc7) * refactor(cloudformation): extract Provider-framework detection from the provisioner The CDK Provider-framework `framework.onEvent` detection and the longer idle budget it earns lived in CloudFormationResourceProvisioner, adding ~55 lines to a class that is being dismantled rather than grown. Move the concern to ProviderFrameworkDetector: it owns the two waiter marker env vars, the best-effort environment probe, the 3-minute async budget and the test seam that shortens it. CustomResourceResponseStore — which already owns the idle-timeout concept via touch/await — gains an await overload that resolves the budget for a ServiceToken and delegates to the existing one, so the provisioner only passes the token through and appends the store's timeout detail to its error. Behaviour is unchanged. (cherry picked from commit 5f93439f409a32012a01b996c5edd0c29d23b260) * fix(stepfunctions): report custom-resource liveness on waiter polls A CDK provider-framework waiter's framework.isComplete poll is itself a Lambda Task the state machine invokes, so it goes through AslExecutor.invokeResource -> LambdaExecutorService directly, bypassing LambdaService.invoke() and the liveness hook it carries. A long-but- progressing custom resource's idle budget in CustomResourceResponseStore ticked down as if no polls were arriving, even while they kept landing. AslExecutor now reports liveness the same way LambdaService does: extract the callback token from the invoke payload and touch() it before invoking. * perf(core): avoid materializing the full payload string in tokenIn CustomResourceLiveness.tokenIn() ran on every Lambda invoke once liveness reporting is wired in, decoding the whole invoke payload as a UTF-8 String even though the overwhelming majority of invokes carry no callback URL at all. Scan the raw bytes for the ASCII "/cfn-response/" marker instead, and only allocate a String for the small token substring when one is found. * fix(cloudformation): compute accurate changeset resource diffs computeChangeSetChanges never read cs.getParameters(), so an update that only changed parameter values reported an empty diff and CDK skipped execution, leaving the old parameter-derived config deployed. It also diffed a SAM change set's raw template against the stack's expanded deployed template, reporting spurious Modify/Remove on every SAM-generated resource for a no-op update, and hardcoded Replacement=False even when a resource's Type changed. Now the diff expands a SAM change set's template before comparing, marks a resource Modify when it references a changed parameter, and reports Replacement=True when a resource's Type changes. * fix(cloudformation): restore last-successful parameters on update rollback executeTemplate overwrote the stack's live parameter map with an update's attempted values before resolving SSM-typed parameters, which can fail. A failed resolution rolled the stack back, but the update snapshot never captured parameters, so DescribeStacks reported the failed update's attempted values instead of the last successfully deployed ones. StackUpdateSnapshot now captures the stack's parameters alongside its template body, and rollbackFailedUpdate restores them together. * fix(cloudformation): log tolerated wait-slice timeouts in custom-resource poll loop Each slice of the custom-resource poll loop below the outer idle budget hit an intentionally-tolerated TimeoutException that was swallowed with only a comment, against the repo's convention of logging deliberately caught exceptions. * fix(cloudformation): honor Parameters.member.N.UsePreviousValue extractParameters never read UsePreviousValue, so submitting it without a ParameterValue stored an empty string for that key. The new parameter-diff logic in computeChangeSetChanges ( |
||
|
|
ac94232910 |
feat(cloudformation): CodeBuild/CodePipeline CFN provisioning (#2685)
* feat(cloudformation): provision CodePipeline pipelines and actions New CodePipelineCfnProvisioner handles AWS::CodePipeline::Pipeline, AWS::CodePipeline::CustomActionType, and AWS::CodePipeline::Webhook by lowering the PascalCase CloudFormation properties into the camelCase CodePipeline API shapes and delegating to the service, so stacks and the API produce identical pipelines. Ref resolves to the pipeline name (generated CloudFormation-style when Name is omitted), Fn::GetAtt Version and webhook Url are populated, an existing physical ID routes updates through UpdatePipeline instead of recreating, DisableInboundStageTransitions is applied after creation, and deletes tolerate already-removed resources. (cherry picked from commit 8007d0b7e872d573217309fccd756c66a2d339a4) * fix(cloudformation): bundle cfn-response into inline ZipFile Lambdas AWS injects the cfn-response (Node.js) and cfnresponse (Python) modules into functions created through CloudFormation's inline ZipFile property, and custom-resource handlers across AWS Solutions templates rely on that — Landing Zone Accelerator's installer stack fails its very first Custom::CreateUUID resource with 'Cannot find module cfn-response' without it. The bundled modules follow the documented AWS implementations but pick the transport and port from the ResponseURL instead of hardcoding https:443, because Floci's custom-resource callback URL is plain http on the emulator's port. (cherry picked from commit 7028f5a85daba6ba9d83032dc940cebe45c0b348) * refactor(cloudformation): extract inline ZipFile packaging CloudFormationResourceProvisioner is a monolith being dismantled, so the cfn-response bundling added there moves to its own InlineZipPackager, ready to travel with the eventual Lambda provisioner extraction. No behavior change. (cherry picked from commit d0d4bff84bda9c143606a8922500515dbe5bc0c0) * fix(cloudformation): keep CodePipeline action config keys verbatim Action and rule configuration maps carry provider-defined string keys (Owner, Repo, ProjectName, ...) that executors match exactly; the PascalCase-to-camelCase property transform was rewriting them, so CloudFormation-created pipelines could never run their GitHub source or CodeBuild actions. Configuration subtrees now pass through untouched. (cherry picked from commit 213e33d9f005ee4df6a66272a91f47ac67a3b7a3) * feat(cloudformation): provision CodeBuild projects AWS::CodeBuild::Project was falling through to the stub path, so CloudFormation-created pipelines referenced build projects that did not exist — Landing Zone Accelerator's installer pipeline failed its Install stage with 'Project not found'. The new provisioner lowers the PascalCase properties into the CodeBuild API shape (including the irregular all-lowercase buildspec field), supports update-in-place, and exposes Ref as the project name and Fn::GetAtt Arn. (cherry picked from commit 7d616b87c7fa58693537dfe7d9d86cd63437ea75) * fix(codepipeline): correct three CFN provisioning bugs in CodePipelineCfnProvisioner - DisableInboundStageTransitions is a declarative list: a stage removed from it on update must be re-enabled, not left disabled after UPDATE_COMPLETE. - CustomActionType has no update operation; a change to Category/Provider/Version is a replacement (create the new identity, delete the superseded one) rather than a silent physicalId swap with no corresponding service call. - Webhook's RegisterWithThirdParty must be read from the resolved/lowercased node, not the raw unresolved props, so intrinsics (Ref, Fn::If) are honored. * fix(codebuild): convert the JSON handler's Map entity instead of dropping it CodeBuildJsonHandler.handle(...) returns Response.ok(Map.of(...)), never a JsonNode, so the instanceof check in CodeBuildCfnProvisioner.handle always missed and silently fell back to an empty ObjectNode -- forcing the guessed ARN fallback even when the handler returned the real project ARN. Convert non-JsonNode entities with ObjectMapper.valueToTree, and close the Response. * fix(cloudformation): UTF-8 encode the injected Python cfn-response callback body http.client encodes a str request body as latin-1, raising UnicodeEncodeError for any response Reason/Data containing non-Latin-1 characters and failing the callback before it's sent. Encode the JSON body to UTF-8 bytes first. * docs(cloudformation): merge the duplicate Lambda resource-type row Two Lambda rows in the supported-resource-types table gave inconsistent descriptions (one had Version/Alias, the other the cfn-response detail). Consolidate into a single row. * fix(codepipeline): fix stage-transition and rename bugs found in re-review - Only re-enable stage transitions this stack previously disabled (tracked via a new __FlociCodePipelineDisabledStages attribute); a stage disabled externally (a manual gate, a human) and never listed in DisableInboundStageTransitions is no longer touched by an unrelated update. - Pipeline Name has no rename operation in CodePipeline; a template Name that differs from the tracked physical ID is now treated as a replacement (create under the new name, delete the old one) instead of calling UpdatePipeline against a pipeline that doesn't exist or belongs to someone else. - Webhook Name rename now deletes the previously-owned webhook after PutWebhook upserts under the new name, instead of orphaning it. * fix(codepipeline): handle legacy stage tracking and failed-replacement cleanup - A resource stored before __FlociCodePipelineDisabledStages existed has no tracking record; fall back to reconciling every declared stage on its first post-upgrade update instead of skipping reconciliation and leaving a removed entry disabled forever. - If stage-transition reconciliation fails after a rename's replacement (or a fresh create) already succeeded, best-effort delete the just-created pipeline before rethrowing. CloudFormation reverts this resource to its previous physicalId on a failed update, so without this the new pipeline is orphaned and a corrected retry hits PipelineNameInUseException. |
||
|
|
054508df87 |
feat(organizations): add CloudFormation resource types (#2495)
* feat(organizations): add CloudFormation resource types Adds OrganizationsCfnProvisioner covering AWS::Organizations::Organization, OrganizationalUnit, Account, Policy and ResourcePolicy. Attribute names are taken from the registry schemas' readOnlyProperties so Fn::GetAtt resolves the keys AWS publishes. CloudFormation's delete path hands over a physical id and a region but no caller identity, and every Organizations mutation is management-account scoped. Rather than injecting a second collaborator into the provisioner, OrganizationsService gains findManagementAccountForResource, which recovers the owning account from the resource id — so the provisioner keeps to the one-injected-service convention the other provisioners follow. provision serves create and update: an OU is renamed in place rather than recreated (ParentId is create-only in the schema), a Policy's TargetIds are reconciled in both directions, and an Account is moved to its ParentIds entry after creation. The integration test asserts through stack Outputs backed by Fn::GetAtt: an unmapped attribute does not fail provisioning, it silently resolves to the literal "LogicalId.Attr", so asserting CREATE_COMPLETE would pass with every attribute unwired. * fix(organizations): converge CFN provisioning on partial failure and tag drops Set the physical id as soon as the create call succeeds in provisionAccount and provisionPolicy, before moveAccount and reconcileTargets respectively. Both can throw once the resource already exists — a ParentIds entry pointing at a missing OU raises DestinationParentNotFoundException, and attachPolicy can fail on a bad target — and without an id CloudFormation's rollback has nothing to call delete() with, leaving the account or policy a real member of the organization but unmanaged by the stack. Make putResourcePolicy replace its tag map rather than merge into it, so a key dropped from a template is removed on update instead of lingering. A resource policy is not a TagResource target, so resolveTagOwner rejects rp- ids and the provisioner cannot reach it through replaceTags the way the other types do; Put is the only call that can converge those tags. Supplying Tags states the full set, while omitting them leaves the existing ones untouched, matching how an absent Tags property behaves for every other Organizations type. * fix(organizations): mark created accounts and policies as rollback-owned CloudFormationService.rollbackCreatedResources deletes a CREATE_FAILED resource only when it carries both a physical id and the CfnRollback.ROLLBACK_OWNED_ATTR marker. The provisioner set the id but not the marker, so rollback walked straight past an account whose MoveAccount failed after CreateAccount had already made it a member of the organization. The account survived, the organization could not be deleted while it still contained one, and the stack reported ROLLBACK_FAILED instead of unwinding. Set the marker as soon as the create call returns, the way IamRoleCfnProvisioner does, so the create and the ownership record cannot drift apart. OrganizationsCfnRollbackIntegrationTest drives a real stack whose ParentIds names an OU that does not exist and asserts the account id reaches the stack events, that rollback emits DELETE_COMPLETE for it, and that neither the account nor the organization is left behind. * feat(organizations): map OU Path and Account State/Paths The published registry schemas declare three readOnly properties the provisioner did not map: OrganizationalUnit Path, and Account State and Paths. An unmapped key does not fail provisioning — CloudFormationTemplateEngine resolves it to the literal string "LogicalId.Attr" — so a template asking for Fn::GetAtt Dev.State silently got back "Dev.State". Path and Paths are the organization path, o-<org>/r-<root>[/ou-<ou>]*[/<id>]/, which needs a walk from the resource up to the root. OrganizationsService owns that hierarchy and already computes the chain for effective-policy merging, so it exposes it as organizationPath rather than the provisioner rebuilding it. The account path is read after the move: accounts are always created under the root, so reading it earlier would publish a path the account no longer lives at. State is the parameter AWS is retiring Status in favour of on 2026-09-09. Floci only ever puts an account in ACTIVE or PENDING_CLOSURE, both of which are also AccountState values, so the two agree; PENDING_ACTIVATION and CLOSED are phases the emulator does not model. Paths is list-typed in the schema, but an account has exactly one parent and so exactly one path, and the engine's Fn::Select splits a comma-delimited scalar back into a list, so the string-valued attribute map carries it without loss. Adding the Path lookup to provisionOrganizationalUnit opens the same window that stranded accounts before: a call that can throw once the OU is already a real member of the organization. Mark the OU stack-owned as soon as the create returns, matching the account and policy paths, so rollback can still delete it. * fix(organizations): Ref on Organization returns the management account id AWS documents Organization as the one Organizations type where bare Ref returns the management account id rather than the resource's own id; Fn::GetAtt Org.Id already returned the organization id correctly. Adds an OrgRef stack output/assertion covering the case, since the existing integration test only ever exercised Fn::GetAtt on Org. |
||
|
|
1461a10de7 |
feat(cloudformation): apply security-group rules — inline properties and standalone resources (#1993)
* feat(cloudformation): apply security-group rules — inline properties and standalone resources Inline SecurityGroupIngress/Egress on AWS::EC2::SecurityGroup were silently dropped (groups deployed with no rules), and the standalone AWS::EC2::SecurityGroupIngress/Egress resource types were unsupported. Both now map onto the existing Ec2Service authorize APIs, including CidrIp/CidrIpv6 ranges and Source/DestinationSecurityGroupId peer pairs. Rules are removed with their group, so stack delete needs no revoke. Fixes #1992 * refactor(cloudformation): move standalone security-group rules into a per-service provisioner The standalone AWS::EC2::SecurityGroupIngress and AWS::EC2::SecurityGroupEgress types move out of the CloudFormationResourceProvisioner switch and into Ec2SecurityGroupRuleCfnProvisioner, discovered through the CDI registry. The inline SecurityGroupIngress/SecurityGroupEgress properties stay with AWS::EC2::SecurityGroup, which has not been extracted yet, and call the shared rule-to-IpPermission mapping so there is one copy of it. Along with the move: - delete() revokes the rule. A standalone rule can target a group that outlives the stack, so DeleteStack and create rollback used to mark the resource gone while its permission stayed active on the group. - Update revokes the rule the previous execution created before authorizing. The authorize APIs append, so re-running a template used to duplicate an unchanged rule and orphan the permission of a changed one. - A rule's Description now reaches its ipv6 range, and DescribeSecurityGroups reports ipv6 range descriptions. - GroupName resolves to a group id instead of being passed through as one. Ec2Service.deleteSecurityGroupRule removes a rule by SecurityGroupRuleId: the rule record plus the one permission (or the one range within it) that the record describes. The existing by-permission revoke matches on protocol and ports alone, which would strip a group's unrelated rules that share them. * fix(ec2): security-group rule records carry their peer, so deletion hits the right rule Three review findings with one root cause. createRules only turned ipv4 ranges into rule records. An ipv6 range or a referenced group collapsed into a single record holding nothing but protocol and ports, so DescribeSecurityGroupRules could not report the peer, and deleting one of several rules sharing a port revoked whichever permission happened to carry no ipv4 ranges — the requested rule stayed active while an unrelated one disappeared. Records are now created per peer, as AWS does: one per ipv4 range, one per ipv6 range, one per referenced group, with the peer recorded on each. removeRecordedPermission matches on that peer and drops the enclosing permission only once nothing is left in it. A record naming no peer matches only a permission that names none either, instead of falling back to the first port match. DescribeSecurityGroupRules gained referencedGroupInfo. The CFN provisioner updated a standalone rule by revoking then authorizing, so a rejected replacement left the group with neither rule: rollback keeps the old physical id but never recreates its permission, and the stack settled as UPDATE_ROLLBACK_COMPLETE minus a valid rule. It now authorizes first and revokes the previous rule only after that succeeds. * fix(cloudformation): a security-group rule names exactly one peer CloudFormation documents exactly one source per rule, an IPv4 range, an IPv6 range, a prefix list or a security group. Floci read each peer property independently, and authorize creates a rule record per peer, so a rule naming several kept only the first record as its physical id. Delete revoked that one and the rest stayed on the group, and a replacement leaked them. Naming more than one is now a ValidationError, which covers the standalone resources and the inline SecurityGroupIngress/Egress entries through the shared mapping. Delete no longer swallows failures from deleteSecurityGroupRule. That call already returns false for a rule it has no record of and succeeds when the group is gone, so the cases the catch existed for never reached it, and what it did absorb was a real failure reported to CloudFormation as a successful delete. * fix(cloudformation): a security-group rule carries its Description to a peer group The ipv4 and ipv6 branches both put Description on the range they build, while the peer-group branch left it off the UserIdGroupPair. Ec2Service reads the description straight off the pair, so a rule declaring SourceSecurityGroupId or DestinationSecurityGroupId with a Description came back from DescribeSecurityGroupRules without it. * fix(cloudformation): a security-group rule naming no source is rejected The peer check counted sources and rejected more than one, so a rule naming none passed and sent an IpPermission with no cidr, prefix list or group on it. CloudFormation then reported the source-less rule as successfully provisioned. AWS requires exactly one, so zero is as invalid as several. * fix(cloudformation): a security-group rule can name its peer group by name The source count read SourceSecurityGroupId but not SourceSecurityGroupName, so tightening the count to exactly one rejected a template that named its peer by name. The ingress schema lists both, along with SourceSecurityGroupOwnerId for a group in another account, and neither was read. Egress has no name variant. The name is handed to Ec2Service as a name rather than resolved here. resolveGroupReferences maps it to an id on authorize before createRules records the rule, so the delete path still matches on the resolved id. Also drops a stale comment three lines above the code it contradicted, claiming UserIdGroupPair has no description field. |
||
|
|
9280369b64 |
feat(cloudformation): provision ApiGateway::Account, AutoScaling::LifecycleHook, and EC2::FlowLog (#2003)
* feat(cloudformation): provision ApiGateway::Account, AutoScaling::LifecycleHook, and EC2::FlowLog Three small provisioners over existing services: Account records metadata (physical id only), LifecycleHook maps onto AutoScalingService.putLifecycleHook, FlowLog onto FlowLogService.createFlowLog (newly injected into the provisioner). Fixes #2002 * feat(cloudformation): per-service provisioners for ApiGateway::Account, AutoScaling::LifecycleHook, and EC2::FlowLog The three resource types land in the extracted provisioner structure rather than the switch in CloudFormationResourceProvisioner, one class per service: - ApiGatewayAccountCfnProvisioner writes CloudWatchRoleArn into the API Gateway account settings, so GET /account reflects what the template asked for instead of the resource being recorded as a bare physical id. - AutoScalingLifecycleHookCfnProvisioner puts the hook on its group and removes it again when the stack is deleted. - Ec2FlowLogCfnProvisioner creates the flow log and deletes it when the stack is deleted. Both deletes close the cleanup gaps raised in review: flow logs and lifecycle hooks no longer outlive their stack. The delete path only holds a physical id, and a hook's physical id is its name, so AutoScalingService gains deleteLifecycleHookByName to find the hook whichever group owns it, including groups that outlive the stack. API Gateway has no DeleteAccount operation and its account settings are regional rather than stack-owned, so that provisioner keeps the default no-op delete. CloudFormationResourceProvisioner is byte-identical to main again: no switch arms, no FlowLogService injection, and the two constructor-arg test edits are reverted. Tests: three isolated provisioner unit tests (one mocked service each) plus the integration test, extended to cover deletion of the hook and the flow log against a group created outside the stack. * fix(cloudformation): delete a lifecycle hook on its own group, not by name alone A lifecycle hook name is unique within an Auto Scaling group, not within a region, but the CloudFormation delete path only had the physical id — the hook name — so it removed every hook with that name in the region. Two groups using the same hook name meant deleting or rolling back either stack stopped the other group's lifecycle action. CfnResourceProvisioner gained a delete overload that receives the whole StackResource, defaulting to the existing id-only form, and the dispatcher calls it for extracted provisioners. It sits after the EKS Nodegroup and IAM policy special cases so extracting one of those later cannot bypass them. The hook provisioner records its AutoScalingGroupName at create time and deletes through the group-scoped API. Resources provisioned before that still fall back to the by-name form: leaving the hook behind is worse, since it can sit on a group that outlives the stack. * fix(cloudformation): a stack update reuses its flow log and lifecycle hook Ec2FlowLogCfnProvisioner called createFlowLog unconditionally, so every UpdateStack created a second flow log and orphaned the first. The orphan then outlived the stack, since delete only knows the id recorded last. It now reuses the log this stack already made and creates only when that one is absent, on a first execution or after removal out of band. AutoScalingLifecycleHookCfnProvisioner had the same shape, but only when LifecycleHookName is omitted: a freshly generated name each update left the previous hook on the group, still firing, with nothing referencing it. An unnamed hook now keeps the name its first execution generated. A declared name needed no change, since putLifecycleHook is idempotent on it. Both follow EcsCapacityCfnProvisioner. Neither surfaced in CI because no test here ran an UpdateStack, so each provisioner now has one that does. * fix(cloudformation): a createOnly change on a flow log or lifecycle hook is reported Both provisioners reuse the resource the stack already made, so a change to a property AWS treats as createOnly was being absorbed instead of surfaced. The flow log reported the stack complete while DescribeFlowLogs kept serving the previous ResourceId, TrafficType, LogDestination, LogFormat or aggregation interval. The lifecycle hook was worse, since changing LifecycleHookName or AutoScalingGroupName created the new hook and overwrote the id delete uses, leaving the previous hook on its group and still firing. Both now report an unsupported replacement, matching how EcsCapacityCfnProvisioner treats a changed Name. A property the template stops declaring, or one the stored record never captured, is left alone rather than read as a change. * docs(cloudformation): list ApiGateway Account, LifecycleHook and FlowLog in the resource-type table * fix(cloudformation): dropping a flow log's createOnly property is a change rejectIfChanged returned early whenever the template supplied no value, so removing a previously explicit LogFormat or MaxAggregationInterval skipped validation entirely and the stack reported complete while DescribeFlowLogs kept serving the old one. An absent stored value still means leave it alone, since that is not evidence of a different one, but an absent requested value is now compared rather than skipped. MaxAggregationInterval compares against its documented default of 600 when the template omits it, which is the value a create would have used. * fix(cloudformation): a flow log's createOnly comparison uses effective values Removing the early return on a blank request fixed the dropped-property case and broke two others. createFlowLog defaults ResourceType, TrafficType and LogDestinationType, so re-applying an unchanged template compared null against a stored default and failed a no-op update, while adding a property to a log that never had one still returned early on the stored null and was ignored. Both sides are now the effective value, defaulting the requested side exactly as createFlowLog does, so add, drop and change all read as changes and a re-apply stays a no-op. The test helper stamps the same three defaults, since a stub without them is not a flow log this provisioner could have created. |
||
|
|
5e01c07b33 |
feat(cloudformation): provision the network ACL family (#2001)
* feat(cloudformation): provision the network ACL family AWS::EC2::NetworkAcl, NetworkAclEntry (rule number, protocol, action, egress flag, CIDR, port range), and SubnetNetworkAclAssociation (CFN semantics: find the subnet's live association and replace it onto the target ACL) — all mapped onto existing Ec2Service APIs. Fixes #2000 * refactor(cloudformation): move the network ACL family to a per-service provisioner Ec2NetworkAclCfnProvisioner serves AWS::EC2::NetworkAcl, AWS::EC2::NetworkAclEntry and AWS::EC2::SubnetNetworkAclAssociation through the CfnResourceProvisioner seam, so the three types leave the switch in CloudFormationResourceProvisioner along with their private provision methods. The class is CDI-discovered by CloudFormationResourceRegistry, needs no registration, and injects only Ec2Service. delete() now covers all three types, so stack deletion cleans them up instead of leaking them. The ACL and the entry delegate to Ec2Service; the subnet association reverts the subnet to its VPC's default ACL, matching CloudFormation. NotFound is treated as already-deleted so a retried delete does not fail the stack. Entry properties resolve through the template engine rather than being read raw off the JSON, so RuleNumber, Egress and the PortRange bounds accept intrinsics such as Ref and Fn::Sub like the other properties already did. The integration test now deletes the stack and asserts the custom ACL is gone. A unit test covers the family in isolation with one mocked service. * fix(cloudformation): a stack update reuses its network ACL and upserts entries provisionNetworkAcl called createNetworkAcl unconditionally. CloudFormationService re-invokes provision with the prior physicalId on UpdateStack, so every update minted a second ACL, overwrote the id, and orphaned the previous one permanently. It now reuses the ACL this stack already made, creating only when that one is absent, and reports an unsupported replacement when VpcId changes, since VpcId is createOnly. Same shape as EcsCapacityCfnProvisioner. Fixing that alone broke the entry path: createNetworkAclEntry ran with replace=false, which raises NetworkAclEntryAlreadyExists for a rule that already exists. RuleNumber, Egress and NetworkAclId are the createOnly key, so re-provisioning the same key is an update, and replace=true is correct. Neither showed up in CI, since no test here ran an UpdateStack. Three now do. * docs(cloudformation): list the network ACL family in the resource-type table |
||
|
|
0971cf6f64 |
fix(cloudformation): resolve ASG launch templates by id and MixedInstancesPolicy (#2005) (#2019)
An AWS::AutoScaling::AutoScalingGroup that pointed at its launch template any way other than by LaunchTemplateName failed with "The specified launch template does not exist." provisionAutoScalingGroup collapsed LaunchTemplateId into the launch template name argument, and Auto Scaling matches names exactly, so a valid lt- id — including one that a Ref to an in-stack AWS::EC2::LaunchTemplate resolves to — never matched. The id and name are now passed to createAutoScalingGroup separately. MixedInstancesPolicy was never read from template properties, so a mixed-instances group reached Auto Scaling with no launch source and failed validation. It is now built in the same shape the Query API parser produces, including Overrides[].InstanceType and InstancesDistribution; a non-integer distribution value fails the stack rather than being silently dropped. CloudFormationAsgLaunchTemplateIntegrationTest covers resolution by name, by id, through a Ref to an in-stack launch template, and through MixedInstancesPolicy. Closes #2005 Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> |
||
|
|
7d66bf087a |
fix(cloudformation): expand SAM AutoPublishAlias into Version + Alias (#1961)
* fix(cloudformation): expand SAM AutoPublishAlias
AutoPublishAlias was read nowhere in the codebase, so the SAM transform
silently dropped it: the stack reached CREATE_COMPLETE, the function
deployed with only $LATEST, and an alias-qualified invoke then failed
with "Alias not found" far from the deploy that caused it. The
"Unsupported SAM resource type" debug arm only covers unknown resource
types, not unknown properties, so nothing was logged either.
Expand it into the AWS::Lambda::Version + AWS::Lambda::Alias pair real
SAM generates, and provision those two types. Both halves are needed:
the transform alone emits resources the provisioner ignores, and the
provisioner alone is unreachable from a SAM template.
The Lambda service already implements publishVersion and the alias APIs,
so this is plumbing rather than new service behavior. The new types go
through CfnResourceProvisioner rather than the legacy switch, following
the registry migration. Ref/GetAtt on the emitted properties give the
function -> version -> alias ordering that topologicalSort already
follows, so no explicit DependsOn is needed.
An intrinsic alias name (e.g. !Ref StageName) is passed through to Name
for the engine to resolve at provision time; only the generated logical
id needs a literal and drops the suffix in that case.
* test(cloudformation): cover Version/Alias provisioner directly
The SAM integration test drives provisioning end to end but cannot reach
two paths: the already-exists fallback (createAlias conflicting with an
alias that outlived a stack delete) and delete(), which its @AfterEach
invokes but never asserts on — a broken delete was silent.
Add LambdaVersionAliasCfnProvisionerTest alongside the existing Sqs and
Rds provisioner tests: attribute wiring for both types, the conflict
fallback, non-conflict failures still propagating, alias delete parsed
out of the ARN, delete idempotency when the alias is already gone,
version delete as a no-op, and a physical id that is not an alias ARN
(the generic fallback's shape on stacks predating this provisioner).
Also stop pinning the alias's FunctionVersion to a literal "1" in the
integration test: assert it is a number and not $LATEST, which is what
the assertion is actually for. Pinning the first version fails
confusingly when an earlier run leaks the function and its counter.
* fix(cloudformation): point the SAM alias at $LATEST
Real SAM points AutoPublishAlias at the published version, and the first
revision of this change did the same. Floci cannot invoke a published
version: the snapshot carries no code path, so a version-qualified
invoke times out on a cold start (#1987), and silently runs $LATEST's
code when a warm container happens to exist (#1988). Emitting the
faithful form therefore broke the alias-qualified invoke this expansion
exists to enable — strictly worse than not expanding the property.
Point the alias at $LATEST instead. The Version resource is still
emitted, so the resource set and GetAtt still match SAM; only the
alias target differs, and it flips back to the version in one line once
#1987 lands.
The integration test asserted the alias record existed with a numeric
FunctionVersion, which the broken form satisfied — so it passed while
the behavior was broken. It now invokes through the alias and asserts
the function actually runs, which fails against the version-pointing
form (verified by reverting it with the record assertion relaxed).
* fix(cloudformation): point the SAM alias at $LATEST
Restores the change
|
||
|
|
a235b76835 |
feat(cloudformation): implement GetTemplateSummary (#2148)
* feat(cloudformation): implement GetTemplateSummary (#1964) Adds the missing action to the CloudFormation Query allowlist and computes Parameters, ResourceTypes, Version, DeclaredTransforms and an informational Capabilities/CapabilitiesReason (derived from AWS::IAM:: resource types) from a stack's existing template, an inline TemplateBody, or a TemplateURL. Without this, tools like sam deploy that call GetTemplateSummary before UpdateStack failed with UnsupportedOperation. * fix(cloudformation): correct GetTemplateSummary for SAM stacks and named IAM resources Addresses two review findings: - StackName lookups summarized the persisted post-transform template, so an existing SAM stack lost its Transform declaration and reported expanded resource types (AWS::Lambda::Function) instead of the original submitted ones (AWS::Serverless::Function). Stack now keeps the pre-transform template body alongside the existing post-transform one, and GetTemplateSummary prefers it. - Capabilities always reported CAPABILITY_IAM for any IAM resource, even ones with an explicit name (e.g. RoleName). CloudFormation requires CAPABILITY_NAMED_IAM for those; GetTemplateSummary now checks the relevant name property per IAM resource type. * fix(cloudformation): detect named IAM resources set via intrinsic functions The CAPABILITY_NAMED_IAM check only looked for a literal string value on the name property, so a real-world RoleName/UserName/etc. set via Ref, Fn::Sub, Fn::Join or another intrinsic (the common shape in SAM and CDK output) was missed entirely, misclassifying the template as only needing CAPABILITY_IAM. CloudFormation requires NAMED_IAM whenever the property is present at all, regardless of how its value resolves, so the check now looks for presence instead of a textual value. * docs(cloudformation): clarify GetTemplateSummary's originalTemplateBody fallback Spells out why the fallback to the post-transform templateBody exists (originalTemplateBody has no data for stacks persisted before this field was added) and that it self-heals on the stack's next CreateChangeSet/UpdateStack call, in response to review feedback. |
||
|
|
d9e4447aeb |
feat(cloudformation): resolve dynamic references in RDS credentials (#1809)
* feat(cloudformation): resolve dynamic references in RDS credentials * test(cloudformation): pin secret resolution failures --------- Co-authored-by: Alexander Banna <abanna@users.noreply.github.com> |
||
|
|
bc21367cc4 |
feat(cloudformation): provision AWS::Events::EventBus as a real custom bus (#1807)
* feat(cloudformation): provision EventBridge event buses * fix(cloudformation): restore main's provisioner changes lost in the EventBus merge The previous conflict resolution took this branch's whole CloudFormationResourceProvisioner, which silently reverted five commits main had landed on that file since the merge base — including the DynamoDB/Lambda delete idempotency from #1803 and AWS::EC2::LaunchTemplate from #1973. Re-resolve from main's file and apply only this branch's EventBus additions on top: the ownership-tracking provisioner, its validation helpers, and the typed rethrow in deleteEventBridgeRuleSafe. main's provisionEventBusPolicy and inline Policy support are kept, with Policy added to EVENT_BUS_SUPPORTED_PROPERTIES so the inline form is no longer rejected. * fix(cloudformation): delete EventBus resources created before ownership tracking deleteEventBusSafe(StackResource) refused to delete whenever the FlociEventBusCreatedTime attribute was absent, treating "ownership not tracked" the same as "ownership changed". Stacks provisioned by an earlier Floci build are restored from cloudformation-stacks.json without that attribute, so the first DeleteStack after upgrading left them permanently in DELETE_FAILED. Only refuse when a recorded created-time actually disagrees with the live bus. A missing attribute falls back to the pre-tracking behaviour of deleting what the stack recorded it created. * fix(cloudformation): adopt untracked EventBus on update and record identity before the policy call Two provision-side defects, both surfaced in review: UpdateStack broke for stacks provisioned before FlociEventBusCreatedTime existed. Those resources are restored without the attribute, so the adoption guard's 'existingCreatedTime == null' arm re-threw ResourceAlreadyExists on every update, including no-ops. Same inverted guard the delete path already uses: only a recorded time that actually disagrees means the bus was recreated out of band. The bus also leaked when Policy application failed. r.setPhysicalId ran after putPermission, and rollbackCreatedResources skips resources whose physicalId is null, so a malformed policy left a live bus rollback could not find. Identity and ROLLBACK_OWNED_ATTR are now recorded before the policy call, matching how provisionIamRole marks a freshly created role. The attribute is cleared on the adoption path so rollback never deletes a bus this stack did not create. * chore: re-run CI Build and Test failed on RuntimeApiServerTest's extension/stop race, a pre-existing flake unrelated to this change (no CloudFormation test failed). Root-caused separately: test-timing half in #2141, server-side shutdown-ordering half filed as an issue. * fix(cloudformation): adopt tagged pre-tracking event buses * test(dynamodb): retain Quarkus port for cleanup * chore: rerun CI after download outage * fix(cloudformation): reject unsafe EventBus policy updates --------- Co-authored-by: Alexander Banna <abanna@users.noreply.github.com> |
||
|
|
ee15447ba4 |
docs(cloudformation): document the per-service provisioner path for new resource types (#2153)
New CloudFormation types belong in services/cloudformation/provisioners/, not in the CloudFormationResourceProvisioner monolith, but nothing outside a gitignored design doc said so: CONTRIBUTING.md, AGENTS.md, docs/ and the PR template were all silent, so contributors read the monolith and copied a case. Adds a step-by-step section to CONTRIBUTING.md and AGENTS.md covering the three traps behind the recurring review findings: Ref and Fn::GetAtt are separate mechanisms and a missed attribute resolves to the literal LogicalId.Attr; provision is also the update path, so creating unconditionally throws AlreadyExists or orphans the old resource; and an unmapped type is stubbed as CREATE_COMPLETE, so status-only assertions cannot detect a type that was never wired. Also refreshes the resource-type table, which had drifted: EC2 gains LaunchTemplate and VPCGatewayAttachment, EventBridge gains EventBus and EventBusPolicy and its Events::Rule naming is normalized. |
||
|
|
7d9b9aedd2 |
feat(cloudformation): honor resource-level DeletionPolicy (#2167)
A resource's DeletionPolicy attribute was never read off the template, so every managed resource was deleted regardless of what it declared: deleteStackResources and rollbackCreatedResources both called provisioner.delete unconditionally. Read DeletionPolicy alongside Type in executeTemplate and apply it at both delete sites. Retain keeps the resource on every stack operation. RetainExceptOnCreate keeps it too, except when the create that made it is rolled back — deleting it there is the entire meaning of that value, and rollbackCreatedResources runs only for a failed create. A retained resource is reported as DELETE_SKIPPED, on the resource and as a stack event, and is not counted as a failed delete, so the stack still reaches DELETE_COMPLETE. That also lets a stack owning a non-empty S3 bucket be deleted, which otherwise fails on the objects. Any other value falls through to the existing delete. That includes Snapshot: floci cannot take the snapshots AWS supports for those types, and AWS does delete the resource under Snapshot, so Delete is the faithful half. The docs record that and the other divergences. The policy is set on the resource after the provisioner returns, because provision() and executeNestedStack() both return a fresh StackResource that replaces the map entry. Closes #1555 |
||
|
|
62a576c8d4 |
feat(cloudformation): provision AWS::SecretsManager::SecretTargetAttachment (#1804)
* feat(cloudformation): provision AWS::SecretsManager::SecretTargetAttachment AWS::SecretsManager::SecretTargetAttachment previously fell through the default branch, so its Ref yielded a generated placeholder rather than the secret ARN. Per the CloudFormation resource reference, this resource's Ref returns the ARN of the secret named in SecretId, and consumers such as Secret.fromSecretCompleteArn(...) require the complete ARN (with the trailing -6char suffix). Resolve SecretId (a Ref to the Secret, a friendly name, or a raw ARN) to the canonical complete ARN via describeSecret and expose it as the resource's physical id / Arn attribute, falling back to SecretId as-given if the lookup fails. Deleting the attachment is a detach no-op — it must not delete the underlying secret. * fix(cloudformation): require SecretId on SecretTargetAttachment SecretId is a required property of AWS::SecretsManager::SecretTargetAttachment. Resolving it as optional let a template omit it and still create (falling back to the logical id); reject a missing SecretId instead. Adds a regression test. * fix(cloudformation): complete secret target attachment lifecycle * fix(cloudformation): require attachment metadata on delete * fix(cloudformation): tolerate detached secret overwrites * fix(cloudformation): align secret target attachment behavior * docs(cloudformation): document secret target attachments --------- Co-authored-by: abanna <abanna@users.noreply.github.com> |
||
|
|
4a16266f48 |
feat(cloudformation): support UpdateTerminationProtection (#1692)
* feat(cloudformation): support UpdateTerminationProtection CDK bootstrap calls UpdateTerminationProtection on the CDKToolkit stack; Floci returned UnknownAction. Add it: a boolean enableTerminationProtection on Stack, a CloudFormationService.updateTerminationProtection(stackName, enabled, region) that sets and persists it, a handler returning the UpdateTerminationProtectionResult/StackId envelope, and the flag echoed as <EnableTerminationProtection> in DescribeStacks. Register the action in AwsQueryController's CloudFormation action set so the Query-protocol POST routes to CloudFormation instead of falling through. Adds an integration test toggling the flag and asserting it round-trips through DescribeStacks. * docs: regenerate action tables |
||
|
|
7d70f64162 |
feat(docs): generate Supported Actions tables from handler source (#1641)
* feat(docs): generate Supported Actions tables from handler source The "Supported Actions" tables in docs/services/*.md were hand-maintained and drifted from the handlers. For example secrets-manager.md omitted RestoreSecret, which SecretsManagerJsonHandler dispatches, and acm.md listed RenewCertificate, which is not implemented anywhere in src/. Derive the action list from handler source so it cannot drift, while keeping the hand-written Description column: - tools/docs/regen_action_docs.py extracts actions from `case "X" ->` switch arms (including multi-label arms) and JAX-RS REST controllers, and rewrites only the rows between the <!-- floci:actions --> markers. Descriptions are preserved by action name; new actions get a "-" placeholder. PascalCase-only matching avoids picking up SCREAMING_CASE labels from non-action switches. - tools/docs/services.yaml registers 18 single-table switch services and lists the remaining switch handlers under deferred_handlers, so the new-service sentinel fires only on a genuinely unregistered handler. - make docs-sync / docs-check / docs-test, plus a Python-only CI workflow that gates on handler, doc, and tooling changes. - Migrate 18 service docs into marker blocks, reconciling real drift (adds RestoreSecret, ImportCertificate, and others; drops the unimplemented RenewCertificate). Revives the parser and CI gate from #738 by @ericbsantana and completes the description-preservation its spec described. REST-mode, mixed-mode, multi-table, non-tabular, S3, and ecr docs are deferred and tracked in deferred_handlers. * docs: drop standalone design spec from action-docs tooling Remove ideas/auto-generated-action-tables.spec.md and the four references to it (CONTRIBUTING.md, Makefile, regen_action_docs.py docstring, services.yaml). It was a planning artifact; the operational docs live in CONTRIBUTING.md and the tooling is self-documenting. The #738 / @ericbsantana credit is preserved in the PR description. * chore: address review on action-docs tooling - pin actions/checkout to v7.0.0 in docs-actions workflow to match the repo-wide bump (#1690), so dependabot does not immediately flag the new file - document in the generator docstring that a switch case label counts as supported purely by existing, so a per-action UnsupportedOperation stub would be a false positive (handlers here reject from the default arm) * docs: regenerate action tables against current handler source Resync the generated Supported Actions tables to handler source after rebasing onto the latest main: - cloudformation: add DescribeStackInstance and DescribeStackSetOperation now emitted by the handler, and keep the implemented StackSet descriptions - cloudtrail: add LookupEvents - firehose: add UpdateDestination - step-functions: add PublishStateMachineVersion, ListStateMachineVersions, DeleteStateMachineVersion - register the cloudcontrol handler in deferred_handlers so the strict unregistered-handler gate passes (no standalone action table yet) * fix(docs): prevent action-table generator from silently dropping actions Address the latest review pass on the action-docs tooling: - switch extraction now captures case arms whose labels wrap across lines (valid Java 14+ syntax). The capture group excludes only `{ } ;` boundaries, so it spans newlines between labels but stops at the arm's `->`. A wrapped arm was previously missed, and docs-check would stay green because the doc and the generated output agreed on the omission, defeating the whole drift-prevention guarantee. - REST extraction skips Javadoc / inline comments between a verb annotation and the method signature; such a line otherwise reset the lookahead and dropped the action. - parse_marker_block raises a descriptive error when a marker is not on its own line, instead of a bare "substring not found". - doc, source, and registry reads/writes are pinned to UTF-8 so generation is locale-independent (the docs contain non-ASCII text). - the docs-actions push trigger watches Makefile and the workflow file, matching its pull_request trigger. Adds regression tests for the multi-line arm and comment-skip paths (20 total). |
||
|
|
058e02630a |
feat(cloudformation): add StackSets with account-aware provisioning (#1551)
* feat(cloudformation): add StackSets with account-aware provisioning Implement CloudFormation StackSets so a template can be deployed across target accounts and regions, and make CloudFormation provisioning land resources in the correct account. Provisioning previously ran on a background executor thread with no request scope, so the downstream service calls fell back to the default account — a stack created by account B materialised its resources under 000000000000. executeChangeSet/deleteStack now run the provisioning under a synthetic request scope bound to the deploying account (the caller's account for a single stack, the target account for a StackSet instance), mirroring the pattern other background workers already use. Single-stack resources now land in the caller's account. StackSet actions are wired through CloudFormationQueryHandler and AwsQueryController: CreateStackSet, DescribeStackSet, ListStackSets, UpdateStackSet, DeleteStackSet, CreateStackInstances, ListStackInstances, DeleteStackInstances, ListStackSetOperations. CreateStackInstances drives the existing single-stack engine once per target (account, region), provisioning each instance into that account's namespace; the stack set, its instances and its operation history live in the administration account. Tests: an integration test deploying a StackSet from an admin account into accounts B and C asserts the resources materialise in B and C and are invisible to the admin/default account, exercises describe/list/operations and instance deletion, and covers the not-found / already-exists / not-empty error paths. A single-stack test asserts resources now land in the caller's account. Design aligned with maintainers in floci-io/floci#1550. * fix(cloudformation): await StackSet instance deletion; test UpdateStackSet Make the account-scoped deleteStack overload return its Future so DeleteStackInstances completes synchronously before the operation returns, rather than racing the async resource removal. Add integration coverage for UpdateStackSet re-applying the template to existing instances. * test(cloudformation): add SDK compatibility test for StackSets Adds an sdk-test-java compatibility test exercising StackSets through the real AWS SDK CloudFormationClient (CreateStackSet, CreateStackInstances, DescribeStackSet, ListStackInstances, ListStackSetOperations, DeleteStackInstances, DeleteStackSet). It asserts the management responses unmarshal cleanly and that instances provision into each target account's namespace (verified via per-account SQS clients), per the project's policy of validating management APIs with AWS SDK clients. Runs in the compatibility CI on pull requests. * feat(cloudformation): add DescribeStackInstance and DescribeStackSetOperation Complete the StackSets API surface with the singular describe operations: DescribeStackInstance (used by orchestration that polls a single instance's status) and DescribeStackSetOperation (companion to ListStackSetOperations). Covered by the integration test and the SDK compatibility test, which confirm the StackInstance / StackSetOperation response shapes unmarshal through the real AWS SDK. * feat(cloudformation): resolve TemplateURL and report StackInstanceStatus.DetailedStatus for StackSets StackSet create/update now resolve a TemplateURL (fetched from S3) in addition to an inline TemplateBody, matching how orchestration tools reference templates staged in S3. DescribeStackInstance and ListStackInstances now also report the nested StackInstanceStatus.DetailedStatus that AWS returns and that pollers read to determine when an instance operation has completed. * feat(cloudformation): derive StackSet operation status and honor RetainStacks Address review feedback on #1551: - Operation status is now derived from instance outcomes: CreateStackInstances and UpdateStackSet report FAILED if any instance fails to deploy, instead of always SUCCEEDED. deployInstance also recognizes a rolled-back create (ROLLBACK_COMPLETE, not *_FAILED) as a failed/INOPERABLE instance, which was previously mis-reported as SUCCEEDED. - DeleteStackInstances honors RetainStacks: when true, the instance is detached from the stack set but its underlying stack and resources are left in place. - UpdateStackSet now persists the refreshed instance records. Tests: RetainStacks retention and the FAILED-operation path; docs updated. * fix(cloudformation): restore account on active scope; log StackSets test teardown Greptile review on #1551: - runUnderAccount now saves and restores the previous account ID when it runs inside an already-active request scope, so it can't leave the overridden account behind on a reused thread. (Background workers normally have no active scope, so this only hardens the synchronous-caller path.) - CloudFormationStackSetsTest teardown no longer swallows exceptions silently; it logs them, per the AGENTS.md no-empty-catch rule. * fix(cloudformation): report a failed StackSet instance delete as FAILED deleteStackInstances awaited the underlying deleteStack via a helper that swallows the failure, then removed the instance record unconditionally and hardcoded the operation status to SUCCEEDED. A failed non-retained delete was therefore reported as a success with the instance silently dropped. await() now returns whether the future completed cleanly. On a non-retained delete failure the instance record is retained (marked INOPERABLE/FAILED) and the operation status is derived via deriveOperationStatus, so it reports FAILED — matching AWS, which does not detach an instance whose stack delete failed. Adds StackSetServiceDeleteFailureTest covering the failure, success, and RetainStacks paths. * fix(cloudformation): reject templateless CreateStackSet and restore interrupt in await CreateStackSet now rejects a request with neither TemplateBody nor TemplateURL (ValidationError, matching AWS) instead of storing a null template — which would otherwise make a later CreateStackInstances deploy empty stacks into every target account. Also handle InterruptedException separately in await(Future) and restore the thread's interrupt flag, so a shutdown signal to the backing ExecutorService propagates instead of being swallowed. Adds a CreateStackSet-without-template integration test. |
||
|
|
e17a8fce36 |
docs(cloudformation): sync supported resource types and annotate stub actions (#1405)
Update docs/services/cloudformation.md to reflect current provisioner coverage (~74 AWS::* types incl. EC2, RDS, EKS, ELBv2, AutoScaling, Kinesis, Firehose, CloudWatch/Logs, Cognito, Batch, Step Functions, full API Gateway). Correct Route53 (now provisioned, not stubbed) and group types by service. Annotate stub/no-op actions (ValidateTemplate, Set/GetStackPolicy, StackSet ops). |
||
|
|
9e35046647 |
Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml * docs: sync with main and new features * docs: reverting docker-compose.yml |
||
|
|
271f27da62 | fix(cfn): reconcile lambda functions on update (#736) | ||
|
|
f30bd79d67 | chore: release 1.5.10 | ||
|
|
a32b7f1f3b |
docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs had drifted from code behaviour. This sweep reconciles docs against the current codebase on upstream/main. - Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history - Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58), Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the actual dispatch handlers rather than @Path annotation counts. - Rewrite README "Supported Services" table to drop per-service op counts (they drift too fast); point readers at docs/services/index.md - Update 24 service docs for accuracy, add "Not Implemented" sections where relevant (s3.md, lambda.md, api-gateway.md) - Refresh configuration and getting-started docs - Add EventBridge Scheduler and AppConfig to mkdocs nav - Add AppConfig / AppConfigData rows to README and services index following the 1.5.2 upstream release |
||
|
|
794939c331 | Add support for CloudFormation's DeleteChangeSet | ||
|
|
61433f59ab | firt commit |