https://pulumi.com logo
#general
Title
# general
v

victorious-toddler-58071

09/15/2022, 12:42 PM
Hi! Question on dependencies between micro-stacks/projects/programs. We are discovering Pulumi for large platform automation and are dealing with multi tenant infrastructure & service needs. (many teams, many projects, single foundation) I looks like micro-stack approach is the better fit. I'm looking for the best way on how to manage the dependencies between micro stacks; And how to run pulumi recursively across multiple micro-stacks. Example: Project structure
Copy code
├── infrastructure
│   ├── foundation (Platform wide Core components [VPC, K8s, ...])
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
│   ├── solution1 (Solution specific infra components [MongoDB, API Gateway, ...] )
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
│   ├── solution2 (Solution specific infra components [Postgres, SNS, ...] )
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
├── services
│   ├── foundation (Platform wide Core components [Auth services, IAM services, ...])
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
│   ├── solution1 (Solution specific services [Custom micro services, ...] )
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
│   ├── solution2 (Solution specific services  [Custom micro services, ...] )
│   │   ├── main.go
│   │   ├── Pulumi.yaml
│   │   ├── Pulumi.dev.yaml
│   │   ├── Pulumi.staging.yaml
│   │   └── Pulumi.prod.yaml
...
In this example above; the infra components from solution 1 & solution 2 can only be deployed once the infra foundation is deployed. Next the service need to go after all infra has completed. last Solution services have to after foundation services. How can i manage this dependencies? And how can i execute a single pulumi command to go and execute/update/destroy all stacks at once in right order?
s

stocky-restaurant-98004

09/15/2022, 1:15 PM
You can use the Automation API to orchestrate multiple stacks. https://www.pulumi.com/docs/guides/automation-api/
e

early-telephone-30941

09/15/2022, 8:20 PM
@victorious-toddler-58071, Depend on what you are comfortable with and dependency needs. You could BASH/ZSH it in Circle/Travis with the CLI. or use the API as suggested by Josh .