steampipe plugin install aws

Table: aws_service_discovery_namespace - Query AWS Cloud Map Service Discovery Namespace using SQL

The AWS Cloud Map Service Discovery Namespace is a component of AWS Cloud Map that helps applications to discover services dynamically over the cloud. It allows services to register their instance and utilize naming schema for easy discovery. This aids in maintaining the updated location of services, which is crucial for microservice architectures and serverless applications.

Table Usage Guide

The aws_service_discovery_namespace table in Steampipe provides you with information about AWS Cloud Map Service Discovery Namespaces. This table allows you, as a DevOps engineer, to query namespace-specific details, including namespace type (DNS, HTTP), associated services, and associated metadata. You can utilize this table to gather insights on namespaces, such as the number of services in each namespace, namespace types, and more. The schema outlines the various attributes of the service discovery namespace for you, including the namespace ID, ARN, name, type, and associated tags.

Examples

Basic info

Determine the areas in which AWS services are being utilized, by identifying their names, IDs, types, and regions. This is useful for understanding your AWS service usage and distribution across different regions.

select
name,
id,
arn,
type,
region
from
aws_service_discovery_namespace;
select
name,
id,
arn,
type,
region
from
aws_service_discovery_namespace;

List private namespaces

Explore which namespaces are private within your AWS Service Discovery to better manage your resources and ensure data security. This is particularly useful in scenarios where you need to isolate specific resources or data within your AWS environment.

select
name,
id,
arn,
type,
service_count
from
aws_service_discovery_namespace
where
type ilike '%private%';
select
name,
id,
arn,
type,
service_count
from
aws_service_discovery_namespace
where
type like '%private%';

List HTTP type namespaces

Identify instances where the type of AWS Service Discovery Namespace is HTTP. This can help in understanding the distribution of different namespace types and aid in the management of AWS services.

select
name,
id,
arn,
type,
service_count
from
aws_service_discovery_namespace
where
type = 'HTTP';
select
name,
id,
arn,
type,
service_count
from
aws_service_discovery_namespace
where
type = 'HTTP';

List namespaces created in the last 30 days

Discover the segments that have been recently added to the service discovery namespace in AWS within the past month. This can be useful in tracking recent changes or additions to your AWS environment.

select
name,
id,
description,
create_date
from
aws_service_discovery_namespace
where
create_date >= now() - interval '30' day;
select
name,
id,
description,
create_date
from
aws_service_discovery_namespace
where
create_date >= datetime('now', '-30 day');

Get HTTP property details of namespaces

Explore the details of HTTP properties associated with specific namespaces to better understand their configuration and usage in your AWS service discovery setup. This can be useful in diagnosing issues or optimizing resource utilization.

select
name,
id,
http_properties ->> 'HttpName' as http_name
from
aws_service_discovery_namespace
where
type = 'HTTP';
select
name,
id,
json_extract(http_properties, '$.HttpName') as http_name
from
aws_service_discovery_namespace
where
type = 'HTTP';

Get private DNS property details of namspaces

Determine the areas in which private DNS properties of namespaces are utilized within AWS Service Discovery. This assists in understanding the specific configuration and settings of your private DNS, thus aiding in better resource management and optimization.

select
name,
id,
dns_properties ->> 'HostedZoneId' as HostedZoneId,
dns_properties -> 'SOA' ->> 'TTL' as ttl
from
aws_service_discovery_namespace
where
type = 'DNS_PRIVATE';
select
name,
id,
json_extract(dns_properties, '$.HostedZoneId') as HostedZoneId,
json_extract(json_extract(dns_properties, '$.SOA'), '$.TTL') as ttl
from
aws_service_discovery_namespace
where
type = 'DNS_PRIVATE';

Count namespaces by type

Analyze the distribution of different types of namespaces within AWS service discovery to understand their usage and prevalence.

select
type,
count(type)
from
aws_service_discovery_namespace
group by
type;
select
type,
count(type)
from
aws_service_discovery_namespace
group by
type;

Schema for aws_service_discovery_namespace

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.
arntextThe Amazon Resource Name (ARN) that Cloud Map assigns to the namespace when you create it.
create_datetimestamp with time zoneThe date and time that the namespace was created.
descriptiontextA description for the namespace.
dns_propertiesjsonbA complex type that contains the ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.
http_propertiesjsonbA complex type that contains the name of an HTTP namespace.
idtext=The ID of the namespace.
nametext=The name of the namespace.
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.
service_countbigintThe number of services that were created using the namespace.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
tags_srcjsonbInformation about the tags associated with the namespace.
titletextTitle of the resource.
typetext=The type of the namespace, either public or private.

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_service_discovery_namespace