storeVersion (the one write path storePackageVersionAsset/copyPackageVersionAsset/
storeRetainedVersionAsset all go through) always sent dist-tags.latest pointed at
whichever version it was writing, so copying or retaining any other version,
even an old one, silently moved what an unpinned npm install resolves to.
Confirmed live against the pinned Verdaccio image that this was never actually
needed: a PUT that omits dist-tags entirely leaves an existing package's own
dist-tags.latest untouched, while a package's genuinely first-ever version still
gets it set by Verdaccio's own default (there is nothing yet to preserve). So
this write simply stops sending the field at all, rather than needing its own
"is this the right version to call latest" decision.
Corrected two test comments that had over-generalized this as "no retention
write can ever suppress it" to the narrower, now-verified truth: only a
package's very first-ever version is forced.
Also confirmed live, specifically because CopyPackageVersions' own overwrite
path deletes a conflicting version before recreating it (clearing dist-tags.latest
if it pointed there): Verdaccio auto-recomputes latest from whatever versions
remain once it's cleared, rather than leaving the package tagless, so this
write's own change plays correctly with that existing delete-time behavior.
Added a live regression test for exactly that interaction (overwriting the
current latest version while a sibling version exists must neither lose latest
nor wrongly hand it back to the version just overwritten).
A member the table locates in a REST request's path or query was laid
over a JSON body alone: a request sending a form skipped the overlay,
so a form's DomainName was read in place of the path's. OpenSearch
answers a form with 415, so no such request reaches its handlers
today, but the next REST namespace the table reads whose handler does
not refuse a form would be checked on the form's name while it acts on
the path's.
RequestResources now lays the located members over a form as it lays
them over a JSON body, for the resources a request names and for those
it creates: each is dropped from the form and read from the path or
the query alone.
RequestResourceMembersTest checks every resource of the table from a
form as from a JSON body, each located member given in the path or the
query and another value in the body and in the form; RequestResourcesTest
sends OpenSearch requests as forms naming another domain than the path
or the query does. iam.md says so.
* fix(memorydb): restore persistent cluster runtimes after restart
Restore account-scoped cluster backends, authentication and stable proxy endpoints from persisted metadata. Retain data storage across restart and preserve retryable ownership on failed provisioning cleanup.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(memorydb): retain default backend and log names
Keep default-account/default-region container and engine-log names stable while retaining scoped runtime and proxy keys. Pass the logical name and stored owner through creation, restoration, deletion and rollback. Use an unambiguous separator for foreign Docker names in the retained hyphen-prefix collision case, without changing foreign log names or persisted volume identities. Preserve restore and cleanup coverage; new naming regressions fail the former manager. Local mocked-Docker and loopback RESP qualification only, no managed AWS or native runtime claim.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(memorydb): share container naming fixtures
Move the two naming cases into MemoryDbContainerManagerTest and reuse its manager setup. Share the four loopback PONG responders through one helper, observing completion and propagating responder failures. Preserve naming, collision, cleanup and lifecycle assertions. No production change.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
The '*' selector was missing from SqsMessageAttributeSelector.includes(),
so ReceiveMessage with MessageAttributeNames: ["*"] returned no
message attributes. AWS treats '*' the same as 'All' and '.*'.
- Add '*' to the includes() check
- Add '*' to the test loop that already covers 'All' and '.*'
Closes#7503
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
A failed stack update left AppSync entities changed or cleared by the update:
the provisioner had no rollbackUpdate, so the stack ended in
UPDATE_ROLLBACK_FAILED with "Rollback is not implemented".
Before an in-place update of a GraphQL API, data source, function, resolver or
API key, the provisioner records the members the update can change or clear.
The service applies an update member by containsKey, so replaying them puts
back both the changed and the cleared values. An update that fails part way
undoes itself through CfnRollback.guarded, and a failed undo keeps the
snapshot for ContinueUpdateRollback.
GraphQLSchema and a replaced AppSync resource are not covered.
tagResource, untagResource and putEnvironmentVariables change the stored API in place while updateGraphqlApi saves a copy, so a copy could overwrite a tag or variable written in between. Every method that writes a store now holds the service monitor, as startSchemaCreation does, and startSchemaCreation checks the API under it too. refreshGraphqlApiUris refreshes the stored API under the monitor instead of putting the instance it read earlier.
Every request and every response wakes a relay thread blocked on a socket
read. On a virtual thread that wakeup goes through the JDK poller and a
carrier handoff, which made the relay itself cost about 0.13 ms per
roundtrip in one Docker network (0.063 ms direct, 0.198 ms through the
proxy). The relay loops of the PostgreSQL, MySQL and opaque TCP bridges now
run on daemon platform threads; the accept loop and the handshake stay
virtual.
The IAM session guard read each backend message's type, length and payload
straight from the socket, plus an available() call per message. Its input
is now buffered, and the flush-on-pause check asks the socket only once the
buffer is drained.
A MySQL or MariaDB client that disconnects without COM_QUIT ended the
client-to-backend relay but left the backend-to-client relay blocked on a
backend that never speaks, and bridge() waited for both before closing
either socket. Close both sockets as soon as either relay ends, as the
PostgreSQL bridge already does, so a dropped client no longer holds a relay
thread and a backend connection open.
Returns a console log carrying the instance's SSH host public keys between the markers cloud-init prints, read from the running instance container, so clients can verify the host before connecting. An instance without a running container has an empty log.
Look the instance up in the request's region, read host keys only from a running container and treat a failed read as an empty log, build the response with XmlBuilder, and cover the SDK reading of the response.
AWS returns DryRunOperation for DryRun=true even for an empty or malformed instance id, so check the dry run first.
The key files are the guest's to write, so capture at most 16 KiB of stdout (and 1 KiB of stderr) through bounded streams, and answer an empty log, with a warning, when the output is larger than host keys can be.
* fix(cognito): offer configured providers in managed login
Preserve native authentication eligibility and request parameters for federated-only and mixed clients.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(cognito): explain unavailable sign-in providers
Show an actionable managed-login error after every provider is removed, without enabling native credentials.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Populate existing instance types with AWS-verified manufacturer values and expose them through DescribeInstanceTypes. Add SDK regression coverage for all 84 catalog entries.
Closesfloci-io/floci#7516
The controller read path parameters from the decoded JAX-RS path and
substituted them into the integration URI, so a path with an encoded space
threw from URI.create and answered 500 without reaching the backend. An
encoded ? or # cut the backend path short, %2F became a separator and %252F
lost a level of encoding.
Read the target URL's path parameters from the raw request path, for REST
HTTP_PROXY, REST HTTP and HTTP API HTTP_PROXY integrations. A value mapped
from elsewhere is percent-encoded. $request.path.X and header mappings keep
the decoded value. An integration URI that cannot be parsed now answers 502.
Routes match on the decoded path, so an encoded slash ahead of a parameter
shifts the segments read off the raw path. /a%2Fb/c/d on /a/b/{proxy+} called
the backend with /backend/d. A raw value that does not decode to the decoded
parameter is now ignored, and the decoded value is encoded instead. Comparing
values rather than literal segments also covers templates with no literals,
such as /{x}/{y}/{z+} and the HTTP API route /{x}/{y+}.
* fix(dynamodb): check the condition members of a PutItem or DeleteItem in order inside the validation envelope
* fix(dynamodb): reuse the expression member helper in the older PutItem and DeleteItem check
The table of request resources read only a request's body or Query
form, so no REST namespace was read: a REST request names its
resources in its path and its query. An OpenSearch Service request
naming its domain, DescribeDomain on
/2021-01-01/opensearch/domain/{DomainName}, was left unchecked by the
routes the previous change reads, as Floci could not check it on the
domain AWS checks it on.
- The generator reads a rest-json request's members in its path and
its query as members, under their botocore names, and records where
each one a resource reads is (`located`): a path label, `{Label}`, or
a query parameter, `?name`. RequestResources lays them over the body,
a label's value from the route the request matched in the vendored
routes (IamActionRegistry.pathLabels, IamRestRoutes now capturing
each label), a query parameter's from the query, so every kind of
resource reads them as it reads the body's. A located member is read
from where it is alone, as its handler reads it: one the body also
gives is dropped.
- A namespace read this way also takes the operations of each botocore
model Floci reads routes for under it (regen_rest_routes.MODELS) that
the reference lists for none of its clients, each the action of its
own name with that action's resource types, when the reference has
that action: the reference lists OpenSearch Service's `es` client
alone, while the `opensearch` client's operations are named after
`es` actions. --verify checks such an operation's action and types
against the reference's Actions, and reports one whose action AWS no
longer has.
- `es` moves from NOT_COVERED to NAMESPACES: 120 operations, both API
versions', 1505 over 34 namespaces. Every domain route Floci serves
reads its domain, from the path, the body or `?arn`, on
`domain/<DomainName>`, the ARN Floci mints. Those whose resource the
table does not find (outbound connections, applications, insights)
are routes Floci does not serve.
- Reading rest-json would also have read the Payment Cryptography data
plane's key from its path; Floci serves only the control plane, so
`payment-cryptography-data` joins CLIENTS_NOT_READ with its reason
and its operations stay as they were. No other entry changes.
With the domain operations in the table, the routes check them by the
resources-read half of the join rule. IamActionRegistryTest checks the
domain routes and the labels a request's path gives;
RequestResourcesTest reads a path label, a query parameter and a body
together; IamRestRouteEnforcementIntegrationTest checks DescribeDomain,
DescribeElasticsearchDomain and ListTags on the domain they name; the
generator tests cover the located members, a member two clients locate
apart, the REST models' operations and a round trip through --check and
--verify. iam.md says so.
* fix(ec2): associate elastic addresses with primary and detached interfaces
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
(cherry picked from commit 28c17835d6e7dc480f5f5716e206fbbe5b81bee0)
Signed-off-by: Jackson Price <jxnprice@amazon.com>
* test(ec2): clean up partial address-association fixtures
Signed-off-by: Jackson Price <jxnprice@amazon.com>
* fix(ec2): serialize interface deletion and resolve managed interfaces
Signed-off-by: Jackson Price <jxnprice@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
* fix(lambda): validate VPC resources before configuration changes
Require declared subnets and security groups in the request account and region to belong to one VPC. Validate replacement settings before mutating the function. Preserve detachment, published-version snapshots and actual declared-resource fixtures.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(lambda): preserve unknown VPC placeholder compatibility
Keep unknown subnet and security-group IDs in responses without inferring VpcId. Reject mixed known VPCs before mutation even when unknown IDs are also present. Restore placeholder EFS/CloudFormation fixtures and cover partial unknowns, updates and version snapshots. Addresses maintainer review 5766333414.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* feat(ec2): report the service-network address as public IP when Floci runs in a container
Adds FLOCI_SERVICES_EC2_PUBLIC_IP_FROM_SERVICE_NETWORK (default false). When Floci itself runs as a container and the option is on, an instance's public IP is its address on Floci's own Docker network, so clients on that network reach the guest's real ports, port 22 included.
* fix(ec2): record the service-network address and follow protected guests to their helper
Resolve the address once at launch, start and restore instead of asking Docker on every public-address read, which DescribeAddresses does under a lock. A security-group protected guest shares its firewall helper's network namespace, so its address is the helper's.
* fix(ec2): share the helper lookup and retry a failed service-network lookup
Use one container: network-mode lookup for protectedNamespace and the service-network address. A lookup that fails on a Docker error is no longer recorded as the answer; the next address read retries it on the executor without waiting.
* fix(ec2): run service-network lookup retries off the launch pool
Retries ran on the bounded launch executor, whose blocking backpressure could leave launch workers waiting on each other. They now get their own virtual-thread executor, and a retry that cannot be scheduled is logged with the instance id.
* fix(ec2): publish a service-network lookup only for the container it read
A lookup records the container it starts for, asks Docker outside the instance lock, and publishes under the lock only while the instance still runs that container, so a lookup that outlives a replacement or a teardown cannot overwrite what came after it. The retry executor now comes in through the package-private constructor and is final.
* feat(sfn): apply the EventBridge connection to HTTP Tasks
An HTTP Task now resolves the connection named by InvocationConfig or
Authentication. Its authorization, headers, query parameters and body
parameters are merged over the task's, and the connection's value wins on
a duplicate key, as the AWS HTTP Task guide describes. The body is merged
before Transform encodes it. A string body with connection body
parameters fails with States.Runtime, and an unknown connection fails
with Events.ConnectionResource.ResourceNotFound.
The connection logic is the API destination's: EventBridgeInvoker exposes
it as connectionHttpParameters, so both callers share one implementation,
OAuth client credentials included.
* fix(sfn): keep case-distinct query parameters and bound OAuth by the HTTP Task timeout
A connection query parameter now replaces only a task parameter of the exact same name, since query names are case-sensitive. The connection's OAuth token exchange now spends the task's TimeoutSeconds, so the API request gets only the time left.
* chore: retrigger CI
* fix(cloudformation): drop a DynamoDB table's update snapshot once the update commits
* test(cloudformation): clean up the rollback retry test's stack and table even when it fails, using a shared ContinueUpdateRollback helper
CreateUserPoolDomain built its CloudFrontDistribution by hand from 14 hex
characters with no leading d, unlike the names an edge-optimized API Gateway
domain and an AppSync custom domain get. Use CloudFrontEdgeDomain.create, so
the name is d plus 13 hex on the partition's suffix. The name is stored, so
existing domains keep theirs.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(apigateway): report the published regional hosted zones
A regional custom domain reported the invented Z2FDTNDATAQYL2 everywhere outside
GovCloud, so a Route 53 alias built from it pointed at a zone AWS does not have.
Vendor the data plane table of the API Gateway General Reference page into
region-facts.json, with the GovCloud guide kept as a cross-check. A region with no
row keeps the placeholder, now documented as one. Stored domains keep their id.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* test(apigateway): read the regional hosted zone through the SDK clients
Create and read the custom domains with ApiGatewayClient and ApiGatewayV2Client, so the test also shows both SDKs parse the zone fields.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Under IAM enforcement, a ProvisionPermissionSet for
ALL_PROVISIONED_ACCOUNTS is checked on each account the permission set
is provisioned to, which the permission check finds through
SsoAdminService.through. The handler then found those accounts again
and provisioned to each. Another request could provision the permission
set to one more account in between, with an account assignment of its
own, and a permission set change could leave that account
LATEST_PERMISSION_SET_NOT_PROVISIONED: this request then provisioned it
again, changing the account's state with no policy checked against it.
The accounts are now found once for the request and kept, in a
request-scoped SsoAdminRequestContext, as PaymentCryptographyRequestContext
keeps the key an alias named: the check and the provisioning use the
same accounts, and an account provisioned to since is left as the other
request left it. Each request finds them afresh, so the next one is
checked on it.
SsoAdminServiceTest replays the race: the check finds one account,
another account is assigned and a policy attached, and the provisioning
leaves the second account not provisioned. The IAM integration test
assigns a third account after a request was let through on two, and the
same grant no longer covers the next request. iam.md says so.
A REST request gets its IAM action from IamActionRegistry's
hand-written rules, and a route no rule maps gets none, which the
caller allows: under enforcement such a request runs unchecked.
IamRestRoutes (#7085) reads botocore's routes at runtime, but only for
the operations a hand-written list enrolls, ValidatePolicy alone, and
only by literal paths.
A request no rule maps is now the operation whose route in botocore's
model it matches, and it is checked as that operation's action
(IamAuthorizedActions), as a Query or JSON request naming its
operation is, when Floci checks it on the resources AWS does: those
its request names, which ResourceArnBuilder builds for its namespace
or the vendored request resources read for the operation, or none,
when the Service Reference gives the action no resource type, as AWS
authorizes such an action on `*`. An action AWS checks on a resource
Floci neither builds nor reads stays unchecked, as before: checked on
`*`, a grant scoped to its resource would be refused. That is the
reason #7085 gave for enrolling ValidatePolicy alone, now read from
generated data instead of a list.
- The actions of no resource type come from the Service Reference's
Actions, through regen_iam_authorized_actions.py, into
iam-authorized-actions.json, for each credential scope whose routes
rest-routes.json reads: 88 over 7 scopes. They are read from Actions,
not Operations, because the reference lists one SDK client's
operations per namespace, OpenSearch's `es` client alone. --check
fails until a scope rest-routes.json adds is listed, and --verify
fails when AWS gives a listed action a resource type.
- IamRestRoutes now matches every route of a model: literal segments,
a label taking one segment, a greedy label the rest of the path, and
the query a route names, which must be on the request. Of the routes
a request matches, the most specific wins, segment by segment from
the left a literal, then a segment mixing a literal and a label, then
a label, then a greedy label; then the route naming more of the
query. The path is the one the rules match, still percent-encoded and
without a trailing slash, and a segment may still end in a matrix
parameter, which the router ignores.
- The rules come first, so nothing they map changes. S3 and API Gateway
are listed as handRouted, with their reasons, and routed by their
rules alone: S3 tells apart the operations of one route by their
query and headers, and API Gateway is checked by HTTP method. The
route generator fails when one route names two operations of any
other scope.
- OpenSearch Service's models, both API versions, are read under `es`:
59 of their 147 operations are checked by their routes (29 of the
`es` model's 51, 30 of the `opensearch` model's 96), 53 of which ran
unchecked, ListDomainNames and ListVersions among them. The other six
are the VPC endpoint operations #7351 mapped by hand: their rules are
removed, as their routes give the same actions.
- Access Analyzer's 9 operations of no resource type are checked by
their routes, ListAnalyzers among those Floci serves, where
ValidatePolicy alone was; its analyzer operations are not.
Lambda's, EKS's, Scheduler's, Pipes' and DSQL's resources are built
by hand and their routes all mapped by their rules, so none is checked
differently. IamRestRouteCoverageTest checks every route of a scope
not hand-routed: by the vendored routes alone it is its own operation,
and through the registry it is its action when its resources are built
by hand or read, or its action has no resource type, and unmapped
otherwise.
iam.md and access-analyzer.md say which routes are checked.
In the docker runner mode a Hive step failed without running ("hive-script
and pig-script are not in the image steps run in"). On a cluster whose
Applications name Hive, a command-runner.jar step running hive-script, as
the AWS CLI writes a Type=Hive step ("hive-script --run-hive-script
--args" and the step's Args), or hive itself, now runs: the image's
hive-script runs hive with the arguments after --args, with Tez in local
mode, on the cluster's storage and Floci's S3.
- An EMR cluster's nodes hold every application it installs, so a
cluster with Hive bootstraps and runs every step in one image: the
release's EMR Serverless image with the Hive, Tez, HDFS, MapReduce and
YARN of its EMR Serverless Hive image (or the new hive-image-template).
EmrReleaseImages makes it the first time a release's cluster needs it:
a container of the EMR Serverless image, created and never started,
gets the Hive image's folders streamed in from a container of that
image, and is committed, as a bootstrap's container is, with no image
builder involved. The two images ship different builds of
emr-serverless-goodies-common under one name, so Tez keeps the Hive
image's in a folder of its own, its links rewritten to lead there, and
the Hive image's Hadoop configuration, which puts Tez on the class
path, goes to /etc/hadoop/conf.hive, which Hive runs with.
- The image is named after the release, the ids of the two images as a
container would run them (an image-registry-base included) and what
is copied, so a newer pull of either makes another; it is kept for the
release's next cluster, and made once at a time. The bootstrap and the
steps get its id, as they get a bootstrap image's, from their own
thread, which makes it first, unless the cluster has ended by then; a
failure to make it fails the step, or ends a bootstrapping cluster with
INTERNAL_ERROR.
- hive gets Floci's settings, then the cluster's core-site, tez-site and
hive-site properties as --hiveconf settings, then the step's own
arguments, so a step's --hiveconf wins as it does over hive-site.xml;
the cluster's hive-env exports are its environment.
- Its metastore is the cluster's own, as "Hive records metastore
information in a MySQL database on the primary node's file system": an
embedded Derby database in the cluster's /mnt, so a table one Hive step
makes is there for the next until the cluster ends. A hive-site naming
the Glue Data Catalog's client factory uses Floci's Glue instead.
- Hive reaches the cluster's HDFS through the same view of /mnt/hdfs
under the viewfs scheme: Hive looks up the HDFS encryption zone of any
hdfs:// path, which only an HDFS NameNode answers. A table without a
LOCATION is in /user/hive/warehouse there, which other steps read as
hdfs://.
- On a cluster without Hive, hive-script runs in the release's image, as
EMR's does without Hive ("Hive isn't installed."); NOT_RUN is
pig-script's alone.
The Docker-gated EmrHiveStepsDockerIntegrationTest runs the AWS CLI's
Hive steps on a cluster's metastore and HDFS, a hive-site for the Glue
Data Catalog, a cluster without Hive, and a bootstrapped cluster whose
installs a Hive step and a later step both find, in the emr-7.5.0
images, which the CI prefetch pulls for its shard.
EmrServerlessSparkRunner's hiveSettings now builds both services'
--hiveconf settings.
A violation inside a map entry's structure named the entry and then the
field, replacementValues.Department.values. An AWS-validated recording of
the same protocol writes a segment between the two: SNS answers a missing
DataType inside its MessageAttributes map as
1 validation error detected: Value null at
'messageAttributes.attr1.member.dataType' failed to satisfy constraint:
Member must not be null
and, inside a list's member,
publishBatchRequestEntries.1.member.messageAttributes.attr1.member.dataType.
So a map of structures is named the way a list of structures already is
here, the entry's key standing where a list's index stands, and the walk
now writes replacementValues.Department.member.values. AcquireRole is the
one operation that reaches it, its ReplacementValues being the only
structure-valued map these two services vendor.
What stays is the scalar-valued map. Nothing recorded covers one on this
protocol, and the only recording anywhere, Lambda's
routingConfig.additionalVersionWeights on REST-JSON, answers the map rather
than the entry with "Map value must satisfy constraint: [...]". A different
protocol and a different service is not evidence against the answer this
service already gave, so properties.Team/Owner stays as it is, with what
would move it written down beside it.
The core walk had no test for a structure under a map's key at all, every
case in that file holding a scalar, so one is added there rather than left
to the two IAM wire tests that quote the path.
docs/services/iam.md carries both halves, the recorded one and the open
one. The message's other half, the word null in the value slot, is IAM's
own and does not move: that service leaves it out and this is only the path.
GuardedMessageQueue copied the whole message list three times on every
change and once more on every receive, so SendMessage and ReceiveMessage
cost more the deeper the queue was.
The queue now keeps its messages in MessageList, an immutable list whose
appends share one array. A send or a receive copies nothing, and a removal
copies the list once. The store still gets a list that never changes
afterwards, and a failed save still leaves the queue as it was.
* feat(ec2): EC2 Instance Connect Endpoint control plane
CreateInstanceConnectEndpoint, DescribeInstanceConnectEndpoints and
DeleteInstanceConnectEndpoint answered UnknownOperation, so Terraform's
aws_ec2_instance_connect_endpoint failed at create and the AWS CLI's
`ec2-instance-connect ssh --connection-type eice` could not look an
endpoint up. They now carry the fields, filters and errors Terraform and
the CLI use. Endpoint DNS names are <id>.localhost.floci.io, which public
DNS resolves to 127.0.0.1, and each endpoint takes a private address in
its subnet.
As on AWS, a live endpoint makes DeleteSubnet and DeleteVpc fail with
DependencyViolation (a destroy ordered wrongly would otherwise pass here
and fail on AWS, and the endpoint's address reservation leaked), and a
replayed ClientToken returns the first endpoint instead of creating a
duplicate on an SDK or Terraform retry.
The tunnel the endpoint serves is a separate change.
* fix(ec2): create an EC2 Instance Connect Endpoint under the subnet topology lock
Two creates with one ClientToken could both miss the replay scan and make
two endpoints, and a DeleteSubnet could land between the subnet check and
the save, leaving an endpoint on a subnet that is gone. The create now
holds the lock DeleteSubnet holds. The endpoint store is final and comes
through the constructor chain like the other stores, and the service test
is named Ec2InstanceConnectEndpointServiceTest.
* test(ec2): name the exceptions the endpoint race test expects
* fix(ec2): return a copy from instance connect endpoint reads
Create, Describe and Delete handed back the stored endpoint itself, with
its tags written onto it, and Delete then set delete-in-progress on that
object. A caller changing a returned endpoint changed the stored one.
They now return a copy carrying the current tags.
* fix(ec2): scan one region's instance connect endpoints by key on describe
Describe read every region's endpoints and kept those whose region field
matched, while the ClientToken replay scan picks a region by store key.
Describe now uses the key prefix too, so the two agree on what is in a
region and describe no longer reads other regions' records.
* fix(ec2): compare every creation parameter on an instance connect endpoint ClientToken replay
A replayed ClientToken compared only SubnetId, so a retry with other
security groups, IpAddressType, PreserveClientIp or tags returned the
first endpoint as if it matched. Each is now compared after defaults are
applied and a difference is IdempotentParameterMismatch, as the egress-only
internet gateway create does. Tags are compared as the create request
carried them, so a later CreateTags does not turn a retry into a mismatch.
* test(ec2): drive instance connect endpoints over the EC2 Query wire
The service test called Ec2Service directly, so nothing covered the query
handler: SecurityGroupId.N and TagSpecification.N parsing, the ClientToken
echo, and the Create, Describe and Delete response envelopes. The
integration test creates, replays, describes and deletes an endpoint
through the HTTP endpoint and reads each result back with a separate
Describe.
* fix(ec2): validate instance connect endpoint requests before answering DryRun
CreateInstanceConnectEndpoint answered DryRunOperation before checking the
subnet, IpAddressType or security groups, and Describe and Delete ignored
DryRun and acted on the request. Create now validates and then answers
DryRunOperation, as RunInstances and ReplaceRoute do, and Describe and
Delete check the IDs and filters first, then answer DryRunOperation
without deleting anything.
* fix(ec2): page DescribeInstanceConnectEndpoints by MaxResults and NextToken
MaxResults and NextToken were ignored and every match came back on one
page. Describe now returns at most MaxResults endpoints in ID order with a
nextToken for the rest, using the shared opaque-cursor pagination, and an
unreadable NextToken is InvalidParameterValue as DescribeDhcpOptions
answers it. MaxResults is not range-checked against the model's 1-50.
* fix(ec2): range-check MaxResults on DescribeInstanceConnectEndpoints and compare replayed security groups as a set
The model's InstanceConnectEndpointMaxResults allows 1 to 50, but a sent
0, negative or larger value was served. It is now InvalidMaxResults, as
DescribeTags and DescribeEgressOnlyInternetGateways refuse values outside
their own ranges; an omitted MaxResults still returns every match.
A test now pins that a ClientToken replay naming the same security groups
in another order returns the first endpoint.
* docs(ec2): name instance connect endpoints among the private address holders
privateIpsInUse and privateIpsHeldOnVpcNetwork count the addresses EC2 Instance Connect Endpoints hold, but their comments listed only instances, network interfaces and NAT gateways.
* test(ec2): refuse a NAT gateway the private address an instance connect endpoint holds
CreateNatGateway with a PrivateIpAddress an EC2 Instance Connect Endpoint holds answers InvalidIPAddress.InUse, and the address is free again once the endpoint is deleted. Nothing covered the endpoint's share of the in-use scan before.
* fix(ec2): copy each creation tag of an instance connect endpoint
The copy constructor copied the creationTags list but shared its Tag
objects with the stored endpoint, and the create stored the request's
own Tag objects. Changing a tag on a returned endpoint, or on the list
passed to the create, changed the saved creation parameters, so a
retry with the same ClientToken and the original tags failed with
IdempotentParameterMismatch. Copy each Tag when saving and when
returning a copy.
* fix(ec2): reject an unknown DescribeInstanceConnectEndpoints filter before scanning
An unknown filter name was rejected only while testing it against an
endpoint, so with no endpoints, or when an earlier filter excluded them
all, the bad name succeeded silently. Check every name up front through
requireSupportedFilters, as DescribeVpcs and DescribeVpnGateways do,
with the same InvalidParameterValue.
* fix(ec2): resolve an instance connect endpoint's interface in DescribeNetworkInterfaces
CreateInstanceConnectEndpoint published an interface ID in
networkInterfaceIdSet that DescribeNetworkInterfaces answered with
InvalidNetworkInterfaceID.NotFound, so a client could not read the
endpoint's private address or security groups from it. Build the
interface from the endpoint in the describe path, as the NAT gateway
and interface VPC endpoint arms already do: a requester-managed
ec2_instance_connect_endpoint interface with the endpoint's subnet,
VPC, private address and security groups, present while the endpoint
exists. Its address is already counted from the endpoint record, so
subnet address accounting is unchanged. DeleteInstanceConnectEndpoint
also drops the interface's own tags, as DeleteNatGateway does.
* fix(ec2): name an instance connect endpoint interface's groups from the account it is read for
The explicit-account DescribeNetworkInterfaces overload scanned the
named account's endpoints but looked their security group names up
under the ambient request account, so a caller in another account got
the groups back without names. Read the group for the same account,
as natNetworkInterfacesOf reads its subnet.
* test(ec2): keep another account's instance connect endpoint interface out of DescribeNetworkInterfaces
An endpoint created in one account is NotFound by NetworkInterfaceId
and absent from an unfiltered list for another account, and still
visible to its own.
* fix(ec2): accept exactly AWS's DescribeInstanceConnectEndpoints filters
The DescribeInstanceConnectEndpoints reference lists instance-connect-endpoint-id,
state, subnet-id, tag:<key>, tag-key, tag-value and vpc-id. Implement tag-value
(any tag's value in the filter values, as the other EC2 describe calls match it)
and stop accepting availability-zone and owner-id, which the reference does not
list; they are now refused as InvalidParameterValue like any unknown filter.
* refactor(ec2): build NAT gateway and instance connect endpoint interfaces once
natNetworkInterfacesOf and instanceConnectEndpointNetworkInterfacesOf set up the
same requester-managed interface with one primary address; both now call
requesterManagedInterface. Their two DescribeNetworkInterfaces arms, identical
but for the interfaces they walk, become one arm over NAT interfaces then
endpoint interfaces, the order the two arms ran in. No behaviour change.
* test(ec2): share a mock-mode Ec2Service builder in the test fixtures
Ec2ServiceFixtures.mockModeService() in the shared testing package builds the
mock-mode Ec2Service over in-memory storage that Ec2InstanceConnectEndpointServiceTest
built privately, and that class now uses it. The other classes with their own copy
move to it separately.
* docs(ec2): count the three InstanceConnectEndpoint operations in the service matrix
* fix(cloudformation): apply KinesisStreamSpecification on AWS::DynamoDB::Table
The property was accepted and ignored, so a stack that declared it got a
table whose item changes never reached the stream.
The declared stream becomes the table's active Kinesis streaming
destination on create and update. Removing a block the previous template
declared turns it off, and a stack that never declared it leaves
destinations set outside it alone. The in-place update snapshot of a
stack that manages the destinations records them, so a failed update
puts them back as they were.
A change of ApproximateCreationDateTimePrecision alone updates the active
destination in place, as CloudFormation does with one
UpdateKinesisStreamingDestination call, so forwarding never stops and
records already captured are still delivered.
A block that is not an object fails template validation, as
TimeToLiveSpecification does, rather than reading as a removed block
that turns forwarding off.
A StreamArn the destination cannot use fails the table as the AWS handler
does, and the table this attempt created is deleted. One under 37
characters fails EnableKinesisStreamingDestination's validation. One that
is not a Kinesis stream ARN, such as the stream name Ref returns, or one
naming a stream that does not exist fails as NotStabilized.
DynamoDbTableAccess gains enable, disable and update operations for the
destination. DynamoDB Local has no Kinesis forwarding, so that backend
leaves the table as it is and logs a warning. CloudFormation still checks
StreamArn there as AWS does; only the forwarding is skipped.
* fix(cloudformation): match Kinesis destinations by their whole stream ARN
A destination was looked up by the last segment of its StreamArn in the
table's account and region, so an ARN for another account, region or
resource type that ended in a local stream's name forwarded to that
stream. KinesisService.describeStreamByArn now finds a stream only by its
exact ARN. NativeDynamoDbTableService uses it, so the public
EnableKinesisStreamingDestination action reports such an ARN as not
found, and CloudFormation fails the table as NotStabilized.
The DynamoDB Local backend looks the stream up the same way before it
skips forwarding, so a template naming a missing stream fails there too.
A declared StreamArn the table already forwards to now goes through the
same template checks as a new one; only the rollback restore skips them.