steampipe plugin install aws

Table: aws_api_gateway_domain_name - Query AWS API Gateway Domain Names using SQL

The AWS API Gateway Domain Name is a component of Amazon's API Gateway service that allows you to create, configure, and manage a custom domain name to maintain a consistent user experience. It enables routing of incoming requests to various backend services, including AWS Lambda functions, and provides features like SSL certificates for secure communication. This is crucial for providing a seamless and secure API communication channel for your applications.

Table Usage Guide

The aws_api_gateway_domain_name table in Steampipe provides you with information about domain names within AWS API Gateway. This table allows you, as a DevOps engineer, to query domain-specific details, including the domain name, certificate details, and the associated API. You can utilize this table to gather insights on domains, such as the domain's endpoint configuration, the type of certificate used, and the API it's associated with. The schema outlines the various attributes of the domain name for you, including the domain name, certificate upload date, certificate ARN, and endpoint configuration.

Examples

Basic info

Determine the areas in which your API Gateway domain name configurations are operating in AWS. This can help you understand the status and ownership of your domain names, providing insights into their distribution and certificate details.

select
domain_name,
certificate_arn,
distribution_domain_name,
distribution_hosted_zone_id,
domain_name_status,
ownership_verification_certificate_arn
from
aws_api_gateway_domain_name;
select
domain_name,
certificate_arn,
distribution_domain_name,
distribution_hosted_zone_id,
domain_name_status,
ownership_verification_certificate_arn
from
aws_api_gateway_domain_name;

List available domain names

Determine the areas in which domain names are available for use in the AWS API Gateway. This is beneficial for identifying potential new domains for your applications.

select
domain_name,
certificate_arn,
certificate_upload_date,
regional_certificate_arn,
domain_name_status
from
aws_api_gateway_domain_name
where
domain_name_status = 'AVAILABLE';
select
domain_name,
certificate_arn,
certificate_upload_date,
regional_certificate_arn,
domain_name_status
from
aws_api_gateway_domain_name
where
domain_name_status = 'AVAILABLE';

Get certificate details of each domain name

Discover the segments that provide detailed insights about the certificates associated with each domain name. This is useful in understanding the security measures in place and their configurations, aiding in better management of your web assets.

select
d.domain_name,
d.regional_certificate_arn,
c.certificate,
c.certificate_transparency_logging_preference,
c.created_at,
c.imported_at,
c.issuer,
c.issued_at,
c.key_algorithm
from
aws_api_gateway_domain_name as d,
aws_acm_certificate as c
where
c.certificate_arn = d.regional_certificate_arn;
select
d.domain_name,
d.regional_certificate_arn,
c.certificate,
c.certificate_transparency_logging_preference,
c.created_at,
c.imported_at,
c.issuer,
c.issued_at,
c.key_algorithm
from
aws_api_gateway_domain_name as d,
aws_acm_certificate as c
where
c.certificate_arn = d.regional_certificate_arn;

Get endpoint configuration details of each domain

Determine the configuration details of each domain in your AWS API Gateway to better understand the types of endpoints used and identify any associated Virtual Private Cloud (VPC) endpoints.

select
domain_name,
endpoint_configuration -> 'Types' as endpoint_types,
endpoint_configuration -> 'VpcEndpointIds' as vpc_endpoint_ids
from
aws_api_gateway_domain_name;
select
domain_name,
json_extract(endpoint_configuration, '$.Types') as endpoint_types,
json_extract(endpoint_configuration, '$.VpcEndpointIds') as vpc_endpoint_ids
from
aws_api_gateway_domain_name;

Get mutual TLS authentication configuration of each domain name

This query can be used to analyze the mutual TLS authentication settings for each domain name in an AWS API Gateway. It provides insights into the truststore details, which can be beneficial for improving security configurations and troubleshooting potential issues.

select
domain_name,
mutual_tls_authentication ->> 'TruststoreUri' as truststore_uri,
mutual_tls_authentication ->> 'TruststoreVersion' as truststore_version,
mutual_tls_authentication ->> 'TruststoreWarnings' as truststore_warnings
from
aws_api_gateway_domain_name;
select
domain_name,
json_extract(mutual_tls_authentication, '$.TruststoreUri') as truststore_uri,
json_extract(mutual_tls_authentication, '$.TruststoreVersion') as truststore_version,
json_extract(mutual_tls_authentication, '$.TruststoreWarnings') as truststore_warnings
from
aws_api_gateway_domain_name;

Schema for aws_api_gateway_domain_name

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
certificate_arntextThe reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name.
certificate_nametextThe name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificate_upload_datetimestamp with time zoneThe timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
distribution_domain_nametextThe domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint.
distribution_hosted_zone_idtextThe region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2 for all the regions.
domain_nametext=The custom domain name as an API host name.
domain_name_statustextThe status of the DomainName migration. The valid values are AVAILABLE and UPDATING. If the status is UPDATING, the domain cannot be modified further until the existing operation is complete.
domain_name_status_messagetextAn optional text message containing detailed information about status of the DomainName migration.
endpoint_configurationjsonbThe endpoint configuration of this DomainName showing the endpoint types of the domain name.
mutual_tls_authenticationjsonbThe mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
ownership_verification_certificate_arntextThe ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
regional_certificate_arntextThe reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
regional_certificate_nametextThe name of the certificate that will be used for validating the regional domain name.
regional_domain_nametextThe domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regional_hosted_zone_idtextThe region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
security_policytextThe Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0 and TLS_1_2.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.

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)" -- aws

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

steampipe_export_aws --config '<your_config>' aws_api_gateway_domain_name