-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hitting problem running your third variant leveraging deploy-time-build
#1
Comments
Hi @Analect, thank you for reaching me out! I read your log and found that The error itself is an network error, so it should success with a few retry, but it ultimately depends on your network environment. As for the error on cdk diff, I haven't seen that, but can you try the above fix first? I guess it's just a temporary error. |
Thanks @tmokmss ... you were right, I hadn't properly commented-out things. Sorry! I had a quick follow-on question, if you can help clarify, that would be much appreciated. On the backend, I can see you assign values to the An then these are consumed on the front-end, per below.
I am looking to do something similar with React and noticed your If I look here, I can see assignment of values to
Then
... which is then consumed here
There seems to be a fair bit of confusion around how this would all work with v6 of amplify, per this issue. I was wondering if you have implemented anything with amplify v6 and React? One of those on that issue thread ended up having to come up with a more involved solution ... admittedly with NextJS. I'm just hoping the React-based approach is easier. Thanks alot. |
I haven't used Amplify v6, but as far as it uses public environment variables, it should work in the same way. Regarding v5 to v6 migration, it seems you can just change the schema of Amplify config like this: // v5
Amplify.configure({
Auth: {
userPoolId: process.env.REACT_APP_USERPOOLID,
userPoolWebClientId: process.env.REACT_APP_USERPOOLWEBCLIENTID,
identityPoolId: process.env.REACT_APP_IDPOOLID,
region: process.env.REACT_APP_REGION
},
});
// v6
Amplify.configure({
Auth: {
Cognito: {
userPoolId: process.env.REACT_APP_USERPOOLID,
userPoolClientId: process.env.REACT_APP_USERPOOLWEBCLIENTID,
identityPoolId: process.env.REACT_APP_IDPOOLID
}
}, |
Ah OK. I'll give it a try and report back. Have a good evening. |
Yeah let me know if you stumble upon something 👍 |
@tmokmss ... I have been experimenting with your I know that projen is more opinionated in terms of its tooling and I experienced a problem with the build failing on deploy, which ends up reverting the whole stack-building process ... one of the negative consequences of going the I wanted to get to the bottom what I might be doing wrong. For context, here is a high-level view of the
This was the code from
In your
In my case, for the
Below are the full logs of the error and below that a snipped of what I think is the relevant part.
Per the folder-structure above (and projen preferred tooling), it seems it doesn't produce a Any thoughts on how I might fix this? Thanks alot.
|
Hi @Analect
It's based on the current working directory, which is usually where you run cdk command, which is usually the root of the repo. You can also use I think your current
If you are using yarn, change the - buildCommands: ['npm ci', 'npm run build'],
+ buildCommands: ['yarn', 'yarn build'], You might also need to add Hope this helps 👍 |
Is the This is what I run using
|
Yes. The commands will be executed serially in the array order. As for projen, I'm not sure what the exact configuration you are using, but if it is required to build your frontend, you should have to install it too. This construct basically copies your local file to CodeBuild, and run the build command to extract frontend static files. So all you need is 1. include all the necessary files as input, 2. set the required commands to build frontend assets. The commands should be the same as what you run in your local environment. |
@tmokmss ... I was interested to listen to your CDK Day presentation and like the idea behind your 3rd option, in terms of leveraging the deploy-time-build construct.
Just to test, I cloned this demo repo locally, ran
npm install
in thecdk
folder, then commented-out this part of the code, as I was most interested in the third approach, then rancdk deploy
. It pulled an image ofnode:18
locally, but then errored-out, as follows:I then tried a
cdk diff
, but that failed too.Is there some pre-requisite setup that I should be doing ... or certain permissionings on AWS beforehand for the authenticated aws user? Thanks.
The text was updated successfully, but these errors were encountered: