R
R
Roman Mirilaczvili2020-11-23 15:37:08
API
Roman Mirilaczvili, 2020-11-23 15:37:08

What are the ways to manage infrastructure with Terraform beyond their CLI?

Started to get familiar with Terraform (TF), so forgive me in advance if the question seems silly.
So, TF allows you to represent the infrastructure declaratively, using a set of .tf files. We feed files to the utility and it adapts the infrastructure to the new state. Amazing.
And if you want to use TF programmatically, is it supposed to be the only way to call the TF CLI and parse its output? Or are there some SDKs that can be used for, say, Go/Python?
Let's say I want to build an infrastructure management web application.
Too bad there is no Terraform tag.
Here they write that there are no other ways:
https://discuss.hashicorp.com/t/terraform-automati...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Mirilaczvili, 2021-03-12
@2ord

I will answer myself: for Go there is an SDK terraform-exec , which calls the Terraform CLI with the necessary keys and analyzes the output stdout, stderr.

R
Ruslan Lopatin, 2016-09-30
@Scarfase1989

You have an error in the iteration algorithm.
Each time you find a matching element, you skip the next one without checking.
Move in the opposite direction then. Or use an iterator - it has a remove() method.
And you can check just: matches("p")

S
Saboteur, 2016-09-30
@saboteur_kiev

What is the result now? At first glance, the regular expression is correct.
What does search by all characters mean? Do you need to find one letter?
PS to search for a single letter or even a word, it will be less expensive to search for a substring (index) than regular expressions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question