steampipe plugin install env0

Table: env0_template - Query env0 Templates using SQL

An env0 Template is a predefined infrastructure as code (IaC) template that can be used to create and manage resources on the env0 platform. These templates are typically written in Terraform or Terragrunt, and define the infrastructure components needed for an application. The templates are reusable, version-controlled, and can be parameterized to create unique environments based on the same template.

Table Usage Guide

The env0_template table provides insights into the infrastructure as code (IaC) templates used within the env0 platform. As a DevOps engineer, you can explore template-specific details through this table, including the template's name, version, and associated parameters. Utilize it to manage and understand the infrastructure components defined in each template, allowing for better control and visibility over your env0 environments.

Examples

Basic info

Explore which templates are created by whom and when, along with their associated organizations and projects. This could be useful to understand how your infrastructure as code templates are being used across different enterprise version control systems.

select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template;
select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template;

List templates created in the last 30 days

Discover the segments that have been recently added by identifying templates created within the past month. This can help keep track of new additions and understand recent changes in your environment.

select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template
where
created_at >= now() - interval '30' day;
select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template
where
created_at >= datetime('now', '-30 day');

List templates that have not been updated in the last 30 days

Assess the elements within your environment to identify any templates that haven't been updated in the past month. This can be useful to ensure all templates are up-to-date and adhere to current standards or practices.

select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template
where
updated_at >= now() - interval '30' day;
select
name,
id,
author,
created_at,
organization_id,
is_github_enterprise,
is_gitlab_enterprise,
project_ids,
terraform_version
from
env0_template
where
updated_at >= datetime('now', '-30 day');

List templates that uses GitHub or GitLab enterprise

Explore the templates created for organizations that utilize either GitHub or GitLab enterprise versions. This is particularly useful for identifying and analyzing the use of these enterprise platforms in your projects.

select
name,
id,
author,
created_at,
organization_id,
project_ids,
terraform_version
from
env0_template
where
is_github_enterprise
or is_gitlab_enterprise;
select
name,
id,
author,
created_at,
organization_id,
project_ids,
terraform_version
from
env0_template
where
is_github_enterprise = 1
or is_gitlab_enterprise = 1;

Schema for env0_template

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
authortextName of the author of the template.
author_idtextUnique identifier of the author.
bitbucket_client_KeytextThe Bitbucket client key used by template.
created_attimestamp with time zoneThe date and time when template was created
descriptiontextDescription associated with the template.
file_nametextFile name associated with template.
github_installation_idbigintThe GitHub installation of the template.
hreftextHref link to the template.
idtext=Unique identifier of the template.
is_azure_devopsbooleanSpecifies whether the template is associated with Azure DevOps deployment.
is_bitbucket_serverbooleanSpecifies whether or not template is using Bitbucket server.
is_deletedbooleanSpecifies whether or not the template is deleted.
is_github_enterprisebooleanSpecifies whether or not template belongs to GitHub enterprise.
is_gitlab_enterprisebooleanSpecifies whether or not template belongs to GitLab enterprise.
is_terragrunt_run_allbooleanSpecifies whether or not terragrunt will execute all the modules associated with the template.
nametextName of the template.
organization_idtextThe organization ID in which the resource is located.
pathtextThe Path of the template.
project_idtextThe associated project id with the template.
project_idsjsonbThe associated projects id with the template.
repositorytextThe associated version control repository with the template.
retryjsonbRetry associated with the template.
revisiontextRevision of the template.
ssh_keysjsonbThe associated ssh keys with the template.
terraform_versiontextTerraform version associated with the template.
terragrunt_versiontextSpecifies the version of terragrunt that should be used when running a terraform deployment by the template.
titletextTitle of the resource.
token_idtextToken ID associated with the template.
typetextType of the template.
updated_attimestamp with time zoneThe date and time when template was updated

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- env0

You can pass the configuration to the command with the --config argument:

steampipe_export_env0 --config '<your_config>' env0_template