aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
zackteo 2020-09-15T03:36:13.109300Z

Hi guys, I have this project https://istd50043.github.io/project#implementation-requirements I'm trying to consider the possibility of doing this solo (so that I can do Clojure full stack) I'm thinking the "Production System" can be done with Clojurescript. "Analytics System" can be done with Clojure. But I also need to do automation scripts for AWS - not sure how possible is it to do this with babashka :o I know might be pretty intense to tackle alone. But am wondering how intense/possible is it :x

dakra 2020-09-15T07:37:58.110500Z

For working with the AWS API you can use https://github.com/cognitect-labs/aws-api

zackteo 2020-09-15T09:39:42.111100Z

Thanks @daniel415 ! @jimmy , I will be going ahead with the project in Clojure after all! :D I miraculously found 2 peers to join me to form a 3 man team 🙂 so it isn't as ridiculously daunting anymore

jumar 2020-09-15T09:53:15.111300Z

Instead of calling aws api manually consider using a more declarative approach like CloudFormation (rather bad with all that JSON bloat) or better CDK (there was a clojure port but has been abandoned in favor of native TypeScript support)

zackteo 2020-09-15T09:55:15.111500Z

Do you mean this https://github.com/brabster/crucible? o:

jumar 2020-09-15T09:57:57.111800Z

For the abandoned clojure CDK project I meant this: https://github.com/StediInc/cdk-clj I don't know the other one.

zackteo 2020-09-15T11:14:48.112400Z

Isn't it a bad idea since it is abandoned? Or is it because it should still be stable o:

jumar 2020-09-15T13:03:06.115800Z

No, don’t use it. I was broadly speaking about AWS CDK - that’s worth looking at; compiles to CloudFormation and you can write infrastructure code in Typescript, Python, Java, ... to reduce boilerplate

viesti 2020-09-15T13:07:34.116Z

Terraform is also a nice tool for defining infrastructure

steveb8n 2020-09-15T22:32:35.116800Z

I previously used Crucible, then switched to clj-cdk and then to typescript CDK for my clojure /full-stack system. I’m very happy using typescript for just this part. Of course there’s also Terraform, Pulumi, etc. Just pick one :)

include 2020-09-17T17:12:16.117900Z

+1 for CDK with Typescript.

jumar 2020-09-18T06:09:10.000100Z

I've been thinking about starting using CDK (possibly) with Typescript for automating some of our infrastructure. What's unclear to me yet is how well CDK plays with existing resources (based on my current research not su much) - let's say I want define WAF web acl or beanstalk env via CDK and connect them to an existing CloudFront distribution; is there an easy way to do it? To me it looks like with CDK I have to define the whole stack in CDK and if I have resources created manually before I'm out of luck. @viesti @steveb8n any experience regarding this scenario?

jumar 2020-09-18T06:09:42.000300Z

Sorry I meant @include not viesti 🙂

viesti 2020-09-18T06:09:52.000500Z

nah, I'm curious on hearing too 🙂

viesti 2020-09-18T06:10:22.000800Z

Cloudformation has a way to import existing resources these days, don't know how well that plays with CDK

steveb8n 2020-09-18T06:10:54.001Z

most resources in CDK have a fromARN or fromName fn where you can load an existing resource and reference it

viesti 2020-09-18T06:10:59.001200Z

With Terraform, you script the resources, possibly creating many of them and can then import the instances

viesti 2020-09-18T06:11:06.001400Z

ah nice

steveb8n 2020-09-18T06:11:21.001600Z

so that way you can create new stack resources connected to existing ones

steveb8n 2020-09-18T06:12:03.001800Z

but naturally those resources are not “infra as code” so it’s better to replace them with CDK created versions over time

jumar 2020-09-18T06:12:24.002300Z

Interesting, how is it related to CloudFormation's import then? • https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-existing-stack.html • Also found this: https://github.com/aws/aws-cdk-rfcs/issues/52

steveb8n 2020-09-18T06:13:24.002600Z

CDK is CF under the covers so anything you can do all this just using CF if you want

steveb8n 2020-09-18T06:13:48.002800Z

but CDK/typescript gives you compile time checking/intellisense etc

viesti 2020-09-18T06:14:15.003Z

seems like one would do the import onto an already created stack, dunno how the resources end up into the stack though

steveb8n 2020-09-18T06:14:18.003200Z

that said, lots of things only fail when you deploy the CDK stack so not everything is compile time

steveb8n 2020-09-18T06:14:59.003400Z

your best bet is just try a small stack. it’s really easy to get started. you can answer most questions for yourself then

viesti 2020-09-18T06:15:10.003600Z

I think I'm in the minority here, but I quite like Terrafrom too, it offers intellisense (IntelliJ has a nice plugin, Emacs has some support too) and the language kind of suits for configuration 🙂

steveb8n 2020-09-18T06:15:19.003800Z

I didn’t know typescript at all when I started

steveb8n 2020-09-18T06:15:40.004Z

yep. Terraform and Pulumi are also good. CDK is AWS only

viesti 2020-09-18T06:16:04.004200Z

anyhow, interesting things 🙂

jumar 2020-09-18T06:17:02.004400Z

Perfect, thank you both for all the details! I did CDK workshop but need to do some "real" stuff too - will see how well it plays with our infrastructure (lots of things defined manually via AWS console, some via CloudFormation templates)

steveb8n 2020-09-18T06:18:12.004600Z

glad to help

viesti 2020-09-18T06:18:48.004800Z

glad to be part of the discussion 🙂

include 2020-09-18T08:50:01.005Z

@jumar timezones… yes as @viesti said you have a couple ways to use/import external resources/stacks.

include 2020-09-18T08:51:26.005200Z

@steveb8n now we have Terraform + CDK - so we can write CDK Typescrypt and gerenate Terraform.

🙏 1
viesti 2020-09-18T09:53:56.005500Z

ah that too, had forgotten that Terraform has a CDK thing nowadays also: https://github.com/hashicorp/terraform-cdk

include 2020-09-18T13:24:19.005800Z

Yes it’s new but I am willing to give it a try. In the past I only used TF then I jumped into a pure CFN project and now I only code infra with CDK 🙂 yes… I wanna join all my experience in “one code style” and deployment tooling; still I am not a TS developer but until now I was able to move forward.

jimmy 2020-09-15T03:45:12.109500Z

You could definitely do those things with clojure. For the automation scripts, you could use babashka, but there is no reason you can't use vanilla clojure.

zackteo 2020-09-15T03:46:16.109700Z

Right! Are there any references or libraries I would wanna look at? To work with aws?

zackteo 2020-09-15T03:47:15.109900Z

Am also considering the intensity demanded if I tackle this task solo :x