Any ideas on how I could test my resources even be...
# general
s
Any ideas on how I could test my resources even before I could execute pulumi up? I mean is there some possibilities to do some unit testing?
r
s
Does that only work with AWS?
r
i dont knwo alternatives for other clouds
s
So that works only with AWS.
r
yes
s
That does not help as for EKS, I need a Pro license
r
yes
p
Running tests against localstack is faster than the cloud but still far from what we expect from unit tests. And, in my opinion, eventually you will have to run your tests against the real cloud as it is probably not 100% compatible. I have the following approach: 1. Have some integration tests running on a real AWS account with uid in the resource names and good cleanup code. Additionally I am using aws-nuke from time to time to be sure. 2. Have quite a lot of "unit" tests where I compare Pulumi output to my prepared yamls. I had to write some glue code to achieve that (you can find a part of it here: https://github.com/pulumi/pulumi/issues/8938). I am using Golang but I think it should be possible in other languages. With this kind of tests I am covering a lot of cases and also I can develop quite fast as they run in maximum a few seconds. 3. I am writing regular unit tests for some algorithms e.g. my cloud resource naming conventions.
s
All what I'm doing is in my spare time and just for the sake of learning. I do now own any Azure or AWS accounts and without that my only possibility is to run the code against some unit tests. I do not see the possibility to execute or build unit tests against Java
p
If it is only for experiments/learning, I would strongly advice to create a cloud account and start with it. You will fill how Pulumi (or any other IaC tool) work.