create_receipt_rule
async
¶
create_receipt_rule(
rule_set_name: ReceiptRuleSetName,
rule: ReceiptRule,
*,
config_overrides: Optional[AsyncSESClientConfig] = None,
after: Optional[ReceiptRuleName] = None,
) -> CreateReceiptRuleResponse
Creates a receipt rule.
For information about setting up receipt rules, see the Amazon SES Developer Guide.
You can execute this operation no more than once per second.
Parameters:
-
rule_set_name(ReceiptRuleSetName) –The name of the rule set where the receipt rule is added.
-
after(Optional[ReceiptRuleName], default:None) –The name of an existing rule after which the new rule is placed. If this parameter is null, the new rule is inserted at the beginning of the rule list.
-
rule(ReceiptRule) –A data structure that contains the specified rule's name, actions, recipients, domains, enabled status, scan status, and TLS policy.
Raises:
-
AlreadyExistsException–Indicates that a resource could not be created because of a naming conflict.
-
InvalidLambdaFunctionException–Indicates that the provided Amazon Web Services Lambda function is invalid, or that Amazon SES could not execute the provided function, possibly due to permissions issues. For information about giving permissions, see the Amazon SES Developer Guide.
-
InvalidS3ConfigurationException–Indicates that the provided Amazon S3 bucket or Amazon Web Services KMS encryption key is invalid, or that Amazon SES could not publish to the bucket, possibly due to permissions issues. For information about giving permissions, see the Amazon SES Developer Guide.
-
InvalidSnsTopicException–Indicates that the provided Amazon SNS topic is invalid, or that Amazon SES could not publish to the topic, possibly due to permissions issues. For information about giving permissions, see the Amazon SES Developer Guide.
-
LimitExceededException–Indicates that a resource could not be created because of service limits. For a list of Amazon SES limits, see the Amazon SES Developer Guide.
-
RuleDoesNotExistException–Indicates that the provided receipt rule does not exist.
-
RuleSetDoesNotExistException–Indicates that the provided receipt rule set does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
CreateReceiptRule The following example creates a new receipt rule:
>>> await client.create_receipt_rule(rule_set_name='MyRuleSet', after='', rule={'TlsPolicy': 'Optional', 'Enabled': True, 'Name': 'MyRule', 'Actions': [{'S3Action': {'ObjectKeyPrefix': 'email', 'BucketName': 'MyBucket'}}], 'ScanEnabled': True})