MailManager / Client / update_traffic_policy

update_traffic_policy#

MailManager.Client.update_traffic_policy(**kwargs)#

Update attributes of an already provisioned traffic policy resource.

See also: AWS API Documentation

Request Syntax

response = client.update_traffic_policy(
    DefaultAction='ALLOW'|'DENY',
    MaxMessageSizeBytes=123,
    PolicyStatements=[
        {
            'Action': 'ALLOW'|'DENY',
            'Conditions': [
                {
                    'BooleanExpression': {
                        'Evaluate': {
                            'Analysis': {
                                'Analyzer': 'string',
                                'ResultField': 'string'
                            }
                        },
                        'Operator': 'IS_TRUE'|'IS_FALSE'
                    },
                    'IpExpression': {
                        'Evaluate': {
                            'Attribute': 'SENDER_IP'
                        },
                        'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES',
                        'Values': [
                            'string',
                        ]
                    },
                    'StringExpression': {
                        'Evaluate': {
                            'Attribute': 'RECIPIENT'
                        },
                        'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS',
                        'Values': [
                            'string',
                        ]
                    },
                    'TlsExpression': {
                        'Evaluate': {
                            'Attribute': 'TLS_PROTOCOL'
                        },
                        'Operator': 'MINIMUM_TLS_VERSION'|'IS',
                        'Value': 'TLS1_2'|'TLS1_3'
                    }
                },
            ]
        },
    ],
    TrafficPolicyId='string',
    TrafficPolicyName='string'
)
Parameters:
  • DefaultAction (string) – 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

  • MaxMessageSizeBytes (integer) – The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.

  • PolicyStatements (list) –

    The list of conditions to be updated for filtering email traffic.

    • (dict) –

      The structure containing traffic policy conditions and actions.

      • Action (string) – [REQUIRED]

        The action that informs a traffic policy resource to either allow or block the email if it matches a condition in the policy statement.

      • Conditions (list) – [REQUIRED]

        The list of conditions to apply to incoming messages for filtering email traffic.

        • (dict) –

          The email traffic filtering conditions which are contained in a traffic policy resource.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: BooleanExpression, IpExpression, StringExpression, TlsExpression.

          • BooleanExpression (dict) –

            This represents a boolean type condition matching on the incoming mail. It performs the boolean operation configured in ‘Operator’ and evaluates the ‘Protocol’ object against the ‘Value’.

            • Evaluate (dict) – [REQUIRED]

              The operand on which to perform a boolean condition operation.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: Analysis.

              • Analysis (dict) –

                The structure type for a boolean condition stating the Add On ARN and its returned value.

                • Analyzer (string) – [REQUIRED]

                  The Amazon Resource Name (ARN) of an Add On.

                • ResultField (string) – [REQUIRED]

                  The returned value from an Add On.

            • Operator (string) – [REQUIRED]

              The matching operator for a boolean condition expression.

          • IpExpression (dict) –

            This represents an IP based condition matching on the incoming mail. It performs the operation configured in ‘Operator’ and evaluates the ‘Protocol’ object against the ‘Value’.

            • Evaluate (dict) – [REQUIRED]

              The left hand side argument of an IP condition expression.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

              • Attribute (string) –

                An enum type representing the allowed attribute types for an IP condition.

            • Operator (string) – [REQUIRED]

              The matching operator for an IP condition expression.

            • Values (list) – [REQUIRED]

              The right hand side argument of an IP condition expression.

              • (string) –

          • StringExpression (dict) –

            This represents a string based condition matching on the incoming mail. It performs the string operation configured in ‘Operator’ and evaluates the ‘Protocol’ object against the ‘Value’.

            • Evaluate (dict) – [REQUIRED]

              The left hand side argument of a string condition expression.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

              • Attribute (string) –

                The enum type representing the allowed attribute types for a string condition.

            • Operator (string) – [REQUIRED]

              The matching operator for a string condition expression.

            • Values (list) – [REQUIRED]

              The right hand side argument of a string condition expression.

              • (string) –

          • TlsExpression (dict) –

            This represents a TLS based condition matching on the incoming mail. It performs the operation configured in ‘Operator’ and evaluates the ‘Protocol’ object against the ‘Value’.

            • Evaluate (dict) – [REQUIRED]

              The left hand side argument of a TLS condition expression.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

              • Attribute (string) –

                The enum type representing the allowed attribute types for the TLS condition.

            • Operator (string) – [REQUIRED]

              The matching operator for a TLS condition expression.

            • Value (string) – [REQUIRED]

              The right hand side argument of a TLS condition expression.

  • TrafficPolicyId (string) –

    [REQUIRED]

    The identifier of the traffic policy that you want to update.

  • TrafficPolicyName (string) – A user-friendly name for the traffic policy resource.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions