https://pulumi.com logo
Title
s

steep-monitor-75482

03/26/2023, 12:54 PM
Hello team, What should be the ideal project structure for AWS using typescript. I am thinking some thing like these.
.
|
├── Pulumi.dev.yaml
├── Pulumi.qa.yaml
├── Pulumi.prod.yaml
├── Pulumi.yaml
├── dist.                         -- output directory after building typescript
│   ├── index.d.ts
│   ├── index.js
│   ├── index.js.map
│   ├── infra
│   │   ├── index.d.ts
│   │   ├── index.js
│   │   ├── index.js.map
│   │   ├── lambda
│   │       ├── index.d.ts
│   │       ├── index.js
│   │       ├── index.js.map
│   │       ├── variable.d.ts
│   │       ├── variable.js
│   │       └── variable.js.map
│   │   └── vpc
│   │       ├── index.d.ts
│   │       ├── index.js
│   │       ├── index.js.map
│   │       ├── variable.d.ts
│   │       ├── variable.js
│   │       └── variable.js.map
│   └── tsconfig.tsbuildinfo
├── index.ts                   -- entry point file
├── infra
│   ├── index.ts.              -- import services lambda, vpc, etc...
│   ├── lambda
│       ├── index.ts.          -- to create lambdas basics, use variable according to stack stack (dev, qa, prod)
│       └── variable.ts        -- to store variables used in lambda, different values for each stack (dev, qa, prod)
│   └── vpc
│       ├── index.ts
│       └── variable.ts
├── package-lock.json
├── package.json   
└── tsconfig.json
Any suggestion will be appreciated.
s

stocky-restaurant-98004

03/27/2023, 2:53 PM
We have a blog post that you should find useful on this subject: https://www.pulumi.com/blog/iac-recommended-practices-structuring-pulumi-projects/ In general, I would recommend starting simple and evolving your codebase from there. I don't think you'll need something as elaborate as what you have above (although it does look very well thought-out).
m

miniature-musician-31262

03/28/2023, 5:08 PM
This actually looks pretty good to me (
dist
being presumably all generated code), but agree with Josh that starting simple is good. Curious what you’re planning on putting in those
variable
files, though — that looks like the kind of thing that’d typically be handled with stack configuration.