Just curious if SST plans to support the Terraform...
# sst
j
Just curious if SST plans to support the Terraform CDK in the future or to be for AWS specifically?
t
we have no plans right now but if there's a path to including it then it definitely makes sense to
j
Ok cool, yea mainly ask as we do use some services outside of AWS like Auth0 and Github that would be nice if it was all in one place rather than separate. Also the dev experience is much nicer with SST so far!
f
@justindra just curious, are you using Terraform currently?
o
I wonder how well this could be covered with cloudformation custom resources. Right we get around use services like auth0 by setting up instances manually, sharing a few between all our stages, storing the config/keys inside parameter store and injecting env vars into the build as needed. Or a custom resource that lets you bridge into terraform providers…that’d be epic
j
@Frank yea, we had it setup a while back and are mainly using it to manage Github and Auth0, there are a couple other little services, as well. This was done through their CLI, it rarely changes at the moment, so it's not a huge priority to transition it across. It's definitely something that would be great to have though!
@Omi Chowdhury yea, similar with us too, we have a script that takes the Terraform output to save into SSM atm. Sharing of instances between stages is definitely a must have for us, mainly for development and staging.
f
@Omi Chowdhury yeah, using custom resources would allow us piggybagging CFN to manage the resource state. If SST were to directly call Terraform, it’d be much faster (not going through CFN), but SST would have to manage the state.
@justindra thanks for the details. Just curious, how r u managing the states for Terraform? Are you using Terraform Cloud?
j
We currently just use a github repo with strict permissions to manage it. Given the fact that ours is quite stable and it is likely not changing often, we decided to just allow a single user to push on the branch that performs the planning and deployment via Github Actions.
s
IMO there would need to be an adapter layer in SST that could utilise cdktf or aws-cdk. I toyed with the idea of generic constructs like SST has in CDKTF, but I'd like to do something like:
Copy code
new StaticSite(this, "Site", {
  path: "path/to/src",
  provider: 'cloudflare'
});

new StaticSite(this, "Site", {
  path: "path/to/src",
  provider: 'vercel'
});
There would be a huge burden to maintain the translation layer between a generic Site props to a specific provider Site props. Some rough attempts here though from August 2021 https://github.com/simonireilly/cdktf-resource-project/blob/main/infra/main.ts
Had to stop, started a new job and was too busy 😓
f
haha thanks @Simon Reilly. Definitely a burden to support multiple providers for each construct. But might be interesting to have both AWS CDK stacks along side Terraform stacks in the same app. 😇
s
Sounds powerful
o
Yeah being able to use SST’s stage with terraform, have it in Typescript side by side with CDK, and have it natively supported in SEED would be amazing