* fix(eventbridge): validate scheduled rule rate expressions
Validate schedule expressions before PutRule creates or mutates a rule. Reject mismatched rate units with the AWS ValidationException while preserving existing rule state and timers. Keep stored-expression parsing tolerant.
Add service, SDK and scheduler regression coverage.
Closes#7996.
* refactor(eventbridge): share rate parsing and cover legacy stack updates
Use one matcher and parsed value/unit helper for strict API validation and tolerant stored-expression execution. Keep unit agreement checks at the API boundary.
Add a CloudFormation SDK regression proving that unrelated stack updates already skip unchanged legacy rules while direct PutRule calls remain strict. Correct the outdated test comment suggesting every resource is re-provisioned.
* refactor(eventbridge): share AWS rate validation with Scheduler
Move positive value, supported unit and singular/plural constraints into core.common.AwsRateExpressions. Both API validators call the shared checks while their execution parsers retain support for legacy stored expressions.
Parse Scheduler rates once per call and retain its checked interval conversion. Add cross-service tests for matching acceptance and rejection reasons.
Addresses review 5876298647 on #8113.
Keep the current tags when replacing an imported certificate under its
existing ARN. Certificate.setTags already copies the map and normalizes
null, so use that boundary for initial imports and reimports alike.
Cover tag retention and replacement material through the AWS SDK in
commercial and GovCloud regions, including later tag additions/removals
and an untagged certificate.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
CreateBlueGreenDeployment stages a green copy of a PostgreSQL, MySQL or
MariaDB instance with the target engine version, parameter group, class
and storage, linked to the blue instance as a read replica and loaded
from a dump of it. SwitchoverBlueGreenDeployment gives green the blue
identifier, ARN, endpoint and tags and renames blue to <name>-old<n>;
the container manager moves each running container to its new ARN so
stop and delete still find it. DescribeBlueGreenDeployments supports the
four documented filters and paging, and reports INVALID_CONFIGURATION
when a member is gone. DeleteBlueGreenDeployment honours DeleteTarget
before switchover. Deployments are taggable by their deployment ARN.
Closes#8069
TagResource, UntagResource and ListTagsForResource answered
TargetNotFoundException for the organization's resource policy, because
resolveTagOwner matched account, root, OU and policy IDs only. The
model's TaggableResourceId pattern accepts rp- IDs, and AWS's own
CloudFormation handler for AWS::Organizations::ResourcePolicy tags the
policy and lists its tags through that ID.
resolveTagOwner now matches the organization's resource policy ID and
saves the organization, as the root branch does. Any other rp- ID still
answers TargetNotFoundException. The code comments that said a resource
policy is not a TagResource target are corrected, and the docs table
lists the resource policy among the tag targets.
UpdateSecretVersionStage removed the label from the old version and only then found that the target version does not exist, so the refused request left the secret without that label. Look the target version up before any label is moved.
Validate the attached stage and removal version before checking the
destination, keeping both checks ahead of any label mutation.
Cover omitted and mismatched removal IDs with missing destinations
through the AWS SDK for current and custom stages.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
PutReportDefinition now stores its Tags on the report definition, and
TagResource, UntagResource and ListTagsForResource read and change them
by ReportName instead of answering empty stubs. ModifyReportDefinition
keeps the tags, a missing report answers ResourceNotFoundException, and
the TagList and TagKeyList constraints from the model are checked.
Closes#7952
PutReportDefinition and TagResource now fail with ValidationException when the report would hold more than 50 tags, when Tags is not a list, or when a tag key, value or TagKeys entry is not a string.
tools/aws/regen_cur_shapes.py vendors the TagResource, UntagResource and ListTagsForResource input constraints from botocore, and CurRequestShapes checks them, and the Tags of PutReportDefinition, through RequestConstraintCheck in place of the hand-written limits.
MemoryDbService threw ClusterNotFoundFault, UserNotFoundFault and
ACLNotFoundFault with HTTP 404. The MemoryDB API Reference lists 400
for each, and botocore has no status for them. AWS's Smithy model
gives them httpError(404), but botocore calls MemoryDB over awsJson1_1,
which ignores HTTP binding traits.
Use 400 at all eleven places that throw them: the Describe, Update and
Delete actions, CreateACL with an unknown user, CreateCluster with an
unknown ACL, and the three tag operations.
Closesfloci-io/floci#8007
Persist whether a standalone instance has never initialized its database. Protect engine versions before backend startup so runtime loss and proxy failures cannot expose existing storage to a metadata-only version change. Update SDK compatibility assertions to reject unsupported upgrades and verify resizing separately.
Apply supported minor upgrades using the version-specific image on the existing volume and endpoint. Keep major upgrades, downgrades, and pinned-image changes blocked before mutation. Preserve the never-started case, report failed restarts honestly, and restore successful minor-upgrade coverage in the Java SDK compatibility suite.
* fix(glue): preserve existing partitions on duplicate creation
Reject CreatePartition for values already stored in the table before
mutating partition metadata. Keep the existing BatchCreatePartition
error and allow explicit updates through UpdatePartition.
Port the independent duplicate check and regression from
AndreKurait/floci commit f6905c8ced6c21fd9aeca013beb4ac511e5c1469.
Add SDK coverage for single and batch creation, preserved metadata,
per-item batch errors, and subsequent explicit updates.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(glue): serialize concurrent partition creation
Synchronize single and batch creates so duplicate detection and writes share
one service critical section. Cover all four concurrent single/batch combinations,
preserving the first metadata and per-item batch errors.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(glue): isolate catalog fixtures from Athena readers
Share the existing floci-duck resource lock with Athena and Firehose tests.
Their catalog setup must not read temporary Glue metadata whose S3 locations
are placeholders while the catalog test is running.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
Closes#7979
Resolve symlinks on the working directory's path, relative or absolute,
and check every directory on the resolved path. Stop the check at a
function's EFS mount path, which Lambda enters as the access point's user.
Build the Dockerfile-only build context in one place,
DockerBuildContext.ofDockerfile, for the helper image and the two Docker
tests that built it by hand.
It created an application named test-app, which AppConfigIntegrationTest looks up by name when both run in one shard.
* feat(dynamodb): serve DescribeLimits and DescribeEndpoints
DynamoDB reports the default quotas of 80,000 read and write capacity
units per account and 40,000 per table. It names its Regional endpoint
with a cache period of 1,440 minutes.
* fix(dynamodb): name Floci's own address in DescribeEndpoints
With endpoint discovery on, the AWS SDK for Java 2.x sends later
requests to the address DescribeEndpoints names, even when the client
sets an endpoint. The Regional AWS host sent them to real DynamoDB.
Stream records through CopyBulkLoader.Cursor in loadRecords and reuse writeRecord, eliminating duplicate decompression, line skipping, record reading, heap tracking and blank line filtering.
Verify Cursor record iteration, line tracking and raw byte capture, along with writeRecord chunking across PostgreSQL CopyData wire frames.
GetSnapshot and ListSnapshots with an ownerAccount other than the caller's now read the
owner's snapshots and return only the ones the snapshot resource policy shares with the
caller. A snapshot is never shared across partitions.
* fix(bedrock-agentcore): use runtime IDs and endpoint names in ARNs
Keep runtime ARNs stable across versions and use the parent runtime ID and endpoint name for endpoint ARNs. Update API responses, ARN lookups, tagging dispatch and CloudFormation references together.
* fix(bedrock-agentcore): preserve legacy and harness runtime lookups
RedshiftQueryHandler wrote the same Tags/Tag loop in eight resource
builders: clusters, snapshots, cluster parameter groups, cluster
subnet groups, snapshot schedules, event subscriptions, snapshot copy
grants and integrations. They now call one tagsXml helper.
The XML is unchanged. Clusters, snapshot copy grants and integrations
still leave out an empty Tags list, and the other five still write
one. A new RedshiftQueryHandlerTest case pins both shapes for all
eight; it passes before and after the change.
Validate the compact UTF-8 JSON environment before function creation or configuration mutation. Both paths previously accepted the 5,000-character value reported in #7995. Cover exact byte boundaries, aggregate variables, Unicode, JSON escaping, and rejected-update atomicity through the AWS SDK.
Stop quota serialization through a bounded UTF-8 counting sink without allocating complete JSON and byte-array copies. Keep unchanged legacy environments out of CloudFormation configuration updates while validating changed variables and preserving environment removal. Add early-stop, one-megabyte input, Unicode buffer-boundary, and legacy-stack rollback regressions.
Include AWS's String measured diagnostic while retaining at most 5,120 UTF-8 bytes and terminating larger input early. Drop incomplete trailing UTF-8 characters before adding an ellipsis. Keep the 1 MB robustness request on CreateFunction, and assert every SDK configuration-update body stays below the separate 5,120-byte request limit. Cover complete measured JSON and bounded Unicode previews.
CreateUser and CreateACL never read their Tags member, and ListTags,
TagResource and UntagResource resolved every ARN as a cluster, so a
user or ACL ARN answered ClusterNotFoundFault and neither resource
could be tagged at all.
User and Acl now keep a tag map, set from Tags on create as
CreateCluster already does. The three tag operations pick the
resource from the ARN: user/ and acl/ look the name up in the current
Region and require the stored ARN to match, answering
UserNotFoundFault or ACLNotFoundFault, and any other ARN goes through
clusterByArn as before. The built-in default user and open-access ACL
are not stored, so they still answer the not-found fault. Users and
ACLs saved before this change have no tags field and load with an
empty map.
Fixes#7956
Validate the description before replacing stored upstreams so a refused
UpdateRepository request leaves the repository unchanged. Cover rejected
replacement and clearing requests through the AWS SDK, including successful
updates at the accepted description-length boundary.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
Take the execution monitor when an action, stage or condition records a
failure. A concurrent stop can no longer replace a Failed write between
its terminal check and its Stopping transition.
Port the remaining failure transitions and regression coverage from
AndreKurait/floci#710. The stop handler already landed in upstream #7939.
Hold the execution monitor across the approval completion check, result
updates and persistence so stop cannot interleave with a rejected result.
Share the held-monitor stop helper and cover rejection before a waiting
stop. Wait for approval polling after token persistence in the existing
stop-completion fixture.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
Accept SDK credentials in AwsTestClients so session identities use the same
endpoint and transport setup as basic credentials. Reuse the overload in
federation, token-duration and principal-tag fixtures.
Follow up on the shared client setup requested in PR #7839.
Use AwsTestClients for the remaining STS duration, S3 resource-account and
EC2 signature fixtures. Expose its credentials-and-transport overload so
EC2 keeps Apache, and pass S3's path-style builder through the common path.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
CreateClusterParameterGroup and CreateClusterSnapshot both take Tags,
but the handler never parsed them, so the new parameter group or
snapshot came back untagged: in the create response, in
DescribeClusterParameterGroups and DescribeClusterSnapshots, and in
DescribeTags on its ARN.
Tags are now parsed (Tags.Tag.N and Tags.member.N) and stored on the
resource, as CreateClusterSubnetGroup already does, and the
ClusterParameterGroup and Snapshot elements carry a Tags list, as AWS
returns them. DeleteCluster's final snapshot and automated snapshots
are still created without tags.
* feat(sns): trust FLOCI_TLS_EXTRA_CA_PATH for HTTPS subscriptions
SnsService built its delivery HttpClient without an SSLContext, so an
HTTPS subscription whose endpoint has a certificate from a private CA
never got the SubscriptionConfirmation or any notification. Floci only
logged "Failed to reach SNS endpoint".
The @Inject constructor now passes ContainerCaBundle.sslContext(config)
down to the constructor that builds the client, as EventBridgeInvoker
does. The SubscriptionConfirmation and notification delivery share that
one client. It stays pinned to HTTP/1.1, and hostname verification
stays on. The other constructors build the client as before.
Closes#8033
* test: share the /hook HTTPS endpoint between the extra CA delivery tests
LocalHttpsServer.hook starts a localhost HTTPS server that passes each
request to /hook to a callback and answers 200, and hookUrl gives its
URL. EventBridgeInvokerApiDestinationTest and the new SNS test use them
instead of each writing the endpoint out.
Recreate the reviewed Rekognition changes on the existing upstream main base using a verified commit. The complete file tree is identical to PR head 19f259b43e1ec8a3ce5fd2a50eb9c21e4ed604df, preserving the collection, pagination, persistence and model-validation fixes while removing the unsigned merge.
Generate constraints for every modeled operation with constraints=True. Select the served operation in the handler, validate its request once, then dispatch. Preserve UnknownOperationException for unserved actions.
Move constraint tests to the handler boundary and verify newly modeled operations are detected without maintaining an allowlist. Verified 189 Java tests, 55 generator tests, Checkstyle, generated-data, documentation and partition checks. Addresses review 5865133468.
Every check Floci makes on an S3 bucket or object named its ARN itself: the direct path (ResourceArnBuilder), presigned URLs and the bucket policy checks (S3PublicAccessEvaluator), the Redshift COPY (RedshiftRoleAccess, S3CopySimulator), the Redshift audit log delivery and its logging setup, the Spectrum scratch object, the Step Functions s3:PutObject task, and the S3 resources CloudTrail records on a data event. S3ResourceArns now mints both, and S3ConditionKeys names s3:prefix and the listing context for S3Service, the COPY path and the condition resolver. Behaviour is unchanged.
S3 stays built by hand rather than read from iam-request-resources.json: the generator's rule fills no variable of the object type from Bucket and Key, and ListObjects maps to no s3:ListBucket, so a direct GetObject would fall to *.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
CloudFront's REST routes were not in the vendored route table and its namespace's resources were not read, so under IAM enforcement no CloudFront request was checked: a caller with no permissions could create, change and delete distributions, cache policies, functions and the rest. Its botocore model is now in regen_rest_routes.MODELS and its namespace in regen_iam_request_resources.NAMESPACES, so each request is checked as the action of the operation its route names, on the resources the request names.
regen_iam_request_resources read requests of the JSON, Query, CBOR and REST-JSON protocols only, so a REST-XML request named no resource. It now reads a REST-XML request's path labels and query parameters, which RequestResources reads whatever the protocol, and not its body, which is not one it reads.
Creation tags stay unread: CloudFront wraps them in a Tags structure holding Items, which regen_iam_tag_on_create does not read yet.
Three CloudFront operation shapes were still checked on `*` or as no
IAM action:
- `stem` drops a trailing `config`, so a bare `Id` names the resource
whose config an operation reads (GetDistributionConfig and the other
...Config reads, and GetFieldLevelEncryption, whose type is
field-level-encryption-config).
- A member whose pattern takes only an ARN counts as an ARN when it is
named `Resource`, as well as when it is an identifier, so the tagging
calls are checked on the resource their ?Resource names. Members
naming another resource (a role, a monitor, a target) still do not.
- An operation whose own name is no action, and which several actions
authorize, is the one its name starts with as a word:
CreateDistributionWithTags is checked as cloudfront:CreateDistribution.
The same rule maps Keyspaces' CreateKeyspace, CreateTable, CreateType
and RestoreTable to cassandra:Create and cassandra:Restore, and
QuickSight's CreateTopicV2 and UpdateTopicV2 to quicksight:CreateTopic
and quicksight:UpdateTopic. A plural is no such word: S3's
DeleteObjects is checked for each object it deletes.
GetManagedScalingPolicy returned the policy of a cluster that was
shutting down or had ended. AWS answers ValidationException "A job flow
that is shutting down, terminated, or finished may not be modified."
there, as Terraform's acceptance runs recorded, and Terraform's provider
reads that answer as the policy being gone. Floci kept returning it, so
a refresh after termination kept a policy AWS reports gone.
A TERMINATING, TERMINATED or TERMINATED_WITH_ERRORS cluster now gets
that answer. emr.md no longer says no answer is recorded for the managed
scaling calls: Terraform's provider also expects it from
RemoveManagedScalingPolicy.
Preserve the complete focused change from fork #713 on current main, including exact report expiry boundaries and password timestamp regressions.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(codepipeline): preserve and manage custom action type tags
CreateCustomActionType copied its whole request into the stored action
type, so its tags sat inside actionType instead of on the resource, and
the response had no top-level tags. TagResource, UntagResource and
ListTagsForResource only looked up pipeline ARNs, so an actiontype ARN
answered ResourceNotFoundException and a custom action type could not
be tagged.
Keep the tags on the action type's stored item and return them at the
top level of the CreateCustomActionType response, as the API model
does. The three tag operations now resolve an actiontype ARN
(actiontype:Owner/Category/Provider/Version) before falling back to a
pipeline ARN. Action types saved before this change load with no tags.
Fixes#7950
* fix(codepipeline): guard custom action type writes and cap merged tags
CreateCustomActionType checked for an existing type before storing it,
and the tag operations read, edited and stored a type's tag map, all
without a lock. Two creates of one type could both succeed, a tag write
could restore a type deleted meanwhile, and the map was edited in place
while ListTagsForResource and the store serializer iterated it. Create,
delete and tag writes of an action type now share a per-type lock,
pipeline tag writes take the lock pipeline writes already use, and a
tag write stores a new map instead of editing the stored one.
TagResource checked only the size of the incoming tag list, so a
resource with 50 tags accepted a 51st key. It now checks the merged set
and answers TooManyTagsException, for pipelines too; replacing the
value of an existing key at 50 tags still works.
ModifyCluster, the four Set* setters, and Put and Remove of a cluster's
managed scaling, auto-termination and automatic scaling policies all
changed a TERMINATED cluster, and AddTags and RemoveTags its tags.
AWS documents these for running clusters, but no answer for an ended
one is recorded. So they give the one AWS gives AddJobFlowSteps and
ModifyInstanceFleet, "A job flow that is shutting down, terminated, or
finished may not be modified.", in the code each operation's model
points at, as AddInstanceGroups and AddInstanceFleet already did for a
TERMINATING cluster: InvalidRequestException with ErrorCode
INVALID_JOB_SHUT_DOWN for ModifyCluster, ValidationException for the
others, whose models declare no InvalidRequestException. A Set* request
naming such a cluster changes none of the clusters it names.
AddInstanceGroups and AddInstanceFleet now answer a TERMINATED cluster
that way too, in place of "Cluster <id> is terminated.", which no source
has.
The Management Guide says "you cannot add, edit, or remove tags from a
terminated cluster" and names no error. AddTags and RemoveTags refuse an
ended cluster with InvalidRequestException "Tags cannot be modified on
terminated clusters.", the message a tagging tool matches from AWS.