StackQL is an intelligent API client which uses SQL as a front-end language with support for multi-cloud and SaaS provider environments, you can find more information at github.com/stackql/stackql
StackQL can provide valuable insights into your cloud and SaaS estates, whether for security posture management, cross-cloud entitlements reporting, cost optimization, or asset/inventory management.
As an interactive analysis tool, Jupyter notebooks can leverage StackQL to provide sources for cloud and SaaS provider data.
We've recently added magic function support for running StackQL queries in Jupyter notebooks, making the integration between StackQL and Jupyter more seamless. StackQL magic and be used on a line in a cell or the entire cell itself, as shown here:
The stackql-jupyter-demo Docker image is available from Docker Hub. You can find instructions to run using the Docker Hub image and instructions to run using docker-compose at github.com/stackql/stackql-jupyter-demo.
Proud to announce the release of the first version of our middleware server and playground for StackQL.
StackQL allows you to query and interact with cloud services and APIs using SQL grammar and an ORM which is a direct reflection of a provider API, no database is required or implemented
Our middleware solution allows you to use StackQL as a query language to interact with APIs, much like GraphQL - however, the query DSL is SQL, providing a friendlier, more data-centric experience for developers. As shown in the example below, developers can POST queries to a /stackql endpoint; the queries are parsed and executed by a StackQL runner via the middleware server.
As the StackQL middleware API server and runner are stateless, the solution is horizontally scalable. With cache and authorization to be implemented, the solution provides a flexible, robust, scalable, performant back end for applications.
Furthermore, using SQL semantics, developers can JOIN data between API providers and perform projections, filtering, aggregation, windowing operations, and more on simple or complex data types.
The StackQL Playground is a TypeScript app that connects to a StackQL Middleware Server, which provides access to backend APIs using SQL. Features of the playground include...
Query results can be sorted or filtered in the grid result set in the StackQL Playground app, JSON results can also be viewed or copied from the JSON results tab.
Furthermore, after modeling a query you can export the TypeScript types using the Get Types button.
Huge thanks to Yuncheng Yang for the work he put in on this!
You can find the complete code here to launch an environment using docker-compose, which includes the StackQL Middleware Server, a StackQL runner (runs the queries on the back end), and the StackQL Playground app.
A new version of the Azure provider for StackQL plus additional built-in functions are available now.
Version 0.3.0 of the Azure provider for StackQL is available now. This update includes support for extended resource properties, along with support for Hybrid Azure Kubernetes Services. The Azure provider allows you to query across your Azure estate for cloud security posture, asset inventory, analysis and reporting, finops, sysops, and more - all using a natural query language (SQL) and a natural object mapping.
In addition, we have announced the release of several new built-in functions, including SPLIT_PART() - to split a string by a delimiter and extract a single element, additional unicode functions, and expanded regular expression support, including REGEXP_REPLACE() and more.
An example StackQL query using the split_part() function with the azure v0.3.0 provider is shown here:
SELECT name, split_part(id,'/',3)as subscription, split_part(id,'/',5)as resource_group, json_extract(properties,'$.hardwareProfile.vmSize')as vm_size FROM azure.compute.virtual_machines WHERE resourceGroupName ='stackql-ops-cicd-dev-01'AND subscriptionId ='242c6a2d-16f9-4912-90f6-59b1cf85509d';
You can find more information on the latest Azure provider here.
Pleased to announce the initial release of the AWS provider for StackQL.
StackQL allows you to query, provision, and manage cloud and SaaS resources using a simple, SQL-based framework.
The initial release of the AWS provider covers EC2, S3, and the Cloud Control API - with support for other services to be released soon. The documentation for the StackQL AWS provider is available here.
Follow the steps below to get started querying AWS in the StackQL interactive command shell:
Connect to an authenticated shell using the syntax shown below:
# AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID should be set as environment variables AUTH="{ \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsenvvar\": \"AWS_SECRET_ACCESS_KEY\", \"keyID\": \"${AWS_ACCESS_KEY_ID}\" }}" stackql shell --auth="${AUTH}"
Show the 'selectable' fields available in a resource:
StackQL
Results
DESCRIBEEXTENDED aws.ec2.instances;
|--------------------|---------|-----------------------------------| | name | type | description | |--------------------|---------|-----------------------------------| | instanceId | string | The ID of the instance. | |--------------------|---------|-----------------------------------| | instanceType | string | The instance type. | |--------------------|---------|-----------------------------------| | instanceState | object | Describes the current state of | | | | an instance. | |--------------------|---------|-----------------------------------| | vpcId | string | [EC2-VPC] The ID of the VPC in | | | | which the instance is running. | |--------------------|---------|-----------------------------------| | subnetId | string | [EC2-VPC] The ID of the subnet | | | | in which the instance is | | | | running. | |--------------------|---------|-----------------------------------| | ipAddress | string | The public IPv4 address | | | | assigned to the instance. | |--------------------|---------|-----------------------------------| | privateIpAddress | string | The private IPv4 address | | | | assigned to the instance. | |--------------------|---------|-----------------------------------| | launchTime | string | The time the instance was | | | | launched. | |------------------ -|---------|-----------------------------------| | ... | ... | ... | |--------------------|---------|-----------------------------------|
SELECT'N. Virginia'as region,COUNT(*)as num_instances FROM aws.ec2.instances WHERE region ='us-east-1' UNION SELECT'N. California'as region,COUNT(*)as num_instances FROM aws.ec2.instances WHERE region ='us-west-1' UNION SELECT'Sydney'as region,COUNT(*)as num_instances FROM aws.ec2.instances WHERE region ='ap-southeast-2';
|---------------|---------------| | region | num_instances | |---------------|---------------| | N. California | 0 | |---------------|---------------| | N. Virginia | 3 | |---------------|---------------| | Sydney | 12 | |---------------|---------------|
StackQL allows you to query and interact with your cloud and SaaS assets using a simple SQL framework
The StackQL provider for Azure provides key visibility across the Azure estate for CSPM, asset inventory and analysis, finops and more, as well as our IaC and ops (lifecycle management) functionality.
Created using the Autorest project using Azure specification docs from the azure-rest-api-specs repository, the StackQL azure provider exposes 230 services, 2,450 resources (of which 1,985 or 81% are available using SELECT statements) and 10,140 methods in total.
Core services are available in the azure provider, all other services are available using the azure_extras provider.
We will be adding integrated interactive authentication, for now this is cli/sdk based, all of the documentation is here.
Give it a test run and let us know what you think!