Deleting an EKS add-on or Fargate profile now keeps only its ARN for
IAM authorization, keyed by the cluster's incarnation, so a deletion
waiter with a resource-scoped describe grant receives
ResourceNotFoundException instead of AccessDeniedException, while an
unrelated grant or an explicit deny still gets 403. Describe and list
still report the resource as gone, recreation clears the kept ARN and
cluster deletion purges it. Resource tags are not kept.
Closes#8494
ModifyNetworkInterfaceAttribute was not implemented, so a call to change
an interface's security groups, description, source/destination check
or DeleteOnTermination was refused, and with security-group enforcement
on an interface's groups could only change through ModifyInstanceAttribute.
The action now changes a standalone interface or one an instance was
launched with. The group list is read as SecurityGroupId.N, the name the
SDKs and the CLI send. On an instance's primary interface the groups and
the source/destination check are the instance's too. With enforcement
on, a group change reaches the interface's firewall before it is stored,
under the instance's lock, as ModifyInstanceAttribute does, so a policy
that cannot be applied leaves the groups as they were, and the ports the
instance's groups publish are reconciled after a primary-interface change.
The change re-checks the interface and its attachment in the critical
section that stores it, and AttachNetworkInterface and
DetachNetworkInterface now update the standalone record and the instance's
copy under the same topology lock.
ModifyInstanceAttribute no longer overwrites every interface's groups: on
an instance with more than one interface, a group or SourceDestCheck change
answers InvalidInstanceID ("There are multiple interfaces attached to
instance ... Please specify an interface ID for the operation instead."),
the code and message AWS returns, as the Terraform AWS provider quotes them.
The members Floci does not apply (EnablePrimaryIpv6, EnaSrdSpecification,
ConnectionTrackingSpecification, AssociatePublicIpAddress,
AssociatedSubnetIds and the attachment's ENA queue counts) answer
UnsupportedOperation, as ReplaceRoute refuses a target it cannot store,
rather than true with nothing changed.
Part of #2564.
Athena answers a table whose S3 location holds no data with no rows.
Floci's view read the location with DuckDB's read_* glob, which refuses
to bind when nothing matches, so every query on such a table failed.
- GlueViewDdlBuilder checks the location a table is read from (its read
path, so a projected table's partition folders) before building its
view. One that holds no data gets a view of no rows with the table's
declared columns as their declared types (GlueTableResolver
.emptyProjection), nested and binary columns as the engine reads them
(columnType: array<T> as T[], map, struct, binary as BLOB).
- TableLocation.holdsNoData lists the location in one scan: folder
markers (keys ending in a slash) hold no data, and a read path with
`*` segments is listed from its literal prefix, an object counting
when its key matches the glob. A location holding another glob
character, or whose bucket does not exist, is read as before.
GlueViewDdlBuilderTest covers an empty location, one holding only
folder markers, a projected location holding only objects its glob does
not reach, nested and binary column types, an unmodeled glob and a
missing bucket. AthenaDelimitedTextSidecarIntegrationTest
queries an empty location and a folder marker against the real engine.
athena.md says so.
The generated request resources give Lambda's function, function version
and alias, event source mapping, web function, revision and endpoint,
MicroVM image and network connector types aws:ResourceTag/ keys, but
LambdaStoredResourceArns did not answer storedTags, so a condition on
their tags saw none. It now answers from the service holding each:
LambdaService for a function, whose versions and aliases have its tags
as Lambda keeps tags on the function alone, and an event source mapping;
LambdaWebService for a web function, whose revisions and endpoints
inherit its tags; LambdaMicrovmsService for an image or a connector.
Each reads the resource under the ARN in the account and Region it
names, a pre-multi-account one of the default account in place, through
the new AccountAwareStorageBackend.readInAccount, matched on the whole
ARN. Tagging a function or a mapping now puts a new tag map in place of
the old one, so the lookup always copies one whole set.
IAM enforcement now reads RDS requests from the generated
request-resources table: all 168 RDS operations are checked on the
resources they name, from the Service Reference and pinned botocore,
so a policy scoped to a DB parameter group, proxy, snapshot or other
RDS resource applies. Stored tags of RDS and DocumentDB resources come
from the existing tag lookups for aws:ResourceTag conditions, read
only, in the ARN's own account.
Closes#8396
* fix(elbv2): apply regional ALB zone defaults with overrides
* fix(elbv2): restore legacy subnet snapshots during stack rollback
* fix(elbv2): require two ALB zones for the AWS default
* fix(elbv2): simplify explicit ALB zone rules
IAM enforcement now reads an event bus's or rule's stored tags for
aws:ResourceTag conditions, from the exact ARN's account, Region and
partition, without creating the default bus. ListTagsForResource,
TagResource and UntagResource share the same lookup.
Closes#8397
CreateDBInstance and ModifyDBInstance now check that every security
group a request names exists in the caller's account and Region and sits
in the instance's VPC, refusing an unknown id with InvalidParameterValue
and a group of another VPC with InvalidParameterCombination. Restores,
read replicas, Blue/Green deployments and CloudFormation go through the
same check, and DocumentDB shares it. An instance whose request names no
groups gets its VPC's default security group, as RDS documents, and
describe reports that group for an instance that keeps none.
Floci had no emr-containers service, so Airflow's EmrContainerOperator, the
aws emr-containers CLI and the SDKs had nothing to call. This adds its 25
operations: virtual clusters, job runs, job templates, managed endpoints,
security configurations and tags.
Job runs follow the job run states without running Spark on Kubernetes: a
run completes as soon as it is submitted, or after
floci.services.emrcontainers.job-run-duration-seconds. When Floci's EKS has
no cluster of the virtual cluster's container provider id, the run is FAILED
with "Cluster <id> does not exist." and CLUSTER_UNAVAILABLE, as AWS's "Common
errors when running jobs" page gives it; that page also gives the wording for
a job run on a missing or non-RUNNING virtual cluster. A job template's
${name} placeholders are filled from jobTemplateParameters or the parameter's
default. Deleting a virtual cluster clears its tags, as the development guide
says, only resources in an active state of the request's Region take tags,
and a job run's template and request tags together keep the 50-tag limit. A
virtual cluster created on an EKS cluster whose authenticationMode admits
access entries is access entry integrated, which ListVirtualClusters'
eksAccessEntryIntegrated filters on.
Every request is checked against botocore's emr-containers constraints,
vendored by tools/aws/regen_emr_containers_shapes.py and gated by make
aws-data-check. Routes sit under a signed-service prefix, so a path-style S3
request for a bucket named virtualclusters still reaches S3. The routes are
added to IAM's REST route table, and emr-containers to the IAM generators'
namespaces, so each operation is checked on the resource its path names,
StartJobRun and CreateManagedEndpoint need iam:PassRole on their
executionRoleArn, and the create operations need emr-containers:TagResource
for their tags, all from AWS's Service Reference.
No botocore model describes AWS Glue's Iceberg REST endpoint, so no
vendored route mapped its paths to an action, and the endpoint refused
every IAM principal under enforcement, letting only root credentials
and Floci's own query engine through.
- regen_rest_routes.py reads an endpoint botocore does not model from
the AWS page documenting it (DOCUMENTED): Glue's "REST APIs for Apache
Iceberg specifications" gives each operation's REST path, IAM action,
CloudTrail event and a link to its definition in the Apache Iceberg
REST catalog OpenAPI specification. Each row of the Iceberg REST
Catalog API is the Glue operation its IAM action and CloudTrail event
name, refused when they differ, on the method and path of the
definition it links, under the root and the catalogs/{catalog} prefix
the page's path gives. Rows of one operation are its route and its
alternatives. Where the page's own path differs from the definition
(DeleteNamespace's "namespces", CreateTable's GET), the definition is
taken and the difference recorded. Nothing is typed by hand.
- Reading the page needs the network, so a regeneration carries the
routes over from the vendored file, --fetch-documented reads them
again, and --verify checks them against the page;
documented-routes-verify runs in iam-data-verify.
- rest-routes.json gains the endpoint's ten Glue operations under the
glue scope, and iam-authorized-actions.json lists glue's actions of
no resource type, as it does for every routed scope. The same
regeneration takes the actions AWS has added since: GuardDuty's
ListInvestigationRecords and Route 53's IP guardrail policy actions.
- The controller's refusal of IAM principals goes. Each route is now
checked as its Glue operation, on the account's Data Catalog whichever
catalog the prefix names: the request-resource table reads no Glue
member from an Iceberg request, so a grant or deny scoped to a
federated catalog, a database or a table does not apply here.
Floci's own engine's token is not checked again.
- A request a documented route takes is another API's, so it carries
none of its operation's members: the enforcement filter has every
member reader (request resources, condition keys, tag-on-create,
passed roles) read none from it, so a Glue member a caller adds to an
Iceberg body, such as Tags or DatabaseInput, names no resource and
gives no condition key a value.
GlueIcebergIamIntegrationTest checks a principal allowed GetCatalog and
GetDatabase reading the configuration and the namespaces and refused
creating a namespace or loading a table, by GET or HEAD, a deny on the
catalog holding under an allow on everything, and root credentials and
a minted token answered, and a Glue member added to an Iceberg body
neither satisfying an aws:RequestTag condition nor naming a database.
glue.md and iam.md say so.
Under enforcement, the identity that owns a delegation request was denied every
operation on it unless a policy named them, so a customer who claimed a request
could not read it, forward it, reject it or release its token without being
granted each one. AWS grants those by default. The customer page's note, under
"Managing Permissions for Delegation Requests", reads "By default, IAM
principals who initiate a delegation request are automatically granted
permissions to manage that specific request. They can associate it with their
account, view request details, reject a request, forward it to an administrator
for approval, release the exchange token to the product provider after admin
approval, and list delegation requests that they own."
So the holder now carries a grant over the requests it owns:
GetDelegationRequest with GetHumanReadableSummary, UpdateDelegationRequest,
which is the forward, RejectDelegationRequest and SendDelegationToken on those
requests, and ListDelegationRequests. The summary sits beside the read because
the reference puts it there itself: its "rules are identical to
GetDelegationRequest API behavior, such that a party who has permissions to call
GetDelegationRequest for a given delegation request will always be able to
retrieve the human readable summary for that request".
Listing names no resource, the Service Reference giving that action none, and is
scoped by the condition key the same reference publishes on it:
iam:DelegationRequestOwner, under ArnEquals, held to the owner's own ARN. That
is the line the guide draws between its two listing permissions, the table's
"List delegation requests for your account", which an administrator grants, and
the note's "list delegation requests that they own", which an owner has without
one. So an owner names itself in OwnerId and is answered with its own requests,
while naming another owner, or naming none, is refused, and the account's whole
listing stays with the granted permission. The key is read from the request's
OwnerId member through the IAM condition-key table, which names the member for
the pair so that the table's own gates re-derive it. The seven other delegation
actions the reference lists that key on take its value from the stored request
rather than from a parameter, so they stay unread.
The grant reaches whoever claimed the request, user or role session alike:
AssociateDelegationRequest stores "the ARN of the current calling identity", so
a session is recorded under its own assumed-role ARN and is looked up by that
rather than by the role it assumed. It is read where an identity's policies are
assembled, beside the password self-service grant that works the same way, so a
live request, a simulation and the user's access report all see it.
That lookup runs wherever policies are assembled, so on every authorized
request and not only on a delegation one. It answers an empty store without
reading it, and otherwise from a view of who owns what that one scan builds and
any stored write invalidates whole, so the usual answer costs a lookup rather
than a scan of every record in every account. Invalidating the view whole is
what keeps it true: nothing updates it in place, so a claim, an expiry and a
reload all land the same way. An emulator reset wipes the backend without a
request passing through that one method, so the service is Resettable and drops
the view in clear(), which makes the invariant a hook rather than a
coincidence of the store being empty afterwards.
Two abilities the note names are left out, each for its own reason. Approving is
not implicit: the same page lists iam:AcceptDelegationRequest among the
permissions an administrator grants, which is the step the flow keeps for one.
Associating cannot be granted here at all, because a request records no owner
until it is claimed, so before the claim there is no identity to write a grant
for; the claim still needs a permission and everything after it does not.
The ownership itself comes through a port rather than a new dependency:
DelegationRequestOwnership, implemented by DelegationRequestService and asked by
IamService, which is how ScpProvider and ResourcePolicyProvider are declared so
that IAM does not reach into another store.
Glue was one of the namespaces the table of request resources did not
read yet, so under enforcement every Glue request was checked on *: a
grant scoped to one database or table could not allow anything, and a
deny scoped to one did not hold.
- Glue moves from NOT_COVERED to NAMESPACES and the generator reads all
314 of its operations. A table operation is checked on the account's
Data Catalog, the database and the table, the three types the Service
Reference gives glue:GetTable and its kin; a database operation on the
catalog and the database; jobs, crawlers, triggers, workflows and
connections on the ARNs Glue mints for them.
- Where a Glue request names its resources in ways the generator did not
read yet, its rules read a little further, each from botocore alone:
Input and List drop from a member's stem as Config and plurals do
(DatabaseInput.Name, ConnectionNameList); a list whose own list shape
is named for the type's names fills it (BatchDeleteTable's
TablesToDelete, a BatchDeleteTableNameList); "being" ends a type's name
in documentation (GetWorkflowRun's Name, "name of the workflow being
run"); a type of no variables of its own, the account's catalog, is no
longer dropped as an alternative to the unnamed type a create makes;
and a create whose request carries tags and whose action acts on other
types alone tags the resource it makes when the request names it in
full (CreateConnection's tags on connection/<ConnectionInput.Name>),
which the table reader now accepts.
- Outside Glue those rules change four entries: Redshift's
BatchModifyClusterSnapshots is checked on the snapshots its
SnapshotIdentifierList names instead of *, and EventBridge's
CreateEventSource and QuickSight's CreateDataSet and CreateTopic gain
a makes that changes nothing at runtime. Every other entry is
unchanged.
- What the table does not read stays as the metadata gives it: a
CatalogId is not read, so another account's or a federated catalog is
checked on the caller's account's ARNs, and a schema named by its
registry and name on schema/<SchemaName>, the Service Reference's
format, whose botocore pattern takes no slash.
IamRequestResourceEnforcementIntegrationTest checks a table on the
catalog, its database and itself, a database and a job on the ARNs Glue
gives them, a deny on one table or connection holding inside a batch
delete, a database's creation on its DatabaseInput.Name, a connection's
tags on its ConnectionInput.Name, and a workflow run on its workflow.
The generator's tests cover each rule; iam.md says so.
The embedded DNS server only started when Floci ran in Docker, so a
natively running Floci left <service>.<namespace>, Route 53 private
zone records and its own names unresolvable, both for the containers it
launches and for the host.
Natively it now starts up to two listeners. On a host with a docker0
bridge it listens on that bridge's address, port 53, the address
host-gateway points at, and hands it to the containers it launches as
their resolver, as it does from Docker. Port 53 needs root or
CAP_NET_BIND_SERVICE; without it Floci logs how to grant it and the
containers keep resolving through Docker. floci.dns.bridge-listener-enabled
turns it off. With floci.dns.host-port set it also listens on 127.0.0.1
at that port for the host's own resolver; that listener is never handed
to containers, and it refuses names Floci does not hold rather than
forwarding them, so a host resolver that routes a domain to Floci cannot
get a lookup back. Each listener answers Floci's own names with its own
address.
Startup now waits, up to five seconds, for the listener containers are
given to bind or fail, in Docker as well as natively, so a container
launched right after startup is not created without Floci's resolver.
Closes#2556
EMR Serverless resolves a custom image's digest either for each workload
or once, at the application's start: "Custom images are resolved to a
digest at application start; that digest is used for all jobs until the
application restarts". The user guide's table makes that the default for
EMR 7.13 and earlier (applicationLevelDigestResolution = true) and
resolution per workload the default from 7.14. Floci resolved every
custom image for each run, whatever the release or the setting.
Where an image configuration's applicationLevelDigestResolution is true,
or left unset on 7.13 or earlier, the application now reads the digest
of its image in Floci's ECR as it starts, gives it to the image
configuration as its resolvedImageDigest, and each run pulls the image by
that digest until the application starts again, an update meanwhile
notwithstanding; a job run's image configurations carry it. An image
outside ECR, or one Floci's ECR does not hold, has no digest to read and
is resolved for each run, as before, as is one in another account's
repository, which Floci does not check the application may pull; any
other answer from Floci's ECR fails the start, leaving the application
as it was. An update that turns a running application's image to
resolution per workload ends its pin, and a stopped application reports
no digest. EcrRegistryManager gains ecrImage, the repository and the tag
or digest an image URI names.
When a .sync Task's wait ends early, Step Functions "will make a
best-effort attempt to cancel the task". Floci's EMR Serverless undo
already passes over only the answers that say the application or run is
gone or past undoing, and fails the Task with any other. Its three
siblings passed over every failure: the EMR step's cancel, the ECS
tasks' stop and the child execution's abort.
Each now passes over only its service's answer for a job that is gone or
past undoing, logged as before: EMR's InvalidRequestException for a
cluster that is gone or a release that cannot cancel steps (a step it
will not cancel comes back FAILED in an answer that succeeds), ECS's
InvalidParameterException for a task it does not know, and Step
Functions' ExecutionDoesNotExist; a task already stopped and a child
already ended are answered without an error. Any other refusal fails the
state with the integration's error (EMR.<name>, ECS.<code>,
StepFunctions.<code>) and the service's message, the ECS one once every
task has been asked to stop, and any other failure is raised.
A cluster's instance groups and fleets reported RUNNING, with all their
capacity, from its creation until it was TERMINATED, whatever state the
cluster itself was in. InstanceGroupState and InstanceFleetState have
PROVISIONING, BOOTSTRAPPING and TERMINATING too, and the Management
Guide's events end an instance fleet's provisioning with "Provisioning
for instance fleet ... is complete ... The instance fleet now has
On-Demand capacity of Num".
No source says when each applies, so they now follow the cluster's state,
Floci's reading: PROVISIONING while it is STARTING, with nothing running
or provisioned yet, BOOTSTRAPPING with every instance up for its bootstrap
actions, RUNNING while it runs or waits, and TERMINATING as it ends, the
instances still running. One added later takes the state its cluster's
others are in. ListInstances gives each instance its group's or fleet's
state, lists those being provisioned, and filters by InstanceStates per
instance. A cluster terminated while it is STARTING keeps listing the
instances it was provisioning, still PROVISIONING and none of them
running, until it is TERMINATED, so the same instances are listed
throughout.
The generated request resources give CloudFormation's stack, stackset and
changeset types aws:ResourceTag/ keys, but CloudFormationStoredResourceArns
did not answer storedTags, so a condition on their tags saw none. It now
answers from CloudFormationService.storedTags, which reads the live stack, or
the change set, under the ARN in the account and Region it names, and
StackSetService.storedTags, which reads the stack set under the ARN in the
account it names, a pre-multi-account one of the default account in place;
each matched on the whole ARN, reading only.
S3 Tables now serves GetTableBucketEncryption, returning the encryption
configuration CreateTableBucket stored, a configured KMS key ARN
included. A bucket created without one, or loaded from an older
snapshot, reports AES256. It is configuration readback only: Floci does
not encrypt table data or use the KMS key, and updating or deleting a
bucket's encryption configuration is not implemented.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
HTTP_PROXY request parameter mappings on HTTP APIs now read $request.body, $request.body.<JSONPath>, $stageVariables.<name> and $context.<name>, the sources the AWS service integration subtypes already read, resolved by ContextValueResolver for both integration types. A header mapping that carries a control character is refused with 502 before anything reaches the backend, and an overwrite:path reads each embedded source expression whole, bracketed JSONPath selectors included.
Signed-off-by: Tyler Webb <tyler.webb@verkada.com>
The generated request resources give Scheduler's schedule-group type
aws:ResourceTag/ keys, but SchedulerService did not answer storedTags, so a
condition on a schedule group's tags saw none. SchedulerService.storedTags
now reads the one group entry in the account and Region the ARN names and
gives its tags, matched on the whole ARN, reading only; a group stored before
storage was account-aware is read in place for the default account, and the
default group has none until a request stores it.
Tagging and untagging now put a new tag map in place of the group's, taking
turns on the group, and the field is volatile, so the lookup, and the
existing tag listing, always copies one whole set nothing changes after.
EMR's documentation sets four limits on steps that Floci did not check:
StepConcurrencyLevel "a minimum of 1 step and a maximum of 256 steps"
(ModifyCluster; "The maximum value is 256" for RunJobFlow); "only 256
steps can be RUNNING or PENDING at any given time"; an ActionOnFailure
other than CONTINUE added while the level is above 1, where "The step is
not submitted and the action fails with a message that the ActionOnFailure
setting is not valid"; and CancelSteps, "Available only in Amazon EMR
versions 4.8.0 and later, excluding version 5.0.0", with "A maximum of 256
steps ... in each CancelSteps request".
Each is now refused in the error code its operation's model points at:
ValidationException from RunJobFlow and AddJobFlowSteps, which declare no
InvalidRequestException, as Floci's other refusals of theirs, and
InvalidRequestException from ModifyCluster and CancelSteps. No source
gives AWS's messages, so they are Floci's.
UpdateKeyValueStore and DeleteKeyValueStore answered every If-Match that
did not match the store's control-plane ETag with InvalidIfMatchVersion
(400). A stale version Floci issued, one that a comment update has since
rotated, now fails with PreconditionFailed (412); a missing or malformed
version keeps InvalidIfMatchVersion. A refused request leaves the store
and its data plane unchanged, and the CloudFront overview and the
key-value-store section of the docs describe the same statuses.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
* fix(autoscaling): register instances with a Classic Load Balancer on attach and deregister them on detach
* fix(autoscaling): put members back in what they left when a detach is refused
* test(autoscaling): share the attachment tests' groups in one fixture
EC2 deleted a terminated instance's root volume through the raw
block-device helper, though a root has no raw backing: it is the
container's own file system. Volume deletion now takes the same root
check that already skips the detach, so termination and reconciliation
remove a root's metadata and tags without calling the helper, while
data volumes keep their backing-storage cleanup. Failed-launch rollback
records the launch's root volume ids before terminating, so a root that
DeleteOnTermination=false kept, or that reconciliation detached first,
is deleted the same way.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
The generated request resources give S3 Tables' TableBucket and Table types
aws:ResourceTag/ keys, but S3TablesStoredResourceArns did not answer
storedTags, so a condition on a table bucket's or a table's tags saw none.
S3TablesService.storedTags now reads the one bucket entry in the account and
Region the ARN names and gives the bucket's tags, or a table's, matched on
the whole ARN, reading only, a bucket stored before storage was account-aware
read in place for the default account, as Secrets Manager's lookup reads one;
S3TablesStoredResourceArns answers it.
A delegation request's RolePermissionRestrictionArns was stored, echoed and
counted, and nothing applied it, so a role created with delegated credentials
carried no boundary where AWS forces one. The partner guide says long-term
permissions "limit the permissions of any roles that are created or managed
through temporary access" and are "implemented as IAM permissions boundaries",
so a partner's cap did not reach the roles it exists to cap.
The member is also not an input. It is absent from CreateDelegationRequest and
appears only in the DelegationRequest output shape, where
GetDelegationRequest's own example reports it empty, because AWS fills it from
the partner's registration rather than from a request. Those boundaries are
registered by emailing AWS, with no API at all, under ARNs shaped
arn:aws:iam::partner:policy/permission_boundary/<partner_domain>/<policy_name>_<date>,
which carry the word partner where an account id goes. So no caller can create
one, no account holds one, and the only way this emulator can hold what AWS
holds out of band is to be handed it.
It is handed it by configuration. services.iam.partner-permission-boundaries-path
names a JSON file of partner account id to an object of boundary ARN to policy
document, which is the shape of the registration it stands in for. Unset, which
is the default, registers nothing: a request reports no restriction, a role
created with delegated credentials carries only the boundary its call asks for,
and nothing moves for a deployment that configures no file. A file that cannot
be read registers nothing rather than failing startup, an unreadable
registration being the same situation as a partner that never onboarded.
From there the chain is the one the guide describes. A request a registered
partner files reports those ARNs on itself, GetDelegatedAccessToken carries them
onto the delegated session, and CreateRole with that session takes one as the
role's boundary. The session is minted in the partner's account and used in the
customer's, so the lookup spans accounts, which is what findSessionAnyAccount is
for.
A registered document is read as a boundary and as nothing else. One reader
answers a boundary ARN, taking the registration ahead of the store, so GetPolicy
does not answer these ARNs, no Attach call can attach one as an identity policy,
no list reports one, and a policy stored under the same ARN cannot shadow the
cap. Every write that sets a boundary accepts a registered ARN without requiring
it as a policy of the account, the create and the two puts alike, so one ARN
behaves the same way wherever a boundary is set.
The cap also stays where it was put. The credentials a delegation issued cannot
replace or remove the boundary they gave a role, since the guide limits roles
"created or managed through temporary access" and the registration is immutable,
and iam:PermissionsBoundary publishes the boundary the write will apply rather
than the one the call asked for, so a policy conditioned on it is told the value
the role ends up with. Both refusal and reading are this emulator's own, no
source wording either.
A stack's roles are capped too. CloudFormation provisions after the request
returns, on a background executor, so the caller cannot be read when the role is
created and the cap travels with the stack instead: CreateStack and UpdateStack
record the boundary the caller's delegation registers, the dispatcher puts it in
the provisioning context, and the role provisioner prefers it to the template's
PermissionsBoundary, the same precedence a direct CreateRole has. An update
records it as well, the guide capping roles "created or managed through temporary
access". Every existing caller of the context and the dispatcher keeps its
signature, the new component and overload defaulting to no cap.
Two readings here are this emulator's own, both documented. A delegation's cap
beats a PermissionsBoundary the CreateRole call names, since the cap is what the
customer registered rather than a choice of the caller. And where a request
names several boundaries, the first is applied, a role carrying one. Only a
boundary still registered is applied, so a request stored before the
registration changed cannot bound a role by a document nobody can read.
Nothing new is refused and no code or status moves: with no registration the
behaviour is what it was, and with one the role simply carries the boundary AWS
would have given it.
A Lambda extension's exec and the container's exit watcher each hold a
Docker connection for the container's whole lifetime, and both still ran
on the control-plane client. Enough warm containers, especially with
extensions, could fill that pool and stall every create, start, stop and
remove call, the failure the streaming split was made to prevent.
Both now use the @StreamingDocker client. The exit watcher's inspect is
a short call and stays on the control-plane client, with its retries.
The streaming transport now replays a container wait that fails before
the daemon answers, as the control-plane one does, so a stale socket
does not spend one of the watcher's re-arms. Exec starts and log and
attach streams are still never replayed.
Each live Lambda container now holds its log follow, its exit watcher and
one exec per extension on the streaming pool, so its default rises from
512 to 2048 to cover the 500 containers the runtime API port range allows
with two extensions each. The control-plane default stays at 1024.
Closes#2224
Bootstrap actions "run on cluster after Amazon EMR launches the
instance", on every node, and "If you add nodes to a running cluster,
bootstrap actions also run on those nodes in the same way". Floci ran
them once, as on the primary node, and every node ran from the image they
left, so an action's branch for the core or task nodes never ran.
Where a cluster's core and task nodes run in containers of their own,
each now runs the actions too, in a bootstrap container of its own beside
the primary node's, as that node: its node files say CORE or TASK, the
cluster's relay answers its instance metadata as that node, its output
goes under its own instance id, and the container is kept as the image
the node runs from, so it holds what its own actions installed. A node a
resize adds runs them before it starts, and one that leaves takes its
image with it, so one added again runs them again.
AWS terminates a node whose action fails and says only that "If too many
instances fail their bootstrap actions, then Amazon EMR terminates the
cluster. If just a few instances fail, Amazon EMR attempts to reallocate
the failed instances and continue". Floci runs a node's actions again
once, in a fresh container, and a second failure ends the cluster with
BOOTSTRAP_FAILURE and a message of Floci's after the primary node's, as
no source gives AWS's words or an error code for a core or task node.
CloudWatch's console target (CloudWatchVersion20130116.) now serves
PutMetricData, which it used to answer with UnsupportedOperation. It
accepts a nonempty MetricData array whose datums carry a finite numeric
Value or a complete StatisticValues set with a positive SampleCount,
string dimensions and a valid timestamp, and checks the whole batch
before storing anything: a malformed or conflicting datum, or a member
the handler does not parse such as Values, Counts or StorageResolution,
refuses the request without a partial write. Signature validation and
IAM checks are the same as on the SDK prefix.
Under IAM enforcement, a Distributed Map's S3 calls are now authorized as its execution role, which has to exist and to trust Step Functions. An ItemReader needs s3:GetObject on the object it reads or s3:ListBucket on the bucket it lists, offering s3:prefix when the request has one, as a direct listing does. A ResultWriter needs s3:PutObject on each object it writes: SUCCEEDED_0.json, manifest.json, and FAILED_0.json when a child failed. Every key is evaluated before the first write, so a refusal leaves no partial export. Each is evaluated in the bucket's own partition, and the bucket's policy can grant or deny it.
A refusal fails with States.ItemReaderFailed or States.ResultWriterFailed, and an execution role refused outright with States.Permissions, so Retry and Catch on the Map apply. A refused reader runs no child; a refused writer fails the Map run after its children, as any writer failure does. The multipart actions and s3:GetObject the CDK grants a ResultWriter are not needed, since Floci writes each file in one PutObject. PARQUET and MANIFEST make no S3 call and keep their answer. Credentials on a Map or inside its reader or writer are not read. A mocked execution is evaluated on these calls too, since a test case cannot mock a Map and its S3 calls stay real, and with enforcement off nothing changes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
TaskPermissions decided a Step Functions aws-sdk:cloudformation task by six
hand-written operation sets and looked stacks up through four handler methods
of its own. With CloudFormation now read from iam-request-resources.json, a
task goes through the generic requestPermissions, as the same request made
directly is checked: CloudFormationStoredResourceArns, from the handler's
storedResourceArns(), finds the stack or the stack set a name names, and a
request naming none, whatever the task's input is, is checked on *, as the
direct request is. The operations checked are the ones the table reads; one
the handler does not serve is then its own UnknownAction.
So a change set named by its ARN alone, a describeStackResources by
PhysicalResourceId alone and a request with no StackName are checked on *,
a stack or stack set CloudFormation does not hold with its id open, and a
stack id it does not hold as given. The six sets, the arm's own lookups and
the handler and service methods only they used are gone.
* feat(elasticache): IncreaseReplicaCount, DecreaseReplicaCount and TestFailover
* fix(elasticache): refuse a replica count change or failover without a ReplicationGroupId
* fix(elasticache): number a group's members so a decrease keeps the primary
EC2 now serves CreateSnapshot, DeleteSnapshot and CopySnapshot for EBS
volumes. CreateSnapshot takes the volume's size and encryption, is owned
by the caller and accepts snapshot tags from TagSpecification.
DeleteSnapshot removes the snapshot and its tags, and refuses with
InvalidSnapshot.InUse while a registered AMI uses it. CopySnapshot copies
from SourceRegion into the request's Region as a new snapshot, encrypted
when the source is, when Encrypted=true or when the destination's
encryption by default says so, without the source's tags. All three
honor DryRun, keeping the error the real call would give.
An unsigned, unversioned CopySnapshot now routes to EC2, since Floci's
ElastiCache does not serve it. RegisterImage builds its snapshot records
through the same helper.
Closes#7943
Adds ListPackageVersionDependencies, extracted from each format's own metadata
file: the POM for Maven, package.json for npm, the wheel/sdist metadata for
pypi, and the .nuspec for NuGet. Scoped to exactly npm/pypi/maven/nuget,
matching AWS's own documented Valid Values for this action's format
parameter; generic, cargo, ruby, and swift are rejected with a
ValidationException even though cargo's own sparse index already carries the
data, since AWS does not document cargo as a valid format for this specific
action.
A new RepositorySidecarManager#listPackageVersionDependencies default method
(throwing UnsupportedOperationException, the same convention
listPackageVersionAssetNames already uses) is overridden by all four valid
formats' sidecar clients:
- ReposiliteSidecarClient tries the version's standard release POM name
first, falling back to the real directory listing for a -SNAPSHOT
version's own timestamped filename (and surfacing a genuine fetch error
through that same fallback, rather than reporting it as an empty
dependency list), and parses it with a new PomDependencies helper. That
helper only ever walks direct children of a known element rather than
Document#getElementsByTagName, specifically so a managed version pin under
dependencyManagement or a conditionally-activated dependency under profiles
is never mistaken for a real, always-active dependency. One synthetic
"parent"-typed entry is emitted when <parent> is present. No ${property}
placeholder resolution on a dependency's raw version text, a documented
limitation.
- VerdaccioSidecarClient reads dependencies/devDependencies/
peerDependencies/optionalDependencies straight off the already-fetched
packument's version document, splitting a scoped dependency name the same
way CodeArtifactNpmDataPlane already does for the package's own name.
- BagetterSidecarClient reuses the same already-proven .nuspec fetch
fetchPackageVersionReadme falls back to, with NuspecXml extended with a new
dependencies() method that flattens every <group targetFramework> block
(and the older schema's bare <dependency> with no group wrapper) into one
list.
- PypiserverSidecarClient is new ground: a new PypiVersionMetadata helper
opens a real wheel via plain ZipInputStream, or an sdist via GZIPInputStream
plus a new minimal hand-rolled TAR reader (classic 512-byte headers only,
no long-name or PAX support) for .tar.gz/.tgz, or via ZipInputStream for a
.zip sdist, bounding the total bytes it will ever decompress while
scanning one archive so a small, highly compressible entry ahead of the
real metadata entry cannot force unbounded decompression. Only the exact
top-level dist-info/METADATA or PKG-INFO entry is matched, never a nested
one, so a wheel or sdist that vendors another package's own dist-info
alongside its own cannot have that vendored entry mistaken for the real
one. Requires-Dist headers are parsed with RFC822 continuation-line
folding, stopping at the blank line that ends the real header block so a
Requires-Dist-looking line inside the package's own long description is
never read as a real dependency. Any "; extra == ..." environment marker
is kept verbatim in versionRequirement rather than stripped, since
PackageDependency has no marker field. A release available only as a real
.tar.bz2/.tar.xz sdist is reported as having no dependencies rather than
attempted, since bzip2/xz decompression would need a new runtime
dependency this codebase deliberately avoids.
XmlParser gained a new parseDocument(byte[]) overload so a POM or .nuspec's
own raw bytes reach the parser directly: the existing String-based overload
pre-decodes as UTF-8 before the parser ever sees the original bytes, which
would silently corrupt or fail to parse a document that declares a different
encoding. PomDependencies and NuspecXml both now go through the byte-based
overload.
CodeArtifactService#listPackageVersionDependencies validates the format
against this narrower set before the shared validatePackageCoordinates call,
which already enforces the maven-namespace-required and
pypi/nuget-namespace-forbidden rules AWS documents for this action.
Pagination's cursor now folds in each entry's own original-list index as a
final tiebreaker, so two byte-for-byte identical dependencies (e.g. the same
NuGet package id declared under two different target-framework groups with
the same version requirement) never share a cursor and silently drop across
a page boundary.
Verified with standalone parser unit tests, per-client wire-contract tests
against a JDK HttpServer fake, CodeArtifactServiceTest dispatch and
validation cases, and a live Docker-gated round trip added to all four
existing format Docker integration tests, each publishing a real artifact
with real dependency metadata through the real sidecar container.