4 ms·
Ask HN: TSX for Infra?
I was wondering about how things happen in the frontend (virtualizing dom using react component functions) and I thought it would be more natural to use tsx similary for definining infra, mainly cdk/cdktf/pulumi.
<AwsRegion region="us-east-1" ...>
<AwsAvailabilityZone zone="us-east-1a" ...>
<VPV ...>
<Subnet ...>
Databases
</Subnet>
<Subnet ...>
Api
</Subnet ...>
<Subnet ...>
Load balancers
</Subnet>
</VPC>
</AwsAvailabilityZone>
</AwsRegion>
Main advantage is readability of course, but there might be much more. What do you think?
- redleader55 4y agoYou are describing XML. Now you also need to figure out how to convert said XML into actual API calls that create/update/delete corresponding resources. The question you need to ask yourself is why/how is this better than what Terrafrom provides.
- matesz 4y ago> Now you also need to figure out how to convert said XML into actual API calls that create/update/delete corresponding resources Under the hood it could use cdk/cdktf/cdk8s and those frameworks would handle the rest. > The question you need to ask yourself is why/how is this better than what Terrafrom provide When defining resource component in a Subnet component let's say, it would get subnet automatically from current context (all parents) so developer wouldn't have to provide it directly to. Same with region, az etc. So developer don't have to track variables, but just look at the hierarchy. I think it would be more natural to define infra this way. I am not devops expert by any means, just an idea :)
- TechBro8615 4y agoIf you want to play with this yourself, you could try writing a custom react-reconciler and react-renderer. Start here: https://github.com/facebook/react/tree/main/packages/react-reconciler https://github.com/facebook/react/tree/main/packages/react-r...