mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fee688bd051a5bde4e2e8a4d5e0f5d75c7ffe00a
130
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fee688bd05 | feat(cloudformation): support four AWS::AppConfig resource types (#6791) | ||
|
|
c4ae11c414 | feat(cloudformation): expose RegionalEndpoints of a web function endpoint to Fn::GetAtt (#6907) | ||
|
|
d3c4732b31 |
feat(cloudformation): provision Redshift event subscriptions (#6664)
* feat(redshift): support event history and SNS notifications * fix(redshift): guard stale delivery failures and prune all event scopes * feat(cloudformation): provision Redshift event subscriptions * fix(redshift): scope snapshot events and serialize subscription tag mutations * feat(cloudformation): provision Redshift event subscriptions * fix(cloudformation): resolve Redshift subscription list parameters Use the shared list reader for SourceIds and EventCategories. Cover CommaDelimitedList and List<String> parameters through the AWS SDK and verify concurrent tag requests preserve CloudFormation tag updates. * fix(redshift): honor event disablement and restore rollback attributes Check the EventBridge external service key before publishing API events. Snapshot and restore CloudFormation resource attributes alongside subscription state during in-place rollback. * fix(redshift): drop API event publisher and share subscription setup Remove RedshiftApiEventPublisher, its handler hook, tests and docs, which are not part of the CloudFormation resource and emit CloudTrail-style events without a trail. Route createSubscription and replaceSubscription through one helper that normalizes the subscription fields. |
||
|
|
a6cf29ea86 |
fix(cloudformation): copy a SAM function's VersionDescription to its version (#6770)
With AutoPublishAlias, SAM passes a function's VersionDescription to the Description of the AWS::Lambda::Version it generates. The transform dropped it, so a version published from a SAM template never had the description the template gave it. The version now takes it as written, leaving an intrinsic function for CloudFormation to resolve. As in SAM, it stays out of the hash that names the version, and Globals cannot set it: the transform refuses it there, as it already refuses AutoPublishCodeSha256. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
f3f8b42200 |
feat(cloudformation): support AWS::Route53::RecordSetGroup (#6676)
A RecordSetGroup writes all its record sets into one hosted zone in a single ChangeResourceRecordSets batch, so a record set that cannot be written, such as a name another owner already holds, leaves the zone unchanged and fails the stack. Each record set keeps what a RecordSet keeps, including the routing-policy fields SetIdentifier, Weight, Region, Failover and HealthCheckId; entries an Fn::If resolves to AWS::NoValue are dropped, and two record sets with one name, type and set identifier are refused. Ref returns the group's logical ID and Fn::GetAtt Id the change ID that GetChange reads, as AWS documents. The zone comes from the group's HostedZoneId or HostedZoneName, or from its record sets when the group names neither. A record set that repeats the group's HostedZoneId is refused, as AWS documents, and so is one that names another zone. An update in the same zone deletes the records the group wrote and creates the new ones in one batch. HostedZoneId and HostedZoneName are create-only, so a change set reports a zone change as a replacement: the records are written into the new zone, and the old ones are deleted once the update commits, or kept under UpdateReplacePolicy: Retain. A failed update puts back the records the group had; after a zone change the group first points at its old records again, then deletes the new zone's. If that delete fails, ContinueUpdateRollback retries it and DeleteStack deletes those records while the rollback is unfinished; anything else leaves them in their zone, since Route 53 cannot tell them apart from an identical record another writer puts there later. Deletes name the values the group wrote, so a record changed outside the stack fails the delete rather than being removed. The docs say what a record set group's failed rollback leaves behind. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
07597598b6 |
fix(cloudformation): relocate SAM schemes without auth defaults (#6656)
* fix(cloudformation): relocate SAM schemes without auth defaults Follow the separate postprocessing request in upstream #6638. Relocate declared OpenAPI security schemes independently of Auth defaults, preserving Swagger and operation requirements. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> * fix(sam): centralize OpenAPI security scheme relocation Keep the defaults helper responsible only for generating AWS_IAM and api_key definitions. Relocate the security scheme map exclusively in the shared final OpenAPI phase, including documents without Auth defaults. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> --------- Signed-off-by: Andre Kurait <AndreKurait@gmail.com> |
||
|
|
9b36aa6980 |
fix(cloudformation): replace SAM OpenAPI security schemes (#6638)
Follow the separate whole-map replacement requested in upstream #6632. Preserve Swagger, no-default behavior, operation requirements and unrelated OpenAPI components. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> |
||
|
|
3438a00daf |
feat(lambda): version network connectors as AWS does (#6595)
* feat(lambdamicrovms): version network connectors as AWS does * fix(lambda): lock connector versions and refresh them after a CFN rollback Updates, deletes and version reads hold one lock, so two updates cannot take the same version number. A CloudFormation rollback restores the connector through an update. On AWS that makes the next version, and a later Fn::GetAtt returns it. The resource now keeps that version in LatestVersion and LatestVersionArn. Read the connector ARN through AwsArnUtils.parse. AWS refuses LatestVersion, an integer, as a string Output, so the stack test reads LatestVersionArn only. * fix(lambda): type the connector LatestVersion attribute as an integer AWS::Lambda::NetworkConnector declares LatestVersion as an integer. On AWS a stack whose string Output reads it fails with "Template format error: Every Value member must be a string.", and Fn::Sub refuses it with "variable Connector.LatestVersion in Fn::Sub expression does not resolve to a string". * chore(lambda): share the connector version ARN and integer attribute helpers |
||
|
|
f32db4fe49 | fix(cloudformation): drop undeclared OpenAPI authorizer schemes (#6632) | ||
|
|
d903074d75 | fix(cloudformation): preserve numeric GetAtt attributes (#6564) | ||
|
|
2a5f734777 | feat: support managed credentials in Redshift restore (#6515) | ||
|
|
6acd90640d |
feat(cloudformation): provision AWS::EC2::PrefixList (#6481)
* feat(cloudformation): provision AWS::EC2::PrefixList An AWS::EC2::PrefixList was stubbed: Ref returned "<LogicalId>-<8 hex>", Fn::GetAtt the literal "<LogicalId>.<Attribute>", and EC2 held no list, so a route given its Ref pointed at nothing. Ec2NetworkCfnProvisioner now creates the customer-managed list through Ec2Service. Ref is its pl- id, and Fn::GetAtt serves PrefixListId, Arn, OwnerId and Version, the attributes the registry schema declares. The schema has no create-only property, and create-only-properties.json now says so. Without the entry, the engine's name heuristic took PrefixListName for create-only, so a rename was planned as a replacement of the list and of the routes and rules that reference it. An update changes the list in place: its name, capacity, entries and tags. Adding or removing entries makes a new version and a rename does not, as the EC2 API reference says. EC2 refuses a request that removes and adds the same CIDR, which is how a description changes (Terraform's aws_ec2_managed_prefix_list records the error), so such an entry is added back by a second ModifyManagedPrefixList call. The first call carries everything EC2 could refuse, and the capacity the second needs is checked before the first, so a change EC2 refuses leaves the list as it was. A rollback puts the prior name, capacity, entries and tags back, and Version follows the list. Two updates fail before anything changes: another AddressFamily, which no EC2 call can change on an existing list, and a new MaxEntries together with changed Entries, which the CloudFormation and EC2 references both say cannot change at once. MaxEntries is required to create a list, as the CloudFormation reference says (aws/aws-cdk#35360 reports the deploy failing without it); an update that leaves it out keeps the capacity. Entries and Tags are brought to the template when it, or the previous one, declares them, so entries or tags no template declared stay. Tags go through CreateTags after the create, as on the other types in the provisioner, so EC2 checks them; a tag it refuses fails the create and removes the new list. A list gone out of band, or a stub an older Floci left, is replaced by a new one, and a stack delete tolerates only InvalidPrefixListID.NotFound. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): cover AWS::EC2::PrefixList through boto3 A stack's prefix list is created, resized, given new entries and deleted through the CloudFormation and EC2 clients of the pinned boto3: Ref and Fn::GetAtt name the list EC2 describes, a resize keeps the version, new entries make version 2 of the same list, dropping Tags removes them, and the list is gone after the stack delete. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(cloudformation): share optionalInt through ProvisionContext Ec2NetworkCfnProvisioner and ElbV2CfnProvisioner each carried the same private optionalInt. An absent, null or AWS::NoValue property stays unset; a value written into the template, a literal blank included, has to be an integer; anything else fails with ValidationError "Value of property <name> must be an integer." It is now ProvisionContext.resolveOptionalInt, beside resolveOptional, and all seven callers use it: the prefix list's MaxEntries, the target group's Port and four health check settings, and the gateway listener's Port. The two copies differed only in Integer.parseInt against Integer.valueOf and in building the error through a helper, so neither provisioner changes behaviour. ProvisionContextTest covers the method directly. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
2705818ff1 |
fix(cloudformation): scope SAM REST auth defaults to each operation (#6358)
* fix(cloudformation): leave root security out of SAM REST auth defaults AWS::Serverless::Api Auth (DefaultAuthorizer: AWS_IAM, ApiKeyRequired) gave each operation without security of its own a copy of the document's root security before adding the defaults. SAM reads only the operation's own security and leaves the root security as written, and API Gateway does not apply root-level security. As a result: - a root requirement naming a SigV4 scheme or an authorizer, beside the generated AWS_IAM default, failed the import with "Only one Authorizer or IAM authorization is allowed per operation", where SAM gives the operation the one AWS_IAM requirement; - other root requirements, such as an API key scheme, were copied into every operation and enforced, where AWS does not enforce them. The defaults now start from the operation's own security. An Auth that selects no default, such as ApiKeyRequired: false alone, now leaves the body as written, as SAM does; it used to copy the root security into every operation. The docs also say that floci's REST importer still applies root-level security to an operation that has none of its own, which API Gateway does not. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): add SAM REST auth defaults inside Fn::If branches An Fn::If written around a path item or an operation in the DefinitionBody of an AWS::Serverless::Api kept the Auth defaults from reaching the operation. A conditional path item was skipped, because its only key is not a method, and a conditional operation got the default beside the Fn::If, which the template engine drops when it keeps the chosen branch. Either way the method was imported with authorizationType NONE and answered unsigned calls, where SAM adds the default inside each branch. The defaults are now added inside each branch, skipping an AWS::NoValue one, as SAM's get_conditional_contents does. When a default applies, a nested Fn::If, or one whose value is not a list, is refused with a ValidationError instead of being left without the defaults. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): refuse SAM REST bodies that would lose the defaults Some DefinitionBody shapes lost the generated AWS_IAM and api_key schemes or requirements on their way to the REST importer, which then imported the methods with authorizationType NONE: - a securityDefinitions, components or securitySchemes map written as an intrinsic function such as Fn::If. The generated schemes were written beside the function, and the template engine keeps only its result; - a body with an Fn::If key beside its own keys, which the engine replaces with the chosen branch; - an existing AWS_IAM or api_key scheme with the expected fields and an Fn::If key, which the engine replaces with a branch that need not be that scheme; - a body declaring both swagger: "2.0" and an openapi version. The transform wrote the schemes into securityDefinitions, which the importer, reading the body as OpenAPI 3, ignores. When a default applies, these are now refused with a ValidationError, as a path item written as a $ref already is. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): cover SAM REST root security through the SDK The SDK suite creates a stack whose AWS::Serverless::Api root security names its own SigV4 scheme, with DefaultAuthorizer: AWS_IAM, in Swagger 2.0 and OpenAPI 3.0. It checks that the stack deploys, that the processed template keeps the root security and gives the operation the one AWS_IAM requirement, and that the method is imported as AWS_IAM without an API key. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin false Fn::If routes and conditional bodies An Fn::If around a path item or an operation whose condition is false resolves to AWS::NoValue. The transform adds no default to that branch, and the REST importer creates no resource or method for it, so the API has no such route, as on AWS, while the other routes keep the AWS_IAM default. A DefinitionBody written as an Fn::If is refused for any non-empty Auth, ApiKeyRequired: false included. SAM refuses it too: for every non-empty Auth, _add_auth checks SwaggerEditor.is_valid, which needs a literal paths object. The docs now say so. Neither behavior changes here; the tests keep both in place. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say a SAM REST Auth needs a paths object The sentence added in the previous commit said any non-empty Auth needs a literal paths object. The transform, like SAM, accepts any object there, a paths map written as Fn::If included when no default is selected. What it refuses is a DefinitionBody without one, such as a body written as Fn::If. The previous commit's message also said a false Fn::If around an operation leaves no route. That holds for get, post and the other HTTP methods. For x-amazon-apigateway-any-method the REST importer fails the stack instead, with "expected an Operation object", on main too and without Auth. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): check no-default SAM REST bodies as SAM does An Auth that selects no default, such as ApiKeyRequired: false alone, returned once the DefinitionBody had a paths object. SAM checks more for any non-empty Auth before it applies a default: SwaggerEditor.is_valid wants a truthy swagger or an openapi version 3.x, and the SwaggerEditor constructor wants every paths entry, and each branch of an Fn::If around one, to be an object. floci therefore accepted a body without a version, a paths map written as Fn::If, or a path item that is not an object, all of which SAM refuses. The previous commit's message said SAM accepts such a paths map; it does not. These are now refused with a ValidationError when no default is selected too. Nothing else is checked in that case, as in SAM: an OpenAPI 3.1 body, a $ref path item, a nested Fn::If or a malformed security requirement is left as written. SamTransformProcessor's isTruthy helper, which already models SAM's truthiness, becomes package-private so the check can share it. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): leave nested Fn::If operations as SAM does With a default selected, an Fn::If around an operation whose branch was itself an Fn::If failed the transform with "Auth does not support a nested Fn::If in paths". SAM does not fail there. Its iter_on_all_methods_for_path reads one level of Fn::If around an operation and skips a method definition without an x-amazon-apigateway-integration. It therefore leaves the nested branch as written, adds the defaults only to the plain one, and the template deploys on AWS. Such a branch is now left as written, without the defaults, and the plain branches still get them. A nested Fn::If around a path item is still refused: SAM fails there too, once it reads the methods of the inner Fn::If. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): share the SAM REST stack deploy in one helper Three SamRestApiAuthIntegrationTest cases each created the stack, waited for it, read its ApiId output and deleted it in a finally block. withDeployedApi now does that once: it adds the ApiId output, deploys the template, hands the API id to the assertions once the stack is CREATE_COMPLETE, and deletes the stack in its finally. The assertions are unchanged; a failed deploy now reports the stack's own status reason in all three cases. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): keep the failed resource's reason in deploy failures withDeployedApi reported only the stack's status reason when a stack did not reach CREATE_COMPLETE. For a resource failure that is the generic "The following resource(s) failed to create", where two of its callers used to report the failed resource's own reason, such as the importer's refusal. The helper now appends that reason when the stack rolled back, and keeps the stack's reason alone for a transform failure, which has no failed resource. Only failure messages change. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> |
||
|
|
922e36a472 | feat(cloudwatch): support composite alarm lifecycle (#6408) | ||
|
|
9c6d6a0ce8 | fix(cloudformation): append AutoPublishCodeSha256 to a SAM function's Description (#6364) | ||
|
|
deeb3b3075 |
fix(cloudformation): forward Firehose processing and logging configuration (#6277)
* feat(firehose): store and echo CloudWatchLoggingOptions on S3 destinations
CreateDeliveryStream and UpdateDestination silently dropped CloudWatchLoggingOptions because the S3 destination model had no such member. The block is now stored and echoed on both ExtendedS3DestinationDescription and S3DestinationDescription, defaulting to {"Enabled": false} when omitted, as real AWS does. UpdateDestination merges it member-wise, so an update naming only Enabled keeps the stored log group and stream.
* fix(cloudformation): forward Firehose processing and logging configuration
FirehoseCfnProvisioner now reads RoleARN, ErrorOutputPrefix, CloudWatchLoggingOptions and, for the extended S3 destination only, ProcessingConfiguration, resolving intrinsics before handing them to the service. A Lambda transform declared in a template therefore runs on delivery and is echoed by DescribeDeliveryStream, as on AWS. An omitted member stays null so an UpdateStack keeps the stored value, and an unreadable block fails the resource with ValidationError.
* test(cloudformation): cover a stack Firehose stream's Lambda transform end to end
A stack-created extended S3 stream now reads back its role, error prefix, logging options and
Lambda processor, runs that processor on delivery, and picks up a new function on UpdateStack.
* docs(firehose): describe logging options and the CloudFormation members applied
Document how CloudWatchLoggingOptions is stored, defaulted and merged on the S3 destinations, and note which DeliveryStream properties the CloudFormation provisioner applies.
* fix(cloudformation): validate a Firehose stream's forwarded destination like CreateDeliveryStream
The provisioner now runs the same wire-shape validation CreateDeliveryStream applies, so a bad processor or CompressionFormat fails the resource instead of being stored. A structured destination member present as anything but an object also fails rather than being silently dropped.
* docs(cloudformation): name every Firehose property the provisioner applies
* fix(firehose): validate CloudWatchLoggingOptions names against AWS constraints
LogGroupName and LogStreamName are now checked against AWS's 512-character bound and their modeled patterns, reporting both rules when both fail, as probed against real AWS.
* chore: retrigger CI after a transient npm publish race
native arm64 / sdk-test-node ran npm install between the publication of @aws-sdk/lib-storage 3.1156.0 and @aws-sdk/client-s3 3.1156.0, and failed with ERESOLVE.
* test(firehose): share the delivery and Lambda transform helpers in FirehoseRequests
Moves encode, putRecordBatch, firstKey and the record-id driven Lambda transform answer out of CloudFormationFirehoseIntegrationTest and FirehoseLambdaTransformIntegrationTest into one testing fixture both now use.
* fix(firehose): require both log names when CloudWatch logging is enabled
With Enabled true, a missing or empty LogGroupName or LogStreamName is now refused with AWS's InvalidArgumentException, group before stream, on the merged result for UpdateDestination and ahead of the other semantic checks, as probed against real AWS.
* fix(firehose): fill the defaults on a Redshift destination's S3 backup
Create and describe now apply the S3 defaults, including CloudWatchLoggingOptions Enabled false, to a Redshift destination's backup configuration as well as its intermediate one, so persisted streams heal on read.
|
||
|
|
9e3413980e |
docs(cloudformation): explain HTTPS custom resource callbacks (#6279)
Document opt-in TLS and the default port 443 listener for packaged Node.js handlers that hard-code HTTPS callbacks. Preserve certificate verification and clarify the unchanged HTTP ResponseURL and inline module behavior. Verify 51 existing focused callback, TLS-port, endpoint, and CA-bundle tests, Checkstyle, docs checks, 95 docs-tool tests, and the partition gate. No runtime code or configuration defaults change. |
||
|
|
5beb8d47b9 |
fix(cloudformation): keep Route 53 routing policies and provision health checks (#6191)
A Route 53 RecordSet resource now writes Region, Failover, Weight and HealthCheckId into the record, as ChangeResourceRecordSets stores them. A HealthCheck resource creates a health check with its tags, and its Ref and HealthCheckId attribute return the check's id. An unknown Type is refused before any check is created. Changing Type, RequestInterval or MeasureLatency replaces the check, and the old one is deleted once the update commits, or kept under UpdateReplacePolicy: Retain. Any other change updates the check in place, and a failed stack update puts back its earlier settings and tags. |
||
|
|
a8e49fbbaa |
feat(cloudformation): support WAFv2 logging configuration (#6194)
* feat(cloudformation): support WAFv2 logging configuration * fix(cloudformation): honor WAFv2 logging replacement and rollback |
||
|
|
a6433d521a |
fix(cloudformation): refuse a template body that does not parse (#6179)
* fix(cloudformation): refuse a template body that does not parse
ValidateTemplate answered success for a body that reads as neither JSON nor
YAML, since the null value check skipped a template it could not parse.
CloudFormation refuses such a body at the request, and so does Floci now, in
ValidateTemplate, CreateStack, UpdateStack, CreateChangeSet and
GetTemplateSummary, all measured with the same texts.
CloudFormation reads a body as YAML, of which JSON is a subset, so the new
CloudFormationTemplateParser tries strict JSON first (trailing tokens refused)
and falls back to the CF-aware YAML parser, which also reads JSON with a
trailing comma or unquoted keys, as AWS does. When both fail, a body that
starts with { and ends with } is "JSON not well-formed" at Jackson's position,
anything else "YAML not well-formed" at SnakeYAML's, both 1-based and taken
from the body as sent, so leading blank lines keep their line numbers. A body
that reads as a scalar or a list is "unsupported structure.".
Stack sets keep their null check skipping a body that does not parse, since
CreateStackSet was not measured with one. A template that reads but has no
Resources member is left as it was: that is a check of a template, not of
its format.
* fix(cloudformation): refuse a body that is no template in stack sets too
CreateStackSet and UpdateStackSet stored a body that does not parse, whose
instances then could not deploy: CreateStackInstances and UpdateStackSet
stopped halfway with the change set's 400. Measured on CloudFormation, both
refuse such a body before keeping it, with the same texts followed by the
service exception's details, as they refuse a null value, and an update
leaves the previous body in place. They now go through the same check as the
other operations, so a stored body always parses.
The JSON message also needs the body to start with {, not only to end with }:
[{"a": 1} is YAML not well-formed at line 1, column 10 on CloudFormation.
|
||
|
|
5fa67625c1 |
fix(cloudformation): refuse a template that holds a null value (#6071)
* fix(cloudformation): refuse a template that holds a null value
CloudFormation refuses a template with a null anywhere in it when
ValidateTemplate, CreateStack, UpdateStack or CreateChangeSet is
requested, before anything is created: 400 ValidationError
"[<path>] 'null' values are not allowed in templates". Floci accepted
such a template and provisioned it, so a template AWS rejects deployed
locally, and ValidateTemplate answered success without reading it.
The check runs where a change set is created, which CreateStack,
UpdateStack and CreateChangeSet share, and in ValidateTemplate. The
path is the one AWS names, measured on eu-west-1 on 2026-10-20: the
first null in document order, Type in place of a resource's Properties
below them, a null Properties named as is, list entries by index and
an intrinsic's arguments included. JSON null, YAML ~ and a YAML key
with no value are all null there.
A template that does not parse is left to the parser's error where it
is processed, as the other request-time checks do.
CognitoResourceServerCfnIntegrationTest's null Scopes cases sent such
a template and expected the resource to fail. They now expect the
request refused, as on AWS, and keep what they checked: no server is
created, and a refused update leaves the server as it was.
* fix(cloudformation): refuse null templates in stack sets and answer missing template objects
A review of the null-value check found four gaps, each measured on
CloudFormation (eu-west-1, 2026-10-20) before the fix.
- A template that is null as a whole ("null", "~", "---", a comment
alone) parsed to no root
and the check failed with a 500. AWS answers "Template format error:
At least one Resources member must be defined.", which it does now.
- CreateStackSet and UpdateStackSet stored a null-valued template and
only each instance's deployment refused it. AWS refuses the request
and keeps the previous template, with CloudFormation's message
followed by the service exception's details. Both now check the
template they would keep before storing it or reserving an operation.
- ValidateTemplate reading TemplateURL reached the shared S3 fetch,
whose failures were a 500, as they already were for CreateStack and
GetTemplateSummary. A missing object or bucket now answers AWS's
ValidationError texts for all three. AWS also refuses a URL that is
not an S3 one; Floci keeps reading any host as S3, so a local URL can
name Floci by whatever host reaches it.
- The compatibility test's cleanup swallowed every exception; DeleteStack
of a stack that does not exist succeeds, so it no longer catches any.
CloudFormationS3VectorsTest and CloudFormationCognitoResourceServerTest
in sdk-test-java sent null values and expected them to reach the
resource. AWS refuses those templates when the operation is requested,
so the S3 Vectors cases that cannot be deployed there are dropped and
the Cognito update case now expects the request refused, with the
server left as it was.
* refactor(cloudformation): build the stack-set null refusal with sdkErrorMessage
A review pointed out that the suffix StackSets adds to CloudFormation's
message was built by hand while CloudFormationTemplateEngine.sdkErrorMessage
already builds it for this package, and that updateStackSet wrote the
template it would keep twice. The refusal now uses sdkErrorMessage, and
the kept template is one local both checks read; the answers are the
same.
|
||
|
|
95bf6df474 |
feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster (#6048)
* feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster The first half of #6014. Aurora DSQL's REST JSON control plane, with the answers measured on AWS (eu-west-1): CreateCluster, GetCluster, ListClusters, UpdateCluster, DeleteCluster, GetVpcEndpointServiceName, the cluster policy calls and tagging on cluster ARNs. Identifiers are 26 characters of lowercase base32 as DSQL's are, and malformed or unknown ones are refused with DSQL's messages; a cluster created without deletionProtectionEnabled is protected, and deleting a protected one is refused. CreateCluster answers CREATING and the cluster is ACTIVE right after. AWS::DSQL::Cluster waits for ACTIVE, returns the identifier from Ref and Identifier, ResourceArn, Status, CreationTime, Endpoint, VpcEndpoint and VpcEndpointServiceName through Fn::GetAtt, and a protected cluster makes the stack's deletion fail, as on AWS. A cluster has no database behind it here: its endpoint is named as on AWS, <id>.dsql.<region>.localhost.floci.io, but not served. Serving it is the second half of #6014, its own pull request. * fix(dsql): answer the control plane's edge cases as DSQL does Review of #6048, each answer measured on DSQL (eu-west-1) first: - ListClusters carries on from a page token whose cluster was deleted in between, as AWS does: the token now holds the sort position of the next page's first cluster rather than its identifier. - deletionProtectionEnabled is read as DSQL reads it: text is false when it spells false in any case and true otherwise; empty text, a number, an object and a list fail with SerializationException. - The tag calls refuse another account's cluster ARN with 403 AccessDeniedException instead of reading it in the caller's account. - A client token reused with other parameters answers 409 ConflictException; with the same ones, the earlier cluster. - AWS_OWNED_KMS_KEY names AWS's own key on create and update. AWS::DSQL::Cluster reads DeletionProtectionEnabled and PolicyDocument with AWS::NoValue as left out, and an update that drops the multi-Region properties clears them, as it already reset the key and deletion protection. ListTagsForResource copies the tags under the cluster's lock, and a cluster's lock goes with the cluster. * fix(dsql): answer errors, policies, updates and multi-Region clusters as DSQL does A review asked for the attribute coverage, the reason ValidationException carries, a real untag assertion and tests of the stack-update path. Measuring them on DSQL (eu-west-1, 2026-10-20) found more that did not match, fixed here too. - Attributes are written with resource.getAttributes().put, which the schema coverage test reads; EncryptionDetails, an object an output refuses on AWS, is recorded as a gap. - DSQL leaves reason out of its model-validation errors. Only the page token's refusal carries it, with fieldList naming next-token and its own text. maxResults no longer quotes the value. - Tag calls answer what DSQL answers: 403 for an ARN that is not a cluster ARN, 400 BadRequestException for another Region's, 404 NotFoundException for no cluster. The 403s name the caller. - Policy versions are epoch milliseconds, DeleteClusterPolicy answers the deleted version, and the missing-policy and stale-version errors carry DSQL's texts and resourceType. - Policies are checked and kept as DSQL does: its three refusal texts, a service principal, a principal that names no one, a public grant, and the lockout check when both policy actions are denied to the caller, unless bypassPolicyLockoutSafetyCheck. The kept form is Jackson's pretty printer in DSQL's element order, with condition operators and keys in HashMap order, as measured. - The public check shares its condition keys with Lambda web functions through PublicAccessConditions, and S3 now takes its fixed-value and SourceIp range tests from there. Sharing the whole rule was tried and dropped: DSQL was measured to treat some operators otherwise than LambdaWeb's and S3's rules do (ForAnyValue:, ArnLike "*", StringEquals "*"), so the operator rules stay per service. The lockout check is IamPolicyEvaluator's. - A multi-Region cluster is PENDING_SETUP and lists itself until it and each peer name one another, then ACTIVE; its deletion answers PENDING_DELETE. - AWS::DSQL::Cluster reads its properties through CfnPropertyTypes, so a PolicyDocument object or DeletionProtectionEnabled "yes" fails as on AWS, where Boolean.valueOf made "yes" false. An update leaves a property the template no longer sets as it was, deletion protection, KMS key and multi-Region alike, and removes only the tags and the policy; an earlier change put them back to their defaults, which was not measured and is not what CloudFormation does. A policy the template does not change keeps its version, and create settles on PENDING_SETUP too. DsqlServiceTest, DsqlClusterPoliciesTest and DsqlCfnProvisionerTest cover these in isolation, the integration tests over the wire. * fix(dsql): keep the public access rule to DSQL and forget a deleted policy's version A review asked to leave S3 and Lambda web functions out of this change, and pointed at DSQL's own block public access page. The shared helper is dropped and S3 and Lambda web functions are as on main; folding their copies into one helper belongs to a separate change. DSQL now has its own keys: the trusted ones its page lists, and aws:SourceIp, aws:SourceVpcArn and the three aws:Vpce* keys, which the page leaves out but DSQL accepts (measured, eu-west-1, 2026-10-20). As the page says, a policy variable never restricts: StringEquals with ${aws:PrincipalArn}, ${aws:SourceVpc} or a role/${aws:username} ARN is public on DSQL. ArnEquals reads like ArnLike, as IAM matches both the same way, so a value that is no ARN, ${aws:SourceArn} among them, matches nothing and restricts, as measured. DeleteClusterPolicy left the deleted version on the cluster, so a put naming it went through; it is now cleared, and a put that names a version on a cluster with no policy is refused as not found. |
||
|
|
0517a7a936 |
fix(cloudformation): enforce SAM REST authorization defaults (#6021)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
5774e7db8d |
feat(cloudformation): support S3 Vectors resources (#5853)
* feat(cloudformation): support S3 Vectors resources * fix(cloudformation): validate S3 Vectors encryption settings * fix(cloudformation): align S3 Vectors provisioning contracts * fix(cloudformation): restore S3 Vectors properties on rollback |
||
|
|
fcb41966a8 |
fix(cloudformation): read an ECS task definition's properties as the ECS handler does (#6018)
Measured on CloudFormation (eu-west-1): an AWS::ECS::TaskDefinition gets
no template validation. CloudFormation hands the ECS handler every
scalar as text, and the handler converts each to the type the resource
schema declares: an integer is a sign and digits once trimmed, within
32 bits ("+128", " 128", "0128"), and a boolean is true or false in
lower, upper or title case once trimmed. A value it cannot convert
("abc", 4.5 or true for an integer, "yes", "tRuE" or "1" for a
boolean), and an object, a list and a scalar standing for one another,
fail the resource with every violation of the unconverted model, where
every scalar is a String, so a Memory of 128 is listed beside the value
that failed. At each object its missing required members come first,
then its members in the schema's order. When every value converts, the
required members the model lacks fail it alone, grouped where their
paths meet as the schema validator groups them.
Floci read the properties as plain JSON: a Memory of "abc" and a
container without an image were registered, and an Essential of
"False" registered an essential container.
AWS::ECS::TaskDefinition joins the generated cfn-property-types.json,
whose structures now carry the members the schema requires, read into
RequestShapeModel's shapes. CfnPropertyTypes' walk over the shapes is
shared by the template validation Reader and the new HandlerReader,
which differ in how a scalar converts and in what a mismatch does.
|
||
|
|
9099cec5e8 |
fix(cloudformation): check S3 ownership rules against the resource schema (#5834)
* fix(cloudformation): check S3 ownership rules against the resource schema #5712 made AWS::S3::Bucket apply OwnershipControls, with the provisioner answering a wrong type and a rule without ObjectOwnership, and S3 answering two rules, no rule and an unknown mode with MalformedXML. Two constraints of AWS's published resource schema were still missing. A key the schema does not define was dropped unread: next to a valid rule the stack reached CREATE_COMPLETE, and a misspelt ObjectOwnership was reported as missing. A rule listed twice was refused by S3 for the rule count, not by the schema for the repeat. Both now fail the resource before the bucket is created or changed, in the provisioner's "Model validation failed (#/OwnershipControls...)" form: "extraneous key [<key>] is not permitted" on OwnershipControls and on each rule, and "array items are not unique" on Rules, compared once intrinsic functions are resolved. Every other case keeps #5712's answer: two different rules, no rule and an unknown mode still get MalformedXML, and a rule without ObjectOwnership still reports the missing key. Its type checks get tests for the shapes it did not cover. docs/services/cloudformation.md gains an S3 ownership controls section. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): check each ownership rule before the repeat The uniqueness check ran before each rule's own checks, so a repeated rule that is malformed by itself, such as {"Rules": [{}, {}]} or two string rules, was refused as "array items are not unique" rather than for its own fault, which is the answer #5712 gives the same rule alone. The repeat is now checked once every rule passes on its own, still before S3's rule count. Tests now pin the order and the key each level allows: an extra key beside a Rules of the wrong type, ObjectOwnership on OwnershipControls, Rules on a rule, and a repeat that is not adjacent. The update test checks the error it gets. The previous commit's "Every other case keeps #5712's answer" holds from this commit on. Where the schema and S3 disagree, a missing Rules key and a mode outside the enum still get S3's MalformedXML. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): correct the S3 ownership controls section Say which key each level allows, that S3 rather than the resource schema requires ObjectOwnership, and that a repeated rule is checked once every rule passes its own checks. Name the two cases, a missing Rules and a mode outside the enum, where Floci keeps S3's answer and the schema would refuse the template itself. Describe the reason a stack reports rather than error codes it never shows, and flatten the nested list, which Python-Markdown renders as siblings at a two-space indent. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the repeat check after every ownership rule A repeat ahead of a malformed rule, as in [A, A, {}], must still fail for the third rule's missing ObjectOwnership, as a single malformed rule does. Without this row, checking each rule against the earlier ones inside the rule loop passed every test. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say S3 ownership rules are checked in turn The section said that what the resource schema refuses is reported first. The provisioner checks each rule in turn, so a rule without ObjectOwnership, which only S3 requires, is reported ahead of a schema fault in a later rule. Give the order the checks run in, and say that CloudFormation's reason can differ for such a rule, since the schema accepts it. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
a57c20943a |
feat(cloudformation): provision AWS::WAFv2::IPSet (#5950)
* feat(cloudformation): provision AWS::WAFv2::IPSet Serve AWS::WAFv2::IPSet from WafV2CfnProvisioner instead of the dispatcher stub, so stacks with IP sets no longer fail in strict mode and Web ACL rules can resolve a real IP set ARN. Name and Scope are create-only: a change replaces the set with a new name|id|scope physical id (Ref) and deletes the prior one the same way a Web ACL replacement does, tolerating a cleanup failure so the new set is still tracked. Addresses, Description and Tags update in place through UpdateIPSet; IPAddressVersion is never passed to the update, matching the real API, so a template that flips it fails address validation and reports UPDATE_FAILED. Fn::GetAtt resolves Arn and Id from the backing set, and DeleteStack removes it, tolerating a set already gone. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(cloudformation): defer IPSet replacement cleanup and honor its optional name Review follow-ups on the AWS::WAFv2::IPSet provisioner: - A renamed or re-scoped set now records the displaced one with ReplacementCleanup, so a failing delete of the prior set is reported by completeUpdate instead of being tolerated, and rollbackUpdate restores the prior set and deletes the replacement, the same contract the S3 bucket replacement follows. - IPAddressVersion is validated against IPV4/IPV6 on every provision. An in-place update never sends it to UpdateIPSet, so an unknown value would otherwise be accepted without ever reaching WAFv2. - Name is optional in the CloudFormation schema, matching what the Web ACL arm in the same provisioner already does: an omitted Name generates one on a create and reuses the existing set's name on an update. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(cloudformation): mark AWS::WAFv2::IPSet Name and Scope create-only Name and Scope are create-only in the registry schema, so without an entry in create-only-properties.json a Scope change fell to the name-based default and showed Replacement: False in the change set. A resource that reads the set's Ref or Arn was then skipped by the update and kept the ARN of the set that replacement cleanup deletes. Also share the IPV4/IPV6 rule between the provisioner and WafV2Service.validateAddresses, which repeated it, so an unknown IPAddressVersion is rejected in one place. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> --------- Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
1f4a46804c |
fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string (#5949)
* fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string The follow-up asked on #5923. The engine kept parameter values but not their types, so the Lambda provisioner's list readers could not tell a Ref to a CommaDelimitedList parameter, which the engine resolves to the comma-joined text, from a Ref to a String parameter: both read as lists, where CloudFormation refuses the second. Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and Architectures of AWS::Lambda::Function: - a Ref to a CommaDelimitedList, AWS::SSM::Parameter::Value<List<String>> or AWS::SSM::Parameter::Value<CommaDelimitedList> parameter, Fn::Split, an Fn::If choosing a Ref to a list, and Ref AWS::NotificationARNs are lists; - a Ref to a String or Number parameter, Ref AWS::Region, Fn::Select, Fn::Join, Fn::Sub and an Fn::If choosing a literal string fail the template's validation with "Property [Architectures] expected type: JSONArray, found: String"; - a resource's Ref and Fn::GetAtt fail only when the resource is provisioned, with "Properties validation failed for resource Fn with message: #/Architectures: expected type: JSONArray, found: String". CloudFormationTemplateEngine now takes the declared parameter types, which executeTemplate reads from the template (stacks, change sets, stack sets and nested stacks all deploy through it), and yieldsString tells the forms of the second group. The list readers refuse such an intrinsic with the validation message, as they refuse a literal of the wrong type. The third group is left as it was: the engine cannot tell a list-valued attribute from a string one before provisioning, and a resource's own message format is not modelled. parameterType gives a declaration's Type, String when it is left out, for the new reader and for GetTemplateSummary, which had its own copy. Tests: CloudFormationTemplateEngineTest for yieldsString over every measured form; CloudFormationLambdaObjectPropertyIntegrationTest for each refused form, an Fn::If choosing a list, and a nested stack whose own parameter types decide; CloudFormationLambdaObjectPropertyTest in sdk-test-java for a String parameter through the SDK. The integration and SDK tests fail on main. * fix(cloudformation): take Fn::Base64 as a string where a list is expected Review of #5949 (Qodo). Measured on CloudFormation (eu-west-1, 2026-10-18): Architectures: {"Fn::Base64": "x86_64"} fails validation with "Property [Architectures] expected type: JSONArray, found: String", like Fn::Sub. yieldsString left it out, so the Lambda reader split the encoded text into a list and the function got an invalid architecture instead. Tests: CloudFormationTemplateEngineTest and CloudFormationLambdaObjectPropertyIntegrationTest gain the case; both fail on the previous head. |
||
|
|
63af5cd299 |
fix(cloudformation): pass a function's LoggingConfig to Lambda (#5902)
* fix(cloudformation): pass a function's LoggingConfig to Lambda The AWS::Lambda::Function provisioner never read LoggingConfig, so every function a stack created logged in Text to /aws/lambda/<name>, whatever the template said, and an update to it was never applied. Measured on AWS (eu-west-1, 2026-10-16): the function reads back the LogGroup the template names; a change to JSON with an ApplicationLogLevel updates it in place, SystemLogLevel reading back INFO; and removing the property from the template puts the function back on Text and /aws/lambda/<name>, again in place. So the provisioner always sends a LoggingConfig, empty when the template has none, which Lambda resolves to the function's defaults (JSON for a durable function, which refuses Text). The update check compares what Lambda would store, through the same LambdaService.loggingSettings that UpdateFunctionConfiguration applies, so an unchanged LoggingConfig is still a no-op redeploy and the two cannot drift apart. Tests: the stack lifecycle in CloudFormationLambdaLoggingConfigIntegrationTest and, through the SDK clients, CloudFormationLambdaLoggingConfigTest, both failing on main; the normaliser in LambdaServiceTest. The compatibility suite gains TestFixtures.awaitStackTerminal for the new test rather than another private copy of the stack wait. * fix(cloudformation): refuse an invalid log level before comparing LoggingConfig The update check compared normalised logging settings, and the normaliser dropped both log levels under Text before anything validated them. An update whose only change was an invalid level, ApplicationLogLevel VERBOSE on a Text function, then looked unchanged, never reached UpdateFunctionConfiguration, and the stack went UPDATE_COMPLETE where AWS fails the update. LambdaService.loggingSettings now runs validateLoggingConfig before it normalises, so the comparison refuses what Lambda refuses, and applyLoggingConfig validates once, through it. The integration test registers its stacks' deletion with PartitionCleanup, and the compatibility test's cleanup no longer swallows a failed DeleteStack, which succeeds for a stack that is already gone. |
||
|
|
f22c2a4db1 |
feat(cloudformation): support SAM's optional AutoPublishAlias version properties (#5823)
* feat(cloudformation): support SAM's optional AutoPublishAlias version properties With AutoPublishAlias, read the three function properties SAM uses to shape the version it publishes: - AutoPublishCodeSha256: a string names the version by its first ten characters instead of the hash, so new code under the same value publishes nothing. A Ref to a parameter resolves first. - AutoPublishAliasAllProperties: the hash covers every property the transform gives the function, plus its SnapStart. - VersionDeletionPolicy: the version's DeletionPolicy when the function sets none; a function with a CapacityProviderConfig defaults to Delete, any other to Retain. An intrinsic value is copied unresolved, as SAM copies it. Each gets SAM's type checks and messages: AutoPublishCodeSha256 must be a string and make an alphanumeric id, AutoPublishAliasAllProperties a boolean, and VersionDeletionPolicy Delete or Retain, only with AutoPublishAlias. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the default Ref hash and AutoPublishAliasAllProperties coverage Keep the check that a Ref in the code changes the version id without AutoPublishAliasAllProperties, and show that with it a Timeout change names a new version and false hashes as if the property were absent. Pin that an AutoPublishCodeSha256 Ref resolving to an empty value leaves the hash in place. The docs say that ids under AutoPublishAliasAllProperties are floci's own and that a Ref to a parameter works for AutoPublishCodeSha256. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): refuse AutoPublishCodeSha256 in SAM Globals SAM refuses a Globals property it does not list for a section, and Globals.Function does not list AutoPublishCodeSha256. Now that the property names the version, merging it from Globals would give every function the same version id, so a code change would never publish. Refuse the template with SAM's message, without the list of supported properties that SAM appends. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the AutoPublishAliasAllProperties ids and SAM version updates Pin two version ids under AutoPublishAliasAllProperties to the SHA-1 of the generated function's properties, worked out by hand, and that a given AutoPublishCodeSha256 still names the version there. Show that Globals.Function carries AutoPublishAliasAllProperties and VersionDeletionPolicy. On a stack, a Timeout change under AutoPublishAliasAllProperties publishes version 2 with the new timeout, and VersionDeletionPolicy: Delete reports the replaced version DELETE_COMPLETE instead of DELETE_SKIPPED. An intrinsic VersionDeletionPolicy is copied unresolved, which the assertion now says. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say when a new SAM version id publishes Say which statements about the version id hold by default, that AutoPublishCodeSha256 outranks AutoPublishAliasAllProperties and cannot come from Globals, and when a new id publishes nothing: SnapStart, a new AutoPublishCodeSha256 alone, or, under AutoPublishAliasAllProperties, a Tags or ReservedConcurrentExecutions change, which AWS fails with "A version for this Lambda function exists". A hot-reloaded function publishes for every new id. State the DeletionPolicy order, and that CloudFormation takes intrinsic functions only in resource properties, outputs, metadata and update policies. The javadocs of the version id and of AutoPublishAlias say the same. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): note IgnoreGlobals and LanguageExtensions for SAM versions Say that floci does not honour IgnoreGlobals, so a function cannot opt out of a VersionDeletionPolicy in Globals, and that an intrinsic VersionDeletionPolicy reaches CloudFormation only through a transform such as AWS::LanguageExtensions, which floci does not implement. Under AutoPublishAliasAllProperties the code's parameter references are still resolved, and any SnapStart change publishes nothing. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the SnapStart id under AutoPublishAliasAllProperties Pin the id a SnapStart with ApplyOn None gives under AutoPublishAliasAllProperties, worked out by hand like the others, and show that a version VersionDeletionPolicy: Delete reports deleted is still listed, as the docs say floci keeps every version it publishes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say that IgnoreGlobals is the opt-out floci ignores A function can still clear a Globals VersionDeletionPolicy with a null of its own; what floci does not honour is IgnoreGlobals. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
e12b878b77 |
fix(cloudformation): resolve Fn::GetStackOutput as CloudFormation does (#5848)
* fix(cloudformation): resolve Fn::GetStackOutput as CloudFormation does Fn::GetStackOutput was not implemented, and an intrinsic the template engine does not know falls through to the node's text, which for an object is "". A weak cross-stack reference, which aws-cdk-lib synthesizes as Fn::GetStackOutput, therefore deployed CREATE_COMPLETE with an empty string wherever the value was used. The engine now resolves it through a StackOutputResolver that CloudFormationService answers as DescribeStacks would in the referenced account and Region, and the YAML parser maps the !GetStackOutput short form. Every rule follows what CloudFormation does, measured in eu-west-1, where that departs from the function's reference page: a missing stack or output fails the resource and the stack rolls back, an output that cannot be read rolls the stack back once the resources exist, an output whose Condition is false is never read, a dynamic reference reaches DescribeStacks unresolved, and the function is refused in Conditions and inside Fn::ImportValue when the operation is requested, AWS::Include fragments included. A RoleArn has to name an existing role: Floci runs no stack operation under an execution role, so, as AssumeRole does with IAM enforcement off, its trust policy is not evaluated. * fix(cloudformation): refuse Fn::GetStackOutput in export names and nested stacks as AWS does Answers the review of #5848, each point measured on CloudFormation in eu-west-1 on 2026-10-17. An output's Export.Name holding Fn::GetStackOutput is refused when the operation is requested, with "Template format error: Output O is malformed. The Name field of Export must not depend on any resources, imported values, or Fn::GetAZs.", so it never reaches execution. A nested stack's template is checked when the child is created: the Child resource fails with the template error and the parent rolls back. A dynamic reference inside an Fn::Sub variable map of the function's arguments is left as written too: CloudFormation hands it to DescribeStacks unresolved, which refuses the name. The engine suspends dynamic references while it resolves the arguments. An output that cannot be read now logs the stack and the output before the rollback, and the placement check skips only a template that does not parse or an AWS::Include that fails, which the operation reports where it processes them. * fix(cloudformation): check a Fn::GetStackOutput role's trust and permissions under IAM enforcement With IAM enforcement on, a RoleArn only had to name an existing role, so a stack could read another account's outputs through any role there, whatever the role trusted. GetStackOutputRoleAuthorizer now decides the role as AssumeRole and AppSyncDataSourceAuthorizer do: its trust policy has to allow a principal in the consuming account, and its policies, through IamPolicyEvaluator, have to allow cloudformation:DescribeStacks on the referenced stack. The refusals carry the messages measured on CloudFormation: STS's AccessDenied, and DescribeStacks' for the GetStackOutput session. With enforcement off nothing changes. Which principal CloudFormation acts as is not known in Floci, which runs stack operations under no execution role and keeps no caller, so a grant to any principal of the consuming account is enough: its root, or any principal of it the policy names, such as the CDK's execution role. That question is AssumeRolePolicyEvaluator.allowsAnyPrincipalOf, built on its own decide(), so the trust policy is parsed and evaluated in one place. Reuse instead of copies: the tests use EnforcementFixtures.auth, a new EnforcementFixtures.createRole overload taking the trust policy, and PartitionCleanup, and the two GetStackOutput tests share their stack and parameter helpers. The placement checks find the function with JsonNode.findValues instead of three hand-written walks, and the resolveOutputValue wrapper of resolve() is gone. |
||
|
|
197ccb5fb7 |
fix(cloudformation): refuse an update that has nothing to change (#5849)
* fix(cloudformation): refuse an update that has nothing to change UpdateStack ran a full update for a stack resubmitted as it was, ending UPDATE_COMPLETE, and CreateChangeSet created an AVAILABLE change set for it. CloudFormation refuses the update with "No updates are to be performed." and creates the change set FAILED, UNAVAILABLE, with "The submitted information didn't contain changes. Submit different information to create a change set."; the CDK and aws cloudformation deploy read that reason as "no changes". What CloudFormation compares was measured in eu-west-1: each active resource's Type, Properties, Metadata, DeletionPolicy, UpdateReplacePolicy and UpdatePolicy, and each active output's Value, Description and Export, with whatever does not depend on a resource resolved first, and the tags as a set (absent Tags keep the stack's). ComparedTemplate brings a template to that form: a new Description, an unused parameter, a DependsOn or a literal written as Fn::Join is no change, while a used mapping value, a Ref of a resource rewritten as Fn::Sub, or a dynamic reference whose stored value moved is one. Templates are compared as processed, AWS::Include fragments read again and the SAM transform applied with the stack's parameter values, and a stack with a nested stack is always updated. The change set diff uses the same form. The CDK deletes the FAILED change set and deletes it again by name before its next deploy, so DeleteChangeSet now answers success for a change set the stack does not have, as CloudFormation does. A stack set instance whose stack has nothing to change is left as it is. Tests that resubmitted an identical template to exercise an update add an output through CfnUpdates.forceUpdate, which is an update on AWS too. * fix(cloudformation): record dynamic reference values when an operation commits Answers the review of #5849. The value each dynamic reference resolved to is now recorded when the stack's operation commits, from the template the stack then has and keyed as ComparedTemplate hands the references over, instead of while the engine provisioned each resource. Recording and comparison so see the same strings, an Fn::Sub that also reads a resource included; an update that fails and rolls back records nothing and keeps the last deployment's values; a reference the template dropped is dropped; and AWS::RDS::DBInstance's master credentials, which its provisioner resolves itself with ssm-secure, are compared like any other reference. The values are kept as an HMAC-SHA256 under a random key of the stack's own rather than a bare SHA-256. ComparedTemplate keeps an AWS::NoValue inside a function it compares as written, and gives the array form of Fn::Sub the static variable substitution the string form has, its own variables left as written. A stack set instance with nothing to change succeeds whatever status an earlier rolled-back update left its stack in, and the change set that found it so is deleted. DeleteChangeSet by a change set's ARN alone succeeds when the change set is gone, as measured on CloudFormation in eu-west-1 on 2026-10-17. The comparison now catches only what it can meet: a template that does not parse, and the AwsException an AWS::Include, the SAM transform or an SSM parameter raises, which the update itself then reports. |
||
|
|
3cb1643d30 |
fix(cloudformation): publish content-hashed versions for SAM AutoPublishAlias (#5744)
* fix(cloudformation): publish content-hashed versions for SAM AutoPublishAlias
Point the alias AutoPublishAlias generates at the Version attribute of
the generated AWS::Lambda::Version, as SAM does, instead of $LATEST,
and name that version as SAM names it: <Function>Version plus the
first ten hex digits of the SHA-1 of the function's code, with
template parameters resolved as a Ref or as ${Name} in an Fn::Sub,
merged with its Environment and MemorySize, as sorted compact JSON
escaped the way Python's json.dumps escapes it. Under
AutoPublishAliasAllProperties the hash covers every property floci
gives the function. A string AutoPublishCodeSha256 takes the hash's
place with its first ten characters. As in SAM, the version is
retained (DeletionPolicy: Retain) unless the function says otherwise,
and version properties of the wrong type are refused.
With the alias on the published version, a template change to the
code names a new version resource, which publishes, and the alias
moves to it, while changes made to $LATEST outside the stack no longer
reach the alias. The $LATEST pin worked around #1987 and #1988: a cold
invoke of a published version timed out, and a warm $LATEST container
served version-qualified invokes. Both are fixed on main.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): hash an applied SnapStart into the SAM version id
SAM adds a function's SnapStart to the hash behind the AutoPublishAlias
version's logical id when its ApplyOn is anything but None, so turning
SnapStart on names a new version, which publishes and gets its
snapshot. Without it a SnapStart function got a different id than SAM
gives it, and changing SnapStart published nothing. Under
AutoPublishAliasAllProperties SnapStart is hashed like the other
properties.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(cloudformation): resolve SAM destination types with parameterValue
destinationType repeated the parameter lookup parameterValue already
does for the version hash: the stack's value, else the Default. Use the
one helper. A non-string Default still names no destination type.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): describe the SAM version hash in SAM terms
Reword the comments and test names around the AutoPublishAlias version
id to state what SAM and CloudFormation do, rather than how another
project or language implements it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): hash a null SnapStart ApplyOn and state what it changes
SAM leaves SnapStart out of the version hash only when ApplyOn is
missing or "None"; a null ApplyOn is hashed. The check read a null as
"None".
floci does not pass SnapStart to the function, so turning it on
changes the version's logical id but publishes no new version, and
no snapshot is taken.
|
||
|
|
0492fc9842 |
feat(lambdaweb): CloudFormation types for Lambda Web Functions (#5722)
* feat(lambdaweb): CloudFormation types for Lambda Web Functions AWS::Lambda::WebFunction, AWS::Lambda::WebFunctionRevision and AWS::Lambda::WebFunctionEndpoint provision through the resource registry. Ref of each is its ARN. Every property of a revision is createOnly in the registry schema, so a changed revision mints a new one and the displaced revision is deleted once the update commits. An endpoint keeps its identity while its function, name, type and regions stay the same. Fn::GetAtt on RegionalEndpoints is recorded as a gap. Part of #5699 * fix(lambdaweb): compare a revision against the function's default log group revisionMatches filled a request without a log group with the existing revision's log group, so a template that dropped a custom log group kept the old revision. The default is the function's log group, as when a revision is created. replaceTags returns the updated function. * fix(cloudformation): put a Lambda Web function or endpoint back after a failed stack update A function's tags and an endpoint's mutable configuration are changed in place on update. The provisioner now snapshots them before the change and restores them from rollbackUpdate, as the other in-place provisioners do. The function attributes after a tag update come from the updated function, so UpdatedAt moves with the tag change. * test(cloudformation): roll a Lambda Web stack update back after a failed revision A revision that fails to create after the endpoint moved to a replaced revision rolls the stack back. The endpoint returns to the kept revision and the replacement is deleted. The doc page says that a CloudFormation endpoint is always Disabled with RevisionWeights, since the schema has no AutoDeploymentMode, and that a failed update puts in-place changes back. * fix(cloudformation): refuse AutoDeploymentMode on a Lambda Web endpoint The registry schema has no AutoDeploymentMode property and AWS fails a template that sets it at validation. An endpoint from CloudFormation is always Disabled and routes by RevisionWeights. Floci passed the property through to the service, which accepted LatestRevision. * refactor(lambdaweb): share the create and tag steps between the API and CloudFormation paths createFunction and createFunctionShell both check the name and refuse a duplicate under the function's lock. tagResource and replaceTags both check the tags, lock, write, stamp and persist. Each pair now calls one private helper, so the two paths cannot drift. |
||
|
|
945f5d3995 |
fix(cloudformation): restore SSM parameters on failed updates (#5752)
A stack update that changed an AWS::SSM::Parameter and then failed on a later resource ended in UPDATE_ROLLBACK_FAILED with the new value left in place: the provisioner had no rollback. An update that keeps the name now keeps the parameter's value, settings and managed tags before it writes, and the rollback writes them back as a new version unless the parameter still holds them. A changed Name creates the replacement and leaves the displaced parameter to the shared ReplacementCleanup record: a committed rename deletes it unless UpdateReplacePolicy is Retain, a rollback deletes the replacement, and ContinueUpdateRollback retries a restore or delete that failed. A snapshot is spent when the update commits, and one a skipped rollback left is dropped when the next update starts. A create or replacement is one PutParameter without overwrite that carries the tags, as AWS's handler sends it, so a name held outside the stack fails the resource instead of being overwritten or adopted; a dispatcher stub's id is taken over by a create. As AWS's handler checks that the parameter exists before an update writes it, a parameter deleted outside the stack fails the update in place, and a rollback that finds it gone, with ParameterNotFound. A delete treats ParameterNotFound as already deleted. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
ad8fba7f45 |
fix(cloudformation): evaluate conditions with intrinsics, require parameter values (#5737)
* fix(cloudformation): require a value for every declared parameter CreateStack, UpdateStack and CreateChangeSet accepted a template that declares a parameter with no Default when the request gave it no value. The stack deployed with the parameter unset: a condition compared it as an empty string, and a Ref resolved to the parameter's own name. Such a request now fails with ValidationError "Parameters: [Env] must have values", naming every such parameter in declaration order, before the SAM transform and the dependency preflight run and before any stack state changes. An empty value counts as a value. An update does not carry values over, so it needs a value or UsePreviousValue, which keeps the deployed one, for each parameter without a Default. UsePreviousValue on a parameter with no deployed value passes none, rather than an empty string. A request its stack refuses outright, an update of a stack that is missing or cannot be updated or a create over a name in use, still gets that refusal. A parameter that an AWS::Include defines, which only execution merges, is not checked up front. The same check refuses CreateStackSet and UpdateStackSet, before the stack set changes or an operation is recorded. UpdateStackSet resolves UsePreviousValue against the previous template's Defaults too, since a stack set keeps only the values it was given. A nested stack resource whose Parameters leave a child parameter without a value fails, before the child is created or changed. Those Parameters now resolve as a property value: an Fn::If may choose the whole map, and an AWS::NoValue value passes nothing. A CreateStackInstances whose targets cannot be resolved, or whose change set is refused, now ends its operation FAILED. Left RUNNING, it refused every later operation on the stack set. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): evaluate conditions through the template engine Conditions resolved only a bare Ref, and only to a parameter, the account or the region. Every function other than that Ref compared as an empty string inside Fn::Equals: Fn::FindInMap, a Ref to AWS::StackName or AWS::StackId, Fn::Join. A condition on a mapped value or on the stack's own name was decided wrongly, so the wrong resources, or none, were created. The operands now resolve through the template engine, with the template's Mappings and the stack's name and id. The change-set preview and the dependency preflight evaluate against the stack too: the live one an update targets, or the name a create takes, whose id does not exist yet. An operand the engine cannot resolve compares as an empty string, as every function did before, so a template that evaluated then still does. A declared parameter that a stack stored by an older Floci lacks still compares as an empty string, and AWS::NotificationARNs is the empty list, now in properties and outputs too. CloudFormation does not allow Fn::ImportValue in a condition, so a template being deployed with one there is refused with "Template error: Cannot use Fn::ImportValue in Conditions.", also in an operand that evaluation never reaches. A SAM template's change set, or its stack, fails with that reason instead. A stored template compares the import as an empty string, so it never blocks an update that supplies a new template; UsePreviousTemplate checks the stored one as it would a new one. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): check a create's dependencies with its stack id A create's dependency preflight evaluated AWS::StackId as an empty string while the execution used the stack's id, so a dependency on a resource whose condition reads the stack id could pass the preflight and then fail the deploy, or the other way round. A create over a name in use was checked against the stack holding the name instead, and could get a dependency error rather than AlreadyExistsException. createChangeSet now allocates the new stack's id before the preflight and creates the stack with it, so the preflight, the change-set preview and the execution evaluate the same id. An update, or a create that attaches to a REVIEW_IN_PROGRESS placeholder, is checked against that stack as before, and a create over a name in use is checked as the new stack it asks for. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): place the parameter check before dependency checks The parameter section said template errors such as a dependency cycle come first, but createChangeSet checks the parameter values before the dependency checks, which evaluate conditions that read those values. Say so, and keep the stack's own refusal ahead of both. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): order the stack's refusal after dependency errors The previous commit said the stack's own refusal comes ahead of both the parameter check and the dependency checks. It comes ahead of the parameter check only: a request its stack refuses still gets a template's dependency error first, as on main. Say so, and re-wrap the conditions paragraph. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say parameter values are checked before dependency errors The parameter section still read as if a template's dependency errors came first. createChangeSet checks the parameter values before the dependency checks, which evaluate conditions that read the values, so a template with a cycle and a missing value gets the parameter error. Say that, and that a stack's own refusal replaces the parameter error but still follows a dependency error. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin a missing value ahead of a dependency cycle A template with both a DependsOn cycle and a parameter without a value gets "Parameters: [Env] must have values" and creates no stack. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(cloudformation): name the tolerated parse failures ignored requireParameterValues and parametersWithDefaults return when the template does not parse, as intended: there is nothing to check or to add, and the preflight and the execution report the parse error. Name the caught exception ignored and say why, as AGENTS.md asks. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(cloudformation): say only execution reports a parse failure The comment on the ignored parse failure in requireParameterValues said the preflight reports it too. The dependency preflight skips a template that does not parse; only executing the change set reports the error. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
1e423420ed |
fix(ec2): resolve a NAT gateway's network interface and mark its Elastic IP associated (#5622)
* fix(ec2): resolve a NAT gateway's network interface and mark its Elastic IP associated CreateNatGateway gave each gateway address a networkInterfaceId of "eni-" + randomHex(17), but nothing else knew about that interface: DescribeNetworkInterfaces had no NAT arm, so the id DescribeNatGateways publishes (aws_nat_gateway.network_interface_id) answered InvalidNetworkInterfaceID.NotFound. The Elastic IP the gateway took was also never marked associated, so DescribeAddresses showed a held allocation as free. The interface id is now derived from the gateway id, as endpoint ENIs are, and DescribeNetworkInterfaces reports one requester-managed nat_gateway interface per gateway address, built from the stored address so the two reads cannot disagree. CreateNatGateway records the association, interface and private address on the allocation (no instanceId), and DeleteNatGateway clears them if the association is still the gateway's. * fix(ec2): refuse a NAT gateway on an occupied Elastic IP, keep its association, scope its ENI lookup to the account CreateNatGateway rejects an allocation already held by an instance or another gateway (Resource.AlreadyAssociated) under the lock that writes the association. DisassociateAddress rejects an association owned by a NAT gateway. The NAT arm of DescribeNetworkInterfaces reads gateways and subnets for the account asked about. * fix(ec2): lock NAT gateway EIP release, treat a legacy gateway's EIP as held DeleteNatGateway releases the Elastic IP under the lock CreateNatGateway takes. CreateNatGateway also refuses an allocation any live gateway references, covering gateways persisted before Address records were marked. The CloudFormation networking test gives the replacement NAT gateway a new EIP: replacement creates before it deletes, and AWS's CreateNatGateway refuses an EIP still associated elsewhere. * fix(ec2): AssociateAddress refuses a NAT gateway's Elastic IP; legacy gateways hold theirs AssociateAddress checks for a gateway holding the allocation and writes under the allocation lock CreateNatGateway and DeleteNatGateway take, so an instance cannot take over an address the gateway still claims. The gateway scan behind that check, and CreateNatGateway's, now includes unmigrated pre-account-isolation gateway records for the default account, never another account's. * fix(ec2): scope NAT gateway ownership checks to the caller's records callerNatGateways scanned every account's gateways before filtering. Read the caller's own records, plus unprefixed legacy records only for the default account. * fix(ec2): create a NAT gateway failed on an Elastic IP already in use CreateNatGateway with an allocation another gateway or an instance holds no longer answers 400. As the NatGateway shape documents, the gateway is created in state failed with FailureCode Resource.AlreadyAssociated and FailureMessage "Elastic IP address <alloc> is already associated". It gets no interface, claims nothing, and does not count as a holder. AWS::EC2::NatGateway fails the resource and deletes the failed gateway. ReleaseAddress on an allocation a NAT gateway holds, legacy gateways included, answers InvalidIPAddress.InUse. DisassociateAddress and ReleaseAddress run under privateIpAllocationLock. The NAT interface lookup reads legacy unprefixed gateways and subnets for the default account. It also loads the interface's tags, and DeleteNatGateway deletes them. endpointEniId and natEniId become one helper, eniIdFromSeed. * test(cloudformation): say why the replacement template keeps NatEip The replacement template keeps NatEip for two reasons. On AWS a gateway given an Elastic IP the displaced gateway still holds is created failed. And Floci update cleanup deletes removed resources before the old copies of replaced ones, so dropping the EIP while replacing its gateway would try to release it while it is still held. * fix(ec2): a failed NAT gateway does not pin its subnet or VPC #5503 made DeleteSubnet and DeleteVpc refuse while a NAT gateway that is not deleted sits in the subnet. A failed gateway was never created and holds no interface, so it no longer counts, matching the Elastic IP holder check. |
||
|
|
fa682b2d62 |
fix(cloudformation): clean up, roll back and delete AWS::EC2::VPC like the other EC2 types (#5503)
* fix(cloudformation): clean up, roll back and delete AWS::EC2::VPC like the other EC2 types A CidrBlock change, or a tenancy change other than dedicated to default, replaces the VPC, but the provisioner never recorded the displaced one and had no delete arm, so the old VPC was left behind; in-place Tags, EnableDnsSupport and EnableDnsHostnames changes were not snapshotted, so a later failing resource left the VPC changed and reported rollback as not implemented. Ec2VpcCfnProvisioner now follows Ec2NetworkCfnProvisioner: ReplacementCleanup records the displaced VPC and deletes it after the update commits or restores it on rollback; a prior-state snapshot restores DNS attributes, tags and a dedicated-to-default tenancy change on rollback, eagerly when provision itself fails; and a delete arm through CfnDeletes.safeDelete removes the VPC on stack teardown, tolerating only InvalidVpcID.NotFound so stack-external dependents fail the delete with DependencyViolation, as on AWS. * refactor(cloudformation): use the shared CfnRollback.guarded in the VPC provisioner * fix(ec2): count instances and NAT gateways as subnet and VPC dependents DeleteSubnet and DeleteVpc checked subnets, security groups, route tables, ACLs, gateways and endpoints but not the instances and NAT gateways living in a subnet, so a stack teardown could remove a subnet and its VPC out from under an instance launched into it out of band. Both now fail with DependencyViolation while an instance that is not terminated (shutting-down still holds its interface) or a NAT gateway that is not deleted sits in the subnet, as on AWS. The rollback integration test also pins Boom after the VPC with DependsOn so the scenario cannot pass by ordering alone. * fix(cloudformation): keep the VPC and subnet rollback snapshot until the restore succeeds rollbackUpdate removed the in-place snapshot before restoring; a restore that threw left the resource persisted as UPDATE_FAILED with no prior state for a ContinueUpdateRollback retry. Ec2VpcCfnProvisioner and the pre-existing Ec2NetworkCfnProvisioner now restore first and remove after, as the AgentCore provisioner already did. The describeTags loop shared by Ec2Tags.reconcile and the VPC snapshot moves to Ec2Tags.current. * fix(ec2): count standalone network interfaces and interface endpoints as subnet dependents A subnet is pinned by any network interface in it, not only the ones an instance or NAT gateway owns: a standalone interface from CreateNetworkInterface and an interface or Gateway Load Balancer endpoint keep DeleteSubnet at DependencyViolation on AWS too. The endpoint test that deleted a subnet out from under a live endpoint relied on that state being reachable; it now asserts the refusal and that the published interface ids are unchanged. * fix(cloudformation): wait for terminated on instance delete and resolve VPC properties before creating With real containers an instance is still shutting-down when the stack's instance delete returns, so the subnet delete that follows was refused by the new resident check and the stack ended DELETE_FAILED. The instance provisioner now polls until the instance is terminated or gone, as CloudFormation does. The VPC provisioner created the VPC before EnableDnsSupport, EnableDnsHostnames and Tags were resolved, so a resolution failure left it untracked; the resolves now run first, as the subnet provisioner does. Ec2Tags.current drops reserved aws: keys so a rollback snapshot never tries to write one, and the replacement integration test waits in the stack's own region. |
||
|
|
7f8383db38 |
feat(cloudformation): provision SES email identities (#4812)
* feat(cloudformation): provision SES email identities * fix(cloudformation): retry pending SES update rollback * fix(cloudformation): keep recovered SES resource complete * fix(cloudformation): retain recovered SES state on failed replacement * test(cloudformation): use shared waiter for SES DKIM verification |
||
|
|
ad1b225591 |
feat(cloudformation): apply AssociatedRoles on RDS clusters and instances (#5656)
* feat(cloudformation): apply AssociatedRoles on RDS clusters and instances AWS::RDS::DBCluster and AWS::RDS::DBInstance ignored AssociatedRoles, so a CDK DatabaseCluster with s3ImportBuckets deployed with no role on the cluster. The roles are now associated when the resource is created, through the same checks as AddRoleToDBCluster and AddRoleToDBInstance; a list RDS refuses fails the resource and deletes the new database. An update adds the roles the template gained and removes the ones the previous template declared and this one drops, so a role associated outside the stack is kept. An Aurora cluster member carrying its own AssociatedRoles is a ValidationError, as the schema calls the property not applicable there. addRolesToNewDbCluster now also refuses a role named twice in its own list. Closes #5638 * fix(cloudformation): follow AWS on repeated roles, and check before changing a database A renamed instance's predecessor was deleted before the new instance took its roles, so a refused list left neither; the roles now go on first. The property is resolved before it is read, so Fn::If around the list or an entry works and AWS::NoValue leaves it out, and any other value that is not a list is a ValidationError rather than "no roles". Repeated roles follow AWS's handlers: an instance skips a role or feature already associated (AWS ignores DBInstanceRoleAlreadyExists), while a cluster's list is checked first on an update too, and a role the template newly declares is always added, so one attached by hand fails the update with DBClusterRoleAlreadyExists. A rolled back cluster replacement also restores the record of which roles the stack declared. * fix(cloudformation): undo a failed role update's own changes An update changed roles one at a time, so when a later step was refused the roles it had already added stayed on the database while the stack restored its old record, and a retry failed on them with DBClusterRoleAlreadyExists. A refused step now removes the roles the update added and puts back the ones it removed before the error is reported. The cluster check also takes the template's engine, now that it checks feature names, and the roles record reader catches only the JSON parse error. |
||
|
|
a5228a0bf7 |
fix(cloudformation): apply TimeToLiveSpecification on DynamoDB tables (#4951)
* feat(dynamodb): add typed time-to-live operations to the table access DynamoDbTableAccess gains timeToLive and updateTimeToLive next to the stream operations. The native engine reads the TTL flag and attribute from the table definition and calls DynamoDbService.updateTimeToLive under the scope's account; the Local engine sends DescribeTimeToLive and UpdateTimeToLive. * fix(cloudformation): apply TimeToLiveSpecification on DynamoDB tables An AWS::DynamoDB::Table declaring TimeToLiveSpecification reached CREATE_COMPLETE while DescribeTimeToLive answered DISABLED, because the provisioner never read the property. The provisioner now reconciles TTL against what the table reports, so UpdateTimeToLive is called only when the setting differs: enabled turns it on, Enabled false or a block removed on an update turns it off with the current attribute name, and renaming an enabled attribute fails with the DynamoDB ValidationException before anything changes. Enabled with no AttributeName fails with ValidationError before the table is created. An in-place table update now records the tags, stream and TTL setting it replaces, and rollbackUpdate puts all three back, so a stack whose update fails on a later resource ends UPDATE_ROLLBACK_COMPLETE instead of UPDATE_ROLLBACK_FAILED. A restore that throws keeps the snapshot. * fix(cloudformation): roll back and clean up failed DynamoDB table provisions A table's in-place update that failed after its snapshot, for example on UpdateTimeToLive after the tags and the stream had changed, lost the snapshot: the engine put the previous resource back and reported UPDATE_ROLLBACK_COMPLETE with the changes still live. The provisioner now retains a failed attempt that carries its snapshot, so the engine hands it to rollbackUpdate. A failure before the snapshot changed nothing and still uses the engine's restore. A provision that failed after createTable left the new table behind, on create and on a replacing update alike. The provisioner now deletes a table this attempt created, tolerating ResourceNotFoundException, and never one it adopted or updates in place. A delete that fails is logged and leaves the physical id and the rollback ownership marker, so the stack's create rollback retries it. A table recreated because the update target was gone takes no snapshot, since it has no prior state. * fix(cloudformation): match the AWS status reasons for invalid TimeToLiveSpecification Renaming an enabled TTL attribute and enabling TTL without an AttributeName now fail with the handler message AWS CloudFormation reports, as measured in eu-west-1, and with its InvalidRequest handler error code. The resource status reason is the AWS inner text exactly; the type and logical id prefix are gone, since AWS does not include them. * fix(cloudformation): scope DynamoDB table TTL to the stack and validate Enabled - An update leaves TTL alone when neither the template nor the previous one declared TimeToLiveSpecification, so TTL enabled outside the stack survives, as on AWS. - A TimeToLiveSpecification without Enabled, or with a non-Boolean one, fails model validation before the table is created. - A replacing update whose created table cannot be deleted reports a rollback failure naming the table instead of leaving it untracked. |
||
|
|
c4a809f47f | feat(cloudformation): refuse updates after a failed rollback and add ContinueUpdateRollback (#4949) | ||
|
|
f6c8ebd5a0 |
feat(cloudformation): provision Scheduler schedules (#4834)
* feat(cloudformation): provision Scheduler schedules * fix(cloudformation): track schedule move destination ownership * fix(cloudformation): preserve failed schedule deletion cleanup * fix(cloudformation): guard Scheduler schedule cleanup ownership * fix(cloudformation): verify Scheduler ownership before replacement * fix(cloudformation): omit conditional Scheduler properties * fix(cloudformation): share optional resolution and delete cleanup hooks * fix(cloudformation): address Scheduler schedules by group and name * fix(cloudformation): reject malformed Scheduler cleanup entries * fix(cloudformation): align Scheduler replacement cleanup with main |
||
|
|
daef71ca76 |
feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan (#5373)
* feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan Adds CreateMalwareProtectionPlan, GetMalwareProtectionPlan, UpdateMalwareProtectionPlan, DeleteMalwareProtectionPlan and ListMalwareProtectionPlans, and routes plan ARNs through the shared tag operations. Adds a CloudFormation provisioner for AWS::GuardDuty::MalwareProtectionPlan. Ref and Fn::GetAtt MalwareProtectionPlanId return the plan id, and Arn, CreatedAt, Status and StatusReasons are set. Role, object prefixes, the tagging action and tags update in place; a different BucketName is rejected because the update API cannot change the bucket. Management plane only: no scan runs, so a plan stays ACTIVE. Closes #4657 * fix(guardduty): address review findings on Malware Protection plans - Apply a plan update all-or-nothing: validate every supplied field before storing any, so a rejected request no longer changes the role. - Page ListMalwareProtectionPlans by the last returned id instead of an offset, so deleting a plan between pages neither fails nor skips, and use the documented default page size of 100. - Restore a plan on a failed CloudFormation stack update from a snapshot taken before the first change, and delete a plan an update created in place of one deleted out of band. - Clear ObjectPrefixes and Actions on a stack update that drops them. - Apply the creation tag rules to the shared tag routes. - Require the role to be an IAM role ARN. - Use explicit types instead of var. * style(guardduty): import ArrayList instead of fully qualified name * test(cloudformation): wire GuardDuty into CfnProvisionerFixture CfnProvisionerFixtureTest requires every provisioner to be reachable through a public Builder setter. Add a guardDuty(...) setter that registers GuardDutyMalwareProtectionPlanCfnProvisioner. * fix(guardduty): address second review round on Malware Protection plans - Rolling back a stack update that recreated a plan deleted out of band now restores the prior plan's Arn, CreatedAt, Status and StatusReasons, not only its id, so Fn::GetAtt no longer names the deleted replacement. The out-of-band test now changes the plan's properties: unchanged resources are skipped on update, so it never reached the create before. - Plan tag keys are checked against GuardDuty's documented TagKey pattern (^(?!aws:)[a-zA-Z+-=._:/]+$) on creation and on TagResource. - The tag routes require the supplied ARN to equal the stored plan's ARN, so a matching plan id under another account, service or partition is ResourceNotFoundException. - The /malware-protection-plan routes move behind a @PreMatching filter that rewrites only guardduty-signed requests to /_guardduty, as DlmRouteFilter does, so path-style S3 requests for a bucket of that name reach S3. * style(guardduty): import Instant and List, drop em-dash, document the plan route Review on #5373: GuardDutyController used an inline java.time.Instant and its Javadoc carried an em-dash, which AGENTS.md rules out. The Javadoc's routing paragraph now names /malware-protection-plan next to /detector and /admin and says GuardDutyRouteFilter keeps a same-named S3 bucket reachable. The CloudFormation and plan integration tests import List and nullValue instead of spelling them out. * refactor(core): share signed-service route rewriting across DLM, GuardDuty and Resource Explorer 2 DlmRouteFilter, GuardDutyRouteFilter and ResourceExplorer2PathRewriteFilter each repeated the same path test, credential-scope check and rewrite. They now delegate to SignedServiceRoute in core.common. The helper also reads the signing service from the X-Amz-Credential query parameter when there is no Authorization header, as ServiceEnabledFilter does (which now uses the same lookup), so a query-signed plan request reaches GuardDuty instead of S3. A request sent straight to an internal prefix that is not signed for the service is refused as S3 refuses that bucket name, rather than reaching the service's routes. Resource Explorer 2's prefix moves from /re2 to /_re2, since re2 is a valid bucket name. |
||
|
|
b8e628356c |
feat(cloudformation): provision ElastiCache serverless caches (#5423)
* feat(cloudformation): provision ElastiCache serverless caches Add the AWS::ElastiCache::ServerlessCache provisioner on top of the serverless cache API, with dotted Endpoint.* and ReaderEndpoint.* Fn::GetAtt attributes, in-place modification, rejected immutable changes and replacement on rename. * fix(cloudformation): reject a malformed NoPasswordRequired on ElastiCache users * fix(cloudformation): restore serverless cache settings on a failed update and reset removed ones * refactor(elasticache): inject ElastiCacheService once into the serverless service * fix(cloudformation): replace a serverless cache on its create-only properties Register AWS::ElastiCache::ServerlessCache in create-only-properties.json so a change to ServerlessCacheName, SubnetIds, KmsKeyId or SnapshotArnsToRestore is reported as a replacement instead of being applied in place or ignored. Share one Docker availability probe across the ElastiCache integration tests and validate the tag count in one place in ElastiCacheServerlessService. * fix(cloudformation): reject custom-named serverless cache replacement on create-only properties * fix(cloudformation): simplify serverless create-only update check and share replacement error |
||
|
|
ebae2ba0e0 |
feat(cloudformation): provision Cognito resource servers (#4832)
* feat(cloudformation): provision Cognito resource servers * fix(cloudformation): align rollback tests with deletion cleanup * fix(cloudformation): abandon exhausted Cognito replacement cleanup * fix(cloudformation): verify Cognito resource server ownership * test(cognito): use switch expression for ownership writers * fix(cloudformation): share optional resolution and delete cleanup hooks * fix(cognito): use resource server API addresses for stack lifecycle * fix(cloudformation): avoid repeated Cognito cleanup on stack deletion * fix(cloudformation): keep consumed resource server cleanup removed * fix(cloudformation): abandon exhausted Cognito cleanup * test(cloudformation): cover Cognito resource servers with AWS SDK * fix(cloudformation): validate Cognito scopes and replace missing servers * refactor(cloudformation): keep Cognito resource server change scoped |
||
|
|
f50437efba |
feat(cloudformation): provision AWS::BedrockAgentCore::Runtime, RuntimeEndpoint and Memory (#5226)
* feat(cloudformation): provision AWS::BedrockAgentCore::Runtime, RuntimeEndpoint and Memory The AgentCore control plane is emulated but had no CloudFormation provisioner, so the three types fell through to the generic stub that exposes only Arn and a template using Fn::GetAtt [Memory, MemoryArn] in an IAM policy failed the stack. BedrockAgentCoreCfnProvisioner maps every template property the services can store onto CreateAgentRuntime / CreateAgentRuntimeEndpoint / CreateMemory, publishes Ref as the registry schema's primaryIdentifier and Fn::GetAtt for every read-only property, updates in place when the create-only properties are unchanged and replaces otherwise, and deletes on stack teardown. Properties the emulated services have no model for are logged once at warn and listed in the docs. * fix(cloudformation): make AgentCore updates rollback-aware and authoritative Reachable through CfnProvisionerFixture (two-service inference arm). In-place updates snapshot the prior runtime, endpoint and memory configuration and tags, restore them on rollback, and delete a created entity when a later step of the same provision fails. The template is authoritative: UpdateAgentRuntime replaces the full configuration as AWS's PUT does (omitted authorizer, protocol and environment are cleared on the SDK path too), and the partial-update Memory and Endpoint calls get a replace-omitted overload for the provisioner. Nested AWS::NoValue members are omitted rather than stored blank, and the control service validates networkMode and serverProtocol with the API's ValidationException wording. * fix(cloudformation): accept AGUI runtimes and share the guarded provision helper The protocol check left out AGUI, which the AgentCore API and the Runtime schema allow, so an AG-UI runtime was refused through the API and in a stack. Ec2NetworkCfnProvisioner and BedrockAgentCoreCfnProvisioner carried the same guarded helper; it now lives on CfnRollback, taking the provisioner's in-place undo as a callback, and both use it. |
||
|
|
aff6f0eec4 |
fix(cloudformation): expand a SAM function's EventInvokeConfig (#5524)
* fix(cloudformation): expand a SAM function's EventInvokeConfig SAM's EventInvokeConfig was dropped, so a function declaring retries, a maximum event age or invoke destinations deployed with Lambda's defaults and no destination at all. It now expands as AWS's SAM translator expands it: an AWS::Lambda::EventInvokeConfig on $LATEST or the AutoPublishAlias alias, the inline role policy for each destination, the SQS queue or SNS topic SAM creates for a destination given only its Type, and SAM's conditions and error messages. The function's Condition, DeletionPolicy and UpdateReplacePolicy now reach every resource generated for it, as SAM passes them through. A condition naming another with anything but a string is rejected as CloudFormation rejects it, which also fails the template SAM produces for a conditional function with a conditional destination, as on AWS. * fix(cloudformation): resolve SSM parameters for the SAM transform and omit NoValue destinations CloudFormation resolves an AWS::SSM::Parameter::Value<String> parameter before it runs the SAM transform, so a destination Type taken from one is the stored value. The transform now gets the given parameter values over each Default, with SSM-typed parameters read from Parameter Store, wherever it runs. A Destination of AWS::NoValue passes through SAM unchanged and leaves its side without an ARN, which CloudFormation's validation rejects. The event invoke config provisioner resolved it to an empty string and stored that; it now omits AWS::NoValue, so the destination fails as the schema requires. * refactor: share SHA-1 as Digests.sha1 The SAM transform's generated condition names, EC2 key pair fingerprints and the SAML assertion name qualifier each made their own one-shot SHA-1 digest. They now share Digests.sha1 beside sha256. Also moves samTransformParameters above resolveSsmParameters' Javadoc, which it had been inserted beneath. |
||
|
|
991bf3ab9e |
fix(autoscaling): round-trip InstanceMaintenancePolicy, AvailabilityZoneDistribution, CapacityReservationSpecification, ServiceLinkedRoleARN, WeightedCapacity and EnabledMetrics (#5513)
* fix(autoscaling): round-trip InstanceMaintenancePolicy, AvailabilityZoneDistribution, CapacityReservationSpecification, ServiceLinkedRoleARN, WeightedCapacity and EnabledMetrics DescribeAutoScalingGroups dropped several members of the AutoScalingGroup shape that CreateAutoScalingGroup and UpdateAutoScalingGroup accept, so a client that set them read them back as absent and saw a permanent diff. - AsgOptionalFields gains ServiceLinkedRoleARN, InstanceMaintenancePolicy, AvailabilityZoneDistribution and CapacityReservationSpecification with its CapacityReservationTarget. The four-argument constructor stays, so existing call sites are unchanged. - MixedInstancesPolicy launch template overrides carry WeightedCapacity. - EnableMetricsCollection and DisableMetricsCollection are implemented, and DescribeAutoScalingGroups reports EnabledMetrics. - Validation follows the botocore model. MinHealthyPercentage 0 to 100 and MaxHealthyPercentage 100 to 200, both required, at most 100 apart, and -1 on both clears the policy. CapacityDistributionStrategy and CapacityReservationPreference enums. No target with preference none. CapacityReservationIds 1 to 255 characters matching [A-Za-z0-9-_/] and resource group ARNs 1 to 1600. ServiceLinkedRoleARN 1 to 1600 characters. WeightedCapacity 1 to 999 in at most 32 characters, set on every override or none. Granularity required and 1Minute. Known metric names only. - The AWS::AutoScaling::AutoScalingGroup provisioner passes the new properties and MetricsCollection through, and its update rollback snapshot restores them. It requires CapacityReservationPreference and each entry's Granularity as the resource schema does, and rejects an unknown metric before creating the group. - The Java SDK compatibility suite gains a round-trip case that sets every new member, reads it back through DescribeAutoScalingGroups, then clears the maintenance policy and the enabled metrics. * fix(autoscaling): route the metrics collection actions and close the review gaps EnableMetricsCollection and DisableMetricsCollection now route to Auto Scaling when a request carries no credential scope. Both hold the group lock, so concurrent calls keep each other's changes and a call racing a delete cannot write the group back. A failed stack update now clears the service-linked role, AZ distribution and capacity reservation when the group had none before. A blank ServiceLinkedRoleARN or WeightedCapacity in a template reaches the service's validation instead of reading as unset. The provisioner reuses the service's granularity rule and message. |
||
|
|
86b32584f3 |
feat(cloudformation): provision ElastiCache users and user groups (#5422)
* feat(cloudformation): provision ElastiCache users and user groups Add AWS::ElastiCache::User and AWS::ElastiCache::UserGroup provisioners with authentication mode handling, create-only UserName, membership deltas, engine changes and replacement on rename. * fix(cloudformation): address review findings for ElastiCache users and user groups - Require Engine property when provisioning AWS::ElastiCache::User - Reject invalid and conflicting AuthenticationMode combinations - Add setUserGroupMembers to atomically update group membership under lock - Require UserIds property when provisioning AWS::ElastiCache::UserGroup - Snapshot and restore User and UserGroup on stack update rollback - Tighten replaced subnet group deletion assertion in integration test * refactor(elasticache): share user authentication and user group update logic Move the AuthenticationMode / Passwords / NoPasswordRequired decision into UserAuthentication so the query handler and the CloudFormation provisioner no longer duplicate it. Make modifyUserGroup and setUserGroupMembers share one locked update path, and drop the concurrency test that passed without the lock. |