Hello team, What should be the ideal project struc...
# typescript
s
Hello team, What should be the ideal project structure for AWS using typescript. I am thinking some thing like these.
Copy code
.
|
├── 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
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
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.