AWSTemplateFormatVersion: '2010-09-09' Description: Amazon Pinpoint Connect Channel. This application will add users to Google Ads Audiences. Written in Python3. Transform: AWS::Serverless-2016-10-31 Parameters: GoogleAdsClientCustomerId: Type: String Description: Google Ads Client Customer Id GoogleAdsDeveloperToken: Type: String Description: Google Ads Developer Token GoogleAdsClientId: Type: String Description: Google Ads Client ID GoogleAdsClientSecret: Type: String Description: Google Ads Client Secret GoogleAdsRefreshToken: Type: String Description: Google Ads Refresh Token GoogleAdsUserListId: Type: String Description: Google Ads Audience ID (User List ID) Metadata: AWS::ServerlessRepo::Application: Name: amazon-pinpoint-googleads-channel Description: Amazon Pinpoint GoogleAds Channel. This application will add users to Google Ads Audiences. Author: Amazon Pinpoint SpdxLicenseId: MIT-0 LicenseUrl: LICENSE ReadmeUrl: README.md Labels: ['amazon-pinpoint', 'pinpoint', 'custom-channel', 'googleads', 'python'] HomePageUrl: https://aws.amazon.com/pinpoint SemanticVersion: 1.0.0 SourceCodeUrl: https://github.com/aws-samples/amazon-pinpoint-googleads-channel Resources: PinpointGoogleAdsFunction: Type: AWS::Serverless::Function Properties: FunctionName: PinpointGoogleAdsChannel CodeUri: pinpointgoogleads/ Handler: app.lambda_handler Runtime: python3.7 Timeout: 60 Environment: Variables: CLIENT_CUSTOMER_ID: !Ref GoogleAdsClientCustomerId GOOGLE_ADS_DEVELOPER_TOKEN: !Ref GoogleAdsDeveloperToken GOOGLE_ADS_CLIENT_ID: !Ref GoogleAdsClientId GOOGLE_ADS_CLIENT_SECRET: !Ref GoogleAdsClientSecret GOOGLE_ADS_REFRESH_TOKEN: !Ref GoogleAdsRefreshToken GOOGLE_ADS_USER_LIST_ID: !Ref GoogleAdsUserListId Policies: - Statement: - Sid: PinpointPutEvents Effect: Allow Action: mobiletargeting:PutEvents Resource: !Sub arn:${AWS::Partition}:mobiletargeting:${AWS::Region}:${AWS::AccountId}:* PinpointInvokePermission: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: !Ref PinpointGoogleAdsFunction Principal: !Sub pinpoint.${AWS::Region}.amazonaws.com SourceArn: !Sub arn:${AWS::Partition}:mobiletargeting:${AWS::Region}:${AWS::AccountId}:apps/* Outputs: PinpointGoogleAdsFunctionArn: Description: "A function invoked by an Amazon Pinpoint Campaign or Journey that add users to Google Ads Audiences." Value: !GetAtt PinpointGoogleAdsFunction.Arn