Skip to content

Feature/appsync events cfn - #8912

Closed
MasterOfMastersDestoyerOfWorlds wants to merge 2 commits into
floci-io:mainfrom
MasterOfMastersDestoyerOfWorlds:feature/appsync-events-cfn
Closed

MasterOfMastersDestoyerOfWorlds wants to merge 2 commits into
floci-io:mainfrom
MasterOfMastersDestoyerOfWorlds:feature/appsync-events-cfn

Conversation

@MasterOfMastersDestoyerOfWorlds

@MasterOfMastersDestoyerOfWorlds MasterOfMastersDestoyerOfWorlds commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

Depends on Pull Request #8911

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

Add the AppSync Events API resource (CreateApi, GetApi, UpdateApi,
DeleteApi, ListApis) on /v2/apis. API Gateway v2 serves the same paths,
so a pre-matching AppSyncEventsRouteFilter moves appsync-signed
requests onto an internal prefix served by AppSyncApiController.

CreateApi and UpdateApi validate the event config: at least one auth
provider, provider-specific required config, and every connection,
publish and subscribe mode must name a configured provider. dns.HTTP
and dns.REALTIME carry the partition-aware AWS hosts. DeleteApi
cascades to channel namespaces, API keys and domain associations.

Channel namespaces, API keys and tags now resolve either an Events API
or a GraphQL API. Channel namespaces store and validate publish and
subscribe auth modes, handlerConfigs and tags, enforce the model's name
pattern, use the channelNamespace/ ARN segment from the AWS Service
Authorization Reference, and report created and lastModified in epoch
seconds instead of epoch milliseconds.
…hannelNamespace

Serve the two AppSync Events resource types from AppSyncCfnProvisioner
instead of stubbing them.

Api: Ref is the ApiArn, the registry schema's primary identifier, and
Fn::GetAtt serves ApiId, ApiArn, Dns.Http and Dns.Realtime. Every change
is an in-place UpdateApi addressed by the recorded ApiId. UpdateApi takes
no tags, so the template's tags are set through an internal
replaceApiTags call.

ChannelNamespace: Ref and ChannelNamespaceArn are the namespace ARN.
ApiId and Name are create-only; other changes update in place, and a
dropped mode list, CodeHandlers or HandlerConfigs is cleared.
CodeS3Location is refused with ValidationError.

Both types snapshot before an in-place update and replay it on rollback,
and their deletes tolerate only NotFoundException. Register the types in
the resource inventory, regenerate create-only-properties.json and
schema-surface.tsv from the registry schemas, record drop policies and
the nested Dns attribute gap, and regenerate the CloudFormation docs table.
@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add AppSync Events API management and CloudFormation resources

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add AppSync Events API management while preserving API Gateway v2 routing on shared paths.
• Provision Events APIs and channel namespaces through CloudFormation, including updates and
 rollback.
• Extend SDK coverage and documentation for authentication, resource identities, and current
 limitations.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 4 capabilities

  • 4 affected capabilities span independent functional scopes: appsync_cloudformation_integration, appsync_control_plane_management.
  • Create, read, list, update, tag, and delete operations all implement the single end-to-end behavior of managing an AppSync Events API.
  • The controller, route filter, storage backend, model, and endpoint helpers are propagation hops for that behavior rather than separate capabilities.
  • This is a declarative stack lifecycle behavior with its own physical-identity, replacement, rollback, and attribute-contract outcomes.
  • It is a separate integration scope from direct SDK/REST management even though it calls the same AppSync service.
  • Namespace create/get/list/update/delete, auth-mode validation, tags, and parent API resolution form the bounded child-resource management behavior.
  • Events and GraphQL are two supported parent variants of this same AppSync child-resource integration, not separate deployment layers.
  • This is an independently observable existing outcome: GraphQL API child operations must continue resolving the GraphQL store and its configured authentication types after requireApi was generalized to Events APIs.
  • It shares the AppSync control-plane scope with Events child management but has a distinct existing consumer behavior.
Behavioral complexity 🟡 Medium 🧩 Interacting branches, Compatibility cases

  • Before, AppSync management routes were primarily GraphQL-oriented and API Gateway v2 owned the shared /v2/apis paths.
  • After, AppSync-signed GET/POST/DELETE requests on those paths are conditionally moved to an internal AppSync controller while API Gateway-signed requests must remain public.
  • The new correctness conditions are service-aware route selection, method/path filtering, distinct Events versus GraphQL persistent stores, and exact REST-JSON model/timestamp/ARN/DNS compatibility.
  • These are newly interacting compatibility branches, not merely routine use of an existing mapper.
