Best practice sending SMS with EC2 PHP without the AWS PHP SDK

0

Hello!

We would like to use text messages SMS to our clients for certain functions of our website. We are using EC2 with Apache and like to send an SMS with PHP without using the AWS PHP SDK. We cannot find out how to send commands with PHP directly to AWS SNS or to AWS Pinpoint. The telephone numbers come from our database so using 'topics' would seem not usable.

Any help is appreciated!

1개 답변
1
수락된 답변

Since you are running the PHP app on an EC2 instance, you can attach an instance profile to the instance to make the SNS or Pinpoint API calls with SDK with minimal configurations. If you need an alternative way, an easy workaround is to use a REST API in API Gateway. You can have the API method to make an SNS/Pinpoint API call. So, the end users in this case PHP app on EC2 can hit the API endpoint to indirectly send messages through SNS/Pinpoint. However, it is still recommended that you secure the API.

What is the reason behind not wanting to use AWS SDK?

AWS
Taka_M
답변함 일 년 전
  • Pardon me for the late response. The API workaround seems acceptable for us. We prefer not to use the AWS SDK for PHP because we could not find the way to build the SDK with only the SNS components and its dependencies. Now we would need the entire SDK loaded on the server which creates a lot of code clutter and unnecessary tools we do not need nor want.

    Thank you for your time to answer my question.

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

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

질문 답변하기에 대한 가이드라인

관련 콘텐츠