Revisiting a feature request from #817, but with additional context.
Cognito User Pools allows customers to send auth events to a Pinpoint project. However, I found out that it only allows a customer to send events to projects in the us-east-1 region, regardless of the region in which the User Pool resides.
In order to have amplify CLI manage a Pinpoint project used to receive auth events, the options I see are:
us-east-1awsconfiguration.json file to add the Pinpoint project configuration (which they have to do anyway to add the Pinpoint appId to the config. This would be persisted across amplify push invocations, but the project would not be a fully-fledged managed resource.This is tangentially related to #513, which mapped services to available regions; any feature developed from this request would have to consider service availability as well.
Running into this issue as well, trying to configure PinPoint to region ap-southeast-2.
Any news about this? I am also experiencing the same case.
So far I have created pinpoint resources in us-east-1 manually and then I have referenced them in the app with Amplify.configure(Analytics:{..}), but I am interested in having Amplify automatically generating these resources in us-east-1 even if my app region is eu-west-1, so that I do not have to manage different environment variables and different environment configurations by myself (I currently have dev, test, and master, environments).
Any news about this? I am also experiencing the same case.
So far I have created pinpoint resources in us-east-1 manually and then I have referenced them in the app with Amplify.configure(Analytics:{..}), but I am interested in having Amplify automatically generating these resources in us-east-1 even if my app region is eu-west-1, so that I do not have to manage different environment variables and different environment configurations by myself (I currently have dev, test, and master, environments).
Sorry if this is too late but for anyone who is interested you just need to create a profile in us-east-1 from amplify configure and in amplify init stage select that profile and when you do amplify add analytics it will create the pinpoint resource in that region.
Any news about this? I am also experiencing the same case.
So far I have created pinpoint resources in us-east-1 manually and then I have referenced them in the app with Amplify.configure(Analytics:{..}), but I am interested in having Amplify automatically generating these resources in us-east-1 even if my app region is eu-west-1, so that I do not have to manage different environment variables and different environment configurations by myself (I currently have dev, test, and master, environments).Sorry if this is too late but for anyone who is interested you just need to create a profile in us-east-1 from amplify configure and in amplify init stage select that profile and when you do amplify add analytics it will create the pinpoint resource in that region.
Hi,
A quick snippet of example code would be very helpful @wvyeun. Trying to keep all my resources where they are now ( in us-west-1 ) and to work around the limitation of Analytics being able to send events to pinpoint only in us-east-1, I want to create my pinpoint in us-east-1 via amplify. Am using Cognito User Pools if that makes any difference. Thanks !
Any news about this? I am also experiencing the same case.
So far I have created pinpoint resources in us-east-1 manually and then I have referenced them in the app with Amplify.configure(Analytics:{..}), but I am interested in having Amplify automatically generating these resources in us-east-1 even if my app region is eu-west-1, so that I do not have to manage different environment variables and different environment configurations by myself (I currently have dev, test, and master, environments).Sorry if this is too late but for anyone who is interested you just need to create a profile in us-east-1 from amplify configure and in amplify init stage select that profile and when you do amplify add analytics it will create the pinpoint resource in that region.
Hi,
A quick snippet of example code would be very helpful @wvyeun. Trying to keep all my resources where they are now ( in us-west-1 ) and to work around the limitation of Analytics being able to send events to pinpoint only in us-east-1, I want to create my pinpoint in us-east-1 via amplify. Am using Cognito User Pools if that makes any difference. Thanks !
In the CLI
$ npm install -g @aws-amplify/cli@latest
$ npx create-react-app amplify-app
$ cd amplify-app
$ amplify init
$ npm install aws-amplify
import React from 'react';
import Amplify, { Analytics } from "aws-amplify";
import './App.css';
function App() {
const analytics = () => {
Amplify.configure({
Auth: {
identityPoolId: "youridentitypoolid",
region: "identitypoolidregion",
},
Analytics: {
disabled: false,
AWSPinpoint: {
appId: "pinpointprojectidhere",
region: "us-east-1",
},
},
});
Analytics.record("Test");
window.LOG_LEVEL = 'DEBUG';
};
return (
<div className="App">
{analytics()}
<header className="App-header">
<p>
Hola from Amplify
</p>
</header>
</div>
);
}
export default App;
As a final step In cli
$ amplify push
https://docs.amplify.aws/start/getting-started/setup/q/integration/react#create-a-new-react-app
$ npm install -g @aws-amplify/cli@latest
$ amplify configure
$ npx create-react-app pinpoint-amplify
$ cd pinpoint-amplify
$ amplify init
Now inside the app
In your App.js add the following Import statements.
import React from 'react';
import Amplify, { Analytics } from "aws-amplify";
import awsconfig from './aws-exports';
import './App.css';
Amplify.configure(awsconfig);
function App() {
const analytics = () => {
Analytics.record("Test");
};
return (
<div className="App">
{analytics()}
</div>
);
}
export default App;
It should create pinpoint project in region where amplify is created ideally
I follwed as @wvyeun suggested but ended up making a new amplify app.
Making a new profile and amplify configure project in existing project didn't work either.
I had to manually change the region value in the pinpoint-cloud-....json file like below.
"Mappings": {
"RegionMapping": {
"us-east-1": {
"pinpointRegion": "ap-northeast-2" // it was us-east-1 or us-west-2 whatever the region I didn't wanted. So I changed it to ap-northeast-2
},
"us-east-2": {
"pinpointRegion": "ap-northeast-2"
},
"sa-east-1": {
"pinpointRegion": "ap-northeast-2"
},
"ca-central-1": {
"pinpointRegion": "ap-northeast-2"
},
"us-west-1": {
"pinpointRegion": "ap-northeast-2"
},
"us-west-2": {
"pinpointRegion": "ap-northeast-2"
},
"cn-north-1": {
"pinpointRegion": "ap-northeast-2"
},
"cn-northwest-1": {
"pinpointRegion": "ap-northeast-2"
},
"ap-south-1": {
"pinpointRegion": "ap-northeast-2"
},
"ap-northeast-3": {
"pinpointRegion": "ap-northeast-2"
},
"ap-northeast-2": {
"pinpointRegion": "ap-northeast-2"
},
"ap-southeast-1": {
"pinpointRegion": "ap-northeast-2"
},
"ap-southeast-2": {
"pinpointRegion": "ap-northeast-2"
},
"ap-northeast-1": {
"pinpointRegion": "ap-northeast-2"
},
"eu-central-1": {
"pinpointRegion": "ap-northeast-2"
},
"eu-west-1": {
"pinpointRegion": "ap-northeast-2"
},
"eu-west-2": {
"pinpointRegion": "ap-northeast-2"
},
"eu-west-3": {
"pinpointRegion": "ap-northeast-2"
}
}
}
Now it creates pinpoint at ap-northeast-2 region but not sure if it has any side effects.
ughh.. so tired of doing workaround to avoid unwanted settings using amplify...
Most helpful comment
Any news about this? I am also experiencing the same case.
So far I have created pinpoint resources in us-east-1 manually and then I have referenced them in the app with Amplify.configure(Analytics:{..}), but I am interested in having Amplify automatically generating these resources in us-east-1 even if my app region is eu-west-1, so that I do not have to manage different environment variables and different environment configurations by myself (I currently have dev, test, and master, environments).