SELECT * FROM iasql_install('aws_sdk');
SELECT invoke_iam('listGroups', '{}') as result;
SELECT invoke_iam('createGroup', '{
"GroupName": "<prefix>"
}') as result;
SELECT invoke_iam('getGroup', '{
"GroupName": "<prefix>"
}') as result;
SELECT * FROM iasql_install('aws_vpc');
SELECT vpc_id,
cidr_block,
invoke_ec2('describeVpcs', json_build_object('VpcIds', array [vpc_id]), region) -> 'Vpcs' ->
0 as cloud_data
FROM vpc
WHERE is_default;
SELECT invoke_ec2(
'createRouteTable',
json_build_object(
'VpcId',
(SELECT vpc_id FROM vpc WHERE region = default_aws_region() AND is_default LIMIT 1),
'TagSpecifications',
'[{"ResourceType": "route-table", "Tags": [{"Key": "Name", "Value": "<prefix>"}]}]'::json
)
);
SELECT *
FROM route_table
WHERE tags ->> 'Name' = '<prefix>';
DELETE
FROM route_table
WHERE tags ->> 'Name' = '<prefix>';