This repository contains a solution for automating the process of capturing your customers’ interests in a product category, so you can tailor your marketing messages. It uses a series of AWS services including Amazon Pinpoint, AWS Step Functions, AWS Lambda, Amazon DynamoDB and Amazon Simple Notification Service (SNS).
An AWS CloudFormation template will deploy an AWS Step Functions with a series of Lambdas, one Amazon DynamoDB table and three SNS topics. For a successful deployment, you will need to provide an existing Amazon Pinpoint project as well as a validated email address from where you can send emails from.
This repository is part of a blog post where you can find step-by-step instructions.
This solution uses:
- Amazon Pinpoint to send email campaigns and store customer data
- AWS Step Functions to orchestrate the automation of Amazon Pinpoint activities
- AWS Lambda to perform calls to Amazon Pinpoint and process data
- Amazon DynamoDB as a target database to store all logs from this solution
- Amazon Simple Notification Service (SNS) as a way to emit messages depending on the outcome of each AWS Step Functions execution
An overview of the architecture is below:
To deploy the solution, you will require an AWS account. If you don’t already have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions. Your access to the AWS account must have IAM permissions to launch AWS CloudFormation templates that create IAM roles.
The application is deployed as an AWS CloudFormation template.
Note You are responsible for the cost of the AWS services used while running this sample deployment. There is no additional cost for using this sample. For full details, see the pricing pages for each AWS service you will be using in this sample. Prices are subject to change.
- Deploy the latest CloudFormation template by following the link below for your preferred AWS region:
Region | Launch Template |
---|---|
US East (N. Virginia) (us-east-1) | |
US West (Oregon) (us-west-2) | |
EU (Ireland) (eu-west-1) | |
EU (London) (eu-west-2) | |
EU (Frankfurt) (eu-central-1) | |
AP (Sydney) (ap-southeast-2) |
- If prompted, login using your AWS account credentials.
- You should see a screen titled "Create Stack" at the "Specify template" step. The fields specifying the CloudFormation template are pre-populated. Click the Next button at the bottom of the page.
- On the "Specify stack details" screen you may customize the following parameters of the CloudFormation stack:
Parameter label | Default | Description |
---|---|---|
PinpointProjectId | required |
Amazon Pinpoint Project ID. |
EmailFromAddress | required |
Type the email that you would like the campaign email to be sent from. This email address needs to be validated first. |
ResourceTags | MyApp | Tag resources, which can help you identify and categorize them. |
Environment | DEV | The type of environment to tag your infrastructure with. |
When completed, click Next
-
Configure stack options if desired, then click Next.
-
On the review screen, you must check the boxes for:
- "I acknowledge that AWS CloudFormation might create IAM resources"
- "I acknowledge that AWS CloudFormation might create IAM resources with custom names"
- "I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND"
These are required to allow CloudFormation to create a Role to grant access to the resources needed by the stack and name the resources in a dynamic way.
-
Click Create Stack
-
Wait for the CloudFormation stack to launch. Completion is indicated when the "Stack status" is "CREATE_COMPLETE".
- You can monitor the stack creation progress in the "Events" tab.
To remove the stack:
- Open the AWS CloudFormation Console.
- Click the pinpoint-campaign-automation project, right-click and select "Delete Stack".
- Your stack will take some time to be deleted. You can track its progress in the "Events" tab.
- When it is done, the status will change from "DELETE_IN_PROGRESS" to "DELETE_COMPLETE". It will then disappear from the list.
- Locate the S3 bucket and delete it manually.
See Local Development guide to get a copy of the project up and running on your local machine for development and testing purposes.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.