Use the shared thread-state poller for layer policy calls and task
startup. Keep the held monitor and fail if the worker exits before
blocking.
Move the EKS state check into ThreadStates and pass each caller's
timeout through to the shared poller.
Signed-off-by: Jackson Price <jxnprice@amazon.com>
The date-time and JSON function tests each had the same private
row(sql) helper, and jsonResultColumnsAreTypedAsAthenaTypesThem ran
the same translated DESCRIBE and athenaType mapping as the date-time
tests' types(sql). Both helpers move to TrinoSidecarQueries, which the
two classes call.
Wait through CANCELLING in the import tests and report the import ARN on timeout. Use the same DescribeExport check in the round-trip and export tests.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Under enforcement a REST route no vendored model names runs unchecked, and Amazon Connect was among them: any caller
could create, describe, update or delete an instance, its attributes or its storage configs. Connect's model routes are
vendored (regen_rest_routes.MODELS, signed connect), so each request is checked as its operation's action, and connect
joins the generated tables of request resources and tags on create: an instance by the id its path gives, each of
Connect's other resources by the members its request names, and the tags a create carries.
ConnectStoredResourceArns answers the tags Connect holds on an instance, read in place in the ARN's account and Region,
which an aws:ResourceTag condition reads. The table asks for a traffic distribution group or a data table to be found,
which Floci does not serve, so there is nothing to find. The table's integer variables now include Connect's
customer-managed-view-version ViewVersion, which test_regen_iam_request_resources pins.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, so ConnectIntegrationTest's
tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw.
IamRestRouteEnforcementIntegrationTest checks that with no grant an instance's read is refused, that a grant on one
instance reads it and refuses another, and that an aws:ResourceTag condition reads its tags.
ConnectService named an instance by any ARN, reading the text after its first slash, so an ARN of another shape
(arn:aws:connect:us-east-1::other/<id>) reached an instance IAM had not checked the request on, past a deny on it. It
now takes an instance's own ARN alone, the one IAM checks, refuses an ARN of any other shape, and looks one of another
account or Region up as given, which finds nothing; storedTags answers an instance's own ARN alone, so another
partition's gets no tags. ConnectStoredResourceArnsTest covers both, IamRestRouteEnforcementIntegrationTest checks that
an instance deny holds for each form the path gives it and that a tagged CreateInstance needs connect:TagResource, and
docs/services/connect.md says which ARNs are taken.
Add StartOTelEnrichment, GetOTelEnrichment, UpdateOTelEnrichment and
StopOTelEnrichment over Query, JSON 1.0 and CBOR, with one configuration
per account and Region as the user guide scopes it. Floci stores the
configuration; enriching vended metrics comes next.
Resource tag enrichment, the default, needs ObservabilityAdmin's resource
tags for telemetry running in the Region: a start without it is the
modeled ValidationError with the API reference's sentence, as AWS quotes
no message. EnableTagEnrichment false needs nothing. A start while
running changes nothing, an update replaces both filter lists as a pair
and keeps the stored tag setting it omits, and an update while stopped is
AWS's ResourceNotFoundException "OTel enrichment is not enabled for this
account". A stopped enrichment reads as its status alone.
Filters are validated as the model gives them, every violation listed in
AWS's form, then against the 100 selectors allowed across both lists. A
selector naming metrics without a namespace is refused as a null namespace
over Query too, for metric streams as well, rather than read as no selector.
Over JSON, a filter list sent as something else is refused with the
deserializer's SerializationException, and EnableTagEnrichment sent as a
string is read as the boolean it names or refused, so a malformed update
changes nothing.
Over Query, a filter name XML cannot carry is written as U+FFFD, for
metric streams too.
Part of #7030.
Keep each test socket open only for its bind probe and retry only bind conflicts while waiting for release.
Share the listener port checks between the Redshift and RDS proxy tests through FreePorts.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Observe the command monitor before releasing the status writer. Release the writer and join each worker even when an assertion fails.
Share the wait for a worker blocked in a method through ThreadStates.awaitBlockedIn.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
CloudWatch's OTel enrichment reads resource tags through ObservabilityAdmin's
resource tags for telemetry feature, which has to be running before
StartOTelEnrichment enables tag enrichment. Add the ObservabilityAdmin service
with StartTelemetryEnrichment, StopTelemetryEnrichment and
GetTelemetryEnrichmentStatus, one feature per account and Region.
Starting the feature has Resource Explorer create a LOCAL index when the
Region has none and a managed view that includes tags, as the CloudWatch user
guide describes. GetManagedView and ListManagedViews now answer the views
Floci's services create. A status read before the first start is the modeled
ResourceNotFoundException, and a stop of a stopped or never-started feature
changes nothing.
The passed-roles table now reads ObservabilityAdmin. A vendored source,
written from the CloudWatch user guide and the Observability Admin API
reference, gives a dataset integration's role to CloudWatch Logs, whose trust
policy it names, and gives where a telemetry pipeline's YAML configuration
names its roles: its source's and its Secrets Manager extension's, each going
to the service its source type's role trusts, and to CloudWatch Logs as well
with a lookup processor or a conditional route.
Part of #7030.
Check the terminal status in the shared export test helper.
Fail at the wait when an export fails or stays in progress.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
The Glue race test now waits for the delete worker to identify itself and
then for that thread to block on the service monitor before releasing the
paused job-run write. Both waits fail on timeout, so a slow-to-start delete
worker can no longer miss the overlap and still pass.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Bumps botocore from 1.44.14 to 1.44.17 with its regenerated data. 1.44.18 waits: it adds RDS data groups, and the
Service Reference lists two tagging actions for CreateDataGroup, rds:AddTagsToDataGroup and rds:AddTagsToResource,
while no AWS page says which one the tags a create carries need, so the tag-on-create generator stops on it.
botocore 1.44.17 moves Athena to REST-JSON ("The AWS SDKs for Athena now use the REST-JSON format"), and Floci serves
Athena as JSON 1.1 under the AmazonAthena target prefix. regen_rpcv2_cbor_shapes reads Athena's model under that prefix
as a JSON facade, as it reads API Gateway V2's, so Athena's shapes there are unchanged but for GetQueryResultStream.
The request-resources table now locates Athena's members in its REST paths (WorkGroup in /workgroups/{WorkGroup}),
and a member is read from a request's path only when the request came over REST: a JSON, CBOR or Query request carries
every member in its body or form, so RequestResources locates none for it. Without that, a JSON 1.1 Athena request lost
the WorkGroup its body names and was checked on the primary workgroup. RequestResourceMembersTest sends a request whose
members its path carries as REST, and RequestResourcesTest sends Athena's StartSession as JSON 1.1.
The other changes follow the models and the Service Reference: IAM's workload identity operations are read now that
botocore has them, its five new paged lists join regen_iam_shapes' operations so their requests are held to the model as
every paged list's is (Floci does not serve them, so IamListPaginationIntegrationTest pages the lists it serves, those
that do not answer UnsupportedOperation), and its condition keys carry their tagging actions (twenty now, with the
workload identity providers and templates); SageMaker, Redshift Serverless, EKS, Bedrock and ECR rows, the service
namespaces and the DynamoDB and S3 Control condition keys follow theirs, and fetch_dms_arn_formats refreshes its
botocore examples at the new pin.
CreateRestApi refused a PRIVATE REST API unless vpcEndpointIds was supplied, while AWS treats the VPC endpoint list as optional. The check is removed from the shared endpoint configuration path, so creating a PRIVATE API, switching one to PRIVATE, and removing a PRIVATE API's last VPC endpoint all work without endpoint IDs.
Closes#10110
Check the event history before asserting the disabled queue is empty.
Use one SQS long poll to receive the enabled notification.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Keep the half-second release check and retry only bind failures.
Close each loopback probe even when the listener still owns the port.
Check real proxies with the same wildcard bind they use at startup.
Check loopback fixtures at the address the operating system assigned.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
TranslatePinData binds a format 0 or 3 PIN block to the twelve-digit account field, the twelve right-most digits of the account number without its check digit, and a caller holding the block sends that field as PrimaryAccountNumber. A twelve-digit value was read as a PAN whose check digit was dropped, so the derived field was one digit short and the block did not decipher. For the formats 0 and 3 a twelve-digit value is now the field itself, while format 4, which binds the PIN to the whole PAN, reads it as a PAN as before; the Visa verification value follows the same reading. A request whose translation attributes name no account number is refused with ValidationException instead of throwing.
Closes#10077
AthenaIntegrationTest's seven Glue cleanup requests now go through the shared GlueRequests.call, signed for the default account and Region the test's own calls land in, and its private deleteGlue helper is removed. The cleanup order, request bodies and status assertions are unchanged.
BatchDeleteConnection and the ordinary Glue actions now share one nonDefaultCatalogRefusal decision. The batch still answers a refusal for each connection name and leaves connections in the default catalog intact, which a new handler test covers for an existing non-default catalog; the batch refusal checks share one test helper.
Let the HTTP handler wake the test as each signed envelope arrives.
Keep the listener and its queue local to the HTTP test.
Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
The first domain create pauses in the fake container manager, and while it is paused the test issues the duplicate create on the test thread and checks the ResourceAlreadyExistsException. It then releases the first create, also when an assertion fails, and verifies that the manager started one container. This removes the second worker and the sleep loop that polled it.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
For a Lambda (AWS, non-proxy) integration, an integration response's selectionPattern was tested against the error type followed by the whole error payload, so a pattern written for the message could never match. It is now tested against the payload's errorMessage, as the API Gateway developer guide describes; a payload without a textual errorMessage keeps the previous subject. Reading a function error's errorMessage moves to one helper, LambdaFunctionErrors, which AppSync, Cognito and Redshift Spectrum now share, each keeping its own fallback.
Under enforcement a REST route no vendored model names runs unchecked, and Amazon AppIntegrations was among them: any
caller could create, read, update, delete or tag an event integration or a data integration. AppIntegrations' model
routes are vendored (regen_rest_routes.MODELS, signed app-integrations), so each request is checked as its operation's
action, and app-integrations joins the generated tables of request resources and tags on create: an event integration by
the name its path or body gives, a data integration by its id, and the tags a create carries.
AppIntegrationsStoredResourceArns finds the data integration CreateDataIntegration names by its name, as the table asks
(findByMembers), its ARN carrying the id AppIntegrations mints. It finds nothing by the value an ARN is filled with
(find), so a request naming a data integration by its id is checked on that id, as its handler reads it, never on
another integration whose name is that id. It answers the tags AppIntegrations holds on an event or data integration,
read in place in the ARN's account and Region, for the integration's own ARN alone, as the tag routes find it, which
an aws:ResourceTag condition reads. Floci serves no applications, so there is no application to find.
StoredResourceArns names it.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, so
AppIntegrationsIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw.
IamRestRouteEnforcementIntegrationTest checks that with no grant an event integration's read is refused, that a grant on
one reads it and refuses another, that an aws:ResourceTag condition reads its tags, that a CreateEventIntegration
carrying tags needs app-integrations:TagResource on the event integration it makes, that CreateDataIntegration is
checked on the data integration of the name it gives, and that GetDataIntegration by an id is checked on that
integration, not on another named like the id. AppIntegrationsServiceTest checks that another partition's ARN reads
no tags.
Auto Scaling DescribeLoadBalancers and DescribeTrafficSources accepted a NextToken sent without MaxRecords, which AWS refuses with ValidationError "Cannot specify NextToken without MaxRecords". Both now refuse it in AutoScalingService, where DescribeLoadBalancers' group lookup moves too. A NextToken sent with MaxRecords, and every call without a NextToken, behave as before.
CreateFlowLogs stores FileFormat, HiveCompatiblePartitions and PerHourPartition, and DescribeFlowLogs returns them as destinationOptions: an s3 flow log created without them reports plain-text, false, false, a partial request defaults the rest, and a cloud-watch-logs flow log omits the element unless options were sent. A partition flag that is not a boolean is refused. CloudFormation AWS::EC2::FlowLog resolves DestinationOptions whole, so an intrinsic can supply the block, passes it to the flow log, and refuses an update that changes it, as the property is create-only.
Closes#7888
An EC2 instance's network namespace now gets the routes of its subnet's route table whose target is an instance or a network interface, as an EKS cluster's server container already does. Each program reconciles the namespace to the routes due, which carry protocol 252 so the guest's own are left alone; a route through an instance that isn't running, or a detached or missing interface, is programmed as a blackhole, as AWS keeps it. A route covering an address the instance reaches Floci at, its default gateway, or a link-local range is never programmed, and a Floci name that doesn't resolve inside the namespace fails closed. Route table and target resolution move to ec2.net.VpcRoutes, shared with EKS. Controlled by floci.services.ec2.vpc-route-programming (default true).
Part of #10068.
Under enforcement a REST route no vendored model names runs unchecked, and CloudWatch RUM was among them: any caller
could create, read, update, delete or list app monitors with no permission at all. RUM's model routes are vendored
(regen_rest_routes.MODELS, signed rum), so each request is checked as its operation's action, and rum joins the
generated tables of request resources, passed roles and tags on create: an app monitor by the name its path gives, the
tags a create carries, and PutRumMetricsDestination's IamRoleArn passed to rum, which applies once Floci serves that
operation, as it serves only the app monitor routes today.
RumStoredResourceArns answers the tags RUM holds on an app monitor, read in place in the ARN's account and Region, which
an aws:ResourceTag condition reads. PutRumEvents names its monitor by an id, which the table asks to be found; Floci
does not serve it, so there is nothing to find.
IamRestRouteEnforcementIntegrationTest checks that with no grant a monitor's read is refused, that a grant on one
monitor reads it and refuses another, that an aws:ResourceTag condition reads a monitor's tags, that a create granted on
the monitor its Name makes passes with a guest role in its configuration, whose IAM role ARN is not taken for a monitor,
and that a create carrying tags is refused until rum:TagResource is granted on the monitor it makes.
A target group with ProtocolVersion GRPC keeps Matcher.GrpcCode through CreateTargetGroup, DescribeTargetGroups, ModifyTargetGroup and CloudFormation rollback, defaulting to 12, while HTTP1 and HTTP2 groups keep returning HttpCode. GrpcCode used to land in the HTTP matcher slot, so a gRPC group answered HttpCode=200. Groups CloudFormation stored that way still read their gRPC code.
Refs #9899
XrayRouteFilter now claims /TagResource, /UntagResource and /ListTagsForResource, so an xray-signed call there no longer reaches Marketplace Catalog's handler, and CreateSamplingRule keeps its Tags. A sampling rule's tags are changed and read by the rule's ARN, with AWS's key, value and 50-tag limits; a group's ARN, the Default rule's, or one from another Region or account answers ResourceNotFoundException with "Resource <arn> not found". IAM reads a rule's tags for aws:ResourceTag conditions.
ElastiCache SubnetGroup, User and UserGroup take replacement from the engine's NamedChange, as the types in #9671 do, and leave change-exempt.tsv. A subnet group whose CacheSubnetGroupName is removed is now replaced rather than updated in place under its old name, and a UserName change under the same UserId fails with CloudFormation's custom-named replacement error instead of InvalidParameterValue.
Part of #6606.
The Redshift COPY timeout test used a backend thread that read one query and slept for 300 ms. It now leaves its loopback peer connected and silent and, once the simulator's 100 ms read timeout expires, reads the forwarded COPY ... FROM STDIN query from the peer.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
Three extended-query tests waited 200 ms each to check for extra bytes after COPY or UNLOAD. They now half-close the simulator socket and read to EOF through a ClientResponseAssertions helper that S3CopySimulatorTest shares, so a trailing response byte fails the assertion at once.
Signed-off-by: Jackson Price <jxnprice@amazon.com>
AthenaIntegrationTest left two default Glue tables named orders, so GlueS3TablesCatalogIntegrationTest's default SearchTables assertion saw them beside local_orders and failed when it ran later in the same CI shard. The class now registers PartitionCleanup for its Glue tables and databases, deleting tables before their databases.
Publish and PublishBatch looked the topic up in the caller's account, so publishing to another account's topic answered NotFound even though the ARN named an existing topic. The topic is now resolved in the account its ARN names, as topicExists already did, and the fan-out runs as that account so the owner's subscriptions and queues receive the message.
Keep the capacity lock through Auto Scaling group creation and the control-plane taint update, both for a synchronous create and for a node group finished after its launch-template user data runs, so a waiting cluster delete can no longer remove the cluster before the taint lookup. The launch-template script itself still runs outside the lock.
Closes#10057
Under enforcement a REST route no vendored model names runs unchecked, and Amazon Detective was among them: any caller
could enable an organization admin account, list a behavior graph's members or change its organization configuration
with no permission at all. Detective's model routes are vendored (regen_rest_routes.MODELS, signed detective), so each
request is checked as its operation's action, and detective joins the generated tables of request resources and tags on
create: a behavior graph by the ARN its body gives, and an operation the Service Reference gives no resource type on *.
Detective passes no role. Floci keeps no tags on a graph, so an aws:ResourceTag condition on one reads none, as before.
IamRestRouteEnforcementIntegrationTest checks that with no grant, or a grant on another graph, listing a graph's members
is refused, and that a grant on the graph lets the request through; and that listing the organization's administrator
accounts, an operation the Service Reference gives no resource type, is refused until its action is granted on *.
AWS added rds:CreateDataGroup to the Service Reference with two tagging actions, rds:AddTagsToDataGroup and
rds:AddTagsToResource, and regen_iam_tag_on_create asked for a hand entry for it before reading its request, though the
pinned botocore does not have the operation yet. It now asks only when the request carries tags, as which tagging action
checks them is a question only for those, so the operation takes the derived verdict, not in botocore, and a model bump
bringing it in asks again. The regenerated tag-on-create table takes AWS's other new actions too:
ec2:CreateSecondaryNetworkAclAssociation and rds:RestoreDBClusterGroupToPointInTime.
LaunchedContainerAwsEnv builds the AWS SDK environment, from IAM session
credentials, for the containers Lambda, ECS, EMR, Glue, Flink, MWAA and
the Floci UI launch, so it moves from core.common.docker to
services.common.container and its allowlist line goes. core-bound.txt
now scans core.storage.base, and excludes the AWS account and region
scoping StorageFactory, AccountAwareStorageBackend and
RegionScopedStorage, which stay in floci-aws. No behaviour change.
CreateCodeSigningConfig ignored its Tags, and TagResource, UntagResource
and ListTags refused a code-signing-config ARN. Create now checks the
tag keys as TagResource does and keeps the tags in their own store, so
the CodeSigningConfig the reads return still has no Tags. The tag
operations serve a configuration ARN from that store, answer
ResourceNotFoundException for one the caller doesn't hold, and write
under the configuration lock, so a tag write can't outlive a concurrent
delete. Delete drops the tags, and storedTags returns them for
aws:ResourceTag conditions.
The Bedrock proxy timeout tests release their loopback HTTP handler as
soon as each test finishes, instead of teardown waiting out the rest of
a two-second sleep. The stub still returns a successful response after
two seconds if the proxy misses its one-second deadline.
Three Redshift COPY and UNLOAD error tests waited 400 ms for a socket
read to time out after ReadyForQuery. Once the simulator returns and its
fake backend has finished, the test now shuts down the writing half of
the socket and checks for end of stream, so any extra response byte
arrives before EOF and fails the assertion.