Open ppena-LiveData opened 5 months ago
Thank you. Did you see any way to active that from CloudFormation? Looks like just enable this prop? https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-enabled
Can you share the CFN template snippet of this resource when you cdk synth
and let us know the value of the Enable prop?
@pahud, that documentation is about AWS::SES::ReceiptRule
(which CDK is already automatically enabling). I am talking about AWS::SES::ReceiptRuleSet, which is like a parent of ReceiptRule
s.
@pahud enabled is different from "activated" in SES.
You can use something like this as a workaround:
// The rule set needs to be activated: https://docs.aws.amazon.com/ses/latest/APIReference/API_SetActiveReceiptRuleSet.html
const setActiveReceiptRuleSetSdkCall: cr.AwsSdkCall = {
service: 'SES',
action: 'setActiveReceiptRuleSet',
physicalResourceId: cr.PhysicalResourceId.of('SesCustomResource'),
parameters: {
RuleSetName: ruleSet.receiptRuleSetName,
}
};
new cr.AwsCustomResource(this, "setActiveReceiptRuleSetCustomResource", {
onCreate: setActiveReceiptRuleSetSdkCall,
onUpdate: setActiveReceiptRuleSetSdkCall,
logRetention: RetentionDays.ONE_WEEK,
policy: cr.AwsCustomResourcePolicy.fromStatements([
new iam.PolicyStatement({
sid: 'SesCustomResourceSetActiveReceiptRuleSet',
effect: iam.Effect.ALLOW,
actions: ['ses:SetActiveReceiptRuleSet'],
resources: ['*']
}),
]),
});
Beware that if you do decide to activate the rule set with a CR, CloudFormation will not delete it until it is made inactive:
Cannot delete active rule set: <ruleset-name>
Adding an onDelete
handler to reset the active rule set would be necessary to allow your stack to be destroyed
@ppena-LiveData @markusl
My bad. OK sounds like it's a limit and feature gap from cloudformation? I suggest we create a feature request for cloudformation-coverage-roadmap/issues. Meanwhile, I will submit an internal ticket to relevant team for that.
internal tracking: V1358648255
Describe the bug
When an
aws_ses.ReceiptRule
is created, it is automatically set to enabled, but it's not useful because its parentaws_ses.ReceiptRuleSet
is created with a status ofInactive
. To fix it, I have to manually go into the AWS Console GUI to change the status of theReceiptRuleSet
to click on theSet as active
button.Expected Behavior
I'd expect the
aws_ses.ReceiptRuleSet
to be created with a status ofActive
.Current Behavior
aws_ses.ReceiptRuleSet
s are created with a status ofInactive
.Reproduction Steps
Here's an example Python CDK script (which can hopefully be made prettier after https://github.com/aws/aws-cdk/issues/28531 is fixed):
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.118.0 (build a40f2ec)
Framework Version
No response
Node.js Version
v18.18.2
OS
Windows 11
Language
Python
Language Version
Python 3.11.6
Other information
No response