Potential damage 🟡 Medium 🩹 Temporary loss

  • A wrong route, malformed response, or invalid persisted metadata can prevent SDK/CLI clients from creating or managing Events APIs or can return unusable ARN/DNS/configuration data.
  • Reverting code restores the implementation, but already-created emulator state may require deleting or recreating affected records; no external data-plane effect is introduced because the Events data plane remains unimplemented.
  • Generally recoverable by code rollback and retrying management operations.
  • If incorrect API records, tags, or child associations were persisted, rollback alone does not repair them; operators must delete/recreate or manually correct the emulator state.
  • No automatic repair worker or retry scheduler is shown.
Assessed commit 38daef6
Diagram

graph TD
  Clients["Signed clients"] --> Route["Route filter"] --> Controller["Events controller"] --> Service["AppSync service"] --> Events[("Events APIs")]
  Cfn["CFN provisioner"] --> Service --> Children[("Shared child resources")]
Loading
High-Level Assessment

Reuse of the existing signed-route helper, AppSync service, and CloudFormation provisioner fits the shared paths and resource lifecycle. Separate routing or provisioning stacks would duplicate established behavior without a clear benefit.

Files changed (27) +1954 / -52

Enhancement (9) +937 / -25
AwsEndpoints.javaConstruct partition-aware Events DNS hosts +10/-0

Construct partition-aware Events DNS hosts

• Adds helpers for the HTTP and realtime hostnames returned by Events APIs.

src/main/java/io/floci/aws/core/common/AwsEndpoints.java

AppSyncApiController.javaExpose Events API management operations +105/-0

Expose Events API management operations

• Adds create, get, update, delete, and list handlers under the internally routed v2 path, with SDK-compatible response wrappers.

src/main/java/io/floci/aws/services/appsync/AppSyncApiController.java

AppSyncEventsRouteFilter.javaDisambiguate AppSync and API Gateway v2 paths +61/-0

Disambiguate AppSync and API Gateway v2 paths

• Routes supported AppSync-signed API management requests to the internal Events controller before endpoint matching. Leaves API Gateway requests and deeper, non-colliding paths on their public routes.

src/main/java/io/floci/aws/services/appsync/AppSyncEventsRouteFilter.java

AppSyncService.javaManage Events APIs and their shared child resources +369/-21

Manage Events APIs and their shared child resources

• Adds persistent Events API lifecycle operations, event-auth validation, DNS and ARN generation, tags, and deletion cascades. Extends API keys and channel namespaces to Events parents and corrects namespace ARN and timestamp formats.

src/main/java/io/floci/aws/services/appsync/AppSyncService.java

Api.javaModel an AppSync Events API +107/-0

Model an AppSync Events API

• Defines the persisted and serialized API identity, configuration, DNS, tags, and creation timestamp.

src/main/java/io/floci/aws/services/appsync/model/Api.java

EventAuthProvider.javaModel Events authentication providers +50/-0

Model Events authentication providers

• Adds serializable provider settings for IAM, API key, Lambda, Cognito, and OIDC authentication.

src/main/java/io/floci/aws/services/appsync/model/EventAuthProvider.java

EventConfig.javaModel Events authentication modes and logging +59/-0

Model Events authentication modes and logging

• Represents configured providers, connection and default operation modes, and optional logging configuration.

src/main/java/io/floci/aws/services/appsync/model/EventConfig.java

EventLogConfig.javaModel stored Events log configuration +30/-0

Model stored Events log configuration

• Adds log level and CloudWatch role fields for configuration round-tripping; log delivery is not implemented.

src/main/java/io/floci/aws/services/appsync/model/EventLogConfig.java

AppSyncCfnProvisioner.javaProvision Events APIs and channel namespaces +146/-4

Provision Events APIs and channel namespaces

• Adds create, update, rollback, and delete handling for both resource types, using ARN physical IDs and schema-defined attributes. Handles tag replacement, dropped properties, namespace replacement rules, and unsupported S3 handler code.

src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java

