1. Enabling two-way SMS communication with Pinpoint GCM

    TypeScript

    To enable two-way SMS communication with AWS Pinpoint, utilizing the Google Cloud Messaging (GCM) channel for interaction with campaigns, you need to set up a few resources within AWS.

    We will start by creating an AWS Pinpoint application which will house all channels, campaigns, and other configurations. Then, we will set up the SMS channel to enable the two-way SMS communication. While GCM, which has been replaced by Firebase Cloud Messaging (FCM), isn't directly related to SMS, if you want to enable notifications for mobile devices, you would typically configure GCM/FCM Channel. Since your focus seems to be on two-way SMS, we'll concentrate on the SMS channel.

    Here's how you can configure your Pinpoint application and enable two-way SMS communication using Pulumi and TypeScript:

    1. AWS Pinpoint App: This is the container for all Pinpoint functionalities including channels, campaigns, and more.
    2. AWS Pinpoint SMS Channel: This specifically enables the SMS capabilities so you can send messages to and receive messages from recipients.

    Below is a Pulumi program written in TypeScript that accomplishes this:

    import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; // Create an AWS Pinpoint application const app = new aws.pinpoint.App("twoWaySmsApp", { name: "two-way-sms-app" }); // Enable the SMS Channel on the AWS Pinpoint application const smsChannel = new aws.pinpoint.SmsChannel("smsChannel", { applicationId: app.applicationId, enabled: true, // Provide sender ID and short code if required, depending on the country. // These values are typically obtained through the AWS console or through your telecommunications provider. // senderId: "YOUR_SENDER_ID", // shortCode: "YOUR_SHORT_CODE", }); // Export the IDs of the resources export const pinpointAppId = app.applicationId; export const smsChannelId = smsChannel.id;

    Make sure to replace "YOUR_SENDER_ID" and "YOUR_SHORT_CODE" with appropriate values if you have them. You will need to set senderId and shortCode only if they are needed in your environment and if you acquired them from AWS or your provider.

    Also, refer to the official AWS documentation:

    To run this Pulumi program:

    1. Ensure you have Pulumi CLI installed and AWS credentials configured.
    2. Install the required libraries with npm install @pulumi/pulumi @pulumi/aws.
    3. Save the TypeScript code to a file (e.g., index.ts).
    4. Run pulumi up in the same directory as the file.

    This will provision your AWS Pinpoint application and enable the SMS channel for two-way SMS communication, which you can then use to send and receive SMS messages.