* feat(redshift): support event history and SNS notifications
* fix(redshift): guard stale delivery failures and prune all event scopes
* feat(cloudformation): provision Redshift event subscriptions
* fix(redshift): scope snapshot events and serialize subscription tag mutations
* feat(cloudformation): provision Redshift event subscriptions
* fix(cloudformation): resolve Redshift subscription list parameters
Use the shared list reader for SourceIds and EventCategories. Cover CommaDelimitedList and List<String> parameters through the AWS SDK and verify concurrent tag requests preserve CloudFormation tag updates.
* fix(redshift): honor event disablement and restore rollback attributes
Check the EventBridge external service key before publishing API events. Snapshot and restore CloudFormation resource attributes alongside subscription state during in-place rollback.
* fix(redshift): drop API event publisher and share subscription setup
Remove RedshiftApiEventPublisher, its handler hook, tests and docs, which are not part of the CloudFormation resource and emit CloudTrail-style events without a trail. Route createSubscription and replaceSubscription through one helper that normalizes the subscription fields.
* fix(ec2): reject unsupported future capacity reservations
Reject StartDate before capacity reservation creation or client-token replay. Preserve immediate reservation behavior.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): model scheduled capacity reservations
Retain future start and commitment metadata, activate through capacity reconciliation, and preserve client-token replay.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): preserve activation membership and replay tags
Reuse open-reservation instance matching during activation, persist creation tag identity, and keep replay from overwriting later tag edits.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): validate future reservation matching and capacity
Require targeted matching, supported instance families and at least 32 vCPUs before future reservation publication. Preserve scheduling, tag replay and immediate reservation behavior.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* feat(redshift): publish CloudWatch cluster metrics
* fix(redshift): skip duplicate CloudWatch publication minutes
* test(redshift): isolate metrics publisher between integration tests
* fix(test): use Java 17 list access in Redshift metrics compatibility test
* fix(metrics): share minute publishing and prevent duplicate SQS samples
Centralize daemon scheduling, minute claims, per-target failures, retention and shutdown for SQS and Redshift. Carry the Redshift proxy key in metric targets and use the shared compatibility await fixture.
* docs(metrics): restore publisher class docs after the shared publisher move
Keep the SQS sample shape on SqsMetricsPublisher and document minute stamping, 15-day retention and the nothing-may-escape rule on MinuteMetricsPublisher.
* feat(lambdaweb): reject resource policies whose principal does not exist
PutResourcePolicy now looks up every AWS principal a policy names, as Lambda
does before it stores the policy. A role or user ARN has to name one IAM
holds in that account, under its own path, and a unique id one in the
function's account. A missing principal, an assumed-role session, a
CanonicalUser or an ARN in another partition gets the invalid principal
message, and a role or user named under another path gets the message
that the ARN does not match the actual one.
The principals are looked up after every statement passes its other
checks and before any statement is refused as public, which is the order
AWS checks them in.
* docs(lambdaweb): drop the principal check from the items not implemented yet
* refactor(lambdaweb): find policy principals through IamService and the resolver's partition
IamService.heldPrincipalArn now gives the ARN IAM holds what a principal
ARN names under, the root as given or the role or user at its own path.
DSQL's principal check and Lambda Web's use it, and Lambda Web keeps only
the path comparison and its messages. Lambda Web takes the partition from
RegionResolver.partitionForRegion, so a custom region falls back to the
deployment's partition.
With AutoPublishAlias, SAM passes a function's VersionDescription to the
Description of the AWS::Lambda::Version it generates. The transform
dropped it, so a version published from a SAM template never had the
description the template gave it.
The version now takes it as written, leaving an intrinsic function for
CloudFormation to resolve. As in SAM, it stays out of the hash that
names the version, and Globals cannot set it: the transform refuses it
there, as it already refuses AutoPublishCodeSha256.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Handle both documented default-subnet filter aliases and preserve safe asynchronous ENI cleanup.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
A PutEvents entry naming an event bus that does not exist failed with
InvalidArgument "EventBus not found" and counted in FailedEntryCount.
The EventBridge User Guide, on handling PutEvents failures: "If you use
PutEvents to publish an event to an event bus that does not exist,
EventBridge event matching will not find a corresponding rule and will
drop the event. Although EventBridge will send a 200 response, it will
not fail the request or include the event in the FailedEntryCount value
of the request response." botocore models no not-found error for
PutEvents, only InternalException, and the API Reference lists none.
Such an entry is now answered as published, with an event id and not
counted as failed, and dropped: it reaches no rule and no archive.
Floci logs the drop at INFO. An entry that is not valid, missing a
required field or with a Detail that is no JSON object, still fails as
before, whichever bus it names.
Only the PutEvents action changes. Floci's own deliveries to a bus, for
a rule's event bus target, a pipe, a schedule, a Lambda destination or
a replay, still fail an entry for a bus that does not exist: the
guide's sentence is about the action, and no document says how AWS
answers those deliveries.
Step Functions' optimized events:putEvents integration calls the
action, so a task publishing to a missing bus no longer fails with
EventBridge.FailedEntry; step-functions.md listed that as a deviation,
which is gone. Its two tests that used a missing bus to have an entry
rejected now leave out the entry's Source instead, and a third checks
that a task publishing to a missing bus succeeds.
* feat(lambda): list provisioned concurrency configurations
Dispatch List=ALL to a paginated view of existing provisioned concurrency allocations. Preserve qualified ARNs, current status and existing pool lifecycle.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(lambda): share function ARN region resolution
Share the existing Lambda region validation and error message across function resolution and provisioned-concurrency lookup/listing.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
ListDeployments built each deployment's summary from the deployment
strategy as it is now: once a strategy that one of an environment's
deployments used was deleted, ListDeployments on that environment
answered 404 "Deployment strategy not found", while GetDeployment
still returned the deployment. The summary also took the profile's
current name over the one the deployment recorded. AWS documents these
values as the deployment's own (GetDeployment's
DeploymentDurationInMinutes is "Total amount of time the deployment
lasted"), and DeleteDeploymentStrategy, unlike DeleteEnvironment and
DeleteConfigurationProfile, has no ConflictException for a resource
in use.
- StartDeployment records the strategy's DeploymentDurationInMinutes,
FinalBakeTimeInMinutes, GrowthFactor and GrowthType on the
deployment, and StartDeployment and GetDeployment return them, as
AWS documents for both.
- ListDeployments reports the recorded profile name and strategy
settings, so deleting the strategy leaves earlier deployments as
they started. Floci serves no UpdateDeploymentStrategy or
UpdateConfigurationProfile yet; the recorded values also keep
earlier deployments as they were once anything changes a strategy
or renames a profile in place.
- Deployments stored by earlier builds load unchanged: GetDeployment
still omits the settings they never recorded, and ListDeployments
reads them from the strategy while it exists and reports them as
null once it is gone, instead of failing.
Type is unchanged: it is still read from the profile.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Preserve the requested alias ARN while returning the resolved published version configuration. Retain snapshot-versus-latest regressions for both read APIs.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): create the EBS volumes a launch's block device mappings describe
RunInstances gave every instance one 8 GiB root at /dev/xvda and took
only the root's VolumeType from its block device mappings. Launches now
plan their volumes before anything is stored: the AMI's mappings, or an
8 GiB root when it maps none, with the launch's own entries merged over
them field by field, under either spelling of a device. The instance is
rooted at the AMI's RootDeviceName. NoDevice removes an AMI device and a
VirtualName entry takes one over, never the root. Snapshot sizes apply,
a smaller size, a missing snapshot, a missing or invalid device name and
a device named twice are refused with nothing stored, and IOPS and
throughput are kept only for the types that take them.
DescribeInstances lists every attached volume with its own state and
DeleteOnTermination, and termination treats the root like any other
volume. Volume reads settle attachments to an instance that ended
terminated without TerminateInstances, as a failed container launch does.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): delete every volume of a launch that is rolled back
A launch undone after its instances were stored, an instant CreateFleet
whose later launch fails or a RunInstances whose capacity reservation
was taken in the meantime, terminated its instances. Termination keeps
the volumes whose DeleteOnTermination is false, so the refused launch
left them behind as available.
Each launch now records the volumes it creates on its reservation, and
the rollback deletes those termination left unattached. The ids do not
depend on attachments, which a read can end first when a failed
container's volumes are settled. DeleteOnTermination is never changed,
so an instance whose termination fails keeps its volumes as they were,
and a volume attached to another instance since stays.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): size a snapshot-only root from its snapshot
For an AMI that maps no root device, the launch gave the root a fallback
8 GiB size before merging the launch's own entries, so a root entry
naming only Ebs.SnapshotId kept that size and a larger snapshot was
refused with InvalidBlockDeviceMapping. The fallback size now applies
only after the merge, when the root names neither a size nor a
snapshot.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* perf(ec2): read volume attachments once per DescribeInstances
Listing an instance's block device mapping scanned the whole volume
store, once for every instance in a RunInstances or DescribeInstances
response. The attachments of all the response's instances are now
gathered in one scan per region and looked up per instance.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
SendBulkTemplatedEmail rejected the whole call for an entry with more
than 50 recipients, for template data that is not a JSON object, and
for a tag with an empty name. AWS answers each of these with a 200 and
that entry's InvalidParameterValue ("Recipient count exceeds 50.",
"The template data is invalid", "The tag name must be specified."),
while the other entries still send. DefaultTemplateData that is not a
JSON object, or a DefaultTags tag with an empty name, fails every
entry. Within one entry an address syntax error wins over an empty tag
name, which wins over invalid template data, which wins over the
recipient count.
A DefaultTags or ReplacementTags tag without a Name or a Value is a
model violation, and a skipped tag index is a tag with neither, listed
in the 400 ValidationError after the top-level members. A missing or
empty DefaultTemplateData is a 400 InvalidParameterValue, "The default
template data does not exist".
The handler marks such an entry with its message, and the send answers
it in the per-entry loop after the address syntax. The recipient limit
stays in the service: per entry for v1, whole call for v2 SendBulkEmail,
which was not probed.
* feat(redshift): add event subscriptions with SNS delivery
Add Create, Modify, Delete and DescribeEventSubscriptions, subscription tagging, and publication of matching events to the subscription's SNS topic, honouring the topic policy.
* fix(redshift): deliver events from a consistent subscription snapshot and reject nameless subscription ARNs
Delivery copied no state under the lock modifySubscription holds, so a concurrent
update could change the topic between matching and publishing. Match and publish
from a snapshot taken under that lock.
A tag ARN ending in eventsubscription: passed an empty name to
describeSubscriptions, which lists all subscriptions. Reject it up front.
* feat(cloudfront): model AWS managed cache policies
Serve the 7 AWS managed cache policies that AWS documents with full
settings through GetCachePolicy, GetCachePolicyConfig and
ListCachePolicies, by their AWS IDs. ListCachePolicies honors
Type=managed|custom. UpdateCachePolicy and DeleteCachePolicy refuse a
managed policy with IllegalUpdate and IllegalDelete, as for managed
origin request policies. A cache behavior that references a managed
policy now forwards what that policy selects.
The 4 Amplify-only policies are not modeled: AWS publishes their IDs
but not their settings.
Closes#6691
* refactor(cloudfront): share the policy list merge and the managed ETag
listCachePolicies, listOriginRequestPolicies and listResponseHeadersPolicies
now call one helper for the Type check, the merge of custom and managed
policies, and the sort by name. Each method keeps its own paging, so the
response headers list still rejects an unknown marker.
The managed policy ETag is one constant beside the managed policy maps.
---------
Co-authored-by: liRONCO11 <7966063+liRONCO11@users.noreply.github.com>
* fix(apigateway): send x-amzn-ErrorType on the API key 403
* fix(apigateway): send x-amzn-ErrorType on every REST gateway response
Authorizer, validation, media-type, configuration and Lambda proxy
failures now carry the error type AWS pairs with their gateway response
type, customised or not, measured on a REST API in eu-west-1.
* fix(apigateway): keep a gateway response's own x-amzn-ErrorType where AWS does
A gateway response that maps gatewayresponse.header.x-amzn-ErrorType sends
only that value for the validation, media type, configuration and
integration types, and sends it ahead of the default for the authorizer
and API key types, as measured on AWS.
Return a terminal iterator and direct child metadata from coherent shard snapshots. Preserve final-batch delivery and prevent replay in Pipes and Firehose without changing checkpoint commit boundaries.
A REST API resource such as /v1/admin/catalog/{kind}/{name+} never
matched: greedy resources were matched by the literal text prefix
"/v1/admin/catalog/{kind}/", which no request path starts with, and the
template matcher skipped greedy resources. Every parameterised resource
also ranked ahead of every greedy one.
Match every resource segment by segment and rank all matches the way
AWS does: more literal segments, then more segments before the greedy
parameter, then the leftmost literal. extractPathParams now yields the
parameters before a greedy one, so {kind} reaches the proxy event,
$input.params and integration parameter mappings.
Closes#6686
* fix(iam): authorize S3 Control routes as their own s3 actions
S3 Control clients sign with the s3 scope, so under IAM enforcement its
/v20180820 routes fell through to the S3 data-plane rules and were
checked as s3:GetObject, PutObject or DeleteObject on a bucket named
v20180820, which no policy can name: a role allowed
s3:ListTagsForResource on a bucket was denied its tag list, and
Terraform's AWS provider, which reads bucket tags through S3 Control,
never fell back to GetBucketTagging, leaving aws_s3_bucket unrefreshable.
Map the routes to the actions the Service Authorization Reference gives
them: ListTagsForResource, TagResource and UntagResource are checked
against the ARN the route names, as written and decoded as the handler
decodes it; ListAccessPoints and the account-level Block Public Access,
to which the S3 User Guide gives no resource, against every bucket in
the request's partition; the account control takes the
PutAccountPublicAccessBlock and GetAccountPublicAccessBlock actions. A
data-plane operation under the same prefix keeps its own bucket-and-object
ARN. A denial now answers in S3 Control's own ErrorResponse envelope, the
only one the s3control SDK deserializers read, so the message naming the
missing action survives to the client.
Closes#6537
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(iam): answer the three control-route gaps the review found
A tagging query on a control route still reached the data-plane override,
so GET /v20180820/tags/<arn>?tagging was checked as s3:GetObjectTagging
while the handler read the bucket's tags: the control rules now match
before the query overrides, and a caller holding only the object action
is denied where one holding the control action passes. A tagging ARN in
the regional form was rewritten to the global form downstream and its
bucket misread, so a policy naming the regional form the API reference
requires was denied; the provider now keeps a control tagging ARN as
written and reads the bucket it names. The account actions returned
arn:<partition>:s3:::*, which a bucket-scoped statement matches; they
now return the literal wildcard, so a bucket-scoped statement grants no
account-wide action, the convention the KMS no-resource actions
follow.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(iam): drive S3 Control route authorization from AWS's own data
The s3control model is vendored in rest-routes.json, regen_rest_routes
carries it under the s3 scope, as s3control signs with s3, and
IamRestRouteCoverageTest checks every S3 Control route Floci serves
against the Service Reference. The hand-written S3_CONTROL_RULES and
S3_CONTROL_ACTIONS lists are gone: the control routes are entries of the
one rules table, flagged to match before the S3 data-plane query
overrides so ?tagging on a tagging route cannot re-point the
authorization, and a denial answers in S3 Control's ErrorResponse
envelope by following the route instead of an action-name list. The
account-level Block Public Access is the one written-down exception, as
the reference files S3's and S3 Control's Get, Put and
DeletePublicAccessBlock under the bucket actions and the Block Public
Access page gives the account level its own actions.
A tagging ARN is read once, by the handler, the IAM check and the
bucket-policy lookup together: S3ControlArnUtils decodes and parses it
with AwsArnUtils.parse, and the regional form's account is the account
whose bucket the request acts on, so a grant on
arn:aws:s3:us-east-1:222222222222:bucket/reports no longer lets a
caller in 111111111111 read and change the tags of its own same-named
bucket: it reads and writes 222222222222's bucket, and answers
NoSuchBucket when that account holds no bucket of the name.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(s3): read the policy provider's ARNs without decoding them
The provider received every ARN already decoded, the data plane's from
the request path and a control tagging one re-minted by the rule that
read it off the wire, but the one-parse helper decoded again, so an
object key carrying a plus sign or a literal percent sequence changed
its bytes before IAM checked it: a policy on arn:aws:s3:::example/a+b.txt
denied the very object it named. The provider parses without decoding
now; the wire decode stays where it belongs, at the control request
boundary.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(dynamodb): enforce effective read selection in IAM policies
Preserve generated action and request-member coverage, effective read projections, PartiQL attributes and independent BatchGetItem contexts. Rebase on current main and scope condition data verification to its vendored file, generator, tests and imported modules, retaining all existing IAM data gates.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(dynamodb): derive transaction read conditions from modeled members
Use the generated transaction Get member paths before GetItem IAM extraction, so ignored legacy projection members cannot authorize whole-item reads.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
* feat(ui): serve the Console Contract v2 manifest and pass its URL to the console
/_floci/info and /_localstack/info now carry manifest_version, console_contract, cloud, endpoint, health_url, tls, services, defaults and ui, keeping their existing keys. FlociUiManager injects FLOCI_INFO_URL so the console can read it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* test(ui): drop the DisplayName from the manifest test
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(lambdaweb): check lambda:PassNetworkConnector as AWS does
A revision that sets egressNetworkConnectorArn needs
lambda:PassNetworkConnector on the connector version ARN as given.
Lambda checks it after the connector ARN checks and before it looks
the connector up.
A refusal names the first policy type that refuses, in the order
identity policies, permissions boundary, session policy. An explicit
deny in a managed policy or a boundary also names that policy's ARN.
* fix(lambdaweb): apply service control policies to the account root when passing a connector
* fix(lambdaweb): name the managed policy that denies a session token caller
* feat(iam): check lambda:PassNetworkConnector from a generated table
Move the check out of Lambda Web into the IAM enforcement filter, where
iam:PassRole is checked. tools/aws/regen_iam_passed_network_connectors.py
joins AWS's Service Reference and botocore's models into
src/main/resources/aws/iam-passed-network-connectors.json, and the filter
reads it for Web Functions, MicroVM images and MicroVMs.
A MicroVM request that names no egress connector, or an empty list, passes
the Lambda-managed INTERNET_EGRESS connector, and RunMicrovm with no ingress
connector passes HTTP_INGRESS, as AWS checks them. AppSync's data source
operations are listed too, but botocore's model has no member for their
connector, so they are not read.
The refusal text now comes from AccessDeniedMessages, which
LambdaTaskAuthorizer and GetStackOutputRoleAuthorizer use as well.
Lists every package a repository holds across all five formats, with
each package's origin-control restrictions, filterable by format,
namespace prefix, package-name prefix, and publish/upstream
restriction. generic is enumerated by scanning stored package-version
and origin-config records repository-wide; each container-backed
format gets a new RepositorySidecarManager#listPackages primitive,
confirmed live against each real sidecar: Reposilite has no
list-everything endpoint, so Maven walks its directory tree, peeking
one representative child per directory to tell a group/artifact
directory apart from a plain namespace segment (both look identical
one level up); Verdaccio's /-/all, pypiserver's root simple index, and
BaGetter's Search resource (pressed into service for this admin
listing only, not the native NuGet protocol) answer directly.
PutEvents was checked on `*`: the request-resources table gave it no
resources, as its bus is a field of each entry, which no rule read. A
policy allowing or denying events:PutEvents on one event bus therefore
did not hold for publishing.
Each entry's EventBusName is "the name or ARN of the event bus to
receive the event", and "if you omit this, the default event bus is
used". Bus policies grant events:PutEvents on `event-bus/<name>`. The
EventBridge User Guide checks events:PutEvents against "the bus, once
per entry in the request", and says "Publishing is authorized against
the bus ARN for every entry in the request. If one entry fails an
authorization condition, EventBridge denies the whole request." It says
so in its section on the Custom Event Bus, which keeps the events: IAM
namespace of the Classic one; nothing in the guide says otherwise for a
Classic bus, whose API model lists AccessDeniedException among the error
codes of an entry without saying when.
The table now reads PutEvents' `Entries[].EventBusName`, a field of each
of a list's structures, one resource for each entry:
- The generator takes a correction filling a variable from such a field,
and finds a field whose pattern takes an ARN before a name inside a
list's structures, as it does a top-level member, so the field gets
`arnOf` from botocore.
- The loader reads `Name[].Field` in `fill`, and in `absent` and `arnOf`
when it fills a variable.
- The reader gives one value for each entry, the `absent` value for an
entry that names no bus, gives a null or a blank, as the handler's
`asText(null)` does, and none for no entries, which stay on `*`. Each
value that is an ARN puts its own entry's bus in that ARN's account and
Region, checked as given and as the caller's, which the handler
publishes to; until now the first ARN a request gave set the account
and Region of every value.
The filter checks every resource, so one entry for a bus the caller may
not publish to refuses the whole request, as the guide gives it.
Not in this change: the events:source and events:detail-type condition
keys (Floci supplies neither), EndpointId (the handler ignores it), and
PutPartnerEvents, which stays on `*`.
The upstream drift check on a pull request now verifies only the
vendored IAM files the pull request changes, each with its generator,
its tests and the modules that generator imports. It verified all six
files whichever one a pull request touched, so this change, which
touches only the table of the resources requests name, failed on the
service namespace list, which AWS's index stopped matching when it
dropped `codestar`: drift in a file the change leaves alone. The
pull request's job passes the paths its merge commit changes to
`make iam-data-verify CHANGED=...`, which names each check it skips;
the weekly and manual runs, and a diff that cannot be read, still
check every file, so the namespace list's drift is reported there.
With CloudWatch logging enabled on a job run in the docker runner mode,
its Spark driver's standard output and error now go line by line, while
it runs, to Floci's CloudWatch Logs, as well as to Floci's log.
- Which configuration: the run's cloudWatchLoggingConfiguration, or
else the application's; the user guide merges them by configuration
type, and "enabled": false at the run removes it.
- Where: the log group logGroupName, /aws/emr-serverless by default,
and the log streams <logStreamNamePrefix>/applications/<applicationId>
/jobs/<jobRunId>/SPARK_DRIVER/stdout and .../stderr, with attempts/1/
before SPARK_DRIVER for a retried run on 7.1.0 or later, as for S3.
The guide gives the default group and the stream up to its worker
type; the stdout and stderr streams under it are as Dagster's EMR
Serverless client reads them, and Airflow's operator builds the same
prefix. Group and streams are created as needed, in the run's account
and Region.
- What: the driver's stdout and stderr, "By default, EMR Serverless
publishes only the driver stdout and stderr logs". A logTypes that
names some types sends only the driver's it names, so none of them
when it names only SPARK_EXECUTOR: the API reference's logTypes is
"The types of logs that you want to publish to CloudWatch".
ContainerLogStreamer gets attachByStreamForAccount, which sends a
container's standard output and error to log streams of their own; its
reassembly callback now keeps the stream each line came from. The
shared Spark runner uses it when a job carries a CloudWatch destination.
The Query walk the managed-policy family reads its constraints through read
scalars only, and refused an operation whose input carries a list when the
vendored file loaded. It reads a list now, and a structure, which is what the
rest of this track is gated on: 34 of IAM's 180 operations carry a list or a
map, and 6 of STS's 11 do.
A list arrives numbered under its own name, Audience.member.1 or the bare
Audience.1, and a member of a list of structures carries its fields under that
prefix, as Tags.member.1.Key does. Each is named in a message the way this
package already names one, filter.1.member and tags.1.member.key, under the
index the request spelled rather than the position the member sits at, which is
what #6478 settled. The count is held to the list's own bounds with the value
left out of the message, which is the form checkListLength and the audience
check both already answer: quoting it would echo every member of the list back.
A list of no members is how an absent list arrives on this protocol, so a
required one reads as null rather than as a list breaking a minimum of 1, and
only a minimum above 1 is reachable at all. A structure member arrives as
TaskPolicyArn.Arn and is named taskPolicyArn.arn, and a request naming none of
its fields is a request without the member.
GetAccountAuthorizationDetails is the operation this wave opts in, and the one
where the model adds refusals rather than rewording an answer already given:
the handler reads none of its three declared members, so a Filter outside the
model's enum, a MaxItems outside 1 to 1000 and a Marker breaking its length or
its pattern are all answered with a 200 today. They are a 400 ValidationError
now, which is the ordering #6402 settled for this package.
A map is still refused when the file loads, and so is anything nested deeper
than a list of structures. The refusal is the point rather than a gap: this
package answers a map against the whole map today, Map keys must satisfy
constraint on PutAccountProperties, where the protocol numbers a map's entries
as Properties.entry.N.key, and no source here says which of the two AWS
answers. Reading one would reword a merged answer on the strength of a guess.
The reader the walk needs went into AwsQueryLists rather than into a third
copy. That file already reads a list's values, and StsQueryHandler holds a
private copy that captures the prefix and the index for the same reason this
one does; the STS wave is where that copy goes.
A number too large for a long is a number all the same, which the range check
reads as one now. It compared through a long before, so a MaxItems of
9223372036854775808 failed to parse, read as no number at all and reached the
operation past a maximum of 1000. The bound it breaks is one that fits in a
long either way, so the comparison carries no width of its own, and the value is
written as the number reads rather than as the request spelled it, a leading
plus or zero gone, which is what a parsed value already answered.
Seven unit tests cover the new forms, two of them on the reader, which is where
one of them found that a key naming its own member read as a member numbered
after it: the index is a number or the key is not a member's. Four wire tests
cover the operation. Removing the list branch fails four of the six list and
structure tests and two of the four wire tests: the two that stay green are
MaxItems and Marker, scalars the walk already read, so they prove the operation
was opted in rather than the walk.
Under IAM enforcement a refused SNS request answered `AccessDenied`, the
code Floci gives every Query service. SNS models no such error. Every
one of its 42 operations lists `AuthorizationError`, HTTP 403, a sender
fault ("Indicates that the user has been denied access to the requested
resource"), which SDKs raise as `AuthorizationErrorException`; the SNS
Developer Guide's own sample reads that code as an IAM permission
failure ("Authorization error listing topics - check IAM permissions").
An SDK caller catching `AuthorizationErrorException` therefore missed
Floci's refusal, which surfaced as a bare `SnsException`.
A Query denial now takes its code from the service that serves the
request: `AuthorizationError` for SNS, whichever action is denied (a
role it is passed as much as its own action), and `AccessDenied` for
every other Query service, as before. The status, the `Sender` type and
the message are unchanged.
Not in this change: Floci's SNS JSON surface (`SNS_20100331.*`
targets), which botocore does not model, keeps `AccessDeniedException`.
In the docker runner mode a Spark driver's output went only to Floci's
log. Once a driver ends, the shared runner now reads its standard output
and error from Docker and puts them, gzipped, into Floci's S3 as
stdout.gz and stderr.gz in the run's log folder, while the container is
still the run's. A driver a cancel or its timeout ended is stopped
first, through a new ContainerLifecycleManager.stop that leaves the
container in place, so it changes nothing more while its output is read
and the logs hold all it wrote; a driver Floci's teardown took writes
nothing. Logs that cannot be written leave the run as it ended.
- EMR steps: under the cluster's LogUri, at
<LogUri>/<cluster-id>/steps/<step-id>/ (Management Guide, "Log
locations"); without a LogUri "logs are not created". An s3n:// or
s3a:// LogUri names the same bucket.
- EMR Serverless job runs: under the run's s3MonitoringConfiguration
logUri, or else the application's (the user guide merges them by
configuration type, and an empty one at the run removes it), at
applications/<applicationId>/jobs/<jobRunId>/SPARK_DRIVER/, with
attempts/1/ before SPARK_DRIVER/ for a STREAMING run or a BATCH run
whose retry policy allows more than one attempt, on 7.1.0 or later.
FailureDetails gets no LogFile: the Management Guide ties it to a root
cause EMR identifies, and Floci's Reason is always "Unknown Error".
core.common.S3Uri splits the folder's s3:// URI into bucket and key.
* feat(ecr): repository creation templates
CreateRepositoryCreationTemplate, DescribeRepositoryCreationTemplates,
UpdateRepositoryCreationTemplate and DeleteRepositoryCreationTemplate store
templates per account and Region, keyed by prefix, with each field checked
against the service model. An update replaces the fields it sets, and an
empty string or list clears one. Templates are recorded, not applied, as
nothing in Floci creates repositories through replication, pull through
cache or create-on-push.
Closes#5804
* refactor(ecr): check repository creation templates against the vendored model
The four template actions join the registry settings in
ecr-request-shapes.json, so the handler checks their requests against the ECR
model's types, lengths, patterns and enums and answers in ECR's
"failed to satisfy constraint" form. The handwritten copies of those rules
go. What the model can't state stays in the service: appliedFor naming at
least one value, and policy text being a JSON object.
The model gives imageTagMutabilityExclusionFilters at least one entry, so an
update sending an empty list is now refused rather than clearing the filters.
Terraform omits the member when the filters are removed and moves to a mode
without exclusions, so an update that leaves the template in such a mode now
drops the filters. Before, they stayed, and every plan showed them again.
* fix(ecr): lock creation template writes, share one JSON object check and fold a trailing slash
Create, update and delete each read a template and then wrote it without a
lock, so two creates of one prefix could both succeed and an update racing a
delete wrote the deleted template back. They now take the registry lock the
registry settings use. The template policies and the registry policy share one
JSON object check that also refuses text after the object, such as {}{}.
ECR assumes a / after every prefix, so prod and prod/ are now one template.
The test helper imports Executable.
* fix(ecr): describe each template once when prefixes differ only by a slash
Describe removed duplicate prefixes before folding the trailing slash, so
prefixes prod and prod/ returned the template twice, and with maxResults 1 a
token followed by an empty page. It now removes duplicates by template key.
The lock tests use the shared testing ParkingStore instead of their own copy.
* fix(iot): honour attributePayload.merge, thingTypeName and expectedVersion on things
UpdateThing replaced the attributes with whatever the request carried, so a
merge update dropped the stored attributes and a type-only update wiped them.
It now merges when attributePayload.merge is true, removes an attribute given
an empty value, leaves the attributes alone when the request has none, sets or
removes the thing type, and rejects a missing or deprecated type and a
removeThingType that also names a type. DeleteThing now honours
expectedVersion, and a stale version reports AWS's message.
Closesfloci-io/floci#6655
* fix(iot): serialize UpdateThing and DeleteThing, reject a malformed thingTypeName
A merge is a read-modify-write and expectedVersion is a compare-and-set,
so both now run under one thing write lock. An empty or malformed
thingTypeName on UpdateThing is an InvalidRequestException, as in AWS,
instead of being treated as absent.
* test(iot): race versioned thing updates and deletes, rerun the SDK test on AWS
A race test holds the thing write lock to one winner per expected
version. On AWS the SDK test borrows an active test thing type, as
fleetIndexSearch does, since a deprecated type cannot be deleted for
five minutes and a rerun would fail.
* fix(iot): answer a malformed thingTypeName with AWS's validation message
UpdateThing now builds the refusal with SmithyValidationErrors, listing
the length violation before the pattern one, as measured on AWS.
* fix(elb): keep Classic health checks apart between accounts
The Classic health checker kept its instance states and its probe timer
under the region and the load balancer name. A Classic name is unique
only within one account, so when two accounts each had a load balancer
called web they shared one entry. Creating the second web replaced the
first one's periodic check with its own, and deleting it removed the
first account's instance states too: those instances then reported
OutOfService with reason ELB ("Instance registration is still in
progress") and were no longer checked.
The key now includes the load balancer's account, and the checker's
methods take the load balancer itself instead of a region and a name,
so the account always comes with it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(elb): restore every account's Classic load balancers at startup
Startup runs outside any request, where the storage-backed map of
Classic load balancers sees only the default account. Restoring through
it restarted health checks for the default account's load balancers
alone: after a restart, the instances registered with another account's
load balancers reported OutOfService with reason ELB and were never
checked. Those accounts' region maps also stayed the plain maps read
from disk, although the name check in CreateLoadBalancer and the
certificate scan rely on concurrent ones, and a load balancer stored
with the old fixed hosted zone kept it unless the default account owned
it.
Startup now walks the stored region maps of every account: it makes
them concurrent, gives each load balancer its region's hosted zone, and
starts its health checks. A load balancer stored before load balancers
recorded their account takes the account it is stored under, so its
health state and instance lookups belong to that account.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(elb): restore the default account's Classic load balancers by their own keys
The every-account restore read the default account from a scan of the
whole store as well, and that scan recognizes only 12-digit account
prefixes. The default account id is configurable, through
FLOCI_DEFAULT_ACCOUNT_ID, and need not be 12 digits. With one such as
local, every restart read the key local/us-west-2 as a region of that
name: the default account's load balancers lost their hosted zone, their
region maps stayed plain maps, and each restart wrote nested copies of
the store that a delete never reached.
The region maps that the storage-backed map shows, which at startup are
the default account's, are read through it again, as they were before
the every-account restore, and written back under their own keys. The
scan now supplies only the other accounts' maps. The javadoc no longer
compares this restore with ELBv2's, which still covers the default
account only.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(elb): run the Classic account isolation checks every second
The account isolation tests set their health check through
ConfigureHealthCheck, whose 5-second minimum interval made the two tests
take about 20 seconds. They now set a check every second on the stored
load balancer and re-arm the checker directly, and take about 4
seconds. Both still fail on the commit before the per-account key.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(elb): restore each Classic region map under the account in its key
The startup restore read the default account through the storage-backed
map, which shows the account of the current request, and every other
account from a scan that recognizes only 12-digit account prefixes.
Neither holds in general. The service is created on its first use, and
that use can come inside another account's request: an IAM
DeleteServerCertificate reaches it even while Classic ELB is disabled
and its lifecycle restore never runs. Account ids need not be 12 digits
either: FLOCI_DEFAULT_ACCOUNT_ID is free-form, and AssumeRole takes the
account from the role ARN. In those cases the restore again nested
copies of a region map and cleared its hosted zone, or left another
account's load balancers unrestored.
Startup now reads every region map by its raw stored key and takes the
account and the region from it. A region never contains a slash, so the
account is everything before the last one.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(elb): check which load balancer each restored account holds
The restore test for region maps read by their stored keys checked each
account's keys, map type, hosted zone and health checks, but not which
load balancer its map held. A restore that wrote every map back under
the account of the current request still passed, with one account left
holding another account's load balancer. The test now checks that each
account's stored map holds that account's own load balancer, and that
write-back fails it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(elb): run the Classic isolation checks without waiting on timers
The account isolation tests waited on the real one-second health check
timer, so the class took about 5.6 seconds, 3 of them in the second
case. The checker now keeps the load balancer each periodic check
probes next to its timer, and a package-private runArmedChecks() runs
one tick of every armed check at once. The tests set an interval no
timer reaches during a test, settle each check in one probe, and run
the rounds themselves. The class now takes about 1.8 seconds, most of
it the first case's setup, and the timers keep their schedule.
Running what the armed timers would run, rather than probing one load
balancer directly, keeps the second case meaningful: it is about
another account's balancer taking over the periodic check. With the
account left out of the health checker's key, both cases still fail.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(elb): make the second Classic isolation case independent of rounds
The case where another account creates a load balancer of the same name
caught a health checker keyed without the account only because it ran
exactly one round: the other account's default TCP:80 check needs two
failures, so a second round would have let it report OutOfService as
well. The case now also checks that the instance recovers once its
backend answers 200 again, which only the first account's own check can
report.
The helper that registers the instance no longer runs a round of its
own. The probe that registration schedules already settles a check with
thresholds of one, and a second probe could still be running when the
case moved on. Each periodic check now stores the tick its timer runs,
and runArmedChecks runs that same tick, so the two cannot drift apart.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(elb): create the Classic load balancer store in the constructor
The Classic service created its load balancer store and the map over it
in initializeStorage, so neither field could be final, as AGENTS.md asks
of service fields. Both are now created in the constructor, as
CloudFormationService creates its stores, and are final; without a
StorageFactory the map is a plain in-memory map, as before.
initializeStorage keeps the conversion of region maps read from disk, so
the startup order is unchanged: the store is created and loaded during
the bean's construction either way, and nothing in that step calls
another bean. The StorageFactory field, read only there, is removed.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>