내용으로 건너뛰기

Migration to AWS SNS

0

Is there is a way to migrate from Zipwhip (Twilio) to AWS SNS. In the company that I am working we use an SMS service for our clients to receive message for each transaction they make. We have an external API in VBScript running in our server that sends the information, that includes the mobile phone number, where the client is going to receive the message, and a description, to Zipwhip (Twilio). But, the Zipwhip company is going to terminate their service, so, we need to change to another method to continue sending SMS to our clients.

I would appreciate any help.

질문됨 3년 전51회 조회
1개 답변
0
const AWS = require('aws-sdk');
const s3 = new AWS.S3();

async function runS3SelectQuery(bucketName, fileName, query) {
  const params = {
    Bucket: bucketName,
    Key: fileName,
    ExpressionType: 'SQL',
    Expression: query, // Example: "SELECT * FROM S3Object s WHERE s.id = 1"
    InputSerialization: {
      JSON: {
        Type: 'Document'
      }
    },
    OutputSerialization: {
      JSON: {}
    }
  };

  try {
    const data = await s3.selectObjectContent(params).promise();
    const records = [];
    // Process the result stream from S3 Select
    data.Payload.on('data', (event) => {
      if (event.Records) {
        const recordsData = event.Records.Payload.toString();
        records.push(JSON.parse(recordsData));
      }
    });

    // Handle errors from the stream
    data.Payload.on('end', () => {
      console.log('Query Results:', records);
    });

    data.Payload.on('error', (err) => {
      console.error('Error streaming S3 Select result:', err);
    });

  } catch (error) {
    console.error('Error running S3 Select query:', error);
    handleError(error);
  }
}
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