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
已回答 1 年前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则