mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
feat(cloudformation): provision AWS::ElasticLoadBalancingV2::ListenerCertificate (#8353)
CDK's ApplicationListener.addCertificates puts the first certificate on the listener and emits one ListenerCertificate for each extra one. Floci had no provisioner for the type, so it was stubbed as CREATE_COMPLETE and did nothing; since the default certificate is held apart from the listener's certificate list, such a listener came up with an empty list and served none of its SNI certificates. ElbV2CfnProvisioner serves the type now. Create adds the declared certificates to the listener's list, as AddListenerCertificates does, and delete removes the ones the resource added, recorded per physical id because the id alone cannot carry them. Certificates updates in place, as the resource reference says: the certificates the template gains are added, then the ones it drops removed, and a failed update puts both back. ListenerArn is create-only, so a change replaces the resource: the certificates go onto the new listener, and come off the old one once the update commits. CloudFormation publishes no format for the resource's identifier, so Ref returns <ListenerArn>|<suffix>. AWS's published resource schemas have moved since the vendored tables were last synced: AWS::Lambda::Function gained AcceleratorConfig and RuntimeConfig, and AWS::ECS::TaskDefinition TrustedExecutionConfiguration. That fails the online check of those tables, which this change runs, so cfn-property-types.json and schema-surface.tsv are synced from AWS here, and the three new properties are recorded as accepted and ignored.
This commit is contained in:
1 parent
acd884a739
commit
0816789e30
11 files changed
+517
-36
No files matched your search
@@ -212,7 +212,7 @@ cross-resource references.
|
||||
| Redshift | `Cluster` (single-node container; Port and non-dev DBName ignored; ManageMasterPassword unsupported), `ClusterParameterGroup`, `ClusterSubnetGroup`, `ClusterSecurityGroup` (accepted; no EC2-Classic security group model), `EventSubscription` |
|
||||
| Redshift Serverless | `Namespace` (Managed admin credentials use Secrets Manager; GetAtt uses the dotted Namespace.* form), `Workgroup` (starts a real container; one workgroup per namespace; capacity, VPC and price-performance settings are stored only; snapshot restore properties are ignored; GetAtt uses the dotted Workgroup.* form) |
|
||||
| EC2 | `VPC` (`Tags` update in place, keeping tags added outside the stack; deleted on stack teardown; a VPC with dependents outside the stack, including anything still holding a network interface in its subnets (an instance that is not terminated, a NAT gateway that is not deleted or failed, a standalone interface, an interface endpoint), fails the delete with `DependencyViolation`, as on AWS), `Subnet`, `SecurityGroup` (inline `SecurityGroupIngress`/`SecurityGroupEgress` supported; `Tags` update in place, keeping tags added outside the stack; a failed stack update puts the rules and tags of a group it changed in place back), `SecurityGroupIngress`, `SecurityGroupEgress`, `InternetGateway`, `RouteTable`, `SubnetRouteTableAssociation`, `Route`, `NatGateway` (zonal; `AvailabilityMode` regional fails; a change to the `Secondary*` address properties updates the gateway in place), `EIP`, `Instance` (`Tags` update in place, keeping tags added outside the stack), `LaunchTemplate`, `VPCGatewayAttachment`, `VPCEndpoint`, `NetworkAcl`, `NetworkAclEntry`, `SubnetNetworkAclAssociation`, `FlowLog` (`Tags` are applied and updated in place, keeping tags added outside the stack; any other change fails, since it needs a replacement), `KeyPair` (a created key's private key is stored in the `SecureString` parameter `/ec2/keypair/<KeyPairId>`, as on AWS, and deleted with the key), `PrefixList` (updated in place; an update that changes `AddressFamily`, or `MaxEntries` together with `Entries`, fails) |
|
||||
| Elastic Load Balancing v2 | `LoadBalancer`, `TargetGroup`, `Listener`, `ListenerRule` |
|
||||
| Elastic Load Balancing v2 | `LoadBalancer`, `TargetGroup`, `Listener`, `ListenerRule`, `ListenerCertificate` (`Certificates` update in place, a `ListenerArn` change replaces it) |
|
||||
| Auto Scaling | `LaunchConfiguration`, `AutoScalingGroup`, `LifecycleHook`, `ScalingPolicy` |
|
||||
| Application Auto Scaling | `ScalableTarget` (`ScheduledActions` are accepted and not run; Floci has no scheduled scaling), `ScalingPolicy` |
|
||||
| Route 53 | `HostedZone`, `RecordSet`, `RecordSetGroup` (written in one change batch, so a record set that cannot be written leaves the zone unchanged; every record set must be in the group's hosted zone), `HealthCheck` |
|
||||
@@ -641,6 +641,25 @@ target has no port and is its function ARN alone.
|
||||
first update that changes the group registers the declared targets and deregisters nothing.
|
||||
- `QuicServerId` is accepted and ignored, as Floci's `RegisterTargets` has no QUIC support.
|
||||
|
||||
## ELBv2 listener certificates
|
||||
|
||||
`AWS::ElasticLoadBalancingV2::ListenerCertificate` adds its `Certificates` to the listener's
|
||||
certificate list, as `AddListenerCertificates` does, so `DescribeListenerCertificates` names them and
|
||||
an HTTPS or TLS listener serves them by SNI. It is how a CDK listener's `addCertificates` gives a
|
||||
listener certificates beyond its default one. `Ref` returns `<ListenerArn>|<suffix>`: CloudFormation
|
||||
publishes no format for this resource's identifier, so the format is Floci's.
|
||||
|
||||
- On `UpdateStack`, a change to `Certificates` (no interruption, as in AWS) adds the certificates
|
||||
the template gains, then removes the ones it drops. A failed update removes the certificates it
|
||||
added and adds back the ones it removed.
|
||||
- A change to `ListenerArn` replaces the resource: the certificates are added to the new listener,
|
||||
and removed from the old one once the update commits.
|
||||
- Deleting the resource removes the certificates it added. One that is also the listener's default
|
||||
certificate is refused with `OperationNotPermitted`, as `RemoveListenerCertificates` refuses it.
|
||||
- A certificate the listener's list already held when the resource declared it, one added outside
|
||||
the stack for instance, was not added by the resource: neither dropping it from `Certificates` nor
|
||||
deleting the resource takes it off the listener.
|
||||
|
||||
## S3 ownership controls
|
||||
|
||||
`AWS::S3::Bucket` applies `OwnershipControls` through the same S3 call as
|
||||
|
||||
@@ -88,6 +88,17 @@ public final class CfnRollback {
|
||||
*/
|
||||
public static final String TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR = "__FlociTargetGroupTargetsUpdateSnapshot";
|
||||
|
||||
/**
|
||||
* Holds what an update that kept an ELBv2 listener certificate resource changed on its listener:
|
||||
* the certificates it added that the listener's list did not hold, the ones it removed, and the
|
||||
* certificates the resource declared before, so a failed stack update can put them back. Written
|
||||
* by {@code ElbV2CfnProvisioner} between its AddListenerCertificates and RemoveListenerCertificates
|
||||
* and spent by the undo of a failed provision or by its {@code rollbackUpdate}, retained across a
|
||||
* failed put back.
|
||||
*/
|
||||
public static final String LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR =
|
||||
"__FlociListenerCertificatesUpdateSnapshot";
|
||||
|
||||
/**
|
||||
* Holds the targets an EventBridge rule carried before the update in flight reconciled them,
|
||||
* with the rule name, bus and region needed to address them again, so a failed stack update can
|
||||
|
||||
+252
-13
@@ -10,6 +10,7 @@ import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.services.cloudformation.model.StackResource;
|
||||
import io.floci.aws.services.elbv2.ElbV2HealthChecker;
|
||||
import io.floci.aws.services.elbv2.ElbV2Service;
|
||||
import io.floci.aws.services.elbv2.ElbV2Service.ListenerCertificate;
|
||||
import io.floci.aws.services.elbv2.model.Action;
|
||||
import io.floci.aws.services.elbv2.model.AvailabilityZone;
|
||||
import io.floci.aws.services.elbv2.model.Listener;
|
||||
@@ -23,6 +24,7 @@ import jakarta.inject.Inject;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -31,8 +33,9 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* CloudFormation provisioning for the Elastic Load Balancing v2 types,
|
||||
* {@code AWS::ElasticLoadBalancingV2::LoadBalancer}, {@code TargetGroup}, {@code Listener} and
|
||||
* {@code ListenerRule}, moved out of the former CloudFormation monolith's switch.
|
||||
* {@code AWS::ElasticLoadBalancingV2::LoadBalancer}, {@code TargetGroup}, {@code Listener},
|
||||
* {@code ListenerRule} and {@code ListenerCertificate}, the first four moved out of the former
|
||||
* CloudFormation monolith's switch.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
@@ -43,6 +46,14 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
private static final String TARGET_GROUP = "AWS::ElasticLoadBalancingV2::TargetGroup";
|
||||
private static final String LISTENER = "AWS::ElasticLoadBalancingV2::Listener";
|
||||
private static final String LISTENER_RULE = "AWS::ElasticLoadBalancingV2::ListenerRule";
|
||||
private static final String LISTENER_CERTIFICATE = "AWS::ElasticLoadBalancingV2::ListenerCertificate";
|
||||
/**
|
||||
* Each listener certificate physical id's record, a JSON object of physical id to its Region, the
|
||||
* certificates it declares and the ones it added to its listener. A delete removes exactly the
|
||||
* added ones, and an id a replacement displaced keeps its entry until its own removal, once the
|
||||
* update commits or when the replacement is rolled back.
|
||||
*/
|
||||
private static final String LISTENER_CERTIFICATES_ATTR = "__FlociListenerCertificates";
|
||||
/** Prefixes one uses attribute per subnet a load balancer is on, numbered from 1. */
|
||||
private static final String USED_SUBNET_ATTR_PREFIX = CfnRollback.USES_ATTR_PREFIX + "Subnet.";
|
||||
/**
|
||||
@@ -57,6 +68,7 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
private static final CreateOnlyInputs DECLARED_TARGETS = new CreateOnlyInputs(
|
||||
"__FlociTargetGroupTargets", "__FlociTargetGroupTargetsPrior");
|
||||
private static final TypeReference<List<TargetDescription>> TARGET_LIST = new TypeReference<>() { };
|
||||
private static final TypeReference<List<String>> CERTIFICATE_LIST = new TypeReference<>() { };
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
|
||||
private final ElbV2Service elbV2Service;
|
||||
@@ -68,19 +80,21 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
|
||||
@Override
|
||||
public Set<String> resourceTypes() {
|
||||
return Set.of(LOAD_BALANCER, TARGET_GROUP, LISTENER, LISTENER_RULE);
|
||||
return Set.of(LOAD_BALANCER, TARGET_GROUP, LISTENER, LISTENER_RULE, LISTENER_CERTIFICATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provision(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
r.getAttributes().remove(CfnRollback.LOAD_BALANCER_SUBNETS_UPDATE_SNAPSHOT_ATTR);
|
||||
r.getAttributes().remove(CfnRollback.TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR);
|
||||
r.getAttributes().remove(CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR);
|
||||
Map<String, String> attributesBefore = Map.copyOf(r.getAttributes());
|
||||
switch (r.getResourceType()) {
|
||||
case LOAD_BALANCER -> provisionLoadBalancer(r, props, ctx);
|
||||
case TARGET_GROUP -> provisionTargetGroup(r, props, ctx, attributesBefore);
|
||||
case LISTENER -> provisionListener(r, props, ctx);
|
||||
case LISTENER_RULE -> provisionListenerRule(r, props, ctx);
|
||||
case LISTENER_CERTIFICATE -> provisionListenerCertificate(r, props, ctx);
|
||||
default -> throw new IllegalStateException("ElbV2CfnProvisioner cannot handle " + r.getResourceType());
|
||||
}
|
||||
// A provision that left the resource with a new physical id replaced the entity: the
|
||||
@@ -112,6 +126,23 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A listener certificate resource is removed from its record of what it added, which the id
|
||||
* alone does not carry; every other type is deleted by its id.
|
||||
*/
|
||||
@Override
|
||||
public void delete(StackResource resource, String region) {
|
||||
deleteOwnedBy(resource, resource.getResourceType(), resource.getPhysicalId(), region);
|
||||
}
|
||||
|
||||
private void deleteOwnedBy(StackResource resource, String resourceType, String physicalId, String region) {
|
||||
if (LISTENER_CERTIFICATE.equals(resourceType)) {
|
||||
removeListenerCertificates(resource, physicalId, region);
|
||||
} else {
|
||||
delete(resourceType, physicalId, region);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasReplacementUpdate(StackResource resource) {
|
||||
return ReplacementCleanup.hasReplacement(resource);
|
||||
@@ -128,7 +159,8 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
resource.getAttributes().remove(CfnRollback.LOAD_BALANCER_SUBNETS_UPDATE_SNAPSHOT_ATTR);
|
||||
}
|
||||
clearTargetUpdateRecords(resource);
|
||||
return ReplacementCleanup.complete(resource, this::delete);
|
||||
return ReplacementCleanup.complete(resource,
|
||||
(type, physicalId, region) -> deleteOwnedBy(resource, type, physicalId, region));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,20 +172,27 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
|
||||
private static void clearTargetUpdateRecords(StackResource resource) {
|
||||
resource.getAttributes().remove(CfnRollback.TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR);
|
||||
resource.getAttributes().remove(CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR);
|
||||
DECLARED_TARGETS.clearPrior(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the snapshot of a target group update whose own undo did not complete. The engine restores
|
||||
* the previous resource and reports the rollback failure once; with the snapshot, a
|
||||
* ContinueUpdateRollback puts back the registrations the update started from, instead of finding
|
||||
* nothing to undo.
|
||||
* Keeps the snapshot of a target group or listener certificate update whose own undo did not
|
||||
* complete. The engine restores the previous resource and reports the rollback failure once; with
|
||||
* the snapshot, a ContinueUpdateRollback puts back the registrations or certificates the update
|
||||
* started from, instead of finding nothing to undo.
|
||||
*/
|
||||
@Override
|
||||
public void mergeFailedUpdateResourceTracking(StackResource previous, StackResource attempted) {
|
||||
String snapshot = attempted.getAttributes().get(CfnRollback.TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR);
|
||||
if (snapshot != null && attempted.getAttributes().containsKey(CfnRollback.UPDATE_ROLLBACK_FAILURE_ATTR)) {
|
||||
previous.getAttributes().put(CfnRollback.TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR, snapshot);
|
||||
if (!attempted.getAttributes().containsKey(CfnRollback.UPDATE_ROLLBACK_FAILURE_ATTR)) {
|
||||
return;
|
||||
}
|
||||
for (String attr : List.of(CfnRollback.TARGET_GROUP_TARGETS_UPDATE_SNAPSHOT_ATTR,
|
||||
CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR)) {
|
||||
String snapshot = attempted.getAttributes().get(attr);
|
||||
if (snapshot != null) {
|
||||
previous.getAttributes().put(attr, snapshot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +201,8 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
* targets goes back with it, even when deleting the replacement fails. Without a cleanup record, a
|
||||
* load balancer is moved back to the subnets an update took it off, and a target group gets back
|
||||
* the registrations the update changed; otherwise neither has anything to put back: an update that
|
||||
* kept the name changed nothing else, the way the switch did. A listener or rule without a record
|
||||
* kept the name changed nothing else, the way the switch did. A listener certificate resource gets
|
||||
* back the certificates the update changed on its listener. A listener or rule without a record
|
||||
* was modified in place, and putting that back needs a snapshot this provisioner does not keep, so
|
||||
* the engine reports it as not rolled back, as it did for the switch.
|
||||
*/
|
||||
@@ -170,7 +210,8 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
public boolean rollbackUpdate(StackResource resource) {
|
||||
boolean replaced;
|
||||
try {
|
||||
replaced = ReplacementCleanup.rollback(resource, this::delete);
|
||||
replaced = ReplacementCleanup.rollback(resource,
|
||||
(type, physicalId, region) -> deleteOwnedBy(resource, type, physicalId, region));
|
||||
} finally {
|
||||
DECLARED_TARGETS.restorePrior(resource);
|
||||
}
|
||||
@@ -184,6 +225,10 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
restorePriorRegistrations(resource);
|
||||
return true;
|
||||
}
|
||||
if (LISTENER_CERTIFICATE.equals(resource.getResourceType())) {
|
||||
restorePriorCertificates(resource);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -551,6 +596,200 @@ public class ElbV2CfnProvisioner implements CfnResourceProvisioner {
|
||||
r.getAttributes().put("IsDefault", String.valueOf(rule.isDefault()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the template's certificates to the listener's certificate list, which is how a listener
|
||||
* gets certificates beyond its default one. The physical id is {@code <ListenerArn>|<suffix>},
|
||||
* CloudFormation publishing no format for it. Certificates updates in place, see
|
||||
* {@link #changeListenerCertificates}. ListenerArn is create-only: moving the resource to another
|
||||
* listener adds the certificates there under a new physical id, and the ones it added to the
|
||||
* displaced listener are removed once the stack update commits.
|
||||
*
|
||||
* <p>The record kept per physical id holds the stack's Region, the certificates the template
|
||||
* declares, and the ones the resource added: a certificate the listener's list already held when
|
||||
* it was declared was not added by the resource, so neither its removal from the template nor the
|
||||
* resource's delete takes it off the listener.
|
||||
*/
|
||||
private void provisionListenerCertificate(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
String listenerArn = ctx.resolveOptional(props, "ListenerArn");
|
||||
if (listenerArn == null || listenerArn.isBlank()) {
|
||||
throw new AwsException("ValidationError", LISTENER_CERTIFICATE + " requires ListenerArn", 400);
|
||||
}
|
||||
List<String> certificates = List.copyOf(new LinkedHashSet<>(parseCertificates(props, ctx)));
|
||||
if (certificates.isEmpty()) {
|
||||
throw new AwsException("ValidationError", LISTENER_CERTIFICATE + " requires Certificates", 400);
|
||||
}
|
||||
String region = ctx.region();
|
||||
ObjectNode records = certificateRecords(r.getAttributes());
|
||||
String prior = ctx.isUpdate() ? ctx.priorPhysicalId() : null;
|
||||
JsonNode priorRecord = prior == null ? null : records.get(prior);
|
||||
boolean kept = priorRecord != null && listenerArn.equals(certificateListener(prior));
|
||||
List<String> held = heldCertificates(region, listenerArn);
|
||||
List<String> added;
|
||||
if (kept) {
|
||||
r.setPhysicalId(prior);
|
||||
List<String> previous = certificateList(priorRecord.path("declared"));
|
||||
List<String> previouslyAdded = certificateList(priorRecord.path("added"));
|
||||
List<String> add = certificates.stream().filter(arn -> !previous.contains(arn)).toList();
|
||||
List<String> remove = droppedAndAdded(previous, certificates, previouslyAdded);
|
||||
List<String> newlyAdded = add.stream().filter(arn -> !held.contains(arn)).toList();
|
||||
List<String> nextAdded = new ArrayList<>(previouslyAdded);
|
||||
nextAdded.removeAll(remove);
|
||||
nextAdded.addAll(newlyAdded);
|
||||
CfnRollback.guarded(r, ctx, false, () -> { }, () -> restorePriorCertificates(r),
|
||||
() -> changeListenerCertificates(r, region, listenerArn, add, remove, newlyAdded, priorRecord));
|
||||
added = nextAdded;
|
||||
} else {
|
||||
elbV2Service.addListenerCertificates(region, listenerArn, certificates);
|
||||
r.setPhysicalId(listenerArn + "|" + UUID.randomUUID().toString().replace("-", "").substring(0, 12));
|
||||
added = certificates.stream().filter(arn -> !held.contains(arn)).toList();
|
||||
}
|
||||
records.set(r.getPhysicalId(), certificateRecord(region, certificates, added));
|
||||
writeCertificateRecords(r, records);
|
||||
r.getAttributes().put("Id", r.getPhysicalId());
|
||||
}
|
||||
|
||||
/** The certificates {@code previous} declared, {@code declared} no longer does, and the resource added. */
|
||||
private static List<String> droppedAndAdded(List<String> previous, List<String> declared, List<String> added) {
|
||||
return previous.stream().filter(arn -> !declared.contains(arn) && added.contains(arn)).toList();
|
||||
}
|
||||
|
||||
/** The listener's certificate list, the default certificate aside. */
|
||||
private List<String> heldCertificates(String region, String listenerArn) {
|
||||
return elbV2Service.describeListenerCertificates(region, listenerArn).stream()
|
||||
.filter(certificate -> !certificate.isDefault())
|
||||
.map(ListenerCertificate::certificateArn)
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the certificates the template declares and the resource did not, then removes the ones the
|
||||
* resource added that the template no longer declares. AddListenerCertificates checks every
|
||||
* certificate before adding any, so a refused one leaves the listener as it was. Once it has taken
|
||||
* them, what the update changed is saved before the removal, with the record it started from, and
|
||||
* {@link #restorePriorCertificates} puts it back from that.
|
||||
*/
|
||||
private void changeListenerCertificates(StackResource r, String region, String listenerArn, List<String> add,
|
||||
List<String> remove, List<String> newlyAdded, JsonNode priorRecord) {
|
||||
if (add.isEmpty() && remove.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (!add.isEmpty()) {
|
||||
elbV2Service.addListenerCertificates(region, listenerArn, add);
|
||||
}
|
||||
ObjectNode saved = MAPPER.createObjectNode();
|
||||
saved.set("added", MAPPER.valueToTree(newlyAdded));
|
||||
saved.set("removed", MAPPER.valueToTree(remove));
|
||||
saved.set("prior", priorRecord.deepCopy());
|
||||
r.getAttributes().put(CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR, saved.toString());
|
||||
if (!remove.isEmpty()) {
|
||||
elbV2Service.removeListenerCertificates(region, listenerArn, remove);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the certificates the update added and adds back the ones it removed, in the Region the
|
||||
* resource was provisioned in, and the resource's record is the one it had before again. A failed
|
||||
* call propagates, so the engine reports its reason, and the snapshot stays until a put back
|
||||
* succeeds.
|
||||
*/
|
||||
private void restorePriorCertificates(StackResource resource) {
|
||||
JsonNode saved = CfnRollback.updateSnapshot(resource, CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR);
|
||||
String listenerArn = certificateListener(resource.getPhysicalId());
|
||||
if (saved == null || listenerArn == null) {
|
||||
return;
|
||||
}
|
||||
JsonNode prior = saved.path("prior");
|
||||
String region = recordRegion(prior, listenerArn, null);
|
||||
List<String> added = certificateList(saved.path("added"));
|
||||
List<String> removed = certificateList(saved.path("removed"));
|
||||
if (!added.isEmpty()) {
|
||||
elbV2Service.removeListenerCertificates(region, listenerArn, added);
|
||||
}
|
||||
if (!removed.isEmpty()) {
|
||||
elbV2Service.addListenerCertificates(region, listenerArn, removed);
|
||||
}
|
||||
ObjectNode records = certificateRecords(resource.getAttributes());
|
||||
records.set(resource.getPhysicalId(), prior.deepCopy());
|
||||
writeCertificateRecords(resource, records);
|
||||
resource.getAttributes().remove(CfnRollback.LISTENER_CERTIFICATES_UPDATE_SNAPSHOT_ATTR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes from its listener the certificates {@code physicalId} added, in the Region it was
|
||||
* provisioned in, and drops its record. A listener already gone took them with it; an id with no
|
||||
* record names nothing this stack added.
|
||||
*/
|
||||
private void removeListenerCertificates(StackResource resource, String physicalId, String region) {
|
||||
String listenerArn = physicalId == null ? null : certificateListener(physicalId);
|
||||
if (listenerArn == null) {
|
||||
return;
|
||||
}
|
||||
ObjectNode records = certificateRecords(resource.getAttributes());
|
||||
JsonNode record = records.get(physicalId);
|
||||
List<String> added = record == null ? List.of() : certificateList(record.path("added"));
|
||||
if (!added.isEmpty()) {
|
||||
String recordedRegion = recordRegion(record, listenerArn, region);
|
||||
CfnDeletes.safeDelete("listener certificates", physicalId,
|
||||
() -> elbV2Service.removeListenerCertificates(recordedRegion, listenerArn, added),
|
||||
"ListenerNotFound");
|
||||
}
|
||||
records.remove(physicalId);
|
||||
writeCertificateRecords(resource, records);
|
||||
}
|
||||
|
||||
/** The listener a listener certificate physical id names, or null when the id is no such id. */
|
||||
private static String certificateListener(String physicalId) {
|
||||
int bar = physicalId.indexOf('|');
|
||||
if (bar <= 0) {
|
||||
return null;
|
||||
}
|
||||
String listenerArn = physicalId.substring(0, bar);
|
||||
return AwsArnUtils.isArn(listenerArn) ? listenerArn : null;
|
||||
}
|
||||
|
||||
/** The Region a record was provisioned in, else {@code fallback}, else the listener ARN's. */
|
||||
private static String recordRegion(JsonNode record, String listenerArn, String fallback) {
|
||||
String recorded = record == null ? null : record.path("region").asText(null);
|
||||
if (recorded != null) {
|
||||
return recorded;
|
||||
}
|
||||
return fallback != null ? fallback : AwsArnUtils.parse(listenerArn).region();
|
||||
}
|
||||
|
||||
private static ObjectNode certificateRecord(String region, List<String> declared, List<String> added) {
|
||||
ObjectNode record = MAPPER.createObjectNode();
|
||||
record.put("region", region);
|
||||
record.set("declared", MAPPER.valueToTree(declared));
|
||||
record.set("added", MAPPER.valueToTree(added));
|
||||
return record;
|
||||
}
|
||||
|
||||
private static List<String> certificateList(JsonNode node) {
|
||||
return node.isArray() ? MAPPER.convertValue(node, CERTIFICATE_LIST) : List.of();
|
||||
}
|
||||
|
||||
private static ObjectNode certificateRecords(Map<String, String> attributes) {
|
||||
String recorded = attributes.get(LISTENER_CERTIFICATES_ATTR);
|
||||
if (recorded == null) {
|
||||
return MAPPER.createObjectNode();
|
||||
}
|
||||
try {
|
||||
JsonNode parsed = MAPPER.readTree(recorded);
|
||||
return parsed.isObject() ? (ObjectNode) parsed : MAPPER.createObjectNode();
|
||||
} catch (JsonProcessingException e) {
|
||||
LOG.warnv("Ignoring unreadable listener certificates record ({0}): {1}", e.getMessage(), recorded);
|
||||
return MAPPER.createObjectNode();
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeCertificateRecords(StackResource r, ObjectNode records) {
|
||||
if (records.isEmpty()) {
|
||||
r.getAttributes().remove(LISTENER_CERTIFICATES_ATTR);
|
||||
} else {
|
||||
r.getAttributes().put(LISTENER_CERTIFICATES_ATTR, records.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/** The listener the stack points at, or null when it was removed out of band (then create). */
|
||||
private Listener priorListener(ProvisionContext ctx) {
|
||||
try {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"_source": {
|
||||
"generator": "tools/aws/regen_cfn_property_types.py",
|
||||
"schemas": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip",
|
||||
"retrieved": "2026-10-20",
|
||||
"retrieved": "2026-11-14",
|
||||
"note": "make cfn-property-types-verify checks the file against AWS."
|
||||
},
|
||||
"operations": {
|
||||
@@ -91,35 +91,35 @@
|
||||
"AWS::DSQL::Cluster": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"DeletionProtectionEnabled": "Boolean",
|
||||
"Tags": "AWS::DSQL::Cluster.Tags",
|
||||
"Status": "String",
|
||||
"PolicyVersion": "String",
|
||||
"EncryptionDetails": "AWS::DSQL::Cluster.EncryptionDetails",
|
||||
"KmsEncryptionKey": "String",
|
||||
"MultiRegionProperties": "AWS::DSQL::Cluster.MultiRegionProperties",
|
||||
"ResourceArn": "String",
|
||||
"Identifier": "String",
|
||||
"CreationTime": "String",
|
||||
"Status": "String",
|
||||
"VpcEndpointServiceName": "String",
|
||||
"MultiRegionProperties": "AWS::DSQL::Cluster.MultiRegionProperties",
|
||||
"KmsEncryptionKey": "String",
|
||||
"EncryptionDetails": "AWS::DSQL::Cluster.EncryptionDetails",
|
||||
"Endpoint": "String",
|
||||
"VpcEndpoint": "String",
|
||||
"PolicyVersion": "String",
|
||||
"PolicyDocument": "String"
|
||||
"Endpoint": "String",
|
||||
"CreationTime": "String",
|
||||
"PolicyDocument": "String",
|
||||
"DeletionProtectionEnabled": "Boolean",
|
||||
"Tags": "AWS::DSQL::Cluster.Tags"
|
||||
}
|
||||
},
|
||||
"AWS::DSQL::Cluster.EncryptionDetails": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"EncryptionStatus": "String",
|
||||
"EncryptionType": "String",
|
||||
"EncryptionStatus": "String",
|
||||
"KmsKeyArn": "String"
|
||||
}
|
||||
},
|
||||
"AWS::DSQL::Cluster.MultiRegionProperties": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"WitnessRegion": "String",
|
||||
"Clusters": "AWS::DSQL::Cluster.MultiRegionProperties.Clusters"
|
||||
"Clusters": "AWS::DSQL::Cluster.MultiRegionProperties.Clusters",
|
||||
"WitnessRegion": "String"
|
||||
}
|
||||
},
|
||||
"AWS::DSQL::Cluster.MultiRegionProperties.Clusters": {
|
||||
@@ -133,8 +133,8 @@
|
||||
"AWS::DSQL::Cluster/Tag": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"Key": "String",
|
||||
"Value": "String"
|
||||
"Value": "String",
|
||||
"Key": "String"
|
||||
},
|
||||
"required": [
|
||||
"Key",
|
||||
@@ -969,6 +969,7 @@
|
||||
"TaskRoleArn": "String",
|
||||
"IpcMode": "String",
|
||||
"InferenceAccelerators": "AWS::ECS::TaskDefinition.InferenceAccelerators",
|
||||
"TrustedExecutionConfiguration": "AWS::ECS::TaskDefinition/TrustedExecutionConfiguration",
|
||||
"Memory": "String",
|
||||
"PlacementConstraints": "AWS::ECS::TaskDefinition.PlacementConstraints",
|
||||
"Cpu": "String",
|
||||
@@ -1488,6 +1489,16 @@
|
||||
"type": "list",
|
||||
"member": "String"
|
||||
},
|
||||
"AWS::ECS::TaskDefinition/TrustedExecutionConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"IsolationMode": "String",
|
||||
"AttestationPolicy": "String"
|
||||
},
|
||||
"required": [
|
||||
"IsolationMode"
|
||||
]
|
||||
},
|
||||
"AWS::ECS::TaskDefinition/Ulimit": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
@@ -1845,6 +1856,7 @@
|
||||
"SnapStart": "AWS::Lambda::Function/SnapStart",
|
||||
"FileSystemConfigs": "AWS::Lambda::Function.FileSystemConfigs",
|
||||
"FunctionName": "String",
|
||||
"AcceleratorConfig": "AWS::Lambda::Function/AcceleratorConfig",
|
||||
"Runtime": "String",
|
||||
"KmsKeyArn": "String",
|
||||
"PublishToLatestPublished": "Boolean",
|
||||
@@ -1865,6 +1877,7 @@
|
||||
"LoggingConfig": "AWS::Lambda::Function/LoggingConfig",
|
||||
"RecursiveLoop": "AWS::Lambda::Function/RecursiveLoop",
|
||||
"Environment": "AWS::Lambda::Function/Environment",
|
||||
"RuntimeConfig": "AWS::Lambda::Function/RuntimeConfig",
|
||||
"Arn": "String",
|
||||
"EphemeralStorage": "AWS::Lambda::Function/EphemeralStorage",
|
||||
"Architectures": "AWS::Lambda::Function.Architectures"
|
||||
@@ -1890,6 +1903,15 @@
|
||||
"type": "list",
|
||||
"member": "AWS::Lambda::Function/Tag"
|
||||
},
|
||||
"AWS::Lambda::Function/AcceleratorConfig": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"AcceleratorMemorySize": "Integer"
|
||||
},
|
||||
"required": [
|
||||
"AcceleratorMemorySize"
|
||||
]
|
||||
},
|
||||
"AWS::Lambda::Function/CapacityProviderConfig": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
@@ -2005,6 +2027,17 @@
|
||||
"AWS::Lambda::Function/RecursiveLoop": {
|
||||
"type": "string"
|
||||
},
|
||||
"AWS::Lambda::Function/RuntimeConfig": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"RuntimeAlias": "String",
|
||||
"RuntimeArn": "String"
|
||||
},
|
||||
"required": [
|
||||
"RuntimeArn",
|
||||
"RuntimeAlias"
|
||||
]
|
||||
},
|
||||
"AWS::Lambda::Function/RuntimeManagementConfig": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
|
||||
@@ -547,6 +547,9 @@
|
||||
"AWS::ElasticLoadBalancingV2::Listener": [
|
||||
"LoadBalancerArn"
|
||||
],
|
||||
"AWS::ElasticLoadBalancingV2::ListenerCertificate": [
|
||||
"ListenerArn"
|
||||
],
|
||||
"AWS::ElasticLoadBalancingV2::ListenerRule": [
|
||||
"ListenerArn"
|
||||
],
|
||||
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package io.floci.aws.services.cloudformation;
|
||||
|
||||
import io.floci.aws.services.ec2.Ec2Service;
|
||||
import io.floci.aws.testing.CfnStackWaits;
|
||||
import io.floci.aws.testing.CfnTestStack;
|
||||
import io.floci.aws.testing.PartitionCleanup;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.config.EncoderConfig;
|
||||
import io.restassured.http.ContentType;
|
||||
import io.restassured.response.Response;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
import software.amazon.awssdk.services.cloudformation.model.Stack;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.ElasticLoadBalancingV2Client;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.model.Certificate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.floci.aws.testing.CfnStackWaits.output;
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
* {@code AWS::ElasticLoadBalancingV2::ListenerCertificate}, read back through the AWS SDK's
|
||||
* DescribeListenerCertificates: the stack adds the declared certificates to the listener's certificate list beside
|
||||
* its default one, an update adds the ones the template gains and removes the ones it drops under the same physical
|
||||
* id, a failed update puts them back, a resource moved to another listener leaves the first one once the update
|
||||
* commits, and a resource the template drops takes the certificates it added off the listener.
|
||||
*/
|
||||
@QuarkusTest
|
||||
class CloudFormationElbV2ListenerCertificateIntegrationTest {
|
||||
|
||||
private static final String ACM_AUTH =
|
||||
"AWS4-HMAC-SHA256 Credential=test/20260227/us-east-1/acm/aws4_request";
|
||||
|
||||
/** Declared before the stack, so its deletes run after the stack's: a listener still using one refuses it. */
|
||||
@RegisterExtension
|
||||
final PartitionCleanup cleanup = new PartitionCleanup();
|
||||
|
||||
@RegisterExtension
|
||||
final CfnTestStack stack = new CfnTestStack("cfn-listener-certs");
|
||||
|
||||
/**
|
||||
* A certificate the listener's list already held when the template declared it was not added by the
|
||||
* resource, so it stays on the listener when the resource lets go of it.
|
||||
*/
|
||||
@Test
|
||||
void theCertificatesFollowTheTemplateThroughChangeRollbackAndRemoval() {
|
||||
String main = certificate();
|
||||
String first = certificate();
|
||||
String second = certificate();
|
||||
String outside = certificate();
|
||||
|
||||
Stack created = stack.create(template(main, "Https", false, first, second));
|
||||
String listener = output(created, "Https");
|
||||
String extra = output(created, "Extra");
|
||||
assertTrue(extra.startsWith(listener + "|"), extra);
|
||||
assertEquals(Set.of(main), defaults(listener));
|
||||
assertEquals(Set.of(first, second), sni(listener));
|
||||
elb().addListenerCertificates(request -> request.listenerArn(listener)
|
||||
.certificates(Certificate.builder().certificateArn(outside).build()));
|
||||
|
||||
Stack changed = stack.update(template(main, "Https", false, second, outside), "UPDATE_COMPLETE");
|
||||
assertEquals(extra, output(changed, "Extra"));
|
||||
assertEquals(Set.of(second, outside), sni(listener));
|
||||
|
||||
stack.update(template(main, "Https", true, first), "UPDATE_ROLLBACK_COMPLETE");
|
||||
assertEquals(Set.of(second, outside), sni(listener));
|
||||
|
||||
stack.update(template(main, null, false), "UPDATE_COMPLETE");
|
||||
assertEquals(Set.of(outside), sni(listener));
|
||||
assertEquals(Set.of(main), defaults(listener));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aResourceMovedToAnotherListenerLeavesTheFirstOnceTheUpdateCommits() {
|
||||
String main = certificate();
|
||||
String extraCertificate = certificate();
|
||||
|
||||
Stack created = stack.create(template(main, "Https", false, extraCertificate));
|
||||
String https = output(created, "Https");
|
||||
String other = output(created, "Other");
|
||||
assertEquals(Set.of(extraCertificate), sni(https));
|
||||
|
||||
Stack moved = stack.update(template(main, "Other", false, extraCertificate), "UPDATE_COMPLETE");
|
||||
assertTrue(output(moved, "Extra").startsWith(other + "|"), output(moved, "Extra"));
|
||||
assertEquals(Set.of(), sni(https));
|
||||
assertEquals(Set.of(extraCertificate), sni(other));
|
||||
|
||||
stack.update(template(main, "Https", true, extraCertificate), "UPDATE_ROLLBACK_COMPLETE");
|
||||
assertEquals(Set.of(), sni(https));
|
||||
assertEquals(Set.of(extraCertificate), sni(other));
|
||||
}
|
||||
|
||||
private ElasticLoadBalancingV2Client elb() {
|
||||
return stack.client(ElasticLoadBalancingV2Client.builder());
|
||||
}
|
||||
|
||||
private List<Certificate> certificates(String listenerArn) {
|
||||
return elb().describeListenerCertificates(request -> request.listenerArn(listenerArn)).certificates();
|
||||
}
|
||||
|
||||
/** The listener's certificate list, the certificates it serves by SNI. */
|
||||
private Set<String> sni(String listenerArn) {
|
||||
return certificates(listenerArn).stream().filter(certificate -> !Boolean.TRUE.equals(certificate.isDefault()))
|
||||
.map(Certificate::certificateArn).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private Set<String> defaults(String listenerArn) {
|
||||
return certificates(listenerArn).stream().filter(certificate -> Boolean.TRUE.equals(certificate.isDefault()))
|
||||
.map(Certificate::certificateArn).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/** An ACM certificate, deleted after the test. */
|
||||
private String certificate() {
|
||||
String arn = acm("RequestCertificate", "{\"DomainName\": \"cfn-certs-" + Long.toString(System.nanoTime(), 36)
|
||||
+ ".example.com\", \"ValidationMethod\": \"DNS\"}").then().statusCode(200).extract().path("CertificateArn");
|
||||
cleanup.register(() -> acm("DeleteCertificate", "{\"CertificateArn\": \"" + arn + "\"}").then().statusCode(200));
|
||||
return arn;
|
||||
}
|
||||
|
||||
private static Response acm(String action, String body) {
|
||||
return given().header("Authorization", ACM_AUTH)
|
||||
.header("X-Amz-Target", "CertificateManager." + action)
|
||||
.contentType("application/x-amz-json-1.1")
|
||||
.config(RestAssured.config().encoderConfig(EncoderConfig.encoderConfig()
|
||||
.encodeContentTypeAs("application/x-amz-json-1.1", ContentType.TEXT)))
|
||||
.body(body)
|
||||
.when().post("/");
|
||||
}
|
||||
|
||||
/**
|
||||
* A load balancer with two HTTPS listeners whose default certificate is {@code main}, and an {@code Extra}
|
||||
* listener certificate resource on the listener {@code on} names, declaring {@code certificates}, or none when
|
||||
* {@code on} is null; with a resource that fails after it when {@code laterFails}.
|
||||
*/
|
||||
private static String template(String main, String on, boolean laterFails, String... certificates) {
|
||||
String extra = on == null ? "" : """
|
||||
,
|
||||
"Extra": {"Type": "AWS::ElasticLoadBalancingV2::ListenerCertificate", "Properties": {
|
||||
"ListenerArn": {"Ref": "%s"}, "Certificates": [%s]}}%s""".formatted(on,
|
||||
Arrays.stream(certificates).map(arn -> "{\"CertificateArn\": \"" + arn + "\"}")
|
||||
.collect(Collectors.joining(", ")),
|
||||
laterFails ? CfnStackWaits.failingResourceAfter("Extra") : "");
|
||||
String extraOutput = on == null ? "" : ", \"Extra\": {\"Value\": {\"Ref\": \"Extra\"}}";
|
||||
return """
|
||||
{"Resources": {
|
||||
"Alb": {"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties": {
|
||||
"Subnets": ["%s", "%s"]}},
|
||||
"Https": %s,
|
||||
"Other": %s%s
|
||||
}, "Outputs": {"Https": {"Value": {"Ref": "Https"}}, "Other": {"Value": {"Ref": "Other"}}%s}}
|
||||
""".formatted(Ec2Service.defaultSubnetId("us-east-1", "a"), Ec2Service.defaultSubnetId("us-east-1", "b"),
|
||||
listener(443, main), listener(8443, main), extra, extraOutput);
|
||||
}
|
||||
|
||||
private static String listener(int port, String certificate) {
|
||||
return """
|
||||
{"Type": "AWS::ElasticLoadBalancingV2::Listener", "Properties": {
|
||||
"LoadBalancerArn": {"Ref": "Alb"}, "Protocol": "HTTPS", "Port": %d,
|
||||
"Certificates": [{"CertificateArn": "%s"}],
|
||||
"DefaultActions": [{"Type": "fixed-response", "FixedResponseConfig": {"StatusCode": "200"}}]}}"""
|
||||
.formatted(port, certificate);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -204,10 +204,10 @@ class ElbV2CfnProvisionerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void declaresTheFourTypes() {
|
||||
void declaresTheFiveTypes() {
|
||||
assertEquals(Set.of("AWS::ElasticLoadBalancingV2::LoadBalancer", "AWS::ElasticLoadBalancingV2::TargetGroup",
|
||||
"AWS::ElasticLoadBalancingV2::Listener", "AWS::ElasticLoadBalancingV2::ListenerRule"),
|
||||
provisioner.resourceTypes());
|
||||
"AWS::ElasticLoadBalancingV2::Listener", "AWS::ElasticLoadBalancingV2::ListenerRule",
|
||||
"AWS::ElasticLoadBalancingV2::ListenerCertificate"), provisioner.resourceTypes());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -100,7 +100,7 @@ AWS::ECS::CapacityProvider AutoScalingGroupProvider,ClusterName,ManagedInstance
|
||||
AWS::ECS::Cluster Arn CapacityProviders,ClusterName,ClusterSettings,Configuration,DefaultCapacityProviderStrategy,ServiceConnectDefaults,Tags
|
||||
AWS::ECS::ClusterCapacityProviderAssociations CapacityProviders,Cluster,DefaultCapacityProviderStrategy
|
||||
AWS::ECS::Service Name,ServiceArn AvailabilityZoneRebalancing,CapacityProviderStrategy,Cluster,DeploymentConfiguration,DeploymentController,DesiredCount,EnableECSManagedTags,EnableExecuteCommand,ForceNewDeployment,GatewayConnectors,HealthCheckGracePeriodSeconds,LaunchType,LoadBalancers,Monitoring,NetworkConfiguration,PlacementConstraints,PlacementStrategies,PlatformVersion,PropagateTags,Role,SchedulingStrategy,ServiceConnectConfiguration,ServiceName,ServiceRegistries,Tags,TaskDefinition,VolumeConfigurations,VpcLatticeConfigurations
|
||||
AWS::ECS::TaskDefinition TaskDefinitionArn ContainerDefinitions,Cpu,EnableFaultInjection,EphemeralStorage,ExecutionRoleArn,Family,IpcMode,Memory,NetworkMode,PidMode,PlacementConstraints,ProxyConfiguration,RequiresCompatibilities,RuntimePlatform,Tags,TaskRoleArn,Volumes
|
||||
AWS::ECS::TaskDefinition TaskDefinitionArn ContainerDefinitions,Cpu,EnableFaultInjection,EphemeralStorage,ExecutionRoleArn,Family,IpcMode,Memory,NetworkMode,PidMode,PlacementConstraints,ProxyConfiguration,RequiresCompatibilities,RuntimePlatform,Tags,TaskRoleArn,TrustedExecutionConfiguration,Volumes
|
||||
AWS::EFS::AccessPoint AccessPointId,Arn AccessPointTags,ClientToken,FileSystemId,PosixUser,RootDirectory
|
||||
AWS::EFS::FileSystem Arn,FileSystemId AvailabilityZoneName,BackupPolicy,BypassPolicyLockoutSafetyCheck,Encrypted,FileSystemPolicy,FileSystemProtection,FileSystemTags,KmsKeyId,LifecyclePolicies,PerformanceMode,ProvisionedThroughputInMibps,ReplicationConfiguration,ThroughputMode
|
||||
AWS::EFS::MountTarget Id FileSystemId,IpAddress,IpAddressType,Ipv6Address,SecurityGroups,SubnetId
|
||||
@@ -112,6 +112,7 @@ AWS::ElastiCache::SubnetGroup CacheSubnetGroupName,Description,SubnetIds,Tags
|
||||
AWS::ElastiCache::User Arn,Status AccessString,AuthenticationMode,Engine,NoPasswordRequired,Passwords,Tags,UserId,UserName
|
||||
AWS::ElastiCache::UserGroup Arn,Status Engine,Tags,UserGroupId,UserIds
|
||||
AWS::ElasticLoadBalancingV2::Listener ListenerArn AlpnPolicy,Certificates,DefaultActions,ListenerAttributes,LoadBalancerArn,MutualAuthentication,Port,Protocol,SslPolicy,Tags
|
||||
AWS::ElasticLoadBalancingV2::ListenerCertificate Id Certificates,ListenerArn
|
||||
AWS::ElasticLoadBalancingV2::ListenerRule IsDefault,RuleArn Actions,Conditions,ListenerArn,Priority,Tags,Transforms
|
||||
AWS::ElasticLoadBalancingV2::LoadBalancer CanonicalHostedZoneID,DNSName,LoadBalancerArn,LoadBalancerFullName,LoadBalancerName EnableCapacityReservationProvisionStabilize,EnablePrefixForIpv6SourceNat,EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic,IpAddressType,Ipv4IpamPoolId,LoadBalancerAttributes,MinimumLoadBalancerCapacity,Name,Scheme,SecurityGroups,SubnetMappings,Subnets,Tags,Type
|
||||
AWS::ElasticLoadBalancingV2::TargetGroup LoadBalancerArns,TargetGroupArn,TargetGroupFullName,TargetGroupName HealthCheckEnabled,HealthCheckIntervalSeconds,HealthCheckPath,HealthCheckPort,HealthCheckProtocol,HealthCheckTimeoutSeconds,HealthyThresholdCount,IpAddressType,Matcher,Name,Port,Protocol,ProtocolVersion,Tags,TargetControlPort,TargetGroupAttributes,TargetType,Targets,UnhealthyThresholdCount,VpcId
|
||||
@@ -142,7 +143,7 @@ AWS::Lambda::Alias AliasArn Description,FunctionName,FunctionVersion,Name,Provis
|
||||
AWS::Lambda::CodeSigningConfig CodeSigningConfigArn,CodeSigningConfigId AllowedPublishers,CodeSigningPolicies,Description,Tags
|
||||
AWS::Lambda::EventInvokeConfig DestinationConfig,FunctionName,MaximumEventAgeInSeconds,MaximumRetryAttempts,Qualifier
|
||||
AWS::Lambda::EventSourceMapping EventSourceMappingArn,Id AmazonManagedKafkaEventSourceConfig,BatchSize,BisectBatchOnFunctionError,DestinationConfig,DocumentDBEventSourceConfig,Enabled,EventSourceArn,FilterCriteria,FunctionName,FunctionResponseTypes,KmsKeyArn,LoggingConfig,MaximumBatchingWindowInSeconds,MaximumRecordAgeInSeconds,MaximumRetryAttempts,MetricsConfig,ParallelizationFactor,ProvisionedPollerConfig,Queues,ScalingConfig,SelfManagedEventSource,SelfManagedKafkaEventSourceConfig,SourceAccessConfigurations,StartingPosition,StartingPositionTimestamp,Tags,Topics,TumblingWindowInSeconds
|
||||
AWS::Lambda::Function Arn,SnapStartResponse Architectures,CapacityProviderConfig,Code,CodeSigningConfigArn,DeadLetterConfig,Description,DurableConfig,Environment,EphemeralStorage,FileSystemConfigs,FunctionName,FunctionScalingConfig,Handler,ImageConfig,KmsKeyArn,Layers,LoggingConfig,MemorySize,PackageType,PublishToLatestPublished,RecursiveLoop,ReservedConcurrentExecutions,Role,Runtime,RuntimeManagementConfig,SnapStart,Tags,TenancyConfig,Timeout,TracingConfig,VpcConfig
|
||||
AWS::Lambda::Function Arn,SnapStartResponse AcceleratorConfig,Architectures,CapacityProviderConfig,Code,CodeSigningConfigArn,DeadLetterConfig,Description,DurableConfig,Environment,EphemeralStorage,FileSystemConfigs,FunctionName,FunctionScalingConfig,Handler,ImageConfig,KmsKeyArn,Layers,LoggingConfig,MemorySize,PackageType,PublishToLatestPublished,RecursiveLoop,ReservedConcurrentExecutions,Role,Runtime,RuntimeConfig,RuntimeManagementConfig,SnapStart,Tags,TenancyConfig,Timeout,TracingConfig,VpcConfig
|
||||
AWS::Lambda::LayerVersion LayerVersionArn CompatibleArchitectures,CompatibleRuntimes,Content,Description,LayerName,LicenseInfo
|
||||
AWS::Lambda::MicrovmImage CreatedAt,ImageArn,LatestActiveImageVersion,LatestFailedImageVersion,State,UpdatedAt AdditionalOsCapabilities,BaseImageArn,BaseImageVersion,BuildRoleArn,CodeArtifact,CpuConfigurations,Description,EgressNetworkConnectors,EnvironmentVariables,Hooks,KmsKeyIdentifier,Logging,Name,Resources,Tags
|
||||
AWS::Lambda::NetworkConnector Arn,LatestVersion,LatestVersionArn,State Configuration,Name,OperatorRole,Tags
|
||||
|
||||
|
@@ -113,6 +113,7 @@ AWS::ElastiCache::SubnetGroup ElastiCacheCfnProvisioner
|
||||
AWS::ElastiCache::User ElastiCacheCfnProvisioner
|
||||
AWS::ElastiCache::UserGroup ElastiCacheCfnProvisioner
|
||||
AWS::ElasticLoadBalancingV2::Listener ElbV2CfnProvisioner
|
||||
AWS::ElasticLoadBalancingV2::ListenerCertificate ElbV2CfnProvisioner
|
||||
AWS::ElasticLoadBalancingV2::ListenerRule ElbV2CfnProvisioner
|
||||
AWS::ElasticLoadBalancingV2::LoadBalancer ElbV2CfnProvisioner
|
||||
AWS::ElasticLoadBalancingV2::TargetGroup ElbV2CfnProvisioner
|
||||
|
||||
|
@@ -288,6 +288,7 @@ AWS::ECS::TaskDefinition PidMode accepted and ignored
|
||||
AWS::ECS::TaskDefinition PlacementConstraints accepted and ignored
|
||||
AWS::ECS::TaskDefinition ProxyConfiguration accepted and ignored
|
||||
AWS::ECS::TaskDefinition Tags accepted and ignored
|
||||
AWS::ECS::TaskDefinition TrustedExecutionConfiguration accepted and ignored
|
||||
AWS::ECS::TaskDefinition Volumes accepted and ignored
|
||||
AWS::EFS::FileSystem BypassPolicyLockoutSafetyCheck Floci's EFS service applies a file system policy without a lockout check, so there is nothing to bypass
|
||||
AWS::EFS::FileSystem ReplicationConfiguration not modeled: Floci has no EFS replication, so the destination file system is not created
|
||||
@@ -404,11 +405,13 @@ AWS::Lambda::EventSourceMapping Queues accepted and ignored
|
||||
AWS::Lambda::EventSourceMapping SelfManagedKafkaEventSourceConfig accepted and ignored
|
||||
AWS::Lambda::EventSourceMapping Tags accepted and ignored
|
||||
AWS::Lambda::EventSourceMapping TumblingWindowInSeconds documented as ignored (docs/services/cloudformation.md, Lambda)
|
||||
AWS::Lambda::Function AcceleratorConfig accepted and ignored
|
||||
AWS::Lambda::Function CapacityProviderConfig accepted and ignored
|
||||
AWS::Lambda::Function FunctionScalingConfig accepted and ignored
|
||||
AWS::Lambda::Function KmsKeyArn accepted and ignored
|
||||
AWS::Lambda::Function PublishToLatestPublished accepted and ignored
|
||||
AWS::Lambda::Function RecursiveLoop accepted and ignored
|
||||
AWS::Lambda::Function RuntimeConfig accepted and ignored
|
||||
AWS::Lambda::Function RuntimeManagementConfig accepted and ignored
|
||||
AWS::Lambda::Function SnapStart accepted and ignored
|
||||
AWS::Lambda::Function TenancyConfig accepted and ignored
|
||||
|
||||
|
@@ -108,7 +108,7 @@ type_order:
|
||||
RouteTable, SubnetRouteTableAssociation, Route, NatGateway, EIP, Instance, LaunchTemplate,
|
||||
VPCGatewayAttachment, VPCEndpoint, NetworkAcl, NetworkAclEntry, SubnetNetworkAclAssociation,
|
||||
FlowLog]
|
||||
AWS::ElasticLoadBalancingV2: [LoadBalancer, TargetGroup, Listener, ListenerRule]
|
||||
AWS::ElasticLoadBalancingV2: [LoadBalancer, TargetGroup, Listener, ListenerRule, ListenerCertificate]
|
||||
AWS::ApplicationAutoScaling: [ScalableTarget, ScalingPolicy]
|
||||
AWS::AutoScaling: [LaunchConfiguration, AutoScalingGroup, LifecycleHook]
|
||||
AWS::Route53: [HostedZone, RecordSet, RecordSetGroup, HealthCheck]
|
||||
@@ -199,6 +199,7 @@ notes:
|
||||
AWS::EFS::FileSystem: 'metadata only, there is no NFS data plane'
|
||||
AWS::EFS::MountTarget: '`SecurityGroups` update in place, every other property replaces'
|
||||
AWS::EFS::AccessPoint: '`AccessPointTags` update in place, every other property replaces'
|
||||
AWS::ElasticLoadBalancingV2::ListenerCertificate: '`Certificates` update in place, a `ListenerArn` change replaces it'
|
||||
AWS::EC2::VPC: '`Tags` update in place, keeping tags added outside the stack; deleted on stack teardown; a VPC with dependents outside the stack, including anything still holding a network interface in its subnets (an instance that is not terminated, a NAT gateway that is not deleted or failed, a standalone interface, an interface endpoint), fails the delete with `DependencyViolation`, as on AWS'
|
||||
AWS::EC2::SecurityGroup: 'inline `SecurityGroupIngress`/`SecurityGroupEgress` supported; `Tags` update in place, keeping tags added outside the stack; a failed stack update puts the rules and tags of a group it changed in place back'
|
||||
AWS::EC2::Instance: '`Tags` update in place, keeping tags added outside the stack'
|
||||
|
||||
Reference in new issue
Block a user