Bug fix (1) +6 / -6
ChannelNamespace.javaRepresent namespace timestamps in epoch seconds +6/-6

Represent namespace timestamps in epoch seconds

• Changes created and lastModified from millisecond-valued longs to SDK-compatible epoch-second doubles.

src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java

Tests (12) +930 / -10
AppSyncTest.javaExercise Events API lifecycle through the compatibility SDK +45/-0

Exercise Events API lifecycle through the compatibility SDK

• Adds a create, read, list, update, namespace, and delete scenario. Checks ARN and DNS values, timestamps, and rejection of an unconfigured namespace auth mode.

compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AppSyncTest.java

RequestRegionArnIntegrationTest.javaAssert the corrected namespace ARN segment +3/-1

Assert the corrected namespace ARN segment

• Extends the request-region test to check the singular channelNamespace ARN path.

src/test/java/io/floci/aws/core/common/RequestRegionArnIntegrationTest.java

RestCrossServiceRouteCollisionIntegrationTest.javaVerify signed routing across shared v2 paths +49/-6

Verify signed routing across shared v2 paths

• Checks that AppSync-signed management calls reach AppSync, API Gateway-signed calls retain API Gateway responses, and unsupported colliding operations remain rejected.

src/test/java/io/floci/aws/core/common/RestCrossServiceRouteCollisionIntegrationTest.java

SignedServiceRouteIntegrationTest.javaReject unauthorized direct access to the AppSync prefix +1/-1

Reject unauthorized direct access to the AppSync prefix

• Adds the internal AppSync path to signed-route access-control coverage.

src/test/java/io/floci/aws/core/common/SignedServiceRouteIntegrationTest.java

AppSyncEventsApiIntegrationTest.javaTest Events management with the AWS SDK +187/-0

Test Events management with the AWS SDK

• Covers API and namespace lifecycle, SDK timestamp parsing, tags, auth-mode validation, and child-resource cleanup.

src/test/java/io/floci/aws/services/appsync/AppSyncEventsApiIntegrationTest.java

AppSyncServiceTest.javaTest Events service validation and persistence +205/-0

Test Events service validation and persistence

• Adds service-level checks for partition-aware identities, authentication requirements, failed-update atomicity, namespace naming and modes, tagging, and deletion.

src/test/java/io/floci/aws/services/appsync/AppSyncServiceTest.java

AppSyncEventsCfnIntegrationTest.javaDeploy and update Events resources across stacks +182/-0

Deploy and update Events resources across stacks

• Tests exported API IDs and ARNs, imported namespace references, DNS attributes, in-place updates, namespace rollback, and stack deletion.

src/test/java/io/floci/aws/services/cloudformation/AppSyncEventsCfnIntegrationTest.java

AppSyncCfnProvisionerTest.javaCover Events provisioner lifecycle decisions +241/-2

Cover Events provisioner lifecycle decisions

• Verifies property translation, physical IDs and attributes, tag replacement, dropped-property handling, rollback, unsupported code locations, and deletion behavior.

src/test/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisionerTest.java

drop-policy.tsvRecord Events property-drop policies +12/-0

Record Events property-drop policies

• Adds expected keep, clear, and create-only behavior for Events API and namespace properties.

src/test/resources/cloudformation/drop-policy.tsv

getatt-attribute-gaps.tsvAccount for nested Events DNS attributes +1/-0

Account for nested Events DNS attributes

• Records that CloudFormation exposes dotted DNS attributes rather than a standalone Dns attribute.

src/test/resources/cloudformation/getatt-attribute-gaps.tsv

schema-surface.tsvTrack Events CloudFormation schema surfaces +2/-0

Track Events CloudFormation schema surfaces

• Adds declared properties and read-only attributes for Api and ChannelNamespace.

src/test/resources/cloudformation/schema-surface.tsv

supported-resource-types.tsvAssert Events resources have a provisioner +2/-0

Assert Events resources have a provisioner

• Maps both new AppSync resource types to AppSyncCfnProvisioner in the supported-types fixture.

src/test/resources/cloudformation/supported-resource-types.tsv

Documentation (3) +74 / -10
appsync.mdDocument Events management and CloudFormation behavior +69/-7

Document Events management and CloudFormation behavior

• Describes Events operations, signed routing, authentication rules, namespace behavior, and CloudFormation identities and updates. Distinguishes supported management operations from the unimplemented Events data plane.

