IaSQL is now Open Source and SaaS
IaSQL, the company behind a service that models AWS infrastructure using SQL, recently announced that IaSQL is available as open source and software as a service.
By mapping cloud APIs into SQL tables, IaSQL manages a two-way connection between an AWS account and a hosted PostgreSQL database to describe an AWS deployment. LuisFer De Pombo, co-founder and CEO, explains:
Infrastructure-as-code solutions don’t have a good way to encode dependencies between infrastructure elements in a microservices architecture, which makes it very difficult to make and roll back changes to infrastructure. Representing your infrastructure as SQL solves the core problem of YAML-based infrastructure tools by making relationships between elements of your infrastructure first-class citizens.
The service can be configured to manage existing deployments: by connecting an AWS account to an IaSQL instance, the database is populated with running cloud resources, and services can be defined and limited using a module system where each IaSQL module is mapped to an AWS service. , for example aws_ec2 or aws_elb.
IaSQL isn’t the only service trying to query and manage cloud infrastructure through SQL. Other options include CloudQuery, an open source cloud asset inventory, Steampipe, an open source project from Turbot, trino-cloud, a Trino connector for cloud resource management, and StackQL. De Pombo adds an example of the benefits of an SQL approach:
You cannot set the EC2 instance type to “t2.mucro » and instruct your deployment system to try and fail to create such an instance. The insert statement will fail and tell you that no rows were inserted and you will quickly understand why.
The article also shows different example SQL statements to manage EC2 instances, for example to create a new one running on the latest Amazon Linux AMI:
INSERT INTO aws_ec2 (ami_id, ec2_instance_type_id) SELECT ami.id, ait.id FROM ec2_instance_type as ait, ( SELECT id FROM amis WHERE image_name LIKE 'amzn-ami-hvm-%'ORDER BY creation_date DESC LIMIT 1 ) as ami WHERE ait.instance_name = 't2.micro';
One of the supposed benefits of using SQL is language adoption: SQL is already used in most engineering teams, so cloud engineers won’t need to learn a new language to manipulate the infrastructure. In a thread on Hacker News, user core comments:
While representing the state of the infrastructure as SQL is useful for enforcing type safety and other constraints, I still don’t understand what the real benefits are over the current tool. All of the key benefits listed there, including type safety and constraints set by cloud providers, are already well covered by battle-tested tools and frameworks.
User rubicity does not agree:
I see a lot of criticism for not wanting to use SQL to do writes and I think that’s misguided. The current state of your infrastructure is absolutely state and SQL is a great language for working with state (…) The infrastructure is stateful and relational, so why not use SQL and relations to manage it?
According to the creators, one of the advantages of relying on a PostgreSQL instance as a repository is the ability to completely replace the running IaSQL database with an earlier snapshot on AWS, bringing the entire deployment back to a previous state.
The current release only supports a subset of services on AWS: EC2, Elastic Container Register (ECR), ECS + Fargate, ELB, RDS, VPC, and IAM. IaSQL plans to support GCP, Azure, and other cloud providers in the future. The repository is on GitHub and a Discord channel is available.