Question for those who wants to “code everything”…...
# random
a
Question for those who wants to “code everything”… In my company we have many third-party services (G Workspaces, Atlassian, VPN Provider, Slack…) .. etc. Once a new member joins the company, somebody has to go manually and create each account, assign each permission, each group… This doesn’t scale, I want to code something in a way that I can execute it many times, and also have some audit of it. Is was thinking to have a sort of “stack” where I can make API calls to Google, Atlassian, Slack .. etc. Somebody knows a framework or tool to do this?
t
I used to do this with terraform
they have providers for things like this - I'd even create github repos this way
it's pretty powerful!
a
Interesting.
I don’t like the way TF language is.
I mean, it’s hard to understand.
Is there a way to use TS for Terraform? hahaha.
t
yeah there is actually
a
😮
t
but I haven't used it
a
Yeah I saw it.
But…
It’s CDK for TF…
t
I actually prefer the TF language. It's more declarative so once you get used to it everyone's tf configs look the same
a
It’s right to use CDK for my purpose?
I associate CDK to CFormation.. maybe I’m wrong.
t
no it's seperate, I haven't tried cdktf but technically it should work for you
CDK really is just the
constructs
library
a
Ok, going to take a look, I wanted to test CDKTF, maybe this is the opportunity.
Yeah makes sense.
t
I personally hate the
constructs
library at this point haha and am sad that this is what is becoming the standard
a
Whyyy?
I like the idea.
And also the “marketplace” they built.
t
I like it conceptually, I just don't like the implementation
a
Ah ok, that makes sense.
t
I think because I work with it at a lower level I run into certain issues. Everything being constructor based is my #1 problem, makes it so everything has to be synchronous and this means there's so much that breaks
a
I see.
t
can't use dynamic imports, which means we can't have optional dependencies can't use anything that requires async so we have to do all kinda of crazy hacks
a
Oh yeah the async stuff it’s true.
I wanted to use async/await on my stacks.
t
yeah you can now with functional stacks but for us on the SST team building constructs, we also want to use async await inside construct code
and we can't 😢
k
@Adrián Mouly regarding stuff outside CDK needs - perhaps Zapier + it's competitors might be worth a look for integrating things that have an API
a
Interesting.
Yeah I know those kind of automation tools.
s
Having just started working with AWS Step Functions, onboarding sounds like a task well suited for the service.
a
Interesting.
s
I've only built some basic workflows with Step Functions, but it feels like it could be used for this
For example, you could write small, self-contained Lambda functions and orchestrate their execution via Step Functions
but yeah, I'd prefer provisioning them with Infrastructure as Code if that were an option
a
Yeah feels more natural to be IaC... But actually is not Infra.. Ops as Code? Haha.
OaC? Is that even a thing?
s
If your third party services expose APIs, I bet you could do something clever with Event Bridge API Destinations
New employee to onboard? Emit a NewEmployeeEvent with Event Bridge Rules that route requests to 3rd party APIs to provision new accounts
This is probably a terrible idea, but kind of fun to think about 🙂
t
the difference is you have to maintain state if you do it that way
keep track of all the actions you took so you can undo them later
that's why I used TF for this before, it already can create/undo stuff. So adding a person was updating one config file, running terraform and having all their stuff provisioned. Then if they left we'd remove them and everything would get cleaned up
s
Terraform seems well suited for this type of thing
a
Yeah, it looks like.
j
So do you mean basically like SSO as code?
a
Sort of, but in my case I need to provision other things, not only new accounts.
j
OK, gotcha. Yea, with other things, Terraform has been good. I tried their CDK about a year ago while it's in alpha stage and it did not do that well. Would be interesting to re-try it now and see if it's much more stable.
a
Yeah looks more stable now.
I’m going to do some tests.