Hey everyone, are there good resources on using pa...
# general
m
Hey everyone, are there good resources on using pants with AWS CDK? Documentation? Example projects? How to organize stacks? I'm thinking of giving pants a try but it would be very useful to see some examples of how other people are working with it and CDK. An initial google search has been, um, not that useful: https://www.mastermans.com/itemdetail/CDK-874BLK3232
1
h
Haha, we really need to work on SEO...
Can you give some examples of what you'd like to do with Pants+AWS CDK? I don't know of existing integrations there, and I'm not super-familiar with CDK
m
Thanks. Basically, I'm thinking about moving a set of microservices into a monorepo and I'd like to understand better how people handle cloud deployments with IaC in that context. We specifically use CDK for that purpose but I'm sure it's comparable to other IaC tools. So far, I can see how I'd use pants for testing and building e.g. a lambda (and be able to only execute these steps if there were changes in the code or dependencies. However, I don't know yet how I'd use those same features in cdk deployments (only deploy this stack if changed).
r
So we are using pants inside aws cdk pipeline. But we are just running these commands inside CI part
Copy code
./pants --version
./pants lint test ::
I have still not figured out how to enable caching. I saw some open issues on aws cdk pipeline https://github.com/aws/aws-cdk/issues/13043
We didn't use pants for lambda because locally we are all using mac.
m
Thanks @refined-addition-53644. Do you use different stacks for different services and is there a convenient way to only trigger deployment for stacks for which the sources have changed?
r
Yeah we do have multiple stacks but we are using aws cdk pipeline to deploy them. As far as I know these pipelines only deploy the changed stack(s) as they are self-mutating. https://docs.aws.amazon.com/cdk/api/v1/docs/pipelines-readme.html
h
I see, so you'd like to leverage Pants's dependency analysis to know when specific cdk pipelines need to be updated.
The rigorous answer would be "we'd need a cdk plugin". We already have plugins for terraform and helm, so there is some IaC precedent.
So if you're interested in contributing that, we can help.
Until then, possibly you can use Pants's introspection goals to figure out which lambdas/pexes/docker images are affected by changes and map those to pipelines via some external config, or naming conventions?
m
yes, that's it. let me take a look at the terraform module and the introspection options
Thanks a bunch.