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
4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 | |