Set up the Openflow Connector for Amazon Ads¶
Note
The connector is subject to the Connector Terms.
This topic describes the steps to set up the Openflow Connector for Amazon Ads.
Prerequisites¶
Ensure that you have reviewed About Openflow Connector for Amazon Ads.
Ensure that you have set up Openflow.
Get the credentials¶
As an Amazon Ads administrator, perform the following actions:
Make sure that you have access to an Amazon Ads account.
Acquire Access to Amazon Ads API and complete the onboarding process.
Review the available regions and get a base URL used for requests based on the region in which you are advertising.
Fetch profile IDs for report configuration.
Set up Snowflake account¶
As a Snowflake account administrator, perform the following tasks:
Create a new role or use an existing role and grant the Database privileges.
Create a new Snowflake service user with the type as SERVICE.
Grant the Snowflake service user the role you created in the previous steps.
Configure with key-pair auth for the Snowflake SERVICE user from step 2.
Snowflake strongly recommends this step. Configure a secrets manager supported by Openflow, for example, AWS, Azure, and Hashicorp, and store the public and private keys in the secret store.
Note
If for any reason, you do not wish to use a secrets manager, then you are responsible for safeguarding the public key and private key files used for key-pair authentication according to the security policies of your organization.
Once the secrets manager is configured, determine how you will authenticate to it. On AWS, it’s recommended that you the EC2 instance role associated with Openflow as this way no other secrets have to be persisted.
In Openflow, configure a Parameter Provider associated with this Secrets Manager, from the hamburger menu in the upper right. Navigate to Controller Settings » Parameter Provider and then fetch your parameter values.
At this point all credentials can be referenced with the associated parameter paths and no sensitive values need to be persisted within Openflow.
If any other Snowflake users require access to the raw ingested documents and tables ingested by the connector (for example, for custom processing in Snowflake), then grant those users the role created in step 1.
Designate a warehouse for the connector to use. Start with the smallest warehouse size, then experiment with size depending on the number of tables being replicated, and the amount of data transferred. Large table numbers typically scale better with multi-cluster warehouses, rather than larger warehouse sizes.
Configure the connector¶
As a data engineer, perform the following tasks to configure a connector:
Create a database and schema in Snowflake for the connector to store ingested data.
Download the
connector definition file
.Import the connector definition into Openflow:
Open the Snowflake Openflow canvas.
Add a process group. To do this, drag and drop the Process Group icon from the tool palette at the top of the page onto the canvas. Once you release your pointer, a Create Process Group dialog appears.
On the Create Process Group dialog, select the connector definition file to import.
Right-click on the imported process group and select Parameters.
Populate the required parameter values as described in Flow parameters.
Flow parameters¶
This section describes the flow parameters that you can configure based on the following parameter contexts:
AmazonAdsConnectionContext: Used to establish connection with Amazon Ads API.
SnowflakeConnectionContext: Used to establish connection with Snowflake.
GetAmazonAdsReportContext: Used to define the reconfiguration of data downloaded from Amazon Ads.
AmazonAdsConnectionContext¶
Parameter |
Description |
Example or possible values |
Required |
---|---|---|---|
Client ID |
Client ID of the Amazon Advertising account |
Not applicable |
Yes |
Client Secret |
Client secret of the Amazon Advertising account |
Not applicable |
Yes |
OAuth Base URL |
The URL of the authorization server that issues the access token |
Possible values: |
Yes |
Refresh Token |
Refresh Token for Amazon Ads API |
Not applicable |
Yes |
Region |
Environment from which the advertising data is downloaded |
Possible values:
|
Yes |
SnowflakeConnectionContext¶
Parameter |
Description |
Example |
Required |
---|---|---|---|
Snowflake Account |
Name of the Snowflake account to which the connection is to be made |
|
Yes |
Snowflake User |
Username used to connect to the Snowflake instance. This is the user that you created in Set up Snowflake account. |
|
Yes |
Snowflake Role |
Snowflake role assigned to the Snowflake User, used during query execution. |
N/A |
Yes |
Snowflake Private Key |
The RSA private key used for authentication. The RSA key must be formatted according to PKCS8 standards and have standard PEM headers and footers. Note that either Snowflake Private Key File or Snowflake Private Key must be defined. |
Not applicable |
No |
Snowflake Private Key File |
The file that contains the RSA private key used for authentication to Snowflake, which is formatted according to PKCS8 standards and has standard PEM headers and footers. The header line starts with |
/opt/resources/snowflake/rsa_key.p8 |
No |
Snowflake Private Key Password |
The password associated with the Snowflake Private Key File |
Not applicable |
No |
Warehouse Name |
Snowflake warehouse on which the queries are executed |
|
Yes |
GetAmazonAdsReportContext¶
Parameter |
Description |
Example or possible values |
Required |
---|---|---|---|
Report Name |
Name of the report to be used as a destination table name. The name must be unique within the destination schema. |
Example: |
Yes |
Report Ad Product |
Type of advertising product being reported |
Possible values:
|
Yes |
Report Columns |
Set of columns which will be present in the end report |
Example: |
Yes |
Report Filters |
Set of filters used to trim the data returned |
Example: |
No |
Report Group By |
Level of granularity for the report |
Example: |
Yes |
Report Ingestion Strategy |
Mode in which data is fetched, either snapshot or incremental |
Possible values:
|
Yes |
Report Ingestion Window |
Specifies the number of days, data from which should be downloaded during incremental ingestion |
Example: |
Yes |
Report Profile ID |
The profile ID associated with an advertising account in a specific marketplace |
Not applicable |
Yes |
Report Time Unit |
Date aggregation |
Possible values:
|
Yes |
Report Type |
Data type contained in the report |
Example: |
Yes |
Report Start Date |
Start date from which the ingestion should happen. The date format is YYYY-MM-DD. |
Example: |
No |
Report Schedule |
Schedule time for processor creating reports |
Example: |
Yes |
Destination Database Name |
Name of the Snowflake database where the data will be ingested |
Example: |
Yes |
Destination Schema Name |
Name of the Snowflake schema where tables will be created |
Example: |
Yes |
Run the flow¶
Right-click on the plane and select Enable all Controller Services.
Right-click on the imported process group and select Start. The connector starts the data ingestion.