This message was deleted.
s
This message was deleted.
l
I'm not aware of a best practice. If I was doing this, I'd probably consider wrapping the build and pulumi app in a sinlgle script, rather than putting the build into the deploy. I'd be worried about sharing node_modules accidentally, using wrong versions of dependencies, etc.
I'm sure it can be done though.
s
I am using pulumi only to deploy infrastructure (s3 in this case) and I use circleci for building the client and pushing it to the s3 bucket
you can use aws circleci orb for that, it's pretty easy
Copy code
- run:
    name: Deploy to S3
    command: |
      aws s3 sync dist/client s3://${S3_SITE_BUCKET_NAME} --no-progress --delete
m
Not sure if running it as part of the pulumi deploy would be a good idea, but you should be able to do it using Dynamic Resource Providers. There is an example that may be useful to adapt - https://github.com/pulumi/examples/tree/master/aws-ts-ec2-provisioners. Likely to much more work that just doing it as a build step or wrapper script though...
l
@wide-jackal-86020 the default way, when using Pulumi, is that Pulumi invokes
node
to create the needed resources. If you want to drive Pulumi from within your NodeJS code, have a look a the Automation API. In that setup, the Pulumi engine will be started by your NodeJS code and you can programmatically set the environment, stack config, etc. https://www.pulumi.com/docs/guides/automation-api/
w
Thank you all!
wrapping the build and pulumi app in a sinlgle script,
This is what we are doing now. The problem is that the API endpoints are generated in other pulumi projects, they are not accessible when building the REACT application. @little-cartoon-10569 @miniature-king-36473
use circleci for building the client and pushing it to the s3 bucket
CI/CD works, But we don't have CI/CD setup for every stack. @sparse-spring-91820
Pulumi invokes 
node
 to create the needed resources.
This is what I am thinking to give it a try. Thank you for sharing the other way of driving Pulumi from within NodeJS code using the Automation API. 👍 @limited-rainbow-51650
211 Views