mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
feat(cloudformation): provision SES receipt rules (#7040)
This commit is contained in:
1 parent
83ec0b82c3
commit
f48c3a9c01
8 files changed
+795
-1
No files matched your search
@@ -173,7 +173,7 @@ cross-resource references.
|
||||
| S3 Vectors | `VectorBucket`, `Index` |
|
||||
| SQS | `Queue`, `QueuePolicy` (accepted; policy not enforced) |
|
||||
| SNS | `Topic`, `Subscription`, `TopicPolicy` |
|
||||
| SES | `EmailIdentity` (BYODKIM is not supported by this resource; Easy DKIM DNS attributes use the shared emulator signing zone `dkim.amazonses.com` rather than AWS's region- and identity-specific zone assignment) |
|
||||
| SES | `EmailIdentity` (BYODKIM is not supported by this resource; Easy DKIM DNS attributes use the shared emulator signing zone `dkim.amazonses.com` rather than AWS's region- and identity-specific zone assignment), `ReceiptRule` (stored in an existing SES receipt rule set; Ref and RuleName return the rule name; management plane only, with no inbound mail delivery) |
|
||||
| DynamoDB | `Table` (`TimeToLiveSpecification` applied on create and update; to rename an enabled TTL attribute, disable TTL in one update and enable the new attribute in a later one), `GlobalTable` |
|
||||
| Lambda | `Function` (Zip via S3/inline `ZipFile`, Image, and the `hot-reload` bind-mount bucket), `LayerVersion`, `EventSourceMapping` (SQS, Kinesis, DynamoDB Streams; `ParallelizationFactor` and `TumblingWindowInSeconds` are ignored), `Version`, `Alias` (also what SAM's `AutoPublishAlias` expands into), `Permission`, `EventInvokeConfig` (also what a SAM function's `EventInvokeConfig` expands into), `MicrovmImage`, `NetworkConnector`, `Url`, `WebFunction` (control plane only; the endpoint domain does not serve requests yet), `WebFunctionEndpoint`, `WebFunctionRevision` (every property is createOnly, so a change mints a new revision). Inline `ZipFile` packages include the `cfn-response` (Node.js) / `cfnresponse` (Python) module AWS injects for that code path, so Solutions-style custom-resource handlers work. |
|
||||
| IAM | `Role`, `User` (template `LoginProfile` and `PermissionsBoundary` are ignored; an API-created login profile is removed on delete), `AccessKey`, `Policy`, `ManagedPolicy`, `InstanceProfile` |
|
||||
|
||||
@@ -548,6 +548,20 @@ An empty body is read as an object without members. A body that is not a JSON ob
|
||||
|
||||
The body shapes are vendored in `src/main/resources/aws/sesv2-request-shapes.json`, generated by `tools/aws/regen_sesv2_shapes.py` from the botocore release pinned in `tools/aws/requirements.txt`.
|
||||
|
||||
### CloudFormation receipt rules
|
||||
|
||||
`AWS::SES::ReceiptRule` provisions a rule in an existing SES receipt rule set. Create the rule set
|
||||
through the SES API first. `Ref` and `Fn::GetAtt RuleName` return the stored rule's name. A missing
|
||||
`Rule.Name` gets a generated name that remains stable across updates.
|
||||
|
||||
Rule contents and `After` update in place. Changing the rule name or `RuleSetName` creates a
|
||||
replacement; the old rule is deleted after the stack update commits unless `UpdateReplacePolicy`
|
||||
is `Retain`. Failed updates restore the previous contents and ordering, and stack deletion removes
|
||||
the managed rule. Actions use the same local-target validation as the SES API.
|
||||
|
||||
This is management-plane support: stored rules do not deliver or process inbound mail.
|
||||
See the [AWS receipt-rule resource reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-ses-receiptrule.html).
|
||||
|
||||
### IAM enforcement
|
||||
|
||||
With `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true`, every SES v2 operation is authorized as the `ses:`
|
||||
|
||||
+370
@@ -0,0 +1,370 @@
|
||||
package io.github.hectorvent.floci.services.cloudformation.provisioners;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.services.cloudformation.model.StackResource;
|
||||
import io.github.hectorvent.floci.services.ses.SesIdentityService;
|
||||
import io.github.hectorvent.floci.services.ses.SesReceiptRuleService;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptAction;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptRule;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@ApplicationScoped
|
||||
public class SesReceiptRuleCfnProvisioner implements CfnResourceProvisioner {
|
||||
private static final String TYPE = "AWS::SES::ReceiptRule";
|
||||
private static final String SET_ATTR = "__FlociSesReceiptRuleSet";
|
||||
private static final String MODE_ATTR = "__FlociSesReceiptRuleNameMode";
|
||||
private static final String UPDATE_ATTR = "__FlociSesReceiptRuleUpdate";
|
||||
private static final String CLEANUP_ATTR = "__FlociSesReceiptRuleCleanup";
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
private final SesReceiptRuleService rules;
|
||||
private final SesIdentityService identities;
|
||||
|
||||
@Inject
|
||||
public SesReceiptRuleCfnProvisioner(SesReceiptRuleService rules, SesIdentityService identities) {
|
||||
this.rules = rules;
|
||||
this.identities = identities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> resourceTypes() {
|
||||
return Set.of(TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provision(StackResource resource, JsonNode properties, ProvisionContext ctx) {
|
||||
// The dispatcher reconstructs resource metadata without its prior UPDATE_FAILED status.
|
||||
if (resource.getAttributes().containsKey(UPDATE_ATTR)) {
|
||||
rollbackUpdate(resource);
|
||||
}
|
||||
JsonNode props = ctx.engine().resolveNodeOmittingNoValue(properties);
|
||||
if (props == null || !props.isObject()) {
|
||||
throw invalid("Properties must be an object.");
|
||||
}
|
||||
validateKeys(props, Set.of("RuleSetName", "Rule", "After"));
|
||||
String ruleSet = text(props, "RuleSetName", true);
|
||||
String after = text(props, "After", false);
|
||||
JsonNode ruleNode = props.path("Rule");
|
||||
if (!ruleNode.isObject()) {
|
||||
throw invalid("Rule must be an object.");
|
||||
}
|
||||
ReceiptRule rule = parseRule(ruleNode);
|
||||
String explicitName = rule.getName();
|
||||
Identity prior = ctx.isUpdate() && resource.getAttributes().containsKey(SET_ATTR)
|
||||
? identity(resource) : null;
|
||||
if (ctx.isUpdate() && prior == null
|
||||
&& !CfnResourceDispatcher.isStub(ctx.priorPhysicalId(), resource.getAttributes())) {
|
||||
throw new IllegalStateException("Missing SES receipt rule identity for " + resource.getLogicalId());
|
||||
}
|
||||
String name = explicitName != null ? explicitName
|
||||
: prior != null && "generated".equals(resource.getAttributes().get(MODE_ATTR)) ? prior.name()
|
||||
: ctx.generatePhysicalName(resource.getLogicalId(), 64, false);
|
||||
rule.setName(name);
|
||||
Identity target = new Identity(ruleSet, name);
|
||||
boolean replacement = prior == null || !prior.equals(target);
|
||||
deletePending(resource);
|
||||
ObjectNode snapshot = null;
|
||||
if (ctx.isUpdate()) {
|
||||
snapshot = prior == null ? MAPPER.createObjectNode() : address(prior, ctx.region());
|
||||
snapshot.put("physicalId", resource.getPhysicalId());
|
||||
snapshot.put("region", ctx.region());
|
||||
snapshot.put("replacement", replacement);
|
||||
snapshot.set("attributes", MAPPER.valueToTree(resource.getAttributes()));
|
||||
snapshot.set("target", address(target, ctx.region()));
|
||||
}
|
||||
if (!replacement) {
|
||||
ReceiptRule previous = rules.describeReceiptRule(ruleSet, name, ctx.region()).copy();
|
||||
snapshot.set("rule", MAPPER.valueToTree(previous));
|
||||
snapshot.put("after", previousRule(prior, ctx.region()));
|
||||
resource.getAttributes().put(UPDATE_ATTR, snapshot.toString());
|
||||
rules.updateReceiptRule(ruleSet, rule, ctx.region(),
|
||||
sender -> identities.isVerifiedSender(sender, ctx.region()));
|
||||
rules.setReceiptRulePosition(ruleSet, name, after, ctx.region());
|
||||
} else {
|
||||
rules.createReceiptRule(ruleSet, rule, after, ctx.region(),
|
||||
sender -> identities.isVerifiedSender(sender, ctx.region()));
|
||||
if (snapshot != null) {
|
||||
resource.getAttributes().put(UPDATE_ATTR, snapshot.toString());
|
||||
if (prior != null) {
|
||||
setCleanup(resource, prior, ctx.region(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
setIdentity(resource, target);
|
||||
resource.getAttributes().put(MODE_ATTR, explicitName == null ? "generated" : "explicit");
|
||||
resource.getAttributes().put(CfnRollback.ROLLBACK_OWNED_ATTR, "true");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(StackResource resource, String region) {
|
||||
deletePending(resource);
|
||||
if (resource.getAttributes().containsKey(SET_ATTR)) {
|
||||
delete(identity(resource), region);
|
||||
}
|
||||
resource.getAttributes().remove(UPDATE_ATTR);
|
||||
}
|
||||
|
||||
private record Identity(String set, String name) {}
|
||||
|
||||
private static Identity identity(StackResource resource) {
|
||||
return new Identity(resource.getAttributes().get(SET_ATTR), resource.getPhysicalId());
|
||||
}
|
||||
|
||||
private static Identity identity(JsonNode address) {
|
||||
return new Identity(address.path("set").asText(), address.path("name").asText());
|
||||
}
|
||||
|
||||
private static ObjectNode address(Identity identity, String region) {
|
||||
return MAPPER.createObjectNode().put("set", identity.set()).put("name", identity.name())
|
||||
.put("region", region);
|
||||
}
|
||||
|
||||
private static void setIdentity(StackResource resource, Identity identity) {
|
||||
resource.setPhysicalId(identity.name());
|
||||
resource.getAttributes().put("RuleName", identity.name());
|
||||
resource.getAttributes().put(SET_ATTR, identity.set());
|
||||
}
|
||||
|
||||
private String previousRule(Identity identity, String region) {
|
||||
List<ReceiptRule> stored = rules.describeReceiptRuleSet(identity.set(), region).getRules();
|
||||
String previous = null;
|
||||
for (ReceiptRule candidate : stored) {
|
||||
if (identity.name().equals(candidate.getName())) {
|
||||
return previous;
|
||||
}
|
||||
previous = candidate.getName();
|
||||
}
|
||||
throw new IllegalStateException("SES receipt rule disappeared: " + identity.name());
|
||||
}
|
||||
|
||||
private void delete(Identity identity, String region) {
|
||||
CfnDeletes.safeDelete("SES receipt rule", identity.name(),
|
||||
() -> rules.deleteReceiptRule(identity.set(), identity.name(), region), "RuleSetDoesNotExist");
|
||||
}
|
||||
|
||||
private static void setCleanup(StackResource resource, Identity identity, String region, boolean retainable) {
|
||||
resource.getAttributes().put(CLEANUP_ATTR,
|
||||
address(identity, region).put("retainable", retainable).put("attempts", 0).toString());
|
||||
}
|
||||
|
||||
private void deletePending(StackResource resource) {
|
||||
ObjectNode pending = read(resource, CLEANUP_ATTR);
|
||||
if (pending != null) {
|
||||
if (!retained(resource, pending)) {
|
||||
delete(identity(pending), pending.path("region").asText());
|
||||
}
|
||||
resource.getAttributes().remove(CLEANUP_ATTR);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean retained(StackResource resource, JsonNode pending) {
|
||||
return pending.path("retainable").asBoolean() && "Retain".equals(resource.getUpdateReplacePolicy());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rollbackUpdate(StackResource resource) {
|
||||
ObjectNode snapshot = read(resource, UPDATE_ATTR);
|
||||
if (snapshot == null) {
|
||||
return false;
|
||||
}
|
||||
String region = snapshot.path("region").asText();
|
||||
if (snapshot.path("replacement").asBoolean()) {
|
||||
// Ref is name-only, so both addresses must survive even when their names are equal.
|
||||
if (!snapshot.path("rollbackStarted").asBoolean()) {
|
||||
setCleanup(resource, identity(snapshot.path("target")), region, false);
|
||||
snapshot.put("rollbackStarted", true);
|
||||
resource.getAttributes().put(UPDATE_ATTR, snapshot.toString());
|
||||
}
|
||||
resource.setPhysicalId(snapshot.path("physicalId").asText());
|
||||
if (snapshot.has("set")) {
|
||||
setIdentity(resource, identity(snapshot));
|
||||
} else {
|
||||
resource.getAttributes().remove(SET_ATTR);
|
||||
}
|
||||
deletePending(resource);
|
||||
} else {
|
||||
ReceiptRule previous;
|
||||
try {
|
||||
previous = MAPPER.treeToValue(snapshot.path("rule"), ReceiptRule.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Invalid SES receipt rule snapshot", e);
|
||||
}
|
||||
rules.updateReceiptRule(snapshot.path("set").asText(), previous, region,
|
||||
sender -> identities.isVerifiedSender(sender, region));
|
||||
rules.setReceiptRulePosition(snapshot.path("set").asText(), previous.getName(),
|
||||
snapshot.path("after").asText(null), region);
|
||||
}
|
||||
resource.getAttributes().clear();
|
||||
snapshot.path("attributes").fields().forEachRemaining(e ->
|
||||
resource.getAttributes().put(e.getKey(), e.getValue().asText()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainsFailedUpdateState(StackResource resource) {
|
||||
return resource.getAttributes().containsKey(UPDATE_ATTR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresUpdateRecovery(StackResource resource) {
|
||||
return "UPDATE_FAILED".equals(resource.getStatus()) && retainsFailedUpdateState(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasReplacementUpdate(StackResource resource) {
|
||||
return resource.getAttributes().containsKey(CLEANUP_ATTR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateCleanupPhysicalId(StackResource resource) {
|
||||
ObjectNode pending = read(resource, CLEANUP_ATTR);
|
||||
return pending == null || retained(resource, pending) ? null : pending.path("name").asText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateCleanupResult completeUpdate(StackResource resource) {
|
||||
if (requiresUpdateRecovery(resource)) {
|
||||
return new UpdateCleanupResult(true, false, resource.getPhysicalId(), 0, "Rule rollback is pending.");
|
||||
}
|
||||
return completeDeleteCleanup(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateCleanupResult completeDeleteCleanup(StackResource resource) {
|
||||
ObjectNode pending = read(resource, CLEANUP_ATTR);
|
||||
if (pending == null) {
|
||||
return retainsFailedUpdateState(resource) ? new UpdateCleanupResult(true, true, null, 0, null)
|
||||
: UpdateCleanupResult.notApplicable();
|
||||
}
|
||||
String name = pending.path("name").asText();
|
||||
try {
|
||||
deletePending(resource);
|
||||
return new UpdateCleanupResult(true, true, name, 0, null);
|
||||
} catch (RuntimeException failure) {
|
||||
int attempts = pending.path("attempts").asInt() + 1;
|
||||
pending.put("attempts", attempts);
|
||||
resource.getAttributes().put(CLEANUP_ATTR, pending.toString());
|
||||
return new UpdateCleanupResult(true, false, name, attempts, failure.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearUpdate(StackResource resource) {
|
||||
resource.getAttributes().remove(UPDATE_ATTR);
|
||||
}
|
||||
|
||||
private static ObjectNode read(StackResource resource, String key) {
|
||||
String raw = resource.getAttributes().get(key);
|
||||
if (raw == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JsonNode node = MAPPER.readTree(raw);
|
||||
if (node.isObject()) {
|
||||
return (ObjectNode) node;
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Invalid SES receipt rule lifecycle record", e);
|
||||
}
|
||||
throw new IllegalStateException("Invalid SES receipt rule lifecycle record");
|
||||
}
|
||||
|
||||
private static ReceiptRule parseRule(JsonNode node) {
|
||||
validateKeys(node, Set.of("Name", "Enabled", "TlsPolicy", "Recipients", "ScanEnabled", "Actions"));
|
||||
ReceiptRule rule = new ReceiptRule();
|
||||
rule.setName(text(node, "Name", false));
|
||||
rule.setEnabled(bool(node, "Enabled"));
|
||||
rule.setScanEnabled(bool(node, "ScanEnabled"));
|
||||
rule.setTlsPolicy(text(node, "TlsPolicy", false));
|
||||
JsonNode recipients = node.get("Recipients");
|
||||
if (recipients != null && !recipients.isNull()) {
|
||||
if (!recipients.isArray()) {
|
||||
throw invalid("Recipients must be an array of strings.");
|
||||
}
|
||||
for (JsonNode recipient : recipients) {
|
||||
if (!recipient.isTextual()) {
|
||||
throw invalid("Recipients must be an array of strings.");
|
||||
}
|
||||
rule.getRecipients().add(recipient.textValue());
|
||||
}
|
||||
}
|
||||
JsonNode actions = node.get("Actions");
|
||||
if (actions != null && !actions.isNull()) {
|
||||
if (!actions.isArray()) {
|
||||
throw invalid("Actions must be an array.");
|
||||
}
|
||||
List<ReceiptAction> parsed = new ArrayList<>();
|
||||
for (JsonNode action : actions) {
|
||||
if (!action.isObject() || action.size() > 1) {
|
||||
throw invalid("Each action may contain at most one action type.");
|
||||
}
|
||||
if (action.isEmpty()) {
|
||||
parsed.add(new ReceiptAction());
|
||||
continue;
|
||||
}
|
||||
Map.Entry<String, JsonNode> entry = action.fields().next();
|
||||
List<String> fields = ReceiptAction.ACTION_FIELDS.get(entry.getKey());
|
||||
if (fields == null || !entry.getValue().isObject()) {
|
||||
throw invalid("Unsupported receipt action: " + entry.getKey());
|
||||
}
|
||||
ReceiptAction parsedAction = new ReceiptAction(entry.getKey());
|
||||
entry.getValue().fields().forEachRemaining(member -> {
|
||||
if (!fields.contains(member.getKey()) || !member.getValue().isTextual()) {
|
||||
throw invalid("Invalid " + entry.getKey() + " property: " + member.getKey());
|
||||
}
|
||||
parsedAction.getProperties().put(member.getKey(), member.getValue().textValue());
|
||||
});
|
||||
parsed.add(parsedAction);
|
||||
}
|
||||
rule.setActions(parsed);
|
||||
}
|
||||
return rule;
|
||||
}
|
||||
|
||||
private static String text(JsonNode node, String key, boolean required) {
|
||||
JsonNode value = node == null ? null : node.get(key);
|
||||
if (value == null || value.isNull() || value.isMissingNode()) {
|
||||
if (required) {
|
||||
throw invalid(key + " is required.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (!value.isTextual() || value.textValue().isBlank()) {
|
||||
throw invalid(key + " must be a nonempty string.");
|
||||
}
|
||||
return value.textValue();
|
||||
}
|
||||
|
||||
private static boolean bool(JsonNode node, String key) {
|
||||
JsonNode value = node.get(key);
|
||||
if (value == null || value.isNull()) {
|
||||
return false;
|
||||
}
|
||||
if (!value.isBoolean() && !(value.isTextual()
|
||||
&& Set.of("true", "false").contains(value.textValue()))) {
|
||||
throw invalid(key + " must be a boolean.");
|
||||
}
|
||||
return value.asBoolean();
|
||||
}
|
||||
|
||||
private static AwsException invalid(String message) {
|
||||
return new AwsException("ValidationError", message, 400);
|
||||
}
|
||||
|
||||
private static void validateKeys(JsonNode node, Set<String> allowed) {
|
||||
node.fieldNames().forEachRemaining(key -> {
|
||||
if (!allowed.contains(key)) {
|
||||
throw invalid("Unknown property: " + key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+11
@@ -109,6 +109,7 @@ import io.github.hectorvent.floci.services.cloudformation.provisioners.Scheduler
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SecretTargetAttachmentCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SecretsManagerCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SesCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SesReceiptRuleCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SnsCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SqsCfnProvisioner;
|
||||
import io.github.hectorvent.floci.services.cloudformation.provisioners.SsmCfnProvisioner;
|
||||
@@ -162,6 +163,7 @@ import io.github.hectorvent.floci.services.s3vectors.S3VectorsService;
|
||||
import io.github.hectorvent.floci.services.scheduler.SchedulerService;
|
||||
import io.github.hectorvent.floci.services.secretsmanager.SecretsManagerService;
|
||||
import io.github.hectorvent.floci.services.ses.SesIdentityService;
|
||||
import io.github.hectorvent.floci.services.ses.SesReceiptRuleService;
|
||||
import io.github.hectorvent.floci.services.ses.SesService;
|
||||
import io.github.hectorvent.floci.services.sns.SnsService;
|
||||
import io.github.hectorvent.floci.services.sqs.SqsService;
|
||||
@@ -203,6 +205,7 @@ final class CfnProvisionerFixture {
|
||||
private S3VectorsService s3VectorsService;
|
||||
private SnsService snsService;
|
||||
private SesService sesService;
|
||||
private SesReceiptRuleService sesReceiptRuleService;
|
||||
private SesIdentityService sesIdentityService;
|
||||
private DynamoDbService dynamoDbService;
|
||||
private LambdaService lambdaService;
|
||||
@@ -329,6 +332,9 @@ final class CfnProvisionerFixture {
|
||||
if (sesService != null && sesIdentityService != null) {
|
||||
discovered.add(new SesCfnProvisioner(sesService, sesIdentityService));
|
||||
}
|
||||
if (sesReceiptRuleService != null && sesIdentityService != null) {
|
||||
discovered.add(new SesReceiptRuleCfnProvisioner(sesReceiptRuleService, sesIdentityService));
|
||||
}
|
||||
if (dynamoDbService != null) {
|
||||
NativeDynamoDbBackend backend = new NativeDynamoDbBackend(null, null, dynamoDbService, null, null, objectMapper);
|
||||
discovered.add(new DynamoDbCfnProvisioner(new DynamoDbFacade(backend, backend,
|
||||
@@ -555,6 +561,11 @@ final class CfnProvisionerFixture {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder sesReceiptRules(SesReceiptRuleService v) {
|
||||
this.sesReceiptRuleService = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder dynamoDb(DynamoDbService v) {
|
||||
this.dynamoDbService = v;
|
||||
return this;
|
||||
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
package io.github.hectorvent.floci.services.cloudformation;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.services.ses.SesReceiptRuleService;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptRule;
|
||||
import io.github.hectorvent.floci.testing.AwsTestClients;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import jakarta.inject.Inject;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.cloudformation.CloudFormationClient;
|
||||
import software.amazon.awssdk.services.cloudformation.model.CloudFormationException;
|
||||
import software.amazon.awssdk.services.cloudformation.model.Stack;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.awaitility.Awaitility.await;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@QuarkusTest
|
||||
class CloudFormationSesReceiptRuleIntegrationTest {
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
private CloudFormationClient cfn;
|
||||
@Inject
|
||||
SesReceiptRuleService ses;
|
||||
private String stackName;
|
||||
private String ruleSet;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
cfn = AwsTestClients.create(CloudFormationClient.builder(), "test", Region.US_EAST_1);
|
||||
stackName = "cfn-receipt-" + Long.toString(System.nanoTime(), 36);
|
||||
ruleSet = stackName + "-set";
|
||||
ses.createReceiptRuleSet(ruleSet, "us-east-1");
|
||||
ses.createReceiptRuleSet(ruleSet + "-next", "us-east-1");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void cleanUp() {
|
||||
try {
|
||||
cfn.deleteStack(r -> r.stackName(stackName));
|
||||
await().atMost(Duration.ofSeconds(15)).until(() -> {
|
||||
try {
|
||||
return cfn.describeStacks(r -> r.stackName(stackName)).stacks().isEmpty();
|
||||
} catch (CloudFormationException expected) {
|
||||
return expected.statusCode() == 400;
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
ses.deleteReceiptRuleSet(ruleSet, "us-east-1");
|
||||
ses.deleteReceiptRuleSet(ruleSet + "-next", "us-east-1");
|
||||
cfn.close();
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {false, true})
|
||||
void sameNamedRuleInAnotherSetReplacesTheOldEntity(boolean retain) throws Exception {
|
||||
ObjectNode initial = (ObjectNode) mapper.readTree(template("store", true));
|
||||
if (retain) {
|
||||
initial.withObject("/Resources/Rule").put("UpdateReplacePolicy", "Retain");
|
||||
}
|
||||
cfn.createStack(r -> r.stackName(stackName).templateBody(initial.toString()));
|
||||
awaitStatus("CREATE_COMPLETE");
|
||||
ObjectNode updated = (ObjectNode) mapper.readTree(template("store", false));
|
||||
updated.withObject("/Resources/Rule/Properties").put("RuleSetName", ruleSet + "-next");
|
||||
if (retain) {
|
||||
updated.withObject("/Resources/Rule").put("UpdateReplacePolicy", "Retain");
|
||||
}
|
||||
cfn.updateStack(r -> r.stackName(stackName).templateBody(updated.toString()));
|
||||
awaitStatus("UPDATE_COMPLETE");
|
||||
assertFalse(ses.describeReceiptRule(ruleSet + "-next", "store", "us-east-1").isEnabled());
|
||||
if (retain) {
|
||||
assertTrue(ses.describeReceiptRule(ruleSet, "store", "us-east-1").isEnabled());
|
||||
} else {
|
||||
assertEquals("RuleDoesNotExist", assertThrows(AwsException.class,
|
||||
() -> ses.describeReceiptRule(ruleSet, "store", "us-east-1")).getErrorCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void failedPositionChangeRestoresRuleContentsAndOriginalPosition() throws Exception {
|
||||
ReceiptRule anchor = new ReceiptRule();
|
||||
anchor.setName("anchor");
|
||||
ses.createReceiptRule(ruleSet, anchor, null, "us-east-1", sender -> false);
|
||||
ObjectNode initial = (ObjectNode) mapper.readTree(template("store", true));
|
||||
initial.withObject("/Resources/Rule/Properties").put("After", "anchor");
|
||||
cfn.createStack(r -> r.stackName(stackName).templateBody(initial.toString()));
|
||||
awaitStatus("CREATE_COMPLETE");
|
||||
ObjectNode updated = (ObjectNode) mapper.readTree(template("store", false));
|
||||
updated.withObject("/Resources/Rule/Properties").put("After", "missing");
|
||||
cfn.updateStack(r -> r.stackName(stackName).templateBody(updated.toString()));
|
||||
awaitStatus("UPDATE_ROLLBACK_COMPLETE");
|
||||
assertTrue(ses.describeReceiptRule(ruleSet, "store", "us-east-1").isEnabled());
|
||||
assertEquals(List.of("anchor", "store"), ses.describeReceiptRuleSet(ruleSet, "us-east-1")
|
||||
.getRules().stream().map(ReceiptRule::getName).toList());
|
||||
}
|
||||
|
||||
@Test
|
||||
void provisionsTheIssueTemplateWithAnS3TargetResolvedFromRef() throws Exception {
|
||||
ObjectNode template = (ObjectNode) mapper.readTree(template("store", true));
|
||||
template.withObject("/Resources").putObject("Bucket").put("Type", "AWS::S3::Bucket");
|
||||
template.withObject("/Resources/Rule/Properties/Rule").putArray("Actions")
|
||||
.addObject().putObject("S3Action").putObject("BucketName").put("Ref", "Bucket");
|
||||
template.withObject("/Outputs").putObject("BucketName").putObject("Value").put("Ref", "Bucket");
|
||||
cfn.createStack(r -> r.stackName(stackName).templateBody(template.toString()));
|
||||
Stack created = awaitStatus("CREATE_COMPLETE");
|
||||
String bucket = created.outputs().stream().filter(o -> "BucketName".equals(o.outputKey()))
|
||||
.findFirst().orElseThrow().outputValue();
|
||||
ReceiptRule rule = ses.describeReceiptRule(ruleSet, "store", "us-east-1");
|
||||
assertEquals("S3Action", rule.getActions().getFirst().getType());
|
||||
assertEquals(bucket, rule.getActions().getFirst().property("BucketName"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void provisionsUpdatesAndDeletesRealReceiptRules() throws Exception {
|
||||
String initial = template("store", true);
|
||||
cfn.createStack(r -> r.stackName(stackName).templateBody(initial));
|
||||
Stack created = awaitStatus("CREATE_COMPLETE");
|
||||
assertTrue(ses.describeReceiptRule(ruleSet, "store", "us-east-1").isEnabled());
|
||||
assertTrue(created.outputs().stream().allMatch(o -> "store".equals(o.outputValue())));
|
||||
|
||||
String updated = template("store", false);
|
||||
cfn.updateStack(r -> r.stackName(stackName).templateBody(updated));
|
||||
awaitStatus("UPDATE_COMPLETE");
|
||||
assertFalse(ses.describeReceiptRule(ruleSet, "store", "us-east-1").isEnabled());
|
||||
|
||||
cfn.deleteStack(r -> r.stackName(stackName));
|
||||
await().atMost(Duration.ofSeconds(15)).untilAsserted(() ->
|
||||
assertEquals("RuleDoesNotExist", assertThrows(AwsException.class,
|
||||
() -> ses.describeReceiptRule(ruleSet, "store", "us-east-1")).getErrorCode()));
|
||||
}
|
||||
|
||||
private Stack awaitStatus(String expected) {
|
||||
return await().atMost(Duration.ofSeconds(15)).until(
|
||||
() -> cfn.describeStacks(r -> r.stackName(stackName)).stacks().getFirst(),
|
||||
s -> expected.equals(s.stackStatusAsString()));
|
||||
}
|
||||
|
||||
private String template(String name, boolean enabled) throws Exception {
|
||||
return mapper.writeValueAsString(Map.of("Resources", Map.of("Rule", Map.of(
|
||||
"Type", "AWS::SES::ReceiptRule", "Properties", Map.of("RuleSetName", ruleSet,
|
||||
"Rule", Map.of("Name", name, "Enabled", enabled, "Recipients", List.of("example.com"),
|
||||
"Actions", List.of(Map.of("AddHeaderAction",
|
||||
Map.of("HeaderName", "X-Test", "HeaderValue", "yes"))))))),
|
||||
"Outputs", Map.of("RuleRef", Map.of("Value", Map.of("Ref", "Rule")),
|
||||
"RuleName", Map.of("Value", Map.of("Fn::GetAtt", List.of("Rule", "RuleName"))))));
|
||||
}
|
||||
}
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
package io.github.hectorvent.floci.services.cloudformation.provisioners;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.RegionResolver;
|
||||
import io.github.hectorvent.floci.core.common.ServiceCallAuthorizer;
|
||||
import io.github.hectorvent.floci.core.storage.AccountAwareStorageBackend;
|
||||
import io.github.hectorvent.floci.core.storage.StorageFactory;
|
||||
import io.github.hectorvent.floci.services.cloudformation.CloudFormationTemplateEngine;
|
||||
import io.github.hectorvent.floci.services.cloudformation.model.StackResource;
|
||||
import io.github.hectorvent.floci.services.lambda.LambdaService;
|
||||
import io.github.hectorvent.floci.services.s3.S3Service;
|
||||
import io.github.hectorvent.floci.services.ses.SesIdentityService;
|
||||
import io.github.hectorvent.floci.services.ses.SesReceiptRuleService;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptFilter;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptRule;
|
||||
import io.github.hectorvent.floci.services.ses.model.ReceiptRuleSet;
|
||||
import io.github.hectorvent.floci.services.sns.SnsService;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.util.List;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
class SesReceiptRuleCfnProvisionerTest {
|
||||
private static final String REGION = "us-east-1";
|
||||
private static final String ACCOUNT = "000000000000";
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
private SesReceiptRuleService rules;
|
||||
private SesReceiptRuleCfnProvisioner provisioner;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
StorageFactory factory = mock(StorageFactory.class);
|
||||
when(factory.<ReceiptRuleSet>create(eq("ses"), eq("ses-receipt-rule-sets.json"), any()))
|
||||
.thenReturn(AccountAwareStorageBackend.inMemory(ACCOUNT));
|
||||
when(factory.<ReceiptFilter>create(eq("ses"), eq("ses-receipt-filters.json"), any()))
|
||||
.thenReturn(AccountAwareStorageBackend.inMemory(ACCOUNT));
|
||||
rules = spy(new SesReceiptRuleService(factory, mock(S3Service.class), mock(SnsService.class),
|
||||
mock(LambdaService.class), mock(ServiceCallAuthorizer.class), new RegionResolver(REGION, ACCOUNT),
|
||||
Clock.systemUTC()));
|
||||
rules.createReceiptRuleSet("first", REGION);
|
||||
rules.createReceiptRuleSet("second", REGION);
|
||||
provisioner = new SesReceiptRuleCfnProvisioner(rules, mock(SesIdentityService.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void generatedNameStaysStableAndExplicitNameRemovalCreatesReplacement() {
|
||||
StackResource generated = resource();
|
||||
ObjectNode props = properties("first", null);
|
||||
provisioner.provision(generated, props, context(null));
|
||||
String name = generated.getPhysicalId();
|
||||
assertTrue(name.length() <= 64);
|
||||
props.withObject("/Rule").put("Enabled", true);
|
||||
provisioner.provision(generated, props, context(name));
|
||||
assertEquals(name, generated.getPhysicalId());
|
||||
assertTrue(rules.describeReceiptRule("first", name, REGION).isEnabled());
|
||||
provisioner.clearUpdate(generated);
|
||||
|
||||
StackResource named = resource();
|
||||
provisioner.provision(named, properties("second", "named"), context(null));
|
||||
provisioner.provision(named, properties("second", null), context("named"));
|
||||
assertNotEquals("named", named.getPhysicalId());
|
||||
assertTrue(provisioner.completeUpdate(named).complete());
|
||||
assertMissing("second", "named");
|
||||
}
|
||||
|
||||
@Test
|
||||
void retainedSameNameReplacementKeepsBothRules() {
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, properties("first", "store"), context(null));
|
||||
resource.setUpdateReplacePolicy("Retain");
|
||||
provisioner.provision(resource, properties("second", "store"), context("store"));
|
||||
assertTrue(provisioner.hasReplacementUpdate(resource));
|
||||
assertNull(provisioner.updateCleanupPhysicalId(resource));
|
||||
assertTrue(provisioner.completeUpdate(resource).complete());
|
||||
provisioner.clearUpdate(resource);
|
||||
provisioner.delete(resource, REGION);
|
||||
assertEquals("store", rules.describeReceiptRule("first", "store", REGION).getName());
|
||||
assertMissing("second", "store");
|
||||
}
|
||||
|
||||
@Test
|
||||
void replacementRollbackCanRetryFailedDeletionWithoutLosingEitherAddress() {
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, properties("first", "store"), context(null));
|
||||
provisioner.provision(resource, properties("second", "store"), context("store"));
|
||||
resource.setStatus("UPDATE_FAILED");
|
||||
doThrow(new AwsException("InternalFailure", "retry", 500)).doCallRealMethod()
|
||||
.when(rules).deleteReceiptRule("second", "store", REGION);
|
||||
assertThrows(AwsException.class, () -> provisioner.rollbackUpdate(resource));
|
||||
assertTrue(provisioner.requiresUpdateRecovery(resource));
|
||||
assertEquals("store", resource.getPhysicalId());
|
||||
assertTrue(provisioner.rollbackUpdate(resource));
|
||||
assertFalse(provisioner.requiresUpdateRecovery(resource));
|
||||
assertEquals("store", rules.describeReceiptRule("first", "store", REGION).getName());
|
||||
assertMissing("second", "store");
|
||||
provisioner.delete(resource, REGION);
|
||||
assertMissing("first", "store");
|
||||
}
|
||||
|
||||
@Test
|
||||
void failedStubMigrationRemovesOnlyTheNewlyCreatedRule() {
|
||||
StackResource resource = resource();
|
||||
resource.setPhysicalId("Receipt-1234abcd");
|
||||
resource.getAttributes().put("Arn", "arn:aws:stub:::Receipt");
|
||||
provisioner.provision(resource, properties("first", "store"), context("Receipt-1234abcd"));
|
||||
assertEquals("store", rules.describeReceiptRule("first", "store", REGION).getName());
|
||||
assertTrue(provisioner.rollbackUpdate(resource));
|
||||
assertEquals("Receipt-1234abcd", resource.getPhysicalId());
|
||||
assertEquals("arn:aws:stub:::Receipt", resource.getAttributes().get("Arn"));
|
||||
assertMissing("first", "store");
|
||||
}
|
||||
|
||||
@Test
|
||||
void newUpdateRecoversAnUnfinishedUndoBeforeReplacingItsSnapshot() {
|
||||
StackResource resource = resource();
|
||||
ObjectNode original = properties("first", "store");
|
||||
original.withObject("/Rule").put("Enabled", true);
|
||||
provisioner.provision(resource, original, context(null));
|
||||
provisioner.provision(resource, properties("first", "store"), context("store"));
|
||||
doThrow(new AwsException("InternalFailure", "retry undo", 500)).doCallRealMethod()
|
||||
.when(rules).updateReceiptRule(eq("first"), argThat(ReceiptRule::isEnabled), eq(REGION), any());
|
||||
assertThrows(AwsException.class, () -> provisioner.rollbackUpdate(resource));
|
||||
// The dispatcher passes a fresh resource object, so the previous UPDATE_FAILED status is absent.
|
||||
resource.setStatus("CREATE_IN_PROGRESS");
|
||||
provisioner.provision(resource, properties("first", "store"), context("store"));
|
||||
assertTrue(provisioner.rollbackUpdate(resource));
|
||||
assertTrue(rules.describeReceiptRule("first", "store", REGION).isEnabled());
|
||||
}
|
||||
|
||||
@Test
|
||||
void cleanupFailureRemainsAddressableForRetryAndStackDelete() {
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, properties("first", "old"), context(null));
|
||||
provisioner.provision(resource, properties("second", "new"), context("old"));
|
||||
doThrow(new AwsException("InternalFailure", "retry", 500)).doCallRealMethod()
|
||||
.when(rules).deleteReceiptRule("first", "old", REGION);
|
||||
assertFalse(provisioner.completeUpdate(resource).complete());
|
||||
provisioner.clearUpdate(resource);
|
||||
assertEquals("old", provisioner.updateCleanupPhysicalId(resource));
|
||||
provisioner.delete(resource, REGION);
|
||||
assertMissing("first", "old");
|
||||
assertMissing("second", "new");
|
||||
}
|
||||
|
||||
@Test
|
||||
void duplicateReplacementNeverAdoptsOrDeletesAnExternalRule() {
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, properties("first", "store"), context(null));
|
||||
ReceiptRule external = new ReceiptRule();
|
||||
external.setName("store");
|
||||
rules.createReceiptRule("second", external, null, REGION, sender -> false);
|
||||
assertEquals("AlreadyExists", assertThrows(AwsException.class, () ->
|
||||
provisioner.provision(resource, properties("second", "store"), context("store"))).getErrorCode());
|
||||
provisioner.delete(resource, REGION);
|
||||
assertEquals("store", rules.describeReceiptRule("second", "store", REGION).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
void stackDeleteToleratesMissingSetButPropagatesRealFailures() {
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, properties("first", "store"), context(null));
|
||||
doThrow(new AwsException("InternalFailure", "unavailable", 500)).doCallRealMethod()
|
||||
.when(rules).deleteReceiptRule("first", "store", REGION);
|
||||
assertThrows(AwsException.class, () -> provisioner.delete(resource, REGION));
|
||||
rules.deleteReceiptRuleSet("first", REGION);
|
||||
assertDoesNotThrow(() -> provisioner.delete(resource, REGION));
|
||||
}
|
||||
|
||||
@Test
|
||||
void acceptsEmptyActionsAsAllowedByTheCloudFormationSchema() {
|
||||
ObjectNode props = properties("first", "store");
|
||||
props.withObject("/Rule").putArray("Actions").addObject();
|
||||
provisioner.provision(resource(), props, context(null));
|
||||
assertNull(rules.describeReceiptRule("first", "store", REGION).getActions().getFirst().getType());
|
||||
}
|
||||
|
||||
@Test
|
||||
void convertsNestedActionsAndResolvesIntrinsics() throws Exception {
|
||||
ObjectNode props = properties("first", "store");
|
||||
props.withObject("/Rule").set("Actions", mapper.readTree("""
|
||||
[{"AddHeaderAction":{"HeaderName":"X-Test","HeaderValue":{"Fn::Join":["",["a","b"]]}}},
|
||||
{"StopAction":{"Scope":"RuleSet"}}]
|
||||
"""));
|
||||
props.withObject("/Rule").putArray("Recipients").add("example.com");
|
||||
StackResource resource = resource();
|
||||
provisioner.provision(resource, props, context(null));
|
||||
ReceiptRule actual = rules.describeReceiptRule("first", "store", REGION);
|
||||
assertEquals(List.of("example.com"), actual.getRecipients());
|
||||
assertEquals("ab", actual.getActions().getFirst().property("HeaderValue"));
|
||||
assertEquals("StopAction", actual.getActions().get(1).getType());
|
||||
assertEquals("store", resource.getAttributes().get("RuleName"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"{}", "{\"RuleSetName\":\"first\"}",
|
||||
"{\"RuleSetName\":\"first\",\"Rule\":{\"Name\":7}}",
|
||||
"{\"RuleSetName\":\"first\",\"Rule\":{\"Enabled\":\"yes\"}}",
|
||||
"{\"RuleSetName\":\"first\",\"Rule\":{\"Actions\":[{\"StopAction\":{},\"S3Action\":{}}]}}",
|
||||
"{\"RuleSetName\":\"first\",\"Rule\":{\"Actions\":[{\"BogusAction\":{}}]}}"})
|
||||
void rejectsInvalidPropertiesBeforeCreatingAnything(String json) throws Exception {
|
||||
assertThrows(AwsException.class, () -> provisioner.provision(resource(), mapper.readTree(json), context(null)));
|
||||
assertTrue(rules.describeReceiptRuleSet("first", REGION).getRules().isEmpty());
|
||||
}
|
||||
|
||||
private void assertMissing(String set, String name) {
|
||||
assertEquals("RuleDoesNotExist", assertThrows(AwsException.class,
|
||||
() -> rules.describeReceiptRule(set, name, REGION)).getErrorCode());
|
||||
}
|
||||
|
||||
private ObjectNode properties(String set, String name) {
|
||||
ObjectNode props = mapper.createObjectNode().put("RuleSetName", set);
|
||||
ObjectNode rule = props.putObject("Rule");
|
||||
if (name != null) {
|
||||
rule.put("Name", name);
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
private StackResource resource() {
|
||||
StackResource resource = new StackResource();
|
||||
resource.setResourceType("AWS::SES::ReceiptRule");
|
||||
resource.setLogicalId("Receipt");
|
||||
return resource;
|
||||
}
|
||||
|
||||
private ProvisionContext context(String prior) {
|
||||
return new ProvisionContext(CloudFormationTemplateEngine.standalone(ACCOUNT, REGION, "stack", mapper,
|
||||
UnaryOperator.identity()), REGION, ACCOUNT, "stack", prior);
|
||||
}
|
||||
}
|
||||
@@ -176,6 +176,7 @@ AWS::S3::BucketPolicy S3CfnProvisioner
|
||||
AWS::S3Vectors::Index S3VectorsCfnProvisioner
|
||||
AWS::S3Vectors::VectorBucket S3VectorsCfnProvisioner
|
||||
AWS::SES::EmailIdentity SesCfnProvisioner
|
||||
AWS::SES::ReceiptRule SesReceiptRuleCfnProvisioner
|
||||
AWS::SNS::Subscription SnsCfnProvisioner
|
||||
AWS::SNS::Topic SnsCfnProvisioner
|
||||
AWS::SNS::TopicPolicy SnsCfnProvisioner
|
||||
|
||||
|
@@ -212,6 +212,7 @@ notes:
|
||||
AWS::DynamoDB::Table: '`TimeToLiveSpecification` applied on create and update; to rename an enabled TTL attribute, disable TTL in one update and enable the new attribute in a later one'
|
||||
AWS::Cognito::UserPool: '`ProviderURL` is the local issuer of the tokens Floci mints, `<base-url>/<pool id>`'
|
||||
AWS::SES::EmailIdentity: 'BYODKIM is not supported by this resource; Easy DKIM DNS attributes use the shared emulator signing zone `dkim.amazonses.com` rather than AWS''s region- and identity-specific zone assignment'
|
||||
AWS::SES::ReceiptRule: 'stored in an existing SES receipt rule set; Ref and RuleName return the rule name; management plane only, with no inbound mail delivery'
|
||||
AWS::Events::Archive: '`KmsKeyIdentifier` is ignored'
|
||||
AWS::AppConfig::Environment: '`Tags` and `DeletionProtectionCheck` are accepted and not stored'
|
||||
AWS::AppConfig::ConfigurationProfile: '`Tags`, `KmsKeyIdentifier`, `RetrievalRoleArn`, `Validators` and `DeletionProtectionCheck` are accepted and not stored'
|
||||
|
||||
Reference in new issue
Block a user