docs/services/appsync.md

cloudformation.mdList the two supported AppSync Events resource types +1/-1

List the two supported AppSync Events resource types

• Adds Api and ChannelNamespace to the supported-resource table and clarifies their ARN-valued Ref behavior.

docs/services/cloudformation.md

cfn_resource_types.yamlInclude Events resources in generated support documentation +4/-2

Include Events resources in generated support documentation

• Adds Api and ChannelNamespace to the AppSync resource order and describes their ARN-valued Ref results.

tools/docs/cfn_resource_types.yaml

Other (2) +7 / -1
ResolvedServiceCatalog.javaRegister the Events management controller +2/-1

Register the Events management controller

• Includes AppSyncApiController among the controllers associated with the AppSync service.

src/main/java/io/floci/aws/core/common/ResolvedServiceCatalog.java

create-only-properties.jsonDeclare Events resource replacement properties +5/-0

Declare Events resource replacement properties

• Marks ChannelNamespace ApiId and Name as create-only while declaring no create-only properties for Api.

src/main/resources/cloudformation/create-only-properties.json

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Events API config checks are untested for most providers 📘 Rule violation ≡ Correctness
Description
requireConfigMember rejects a missing userPoolId or awsRegion on a Cognito provider and a
missing issuer on an OIDC provider, and parseEventConfig rejects a bad logConfig.logLevel or a
missing cloudWatchLogsRoleArn. The new AppSyncServiceTest cases only exercise the AWS_LAMBDA
authorizerUri refusal, so a regression in any of these boundary checks would pass the suite
unnoticed.
Code

src/main/java/io/floci/aws/services/appsync/AppSyncService.java[R418-421]

+    private void requireConfigMember(AuthenticationType type, String configName, Map<String, Object> config,
+                                     String member) {
+        String value = config == null ? null : coerceString(config.get(member));
+        if (value == null || value.isBlank()) {
Relevance

●●● Strong

Requests for tests covering new validation branches were accepted; matches rule for regression
tests.

PR-#8620

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3865583 requires a regression test for each new validation path that rejects with a 400 and
leaves state unchanged. The Cognito, OIDC and log-config refusals have no such test.

Rule 3865583: When validating request fields, reject invalid input at the boundary and add regression tests
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[418-425]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Events API validation in `AppSyncService` has no regression tests for the Cognito (`userPoolId`, `awsRegion`), OIDC (`issuer`) and `logConfig` (`logLevel`, `cloudWatchLogsRoleArn`) rejection paths. Compliance rule 3865583 requires a test per new validation path that asserts a 400 and no stored state change.

## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[418-425]
- src/test/java/io/floci/aws/services/appsync/AppSyncServiceTest.java[860-870]

## Recommended Fix
In `AppSyncServiceTest`, add parameterized tests that call `createApi` with a COGNITO_USER_POOLS provider missing `userPoolId` or `awsRegion`, an OPENID_CONNECT provider missing `issuer`, an invalid `logConfig.logLevel`, and a missing `cloudWatchLogsRoleArn`. Each test should assert `BadRequestException` and that `listApis` is unchanged, following the pattern of `createApiRefusesALambdaProviderWithoutAnAuthorizerUri`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Renamed namespaces remain after updates 🐞 Bug ≡ Correctness
Description
provisionChannelNamespace creates a namespace when ApiId or Name changes, then overwrites the
resource identifiers without recording the displaced namespace for cleanup. After a successful stack
update, the old namespace remains in AppSync and can conflict with a later attempt to reuse its
name.
Code

src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[R572-575]

+            ns = appSyncService.createChannelNamespace(apiId, req);
+        }
+
+        r.setPhysicalId(ns.getChannelNamespaceArn());
Relevance

●●● Strong

Old-resource cleanup after replacement was accepted in past reviews of replacement handling.

PR-#4511

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Changing either create-only identifier takes the creation branch, which replaces the recorded
identity. The provisioner has no replacement detection or cleanup override, so the stack engine does
not delete the previous namespace.

src/main/resources/cloudformation/create-only-properties.json[92-95]
src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-579]
src/main/java/io/floci/aws/services/cloudformation/provisioners/CfnResourceProvisioner.java[137-145]
src/main/java/io/floci/aws/services/cloudformation/CloudFormationService.java[3453-3455]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A successful namespace replacement leaves its previous namespace behind.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-579]
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[610-617]
## Recommended Fix
Record the displaced namespace's API ID and name when creating its replacement, implement replacement detection and post-commit cleanup, and retain the tracking state until cleanup succeeds.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


