aws-solutions / amazon-marketing-cloud-insights-on-aws

Amazon Marketing Cloud Insights on AWS helps advertisers and agencies running campaigns on Amazon Ads to easily deploy AWS services to store, query, analyze, and visualize reporting from the AMC API
https://aws.amazon.com/solutions/implementations/amazon-marketing-cloud-insights-on-aws/
Apache License 2.0
11 stars 6 forks source link

Amazon Marketing Cloud Insights on AWS

Amazon Marketing Cloud Insights on AWS

Architecture

The following images show the architecture of the solution and its components

Architecture 1 Overview

Architecture 2 Workflow Manager

Architecture 4 Amazon Ads Reporting

Architecture 5 Selling Partner Reporting

Architecture 6 Data Lake

Note: From v2.0.0, AWS CloudFormation template resources are created by the AWS CDK and AWS Solutions Constructs.

AWS CDK Constructs

AWS CDK Solutions Constructs make it easier to consistently create well-architected applications. All AWS Solutions Constructs are reviewed by AWS and use best practices established by the AWS Well-Architected Framework.


AWS Service Requirements


IAM Roles for Installation and Admin Operation

An IAM policy for installing the solution is listed within the IAM_POLICY_INSTALL.json file. IAM policies for operating the solution as an admin are created on stack deployment and can be found in the Outputs window of your Cloudformation stack under the AdminPolicyOutput key. Note: the policies generated should be used as a guide. Please review them as they may need to be amended in order to fit your specific use case.

These JSON files can be used to create a JSON policy in AWS IAM to scope the actions available to a user so they can install and operate the solution.

Deployment

You can launch this solution with one click from the AWS Solutions landing page.

To customize the solution, or to contribute to the solution, see Creating a custom build

Creating a custom build

To customize the solution, follow the steps below:

Prerequisites

The following procedures assumes that all the OS-level configuration has been completed. They are:

Please ensure you test the templates before updating any production deployments.

1. Download or clone this repo

git clone https://github.com/aws-solutions/amazon-marketing-cloud-insights-on-aws

2. Create a Python virtual environment for development

python -m venv .venv 
source ./.venv/bin/activate 
cd ./source 
pip install -r requirements.txt 

3. After introducing changes, run the unit tests to make sure the customizations don't break existing functionality

cd ./deployment
bash run-unit-tests.sh

4. Build the solution for deployment

Using AWS CDK

Packaging and deploying the solution with the AWS CDK allows for the most flexibility in development

cd ./source/infrastructure 

# bootstrap CDK (required once - deploys a CDK bootstrap CloudFormation stack for assets)  
cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess

# build the solution 
cdk synth

# build and deploy the solution (replacing the indicated variable)
cdk deploy --parameters NotificationEmail=$YOUR_EMAIL_HERE

Using the solution build tools

It is highly recommended to use the AWS CDK to deploy this solution (using the instructions above). While CDK is used to develop the solution, to package the solution for release as a CloudFormation template, use the build-s3-cdk-dist build tool:

cd ./deployment

export DIST_BUCKET_PREFIX=my-bucket-name  
export SOLUTION_NAME=my-solution-name  
export VERSION=my-version  
export REGION_NAME=my-region

build-s3-cdk-dist deploy \
  --source-bucket-name $DIST_BUCKET_PREFIX \
  --solution-name $SOLUTION_NAME \
  --version-code $VERSION \
  --cdk-app-path ../source/infrastructure/app.py \
  --cdk-app-entrypoint app:build_app \
  --region $REGION_NAME \
  --sync

Parameter Details

This will result in all global assets being pushed to the DIST_BUCKET_PREFIX, and all regional assets being pushed to DIST_BUCKET_PREFIX-<REGION_NAME>. If your REGION_NAME is us-east-1, and the DIST_BUCKET_PREFIX is my-bucket-name, ensure that both my-bucket-name and my-bucket-name-us-east-1 exist and are owned by you.

After running the command, you can deploy the template:

Note: build-s3-cdk-dist will use your current configured AWS_REGION and AWS_PROFILE. To set your defaults, install the AWS Command Line Interface and run aws configure.

Note: You can drop --sync from the command to only perform the build and synthesis of the template without uploading to a remote location. This is helpful when testing new changes to the code.

Additional Resources

Please refer to the official implementation guide for information on configuration options, using the solution, troubleshooting, uninstalling and more.

Collection of operational metrics

This solution collects anonymized operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the implementation guide.

License

This project is licensed under the Apache-2.0 License.