fleetfolio/aws_ec2_instance_list.sql
SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
-- not including breadcrumbs from sqlpage_aide_navigation
-- not including page title from sqlpage_aide_navigation
SELECT 'title' AS component, (SELECT COALESCE(title, caption)
FROM sqlpage_aide_navigation
WHERE namespace = 'prime' AND path = 'fleetfolio/aws_ec2_instance_list.sql/index.sql') as contents;
;
--- Display breadcrumb
SELECT
'breadcrumb' AS component;
SELECT
'Home' AS title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' AS link;
SELECT
'FleetFolio' AS title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/index.sql' AS link;
SELECT
'Boundary' AS title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/boundary.sql' AS link;
SELECT
'AWS Trust Boundary' AS title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/aws_trust_boundary_list.sql' AS link;
SELECT
'AWS EC2 instance' AS title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/aws_ec2_instance_list.sql' AS link;
--- Dsply Page Title
SELECT
'title' as component,
"AWS EC2 instance" contents;
select
'text' as component,
'An EC2 instance represents a virtual server hosted on Amazon Web Services (AWS), used to run applications, services, or processes in a scalable and flexible cloud environment. Each instance is provisioned with a specific configuration—such as CPU, memory, storage, and networking capabilities—to meet the needs of the workload it supports. EC2 instances are a core component of cloud infrastructure, enabling users to deploy and manage computing resources without the need for physical hardware. They can be started, stopped, resized, or terminated as needed, offering full control over performance, cost, and security.' as contents;
SET total_rows = (SELECT COUNT(*) FROM list_aws_ec2_instance );
SET limit = COALESCE($limit, 50);
SET offset = COALESCE($offset, 0);
SET total_pages = ($total_rows + $limit - 1) / $limit;
SET current_page = ($offset / $limit) + 1;
SELECT 'table' AS component,
'host' as markdown,
TRUE as sort,
TRUE as search,
'title' as markdown;
SELECT
'[' || title || '](' || sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/aws_ec2_instance_detail.sql?instance_id=' || instance_id || ')' as title,
architecture,
platform_details AS platform,
root_device_name as "root device name",
state,
instance_type as "instance type",
datetime(substr(launch_time, 1, 19)) as "launch time"
FROM list_aws_ec2_instance;
SELECT 'text' AS component,
(SELECT CASE WHEN $current_page > 1 THEN '[Previous](?limit=' || $limit || '&offset=' || ($offset - $limit) || ')' ELSE '' END) || ' ' ||
'(Page ' || $current_page || ' of ' || $total_pages || ") " ||
(SELECT CASE WHEN $current_page < $total_pages THEN '[Next](?limit=' || $limit || '&offset=' || ($offset + $limit) || ')' ELSE '' END)
AS contents_md
;