3. Namespace replacement blocks rollback 🐞 Bug ☼ Reliability
Description
provisionChannelNamespace takes the creation branch for a replacement but records no snapshot or
other state that rollbackUpdate can use to undo it. If a later resource fails during the stack
update, the rollback walker treats this as an update to an existing resource, cannot remove the
newly created namespace, and marks rollback failed.
Code

src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[R568-572]

+        } else {
+            if (!tags.isEmpty()) {
+                req.put("tags", tags);
+            }
+            ns = appSyncService.createChannelNamespace(apiId, req);
Relevance

●●● Strong

Rollback-failure findings for replacements without snapshots were accepted in prior CloudFormation
reviews.

PR-#4731
PR-#4511

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The replacement branch creates no in-place snapshot, while rollback of an attempted update with a
previous resource calls rollbackUpdate rather than deleting the new entity. That method returns
false without a snapshot, causing the rollback walker to record failure.

src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-578]
src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[584-594]
src/main/java/io/floci/aws/services/cloudformation/CloudFormationService.java[3709-3755]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A failed stack update cannot roll back a namespace replacement.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-579]
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[584-594]
## Recommended Fix
Persist the previous and replacement identities on the attempted resource. Teach rollback to delete the replacement and restore the prior resource identity, while keeping successful-update cleanup separate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View high (1)
4. Other regions can delete Events APIs 🐞 Bug ≡ Correctness
Description
getApi, listApis, updateApi, and deleteApi use an account-scoped store without comparing the
request region to the API ARN's region. A request from the same account signed for a different
served region can list, read, modify, or delete the API, including its children on deletion.
Code

src/main/java/io/floci/aws/services/appsync/AppSyncService.java[R286-293]

+    public Api getApi(String apiId) {
+        return eventApiStore.get(apiId)
+                .orElseThrow(() -> new AwsException("NotFoundException", "API not found: " + apiId, 404));
+    }
+
+    public Page<Api> listApis(Integer maxResults, String nextToken) {
+        return paginate(eventApiStore.scan(k -> true), nextToken, maxResults);
+    }
Relevance

●●● Strong

Region-scoping of resources to the request/ARN region was consistently accepted in past reviews.

PR-#5053
PR-#8077

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Creation embeds the selected region in the ARN, but all subsequent Events API lookups use only the
account and API ID. The request context contains a signing region, and the storage backend
partitions by account rather than region.

src/main/java/io/floci/aws/services/appsync/AppSyncService.java[266-293]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[295-317]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[473-501]
src/main/java/io/floci/aws/core/common/AccountContextFilter.java[104-127]
src/main/java/io/floci/aws/core/storage/AccountAwareStorageBackend.java[107-115]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Events API lookups ignore the region of the incoming request.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[286-317]
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[473-501]
## Recommended Fix
Filter listings and reject API and child-resource lookups whose stored ARN region differs from the effective request region. Preserve explicit stack-region context for CloudFormation worker calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Remediation recommended

5. Query-signed APIs get the wrong region 🐞 Bug ≡ Correctness
Description
createApi passes RegionResolver.resolveRegion(headers) to the service, but that method does not
read the credential in a query-signed request. When such a request has no Authorization header and
signs for a region other than the configured default, the created API receives the default region in
its ARN and DNS names.
Code

src/main/java/io/floci/aws/services/appsync/AppSyncApiController.java[R50-52]

+    public Response createApi(@Context HttpHeaders headers, String body) throws IOException {
+        Api api = service.createApi(readRequest(body), regionResolver.resolveRegion(headers));
+        return Response.ok(wrap(api)).build();
Relevance

●●● Strong

Presigned/query-signed region from headers was accepted in prior reviews; RegionResolver header-only
resolution is a known gap.

PR-#7781
PR-#5589

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Routing and account context both recognize query credentials, and account context records their
region. Header-only resolution falls back to the default without Authorization; the service uses
that result to mint the ARN and DNS names.

src/main/java/io/floci/aws/core/common/SignedServiceRoute.java[78-88]
src/main/java/io/floci/aws/core/common/AccountContextFilter.java[130-153]
src/main/java/io/floci/aws/core/common/RegionResolver.java[86-95]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[266-281]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Query-signed creates use the deployment default instead of the credential's region.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncApiController.java[49-52]
## Recommended Fix
Use the region already established in request context for API creation, including query-signed requests, rather than resolving it solely from headers.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


6. Saved namespaces show far-future dates 🐞 Bug ≡ Correctness
Description
ChannelNamespace.created and lastModified are now read and emitted as epoch seconds, but
previously persisted millisecond values are not converted when the store loads. After an upgrade
using persistent storage, SDK clients receive creation dates far in the future, and updating a
namespace does not correct its original created value.
Code

src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[R19-21]

+    private Double created;
    private HandlerConfigs handlerConfigs;
-    private Long lastModified;
+    private Double lastModified;
Relevance

●● Moderate

Legacy persisted-data compatibility concerns were mixed (some accepted, some rejected); the
unit-change impact is real but the team's stance is uncertain.

PR-#7065
PR-#5694

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The previous createChannelNamespace and updateChannelNamespace code wrote
System.currentTimeMillis() into persisted namespace records, while the new code writes epoch
seconds into Double fields. Changing the number type does not change the numeric values in older
records, and AppSync's configurable persistent storage allows those records to survive an upgrade
unchanged.

src/main/java/io/floci/aws/services/appsync/AppSyncService.java[1214-1216]
src/main/java/io/floci/aws/core/common/ResolvedServiceCatalog.java[736-740]
src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[16-21]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[1203-1217]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[1221-1251]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Previously saved channel namespace timestamps retain millisecond values under the new seconds-based model, so records loaded after an upgrade expose dates far in the future.

## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[19-21]
- src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[41-48]
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[1214-1216]

## Recommended Fix
Normalize legacy `created` and `lastModified` values when loading persisted namespaces, before exposing or updating them. In the timestamp setters or Jackson setters used on load, divide values greater than about 1e11 by 1000 to convert legacy milliseconds to seconds. Test loading and updating a namespace saved in the previous storage format, including that its creation date remains correct.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

7. Docs promise a failure that updates never raise 🐞 Bug ⚙ Maintainability
Description
The new docs say a template without EventConfig fails the resource, but the provisioner lists
EventConfig as kept-on-drop for AWS::AppSync::Api, so clearDropped leaves it out of the
UpdateApi request. Only a create fails. An UpdateStack that drops EventConfig succeeds and
keeps the old config, so a reader who trusts the docs gets the wrong result.
Code

docs/services/appsync.md[R656-657]

+  `EventConfig` is replaced as a whole. A template without `EventConfig` fails the resource, since
+  `CreateApi` requires one.
Relevance

●●● Strong

Doc-accuracy corrections on this PR's own docs were accepted in review; trivial factual fix.

PR-#7599

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
On update, KEPT_ON_DROP holds EventConfig, so dropPolicy returns keep and clearDropped
never sends eventConfig. updateApi changes eventConfig only when the request contains it, so
the stored config stays and the update succeeds. The drop-policy table records this as keep.

src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[122-127]
src/main/java/io/floci/aws/services/appsync/AppSyncService.java[295-308]
src/test/resources/cloudformation/drop-policy.tsv[20-23]
PR-#7599

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The docs say a template without `EventConfig` fails the resource. That only happens on create. On update, a dropped `EventConfig` is kept.

## Fix Focus Areas
- docs/services/appsync.md[655-657]

## Recommended Fix
Rewrite the sentence: "A create without `EventConfig` fails the resource, since `CreateApi` requires one; an update that drops it keeps the API's current event config."

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 15 rules
✅ Web pages:
  +11 more
✅ Cross-repo context — repo relationships
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: 🧠 Deep: Broad API, routing, and CloudFormation changes create numerous independent risks.

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +418 to +421
private void requireConfigMember(AuthenticationType type, String configName, Map<String, Object> config,
String member) {
String value = config == null ? null : coerceString(config.get(member));
if (value == null || value.isBlank()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Events api config checks are untested for most providers 📘 Rule violation ≡ Correctness

requireConfigMember rejects a missing userPoolId or awsRegion on a Cognito provider and a
missing issuer on an OIDC provider, and parseEventConfig rejects a bad logConfig.logLevel or a
missing cloudWatchLogsRoleArn. The new AppSyncServiceTest cases only exercise the AWS_LAMBDA
authorizerUri refusal, so a regression in any of these boundary checks would pass the suite
unnoticed.
Agent Prompt
## Issue description
The Events API validation in `AppSyncService` has no regression tests for the Cognito (`userPoolId`, `awsRegion`), OIDC (`issuer`) and `logConfig` (`logLevel`, `cloudWatchLogsRoleArn`) rejection paths. Compliance rule 3865583 requires a test per new validation path that asserts a 400 and no stored state change.

## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[418-425]
- src/test/java/io/floci/aws/services/appsync/AppSyncServiceTest.java[860-870]

## Recommended Fix
In `AppSyncServiceTest`, add parameterized tests that call `createApi` with a COGNITO_USER_POOLS provider missing `userPoolId` or `awsRegion`, an OPENID_CONNECT provider missing `issuer`, an invalid `logConfig.logLevel`, and a missing `cloudWatchLogsRoleArn`. Each test should assert `BadRequestException` and that `listApis` is unchanged, following the pattern of `createApiRefusesALambdaProviderWithoutAnAuthorizerUri`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +572 to +575
ns = appSyncService.createChannelNamespace(apiId, req);
}

r.setPhysicalId(ns.getChannelNamespaceArn());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Renamed namespaces remain after updates 🐞 Bug ≡ Correctness

provisionChannelNamespace creates a namespace when ApiId or Name changes, then overwrites the
resource identifiers without recording the displaced namespace for cleanup. After a successful stack
update, the old namespace remains in AppSync and can conflict with a later attempt to reuse its
name.
Agent Prompt
## Issue description
A successful namespace replacement leaves its previous namespace behind.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-579]
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[610-617]
## Recommended Fix
Record the displaced namespace's API ID and name when creating its replacement, implement replacement detection and post-commit cleanup, and retain the tracking state until cleanup succeeds.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +568 to +572
} else {
if (!tags.isEmpty()) {
req.put("tags", tags);
}
ns = appSyncService.createChannelNamespace(apiId, req);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

3. Namespace replacement blocks rollback 🐞 Bug ☼ Reliability

provisionChannelNamespace takes the creation branch for a replacement but records no snapshot or
other state that rollbackUpdate can use to undo it. If a later resource fails during the stack
update, the rollback walker treats this as an update to an existing resource, cannot remove the
newly created namespace, and marks rollback failed.
Agent Prompt
## Issue description
A failed stack update cannot roll back a namespace replacement.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[556-579]
- src/main/java/io/floci/aws/services/cloudformation/provisioners/AppSyncCfnProvisioner.java[584-594]
## Recommended Fix
Persist the previous and replacement identities on the attempted resource. Teach rollback to delete the replacement and restore the prior resource identity, while keeping successful-update cleanup separate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +286 to +293
public Api getApi(String apiId) {
return eventApiStore.get(apiId)
.orElseThrow(() -> new AwsException("NotFoundException", "API not found: " + apiId, 404));
}

public Page<Api> listApis(Integer maxResults, String nextToken) {
return paginate(eventApiStore.scan(k -> true), nextToken, maxResults);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

4. Other regions can delete events apis 🐞 Bug ≡ Correctness

getApi, listApis, updateApi, and deleteApi use an account-scoped store without comparing the
request region to the API ARN's region. A request from the same account signed for a different
served region can list, read, modify, or delete the API, including its children on deletion.
Agent Prompt
## Issue description
Events API lookups ignore the region of the incoming request.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[286-317]
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[473-501]
## Recommended Fix
Filter listings and reject API and child-resource lookups whose stored ARN region differs from the effective request region. Preserve explicit stack-region context for CloudFormation worker calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +50 to +52
public Response createApi(@Context HttpHeaders headers, String body) throws IOException {
Api api = service.createApi(readRequest(body), regionResolver.resolveRegion(headers));
return Response.ok(wrap(api)).build();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

5. Query-signed apis get the wrong region 🐞 Bug ≡ Correctness

createApi passes RegionResolver.resolveRegion(headers) to the service, but that method does not
read the credential in a query-signed request. When such a request has no Authorization header and
signs for a region other than the configured default, the created API receives the default region in
its ARN and DNS names.
Agent Prompt
## Issue description
Query-signed creates use the deployment default instead of the credential's region.
## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/AppSyncApiController.java[49-52]
## Recommended Fix
Use the region already established in request context for API creation, including query-signed requests, rather than resolving it solely from headers.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment thread docs/services/appsync.md
Comment on lines +656 to +657
`EventConfig` is replaced as a whole. A template without `EventConfig` fails the resource, since
`CreateApi` requires one.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

7. Docs promise a failure that updates never raise 🐞 Bug ⚙ Maintainability

The new docs say a template without EventConfig fails the resource, but the provisioner lists
EventConfig as kept-on-drop for AWS::AppSync::Api, so clearDropped leaves it out of the
UpdateApi request. Only a create fails. An UpdateStack that drops EventConfig succeeds and
keeps the old config, so a reader who trusts the docs gets the wrong result.
Agent Prompt
## Issue description
The docs say a template without `EventConfig` fails the resource. That only happens on create. On update, a dropped `EventConfig` is kept.

## Fix Focus Areas
- docs/services/appsync.md[655-657]

## Recommended Fix
Rewrite the sentence: "A create without `EventConfig` fails the resource, since `CreateApi` requires one; an update that drops it keeps the API's current event config."

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +19 to +21
private Double created;
private HandlerConfigs handlerConfigs;
private Long lastModified;
private Double lastModified;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

6. Saved namespaces show far-future dates 🐞 Bug ≡ Correctness

ChannelNamespace.created and lastModified are now read and emitted as epoch seconds, but
previously persisted millisecond values are not converted when the store loads. After an upgrade
using persistent storage, SDK clients receive creation dates far in the future, and updating a
namespace does not correct its original created value.
Agent Prompt
## Issue description
Previously saved channel namespace timestamps retain millisecond values under the new seconds-based model, so records loaded after an upgrade expose dates far in the future.

## Fix Focus Areas
- src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[19-21]
- src/main/java/io/floci/aws/services/appsync/model/ChannelNamespace.java[41-48]
- src/main/java/io/floci/aws/services/appsync/AppSyncService.java[1214-1216]

## Recommended Fix
Normalize legacy `created` and `lastModified` values when loading persisted namespaces, before exposing or updating them. In the timestamp setters or Jackson setters used on load, divide values greater than about 1e11 by 1000 to convert legacy milliseconds to seconds. Test loading and updating a namespace saved in the previous storage format, including that its creation date remains correct.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

@hectorvent hectorvent added appsync AWS AppSync cloudformation AWS CloudFormation labels Nov 18, 2026
@pgermosen

Copy link
Copy Markdown
Member

@MasterOfMastersDestoyerOfWorlds welcome, and thanks for your first PR! This one carries #8911's first commit underneath the CloudFormation work, so it can't be reviewed on its own yet. Could you rebase it onto main once #8911 merges, so only the CloudFormation commit is left?

A couple of small things for then: both commits need signing, which main requires before a merge (GitHub's guide), and the title needs a Conventional Commits prefix, e.g. feat(cloudformation): provision AWS::AppSync::Api and AWS::AppSync::ChannelNamespace. It would also help to open an issue setting out the scope of the Events API work across #8911, this PR and #8913, and link it here with Closes #N.

@pgermosen pgermosen added the waiting-author Review posted; waiting on the PR author to respond label Nov 19, 2026
@pgermosen pgermosen mentioned this pull request Nov 19, 2026
4 of 8 tasks
@pgermosen

Copy link
Copy Markdown
Member

@MasterOfMastersDestoyerOfWorlds I'm closing this one too, since it is built on #8911, which I closed, and it has been quiet for a few days. The CloudFormation work is welcome once the Events API management is in: a fresh PR on top of main with just the CloudFormation commit, signed, with a Conventional Commits title (e.g. feat(cloudformation): provision AWS::AppSync::Api and AWS::AppSync::ChannelNamespace) and Closes #9001 or a narrower issue, would be great. Thanks again for the work here.

@pgermosen pgermosen closed this Nov 21, 2026
@pgermosen pgermosen removed the waiting-author Review posted; waiting on the PR author to respond label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

appsync AWS AppSync cloudformation AWS CloudFormation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants