Commit Graph
1922 Commits
Author SHA1 Message Date
Hector Ventura 898615707d fix(cloudmap): avoid SecureRandom in native image heap (#1289)
CloudMapService held a static final SecureRandom, which GraalVM evaluates
at build time and bakes into the image heap with a cached seed, failing the
native build (DisallowedImageHeapObjects). Make it a non-static instance field
on the @ApplicationScoped bean so it is created at runtime instead, matching
how other services (msk, opensearch, rds) construct SecureRandom locally.

Also remove the stray src/main/resources/application.yml.bak that triggered an
"Unrecognized configuration file" warning during the native build.
2026-06-10 17:54:20 -05:00
TomDav28andTomer David 076afb3ebd feat(parity): emit LocalStack-compatible "Ready." log line on startup (#1284)
Co-authored-by: Tomer David <tomer.david+catonian@catonetworks.com>
2026-06-10 07:52:15 -05:00
Hector Ventura f669116908 feat(eks): support managed node groups (create/describe/list/delete) (#1226)
* feat(eks): support managed node groups (create/describe/list/delete)

aws eks create-nodegroup returned a 400 S3 error ("POST requires ?uploads
parameter") because EksController declared no route for
/clusters/{name}/node-groups, so the request fell through to S3's path-style
catch-all. Add the nodegroup REST routes (which outrank S3's templated path)
plus management-plane node group CRUD.

Node groups are emulated as catalog records that become ACTIVE immediately,
mirroring mock-mode cluster creation; no real worker nodes are provisioned
(k3s schedules pods on its built-in node in real mode).

Closes #1137

* refactor(eks): drop unused nextToken/maxResults params from listNodegroups
2026-06-09 02:09:16 -05:00
shrimptails-f 2ba1798b5d feat(elbv2): align DescribeLoadBalancers availability zones with AWS behavior (#1206)
* feat(elbv2): align DescribeLoadBalancers availability zones with AWS behavior

* feat(elbv2): align DescribeLoadBalancers availability zones with AWS behavior

* feat(elbv2): return SubnetNotFound for missing load balancer subnets
2026-06-09 00:57:56 -05:00
Luke Walker a89121c625 feat(cloudformation): provision AWS::StepFunctions::StateMachine (#1152)
CloudFormationResourceProvisioner previously had no case for
AWS::StepFunctions::StateMachine, so stacks containing one fell through
to the default branch that stubs a placeholder ARN and reports
CREATE_COMPLETE without invoking StepFunctionsService. Downstream
EventBridge Pipes that target the state machine then fail at runtime
with "State machine does not exist".

Add a provisioner that:

- Resolves StateMachineName (auto-generating from logical id when absent)
- Resolves DefinitionString and applies DefinitionSubstitutions
  (the same ${Var} replacement CloudFormation performs server-side)
- Resolves RoleArn, StateMachineType, and Tags
- Delegates to the existing StepFunctionsService.createStateMachine
- Sets PhysicalId to the canonical ARN (matching AWS Ref semantics)
  and exposes the Arn and Name attributes for Fn::GetAtt

Also wire deletion through StepFunctionsService.deleteStateMachine.

Adds an integration test that creates a stack with substitutions,
asserts the resolved definition is stored, asserts CFN outputs return
the canonical ARN and name, and asserts deletion removes the resource.
2026-06-09 00:42:54 -05:00
Kenshin Okinaka 35f597addd feat(ses): publish events to Firehose, EventBridge, CloudWatch (#1188)
* feat(ses): publish events to Firehose, EventBridge, and CloudWatch destinations

Extend SES V2 configuration set event publishing so destinations beyond
SnsDestination actually deliver. Previously KinesisFirehoseDestination,
EventBridgeDestination, and CloudWatchDestination were stored but the
publisher logged a warning and skipped. PinpointDestination still skips.

- KinesisFirehoseDestination → single Firehose PutRecord per event;
  S3-backed streams flush accumulated records as NDJSON once the default
  count threshold is reached.
- EventBridgeDestination → PutEvents entry with Source=aws.ses,
  DetailType="Email <EventTypeLabel>", payload as Detail. Region is
  stamped on the entry (so matchesPattern + envelope agree on a
  non-default region) and Resources is always present (empty when
  sourceArn is null — matchesPattern's resources-filter branch casts
  entry.get("Resources") unconditionally).
- CloudWatchDestination → MetricDatum to AWS/SES with Unit=Count.
  Dimensions resolved from DimensionConfigurations against EmailTags
  (MESSAGE_TAG / messageTag), email headers (EMAIL_HEADER / emailHeader),
  or ses:configuration-set, falling back to DefaultDimensionValue.
  Timestamp left to putMetricData's epoch-seconds default.

Tests
- SesEventPublishingV2IntegrationTest @Order 14-28: per-destination
  setup → send → assert, plus a cross-region (eu-west-1) EventBridge
  case pinning region propagation end-to-end.
- SesEventPublisherTest (Mockito ArgumentCaptor): the EB PutEvents
  entry always carries Resources as an ArrayNode — integration tests
  cannot pin this because EventBridgeService.buildEventEnvelope
  defaults a missing key via getOrDefault.

Docs
- docs/services/ses.md: replace the SNS-only claim with the four
  supported destination types.

* fix(ses): use AWS past-tense detail-type for EventBridge SES events

The EventBridge publisher was emitting "Email Send", "Email Delivery",
etc — derived from the SNS notification eventType vocabulary by
prepending "Email ". AWS uses a separate past-tense vocabulary on
EventBridge: "Email Sent", "Email Delivered", "Email Bounced", "Email
Complaint Received", "Email Rejected", "Email Opened", "Email Clicked",
"Email Rendering Failed", "Email Delivery Delayed", "Email Subscribed"
(see https://docs.aws.amazon.com/eventbridge/latest/ref/events-ref-ses.html).

A customer rule pattern keyed on the AWS value
({"source":["aws.ses"],"detail-type":["Email Delivered"]}) would
silently fail to match Floci events.

Changes:
- Add SesEventPayload.eventBridgeDetailType returning the past-tense
  EventBridge vocabulary. Kept separate from eventTypeLabel (which
  remains correct for SNS notifications and CloudWatch metric names).
- SesEventPublisher.publishEventBridge uses the new mapping.

Tests
- SesEventPayloadTest.eventBridgeDetailType_matchesAwsPastTenseVocabulary:
  pins all 10 mappings against AWS docs.
- SesEventPublishingV2IntegrationTest @Order 29
  (eventBridge_detailTypePattern_keyedOnAwsSentValue_matches):
  structural pin — creates a rule with EventPattern
  {"source":["aws.ses"],"detail-type":["Email Sent"]} and asserts the
  SQS target receives the SEND envelope. A regression to "Email Send"
  would cause the rule to silently drop the event, failing the test
  without relying on any hard-coded assertion string.
- Existing tests updated to assert the AWS values:
  SesEventPublishingV2IntegrationTest 4 assertions; sdk-test-java
  SesEventPublishingTest 3 assertions.

* fix(ses): emit CloudWatch metric name "RenderingFailure" without space

AWS CloudWatch metric publishing for SES uses "RenderingFailure" (no
space) for the RENDERING_FAILURE event type — verified against real
AWS by configuring a CW event destination on a configuration set,
sending a templated email with a missing TemplateData key to trigger
the rendering failure path, and capturing the new metric name from
`aws cloudwatch list-metrics --namespace AWS/SES`.

Floci's publisher was previously sourcing the CW MetricName from
SesEventPayload.eventTypeLabel, which returns "Rendering Failure" (with
space). That spelling is correct for the SNS notification's eventType
field but wrong for CloudWatch — customer dashboards / alarms keyed on
the AWS-correct "RenderingFailure" never see Floci's metric.

Changes:
- Add SesEventPayload.cloudWatchMetricName returning the CW spelling.
  Mirrors eventTypeLabel for every other case so the two stay aligned
  in shape; only RENDERING_FAILURE differs.
- SesEventPublisher.publishCloudWatch uses the new mapping.
- SesEventPayloadTest.cloudWatchMetricName_matchesAwsCwSpelling pins
  all 10 mappings; RENDERING_FAILURE expectation comes from the live
  AWS capture rather than an AWS docs guess.

DELIVERY_DELAY remains as "DeliveryDelay" in this commit — it could
not be triggered conveniently from the SES sandbox (needs genuine SES
backoff), so leaving the existing value rather than guessing. Flagged
in code comments as needing future verification.

The other simple metric names (Send, Delivery, Bounce, Complaint) were
also verified against the same AWS capture and match Floci's existing
spelling byte-for-byte — no change needed for those.
2026-06-09 00:36:28 -05:00
Prakhar Kapoor 3065774e80 feat(ec2): auto-create default security group and main route table on CreateVpc (closes #1091) (#1177)
* feat(ec2): implement default security group and main route table creation for VPC

* fix(ec2): update route table association check to use boolean value

* test(ec2): update security group test to validate group name and VPC ID

* fix(ec2): update security group description in Ec2Service and corresponding tests

* test(ec2): fix integration test failures

* fix(ec2): fix integration test error

* feat(ec2): update description

* fix(ec2): fix SG id to use 17 character hex code
2026-06-09 00:34:51 -05:00
shrimptails-f 40c1c4339d feat(athena): align CreateWorkGroup with AWS behavior (#1174)
* feat(athena): align CreateWorkGroup with AWS behavior

* fix(athena): align CreateWorkGroup wire contract
2026-06-09 00:32:05 -05:00
Jason van Zyl 65c7440f9d refactor(core): add storage-backed maps for service state (#1243) 2026-06-08 23:39:16 -05:00
David Phillips 94a8bdaca1 fix: preserve Glue column parameters (#1210)
* fix: preserve Glue column parameters

* test: cover Glue column parameters compatibility
2026-06-07 23:19:26 -05:00
David Phillips 1ea22d0f60 fix: support Glue BatchDeleteTable (#1209)
* fix: support Glue BatchDeleteTable

* test: cover Glue BatchDeleteTable compatibility
2026-06-07 23:08:15 -05:00
David Phillips 3894ffcf8a fix: normalize Glue catalog names (#1208) 2026-06-07 22:45:29 -05:00
Hector Ventura b449ba2c29 feat(cloudmap): add AWS Cloud Map (servicediscovery) management API (#1217)
* feat(cloudmap): add AWS Cloud Map (servicediscovery) management API

Implements the Route53AutoNaming_v20170314 JSON 1.1 service: namespace
management (HTTP/public-DNS/private-DNS), services, instance register/
deregister, async operation tracking, DiscoverInstances/DiscoverInstancesRevision
(honouring the data- host prefix), instance health status, and tags.

Dispatched via AwsJson11Controller; storage through StorageFactory; config in
EmulatorConfig + application.yml. Covered by an in-repo RestAssured integration
test and an AWS SDK v2 ServiceDiscoveryClient compatibility test.

* refactor(cloudmap): drop unused prefix variable in scanInstances
2026-06-07 07:24:30 -05:00
Ben Younes e3c19461db feat(iam): seed standard EKS cluster and node group managed policies (#1216)
EKS cluster creation and managed node groups attach a set of AWS managed
policies that floci did not seed, so GetPolicy / AttachRolePolicy failed with
NoSuchEntity (e.g. AmazonEKSClusterPolicy, AmazonEKSVPCResourceController),
breaking the terraform-aws-modules/eks module and the EKS console flow.

Add the standard set to the seeded catalog (all path "/"):
AmazonEKSClusterPolicy, AmazonEKSServicePolicy, AmazonEKSVPCResourceController,
AmazonEKSWorkerNodePolicy, AmazonEKS_CNI_Policy. Documented in the IAM managed
policy catalog (docs/services/iam.md).

Closes #1092
2026-06-07 00:41:48 -05:00
David Phillips ec8e1cf85e fix: enforce Glue table version checks (#1211) 2026-06-07 00:39:30 -05:00
Samarth Tikotkar 882fd03457 fix(ec2): include AttachTime in describe-instances network interface response (#1214) 2026-06-07 00:26:36 -05:00
devansh-jain-18 43f4451834 fix(stepfunctions): honor catch on lambda task failures (#1196) 2026-06-07 00:25:03 -05:00
AgustinBertagna 4446404288 feat(appsync): Phase 2 — Schema Registry, Model Fixes, CRUDL completion & AWS Scalars (#1185)
* build: add graphql-java dependency

* feat(appsync): add and extend data models for Phase 2

- Add AdditionalAuthenticationProvider, DomainName, ChannelNamespace, ApiAssociation models
- Add 14 fields to GraphqlApi (apiType, visibility, owner, etc.)
- Change additionalAuthenticationProviders from raw maps to typed list
- Add 6 fields to Resolver (resolverArn, cachingConfig, maxBatchSize, etc.)
- Add dataSourceArn to DataSource
- Rename FunctionConfiguration.arn to functionArn

* feat(appsync): add service and controller changes for Phase 2

* feat(appsync): add service and controller changes for Phase 2

* test(appsync): add Phase 2 integration tests

Add ~60 new tests for:
- Model completeness (new fields, ARNs, functionArn rename)
- Domain names CRUDL + associate/disassociate
- Channel namespaces CRUDL + update
- Merged API associations CRUDL
- Enhanced metrics
- Schema registry parsing with AWS scalars and extensions
- Directive registration (aws_api_key, aws_subscribe, deprecated, unknown)
- Edge cases (null auth providers, maxBatchSize 0, cleanup on delete)

* test(appsync): add AWS scalar unit tests

Test all 17 AWS scalars:
- All registered in AppSyncScalarRegistry
- AWSDateTime, AWSJSON, AWSEmail parse valid/invalid values
- AWSTimestamp and AWSShort range validation
- AWSURL and AWSPhone format validation

* test(appsync): add SDK compatibility tests for Phase 2

Validate that the AWS SDK Java v2 can read:
- dataSourceArn() on CreateDataSource response
- resolverArn() on CreateResolver response
- functionArn() on CreateFunction response
- BadRequestException on invalid schema creation

* docs(appsync): add Phase 2 operations, schema registry, and AWS scalars documentation

- Add Domain Names, Channel Namespaces, Merged API Associations, Enhanced Metrics
- Document AWS scalar types (17 scalars with validation rules)
- Document AppSync directives (8 directives with locations)
- Update Not Implemented section with future phase references
- Add CLI examples for domain names and channel namespaces
- Update cascade delete to include channel namespaces and domain associations

* docs: add AppSync to service tables, env vars, storage config, and SDK README

- README.md: add AppSync to category table, detailed notes, and architecture diagram
- docs/index.md: add AppSync to supported services table, fix count to 52
- docs/configuration/environment-variables.md: add FLOCI_SERVICES_APPSYNC_ENABLED
- docs/configuration/advanced/application-yml.md: add appsync config block
- docs/configuration/storage.md: add AppSync per-service storage override
- compatibility-tests/sdk-test-java/README.md: add AppSyncTest to services table

* fix(appsync): reuse ObjectMapper and fix AWSJSON serialize for non-string values

AWSJSON scalar was creating a new ObjectMapper on every parseValue() call. serialize() used toString() which produces invalid JSON for Map/JsonNode results.

* fix(appsync): strip string literals and comments before unknown directive validation

The regex @(\w+) incorrectly flagged @ mentions inside GraphQL string literals and comments as unknown directives.

* fix(appsync): prevent silent overwrite on creates, validate required fields and input values

- Add existence checks on createDataSource, createResolver, createType,
  createChannelNamespace, createMergedApiAssociation (→ ConflictException 409)
- Validate authenticationType is required on createGraphqlApi
- Validate typeName is required on createResolver
- Validate dataSourceName exists on createResolver and createFunction
- Prevent associateApi from silently overwriting existing association
- Enforce API key limit (max 2 per API)
- Fix expires parsing to accept ISO 8601 strings, throw on invalid values
- Fix castInt overflow detection
- Fix updateApiKey expires validation (was silently swallowing errors)
- Change InvalidNextTokenException to BadRequestException (AWS standard)
- Fix maxResults=0 to return empty page
- Fix getIntrospectionSchema to throw 404 instead of returning null
- Fix tags with null values (was producing literal string "null")

* test(appsync): fix cascade delete test to create data source before function, align with new validation

* refactor(appsync): remove dead code and unused hasSchema()

- Delete AppSyncDirectiveRegistry.java (100 lines, never used)
- Delete DirectiveValidator.java (45 lines, never called)
- Remove hasSchema() from SchemaRegistry (never called)

* fix(appsync): scalar null-safety, type validation, and DNS resolution

- Add null checks to 5 serialize() methods (AWS_TIMESTAMP, AWS_LONG,
  AWS_INTEGER, AWS_BOOLEAN, AWS_FLOAT) to prevent NPE
- Fix AWS_TIMESTAMP parseValue() ClassCastException on String input
- Replace InetAddress.getByName() with regex in AWS IPAddress to
  prevent DNS resolution (SSRF concern)
- AWSBoolean now rejects non-boolean values (matches AppSync behavior)

* refactor(appsync): centralize directive definitions in AppSyncDirective enum

- Add AppSyncDirective enum as single source of truth for directive
  names and SDL definitions
- Update AppSyncSchemaParser to use enum instead of duplicated strings
- Eliminates 3 sources of truth (validateNoUnknownDirectives Set,
  injectDirectiveDefinitions SDL, and formerly AppSyncDirectiveRegistry)

* perf(appsync): cache scalarMap in AppSyncScalarRegistry

- Initialize scalarMap once in constructor as unmodifiableMap
- Avoids recreating HashMap on every call (was called twice per
  schema parse)

* test(appsync): add tests for scalar fixes and behavior changes

- Add tests for null-safety in serialize() (5 scalars)
- Add test for AWSTimestamp parseValue with String input
- Add tests for AWSIPAddress regex validation (IPv4, IPv6, invalid)
- Add tests for AWSBoolean rejecting non-boolean values
- Add test for scalarMap caching

* test(sdk): add AWS scalars schema creation test

Verifies that schemas with AWS scalar types (AWSDateTime, AWSJSON,
AWSIPAddress, AWSBoolean) parse correctly via the SDK.

* fix(appsync): correct API paths to match AWS documentation

- Channel namespaces: /v1/ → /v2/, channelnamespaces → channelNamespaces
- Domain association: /apis → /apiassociation
- Remove ListApiAssociations (not a real AppSync operation)
- Remove GetEnhancedMetricsConfig (not a real AppSync operation)
- Rename Merged API Association to Source API Association with correct paths:
  - AssociateSourceGraphqlApi: POST /v1/mergedApis/{id}/sourceApiAssociations
  - GetSourceApiAssociation: GET /v1/mergedApis/{id}/sourceApiAssociations/{id}
  - ListSourceApiAssociations: GET /v1/apis/{apiId}/sourceApiAssociations
  - DisassociateSourceGraphqlApi: DELETE /v1/mergedApis/{id}/sourceApiAssociations/{id}

* feat(appsync): add SourceApiAssociation models

Add SourceApiAssociation, SourceApiAssociationConfig, and
SourceApiAssociationSummary models to support merged/source API
association operations per AWS AppSync API Reference.

* feat(appsync): add ChannelNamespace support models

Add AuthMode, HandlerConfig, HandlerConfigs, Integration, and
LambdaConfig models for ChannelNamespace handler configuration
per AWS AppSync API Reference.

* fix(appsync): fix ApiAssociation and ChannelNamespace models

ApiAssociation: remove source/merged API fields, keep only domain
association fields (apiId, associationStatus, deploymentDetail,
domainName) per AWS AppSync API Reference.

ChannelNamespace: add missing fields (channelNamespaceArn,
codeHandlers, created, handlerConfigs, lastModified,
publishAuthModes, subscribeAuthModes, tags) per AWS docs.

* feat(appsync): add missing service methods and fix response models

- associateApi now returns full ApiAssociation object
- createMergedApiAssociation returns SourceApiAssociation
- createSourceApiAssociation returns SourceApiAssociation
- getSourceApiAssociation validates mergedApiId
- listSourceApiAssociations returns SourceApiAssociationSummary
- Add updateSourceApiAssociation method
- Add deleteMergedApiAssociation method
- ChannelNamespace: populate arn, timestamps on create/update

* feat(appsync): fix response formats and add missing endpoints

- associateMergedGraphqlApi: response key apiAssociation → sourceApiAssociation
- disassociateSourceGraphqlApi: returns 200 + body (not 204)
- associateApi: returns full ApiAssociation from service
- Add POST /v1/mergedApis/{id}/sourceApiAssociations/{assocId} (UpdateSourceApiAssociation)
- Add DELETE /v1/sourceApis/{id}/mergedApiAssociations/{assocId} (DisassociateMergedGraphqlApi)

* test(appsync): fix and add integration tests for new endpoints

- Fix associateSourceGraphqlApi: use mergedApiId and sourceApiAssociationStatus
- Fix deleteSourceApiAssociation: expect 200 with body (not 204)
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test

* test(appsync): add SDK tests for missing operations

- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
- Fix test ordering for new domain tests
2026-06-07 00:05:51 -05:00
Matt Van Horn 9a7070992e fix: persist SSE specification and return SSEDescription for encrypted tables (#1191) 2026-06-06 21:08:30 -05:00
David Phillips 24250b658d fix: enforce Glue table version checks (#1184) 2026-06-06 20:55:36 -05:00
Hoang Lan 3732d2491b fix(dynamodb): update DynamoDB's reserved keywords (#1176) 2026-06-06 18:28:38 -05:00
guilhermejsonar a81b961167 feat(cloudwatch): accept log group ARN via logGroupIdentifier (#1172)
DescribeLogStreams, PutLogEvents, GetLogEvents, and FilterLogEvents now
accept either logGroupName or logGroupIdentifier. When an ARN is provided,
the log-group name is extracted from the :log-group: segment (with
trailing :* tolerated). Log-stream identifiers are similarly stripped of
the :log-stream: prefix so SDK responses can round-trip cleanly.
DescribeLogStreams responses also include a per-stream arn field.

Closes #1164
2026-06-06 10:14:56 -05:00
Samarth Tikotkar f359ae854d fix(ecs): retain inactive services for terraform draining and recreation with correct idempotency (#1166)
* fix(ecs): retain inactive services for terraform draining and recreation with correct idempotency

* fix(ecs): enforce strict aws compliance for service lifecycles and idempotency

- retain inactive services
- added status filters to listServices and listServicesByNamespace
- wrote a shared extractServiceName helper
2026-06-06 08:58:21 -05:00
Niraj b9dd0c38a9 feat(ecs): honour task-definition volumes + container mountPoints (#1171)
* feat(ecs): honour task-def volumes + container mountPoints

Implements EC2-launch-type ECS host-bind semantics: a task definition may
declare task-level volumes ({name, host.sourcePath}) and each container
definition may reference them via mountPoints ({sourceVolume, containerPath,
readOnly}). At RunTask launch, each mountPoint resolves its source volume to
the host source path and bind-mounts it into the container (read-only via
withReadOnlyBind, read-write via withBind); unresolved volume references are
skipped with a warning.

This lets stock images be launched with per-task config bind-mounted at a
fixed container path, instead of baking config into per-image wrappers.

- model: Volume, MountPoint records; volumes on TaskDefinition, mountPoints on
  ContainerDefinition
- EcsJsonHandler: parse + serialize round-trip for both
- EcsContainerManager.startTask: resolve volumes and wire binds
- tests: JSON wire-path round-trip + bind-by-access-mode (Docker-free)

* fix(ecs): fail loudly when a task definition resolves zero container definitions

RunTask/StartTask on a task definition with no container definitions used to
launch zero containers silently: the per-container loop was a no-op, the task
still transitioned through PENDING towards RUNNING, and callers polling
DescribeTasks waited forever on a task with nothing behind it.

Validate up front in launchTasks (covers RunTask and StartTask, docker and
mock mode alike): WARN and throw a ClientException (HTTP 400) before any task
is created, consistent with how unresolved task definitions fail.
2026-06-06 08:57:37 -05:00
Tom Myers 772467b7cc fix: tag rpc-v2-cbor timestamp lists so GetMetricData decodes (#1162)
* fix(cloudwatch): tag rpc-v2-cbor timestamp lists so GetMetricData decodes

GetMetricData responses encode MetricDataResults[].Timestamps as a list, but
the rpc-v2-cbor serializer only tagged scalar fields named "Timestamp". The
untagged list elements caused aws-sdk-go-v2 (and the OpenTelemetry Collector
awscloudwatch metrics receiver) to fail decoding with "unexpected value type
cbor.Uint".

Carry timestamp context into array elements and match timestamp members by
their "Timestamp"/"Timestamps" suffix, so every element of a timestamp list is
emitted as a CBOR tag(1) value (epoch seconds, RFC 8949 3.4.2) with integer-ness
preserved. Scalar timestamp handling is unchanged.

Tests:
- AwsJsonCborSerializerTest: asserts tag(1) bytes for scalar and list timestamps,
  integer preservation, and that non-timestamp numbers stay untagged.
- Go SDK compatibility suite: a GetMetricData case that exercises the real
  aws-sdk-go-v2 CBOR client end to end.

* apply copilot suggestions to tests
2026-06-06 08:37:34 -05:00
Clément dbcde087f9 fix(sns): align mobile push error codes, payload resolution, and Token rotation with AWS (#1165)
* fix(sns): align mobile push error codes, payload resolution, and Token rotation with AWS

* ci: retrigger checks
2026-06-06 08:27:16 -05:00
Kenshin Okinaka e36576c2a4 feat(ses): per-configuration-set sending toggle (v1 + v2) (#1193)
Add UpdateConfigurationSetSendingEnabled (SES v1 Query) and
PutConfigurationSetSendingOptions (SES v2 REST, PUT
/v2/email/configuration-sets/{name}/sending) to toggle email sending
on a single configuration set, complementing the existing
account-level UpdateAccountSendingEnabled / PutAccountSendingAttributes
toggle. The two APIs share state: both write
`ConfigurationSet.sendingEnabled` (Boolean, null/true = enabled).

Enforcement is centralized in SesService.validateConfigurationSet,
which is called by SendEmail, SendRawEmail, and SendBulkTemplatedEmail
(v1 and v2 paths). When the CS's sendingEnabled is false, the send is
rejected with SendingPausedException + "Sending is paused for
configuration set <name>" — matching the exact wire shape AWS returns
in production (verified via `aws sesv2 send-email` against an AWS
account with a disabled CS; both ErrorCode and Message reproduce as-is).

Read-back paths:
  - v2 GetConfigurationSet returns SendingOptions: {SendingEnabled}
  - v1 DescribeConfigurationSet with `reputationOptions` attribute
    returns ReputationOptions/SendingEnabled (matches the AWS v1 wire
    contract where SendingEnabled lives under ReputationOptions)

The v1 action is also added to AwsQueryController.SES_ACTIONS so that
action-name-based service routing recognizes it.

Tests
- SesConfigurationSetSendingOptionsV2IntegrationTest (13 cases): toggle
  via both APIs, cross-API state sharing, SendEmail rejection with
  SendingPausedException when disabled, read-back via Get/Describe,
  bad-request validation, unknown CS returns 404 via v2.
- SesConfigurationSetSendingTest (SDK compat, 9 cases): AWS Java SDK
  v2 marshalling of both APIs, with sendEmail rejection asserted as
  `SendingPausedException` (the AWS SDK class corresponding to the
  matched server-side error code).

Docs
- docs/services/ses.md: list both APIs in their respective tables.
2026-06-06 08:16:39 -05:00
Matt Van Horn 70acf49b00 fix: accept AttributesToGet with Select=SPECIFIC_ATTRIBUTES in Query (#1190) 2026-06-05 23:48:19 -05:00
David Phillips 10e28f33c2 feat: support Glue DeleteDatabase (#1181) 2026-06-05 23:38:34 -05:00
shrimptails-f 701d8f4ae9 fix(elbv2): align DeleteTargetGroup with AWS Query response (#1194) 2026-06-05 23:35:30 -05:00
David Phillips 6089d8ddc7 feat: support Glue user-defined functions (#1187) 2026-06-05 23:20:42 -05:00
David Phillips ef65660f3b fix: preserve Glue view table fields (#1182) 2026-06-04 22:09:27 -05:00
David Phillips 761814f3f2 feat(s3): enforce SSE-C customer keys (#1143) 2026-06-04 01:17:22 -05:00
Niraj a9297b8fec feat(ecs): honour RunTask containerOverrides (command + environment) (#1151)
RunTask accepts overrides.containerOverrides[] in the AWS ECS API, but floci
parsed RunTask without reading them, so a caller's per-container command and
environment overrides were silently dropped — the launched container always ran
the task-definition's command/env.

Thread containerOverrides from EcsJsonHandler.runTask through
EcsService.runTask/launchTasks into EcsContainerManager.startTask, matched to a
container definition by name:
  - command (if present and non-empty) replaces the task-def command
  - environment is merged over the task-def environment (override wins on key)

StartTask and the service reconciler pass null (no overrides), unchanged.

Adds model/ContainerOverride (name, command, environment), @RegisterForReflection
for native builds.
2026-06-04 01:12:59 -05:00
Vinod Kumar Bengaluru b0afe9d00d fix(s3): error on unsupported S3 Select expressions (#1160)
Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
2026-06-04 00:45:16 -05:00
Hoang LanandHector Ventura e5ef46d350 fix: use region consistently across service operations (#1105)
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-06-04 00:44:14 -05:00
David Phillips 6b92d2954b fix(s3): handle empty object suffix ranges (#1142) 2026-06-04 00:43:39 -05:00
Hector Ventura 2d30641479 fix(dns): resolve public hostnames from spawned containers (#1168)
Lambda/CodeBuild containers get Floci's IP as their only DNS, so all
public-name resolution flows through Floci's embedded UDP/53 forwarder.
The forwarder read responses into a hardcoded 512-byte buffer, silently
truncating larger EDNS0 responses (e.g. CDN-backed hosts), so public
lookups failed inside Lambda with ENOTFOUND/EBUSY.

- Enlarge the forwarder receive buffer to 4096 bytes (EDNS0).
- Forward across an ordered upstream list (resolv.conf + configurable
  public fallbacks), returning the first valid response; warn when all
  upstreams fail instead of dropping the response silently.
- Append configurable fallback resolvers (default 8.8.8.8, 8.8.4.4)
  after Floci's IP on spawned containers' HostConfig.Dns, controllable
  via floci.dns.container-fallback-* / FLOCI_DNS_CONTAINER_FALLBACK_*.

Closes #1110
2026-06-04 00:42:38 -05:00
Hector Ventura 7128758a63 feat(eks): make real-mode clusters reachable and authenticable from the host (#1167)
In real mode `aws eks create-cluster` brought up a k3s container that was
unreachable from the host and rejected every request with 401. This makes the
native AWS workflow work end to end (`aws eks update-kubeconfig` + `kubectl`).

- describe-cluster returns a host-reachable endpoint (https://localhost:<hostPort>),
  configurable via endpoint-mode (host|network), default host
- token-authentication webhook (POST /_floci/eks/token-webhook) validates the
  `aws eks get-token` bearer token and maps it to system:masters; pins the
  apiserver to the v1 TokenReview API and echoes the request apiVersion
- webhook kubeconfig is injected into k3s via the Docker API (create -> copy ->
  start), so it works in native and Docker-in-Docker with no host-path config
- k3s network falls back to the global docker-network, then auto-detected

Closes #1118
2026-06-04 00:42:25 -05:00
Arthur Tristram 3989064a1c fix(ApiGateway): implement EndpointConfiguration for REST APIs (#1116) 2026-06-04 00:35:33 -05:00
Rayan Salhab 938c693f8d fix(ecs): preserve create-time resource tags (#1139) 2026-06-04 00:32:24 -05:00
Kenshin Okinaka c576d3341b fix(eventbridge): propagate PutEvents call region and account through pattern matching and delivered envelope (#1125)
* fix(eventbridge): propagate PutEvents call region and account through pattern matching and delivered envelope

EventBridgeService.putEvents previously had two related defects in how
the call's region and account flowed through to rule matching and the
delivered EventBridge envelope:

1. buildEventEnvelope hardcoded the envelope's "region" and "account"
   fields to RegionResolver.getDefaultRegion() /
   RegionResolver.getAccountId(), regardless of which region/account
   the PutEvents call was made against. A rule scoped to eu-west-1
   would fire correctly for an eu-west-1 PutEvents call (rules are
   stored per (region, bus)), but the envelope delivered to its
   target would report region=us-east-1. Downstream consumers /
   re-routing rules that filter on the envelope region saw an
   incorrect value.

2. matchesPattern read entry.Region / entry.Account with a fallback
   to the RegionResolver defaults. For a PutEvents entry without
   explicit Region (the common case — the AWS SDK doesn't model
   per-entry region), the pattern's region/account filter saw the
   resolver default while the envelope (after fix #1) saw the
   actual call region. Same kind of inconsistency, one step earlier.

- putEvents() now defensively copies each entry into a mutable
  HashMap and fills missing/blank Region / Account from the call
  context (region argument; accountId if non-null else
  regionResolver.getAccountId()) at the top of the per-entry loop.
  matchesPattern, buildEventEnvelope, and captureToArchives all
  subsequently see the same normalized entry, so a pattern's
  region/account filter agrees with the delivered envelope.
- buildEventEnvelope now takes the PutEvents call's region and
  accountId and resolves region/account with the same precedence:
  entry-supplied value wins (cross-region producers, archive
  replay), then the call's region/accountId, finally the resolver
  default. For the putEvents path the entry is already normalized,
  so this is defense-in-depth for any other callers.
- A small isBlank(Object) helper centralizes the null + blank-string
  predicate used in both the entry normalization and the envelope
  fallback.

Tests
- Five new EventBridgeServiceTest cases pin the new behavior:
  * envelope.region equals the PutEvents call's region for a
    non-default-region rule+target+entry triple (eu-west-1).
  * entry.Region / entry.Account win when set explicitly (mirrors
    the archive-replay scenario where the originating envelope's
    region/account are stamped back onto the re-emitted entry).
  * default-region call still stamps the resolver default —
    regression pin so the pre-fix behavior isn't silently restored.
  * a region-filtered rule for the call region fires on a
    PutEvents call to that region with no explicit entry.Region
    (matchesPattern + envelope agree).
  * a region-filtered rule for the resolver default does NOT fire
    under a non-default-region PutEvents call — pre-fix this
    accidentally matched via the resolver default.
- All 173 EventBridge tests pass.

* fix(eventbridge): default to RegionResolver when normalizing a missing PutEvents region

Address okinaka's review on the envelope-region fix: the Region branch
of the entry normalization passed the raw `region` argument straight
through, so a null/blank `region` would stamp `entry.Region = null`.
The matching Account branch already fell back to
`regionResolver.getAccountId()` when accountId was null, so the two
branches were asymmetric. Apply the same fallback chain to Region —
`entry.Region = isBlank(region) ? regionResolver.getDefaultRegion() :
region` — and tighten Account's null check to `isBlank(accountId)` for
symmetry.

No new test: every real caller of EventBridgeService.putEvents
(EventBridgeHandler, ScheduleInvoker, PipesTargetInvoker, S3Service)
passes a non-null region, and the surrounding bus/rule-prefix lookups
also use the raw `region` argument, so a null `region` would short-
circuit at the bus lookup before the normalization invariant matters.
This is a consistency fix for the in-loop normalization itself; the
"normalize once at the top, downstream sees a stable value" invariant
Copilot's review established now holds for Region the same way it
holds for Account.

* style(eventbridge): keep envelope region/account fallback ternaries on one line

Match the formatting of the new entry-normalization fallbacks
(entry.put("Region", isBlank(region) ? ... : region) — single line) by
joining the envelope ternaries that the previous commits left wrapped
at the question mark. Same code, just consistent layout.
2026-06-03 22:02:05 -05:00
Kenshin Okinaka 19b0432b8c feat(ses): apply suppression list during send with per-CS SuppressionOptions override (#1109)
When SendEmail / SendRawEmail is called with a recipient on the
account-level suppression list whose reason matches the effective
SuppressedReasons (the configuration set's SuppressionOptions
override if present, else the account-level reasons), Floci now:

1. Emits a synthetic Bounce or Complaint event (per the suppression
   reason) through the configured event destinations alongside the
   always-emitted Send event.
2. Drops the suppressed recipient from the SMTP relay step, while
   still delivering the message to non-suppressed recipients on the
   same send.

The SendEmail API response (200 + MessageId), the stored SentEmail
(used by the LocalStack-compatible /_aws/ses inspection endpoint),
and the published event's mail.destination all continue to reflect
the original recipient list — matching how AWS reports the message
at the API and event layers.

This PR bundles two related pieces:
- The per-configuration-set SuppressionOptions block (Put endpoint +
  GetConfigurationSet response shape + getEffectiveSuppressedReasons
  helper). Mirrors AWS V2 PutConfigurationSetSuppressionOptions:
  empty list = explicit "no suppression filtering" for this CS,
  unset block = fall back to account-level reasons. The validation
  message for the new endpoint matches the AWS V2 natural-language
  form ("Reason <X> is invalid, must be one of [BOUNCE, COMPLAINT].")
  which is distinct from the V1-style nested message returned by the
  three older suppression endpoints; both forms were verified
  against live AWS on 2026-06-03.
- The send-time filter + synthetic-event partitioning, plumbed
  through getEffectiveSuppressedReasons so the override takes effect
  per-send. collectSuppressedReasons and resolveSuppressionReason
  now both take configurationSetName, hitting the per-CS override
  when present and falling back to the account-level reasons
  otherwise.

Per-recipient: when only some recipients are suppressed, the
non-suppressed ones still reach smtpRelay.relay() / relayRaw().
The relay is skipped entirely only when every recipient is
suppressed.

- Recipient suppressed with reason BOUNCE (and BOUNCE in the
  effective reasons) -> synthetic Bounce event; not relayed.
- Recipient suppressed with reason COMPLAINT (and COMPLAINT in the
  effective reasons) -> synthetic Complaint event; not relayed.
- Reason mismatch or address not on the list -> Send only; relayed
  normally.
- Simulator-address recipients and suppression-listed recipients
  are unioned into the same event's recipient list, deduplicated.

Tests
- SesConfigurationSetSuppressionOptionsV2IntegrationTest (16 cases)
  for the CRUD + helper.
- SesConfigurationSetTest SDK compat (6 V2 cases) using
  SesV2Client.PutConfigurationSetSuppressionOptions and the typed
  SuppressionListReason enum (+ the WithStrings escape hatch for
  the server-side validation path).
- SesServiceSmtpTest grows four cases pinning the send-time
  override behaviour: empty list on the CS disables filtering and
  the relay receives the address; BOUNCE-only override leaves
  COMPLAINT-suppressed addresses unfiltered; a CS without an
  override falls back to account-level (parity with no-CS sends);
  raw-send mirrors the JSON-send path.
- SesEventPayload / SesEventPublishingV2IntegrationTest / further
  send-path coverage from the original suppression PR is preserved.
- All 452 SES tests pass.
2026-06-03 21:57:20 -05:00
shrimptails-f 2a14f35c2d fix(lambda): support path-style ECR URIs for image functions (#1135) 2026-06-03 21:54:19 -05:00
Felipe Guilherme Sabino a435147bea fix(athena): align metadata behavior with AWS (#1119) 2026-06-03 21:52:49 -05:00
JonghyeokNam 289e1e9630 fix(elb): return TargetGroupNotFound for missing target groups (#1161) 2026-06-03 20:40:52 -05:00
nblomquist 30a598f080 feat(kms): add GenerateRandom action (#1036)
- Add GenerateRandom action routing and handler in KmsJsonHandler
- Add SecureRandom field, constructor overload, and generateRandom() method with bounds validation
- Reject unsupported Recipient and CustomKeyStoreId fields
- Add integration tests for happy path, boundaries, validation, and unsupported fields
- Add SDK compatibility tests for Java, Python, and Node
2026-06-03 17:42:40 -05:00
Hector Ventura 846ba614dd fix(cloudformation): roll back failed stack creates (#1123)
A resource that failed to provision was silently ignored — the stack still reached
CREATE_COMPLETE, leaving a half-built stack behind. The execution now stops on the
first CREATE_FAILED/UPDATE_FAILED resource and, on a create, deletes the resources
already created in that execution so the stack ends ROLLBACK_COMPLETE on a clean
slate and a corrected re-deploy can succeed. Updates mark UPDATE_ROLLBACK_COMPLETE
and keep prior physical ids (full prior-template restoration is out of scope). The
rolled-back terminal state is persisted so it survives a restart.

Tests cover rollback + successful retry and the single-failed-resource case.

Refs #924
2026-06-03 17:33:38 -05:00
Hector Ventura e486814686 fix(apigatewayv2): support CloudFormation update path (#1122)
provisionApiGatewayV2 {Api,Route,Integration,Stage} re-created resources on every
stack update, duplicating routes/integrations on redeploy. They now patch in place
via the service's updateX when the resource already has a physical id. Deployments
are immutable so a redeploy reuses the existing one, and Stage now carries
StageVariables.

Test covers update-in-place (stable physical ids, no duplication) and an
idempotent no-op redeploy.

Refs #924
2026-06-02 01:52:09 -05:00
Hector Ventura 4695103bf0 feat(elbv2): provision ELBv2 resources via CloudFormation (#1121)
Provision AWS::ElasticLoadBalancingV2 LoadBalancer, TargetGroup, Listener, and
ListenerRule through CloudFormation instead of the synthetic stub branch.

- Full Ref/GetAtt parity (all Ref=ARN; LB DNSName/CanonicalHostedZoneID/
  LoadBalancerFullName, TG TargetGroupFullName, etc.), verified against the CFN
  Template Reference.
- Listener and ListenerRule support the update (modify) path on redeploy.
- Parses forward/redirect/fixed-response actions and the full rule-condition set.
- Teardown leaves no orphans: deleting a listener/rule now unlinks the target
  group from its load balancer.

Tests cover create (LB+TG+Listener+Rule wired together), update (listener port),
and delete-no-orphans.

Refs #924
2026-06-02 01:27:22 -05:00