create_traffic_policy
async
¶
create_traffic_policy(
traffic_policy_name: TrafficPolicyName,
policy_statements: PolicyStatementList,
default_action: AcceptAction,
*,
config_overrides: Optional[AsyncMailManagerClientConfig] = None,
client_token: Optional[IdempotencyToken] = None,
max_message_size_bytes: Optional[MaxMessageSizeBytes] = None,
tags: Optional[TagList] = None,
) -> CreateTrafficPolicyResponse
Provision a new traffic policy resource.
Parameters:
-
client_token(Optional[IdempotencyToken], default:None) –A unique token that Amazon SES uses to recognize subsequent retries of the same request.
-
traffic_policy_name(TrafficPolicyName) –A user-friendly name for the traffic policy resource.
-
policy_statements(PolicyStatementList) –Conditional statements for filtering email traffic.
-
default_action(AcceptAction) –Default action instructs the traffic policy to either Allow or Deny (block) messages that fall outside of (or not addressed by) the conditions of your policy statements
-
max_message_size_bytes(Optional[MaxMessageSizeBytes], default:None) –The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.
-
tags(Optional[TagList], default:None) –The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
Raises:
-
ConflictException–The request configuration has conflicts. For details, see the accompanying error message.
-
ServiceQuotaExceededException–Occurs when an operation exceeds a predefined service quota or limit.
-
ValidationException–The request validation has failed. For details, see the accompanying error message.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create TrafficPolicy
>>> await client.create_traffic_policy(traffic_policy_name='trafficPolicyName', policy_statements=[{'Conditions': [{'IpExpression': {'Evaluate': {'Attribute': 'SENDER_IP'}, 'Operator': 'CIDR_MATCHES', 'Values': ['0.0.0.0/12']}}], 'Action': 'ALLOW'}], default_action='DENY')
Source code in docs_src/capo_mailmanager/_services/async_mail_manager.py
3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 | |