UpdateReceiptRuleCommand

Updates a receipt rule.

For information about managing receipt rules, see the Amazon SES Developer Guide .

You can execute this operation no more than once per second.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SESClient, UpdateReceiptRuleCommand } from "@aws-sdk/client-ses"; // ES Modules import
// const { SESClient, UpdateReceiptRuleCommand } = require("@aws-sdk/client-ses"); // CommonJS import
const client = new SESClient(config);
const input = { // UpdateReceiptRuleRequest
  RuleSetName: "STRING_VALUE", // required
  Rule: { // ReceiptRule
    Name: "STRING_VALUE", // required
    Enabled: true || false,
    TlsPolicy: "Require" || "Optional",
    Recipients: [ // RecipientsList
      "STRING_VALUE",
    ],
    Actions: [ // ReceiptActionsList
      { // ReceiptAction
        S3Action: { // S3Action
          TopicArn: "STRING_VALUE",
          BucketName: "STRING_VALUE", // required
          ObjectKeyPrefix: "STRING_VALUE",
          KmsKeyArn: "STRING_VALUE",
          IamRoleArn: "STRING_VALUE",
        },
        BounceAction: { // BounceAction
          TopicArn: "STRING_VALUE",
          SmtpReplyCode: "STRING_VALUE", // required
          StatusCode: "STRING_VALUE",
          Message: "STRING_VALUE", // required
          Sender: "STRING_VALUE", // required
        },
        WorkmailAction: { // WorkmailAction
          TopicArn: "STRING_VALUE",
          OrganizationArn: "STRING_VALUE", // required
        },
        LambdaAction: { // LambdaAction
          TopicArn: "STRING_VALUE",
          FunctionArn: "STRING_VALUE", // required
          InvocationType: "Event" || "RequestResponse",
        },
        StopAction: { // StopAction
          Scope: "RuleSet", // required
          TopicArn: "STRING_VALUE",
        },
        AddHeaderAction: { // AddHeaderAction
          HeaderName: "STRING_VALUE", // required
          HeaderValue: "STRING_VALUE", // required
        },
        SNSAction: { // SNSAction
          TopicArn: "STRING_VALUE", // required
          Encoding: "UTF-8" || "Base64",
        },
        ConnectAction: { // ConnectAction
          InstanceARN: "STRING_VALUE", // required
          IAMRoleARN: "STRING_VALUE", // required
        },
      },
    ],
    ScanEnabled: true || false,
  },
};
const command = new UpdateReceiptRuleCommand(input);
const response = await client.send(command);
// {};

Example Usage

 Loading code editorLoading code editor

UpdateReceiptRuleCommand Input

See UpdateReceiptRuleCommandInput for more details

Parameter
Type
Description
Rule
Required
ReceiptRule | undefined

A data structure that contains the updated receipt rule information.

RuleSetName
Required
string | undefined

The name of the receipt rule set that the receipt rule belongs to.

UpdateReceiptRuleCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InvalidLambdaFunctionException
client

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
client

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
client

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
client

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
client

Indicates that the provided receipt rule does not exist.

RuleSetDoesNotExistException
client

Indicates that the provided receipt rule set does not exist.

SESServiceException
Base exception class for all service exceptions from SES service.