Skip to content

Commit

Permalink
Merge branch 'main' into ensure-workgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborschulz-aws committed Sep 22, 2023
2 parents 587817e + aa9a4d5 commit e7afad0
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 204 deletions.
1 change: 1 addition & 0 deletions cfn-templates/cid-cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Parameters:
Type: String
Description: The S3 path to the bucket created by the Cost Optimization Data Collection Lab. The path will need point to a folder containing /trusted-advisor and/or /compute-optimizer folders. You can leave the variable {account_id} in place, it will be replaced by current account ID automatically.
Default: "s3://costoptimizationdata{account_id}"
AllowedPattern: '^s3://[a-zA-Z0-9-_{}/]*$'
LambdaLayerBucketPrefix:
Type: String
Description: An S3 bucket with a Lambda layer
Expand Down
123 changes: 61 additions & 62 deletions cid/builtin/core/data/queries/co/auto_scale_options.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,18 @@ SELECT * FROM (
AND recommendationoptions_3_ondemandprice != '') THEN TRY((CAST(current_ondemandprice AS double) - CAST(recommendationoptions_3_ondemandprice AS double)) * 730) ELSE 0E0 END
) as max_estimatedmonthlysavings_value_medium
, CONCAT(
currentperformancerisk, ';',
currentconfiguration_instancetype, ';',
'', ';',
current_memory, ';',
current_vcpus, ';',
current_network, ';',
current_storage, ';',
'', ';',
utilizationmetrics_cpu_maximum, ';',
utilizationmetrics_memory_maximum, ';',
currentconfiguration_desiredcapacity, ';'

) option_details
COALESCE(currentperformancerisk, 'na'), ';',
COALESCE(currentconfiguration_instancetype, 'na'), ';',
'', ';',
COALESCE(current_memory, 'na'), ';',
COALESCE(current_vcpus, 'na'), ';',
COALESCE(current_network, 'na'), ';',
COALESCE(current_storage, 'na'), ';',
'', ';',
COALESCE(utilizationmetrics_cpu_maximum, 'na'), ';',
COALESCE(utilizationmetrics_memory_maximum, 'na'), ';',
COALESCE(currentconfiguration_desiredcapacity, 'na'), ';'
) AS option_details
, cast(NULL as varchar(1)) as tags

FROM
Expand Down Expand Up @@ -128,19 +127,19 @@ UNION SELECT
effectiverecommendationpreferencesenhancedinfrastructuremetrics
) ressouce_details
, CONCAT(
utilizationmetrics_disk_read_bytes_per_second_maximum, ';',
utilizationmetrics_disk_read_ops_per_second_maximum, ';',
utilizationmetrics_disk_write_bytes_per_second_maximum, ';',
utilizationmetrics_disk_write_ops_per_second_maximum, ';',
utilizationmetrics_ebs_read_bytes_per_second_maximum, ';',
utilizationmetrics_ebs_read_ops_per_second_maximum, ';',
utilizationmetrics_ebs_write_bytes_per_second_maximum, ';',
utilizationmetrics_ebs_write_ops_per_second_maximum, ';',
utilizationmetrics_network_in_bytes_per_second_maximum, ';',
utilizationmetrics_network_out_bytes_per_second_maximum, ';',
utilizationmetrics_network_packets_in_per_second_maximum, ';',
utilizationmetrics_network_packets_out_per_second_maximum, ';'
) utilizationmetrics
COALESCE(utilizationmetrics_disk_read_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_disk_read_ops_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_disk_write_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_disk_write_ops_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_ebs_read_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_ebs_read_ops_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_ebs_write_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_ebs_write_ops_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_network_in_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_network_out_bytes_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_network_packets_in_per_second_maximum, 'na'), ';',
COALESCE(utilizationmetrics_network_packets_out_per_second_maximum, 'na')
) AS option_details
, 'Option 1' option_name
, currentconfiguration_instancetype option_from
, recommendationoptions_1_configuration_instancetype option_to
Expand Down Expand Up @@ -192,19 +191,19 @@ UNION SELECT
AND recommendationoptions_3_ondemandprice != '') THEN TRY((CAST(current_ondemandprice AS double) - CAST(recommendationoptions_3_ondemandprice AS double)) * 730) ELSE 0E0 END
) as max_estimatedmonthlysavings_value_medium
, CONCAT(
recommendationoptions_1_performancerisk, ';',
recommendationoptions_1_configuration_instancetype, ';',
recommendationoptions_1_migrationeffort, ';',
recommendationoptions_1_memory, ';',
recommendationoptions_1_vcpus, ';',
recommendationoptions_1_network, ';',
recommendationoptions_1_storage, ';',
'', ';', --platform diff
recommendationoptions_1_projectedutilizationmetrics_cpu_maximum, ';',
recommendationoptions_1_projectedutilizationmetrics_memory_maximum, ';',
recommendationoptions_1_configuration_desiredcapacity, ';'
COALESCE(recommendationoptions_1_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_instancetype, 'na'), ';',
COALESCE(recommendationoptions_1_migrationeffort, 'na'), ';',
COALESCE(recommendationoptions_1_memory, 'na'), ';',
COALESCE(recommendationoptions_1_vcpus, 'na'), ';',
COALESCE(recommendationoptions_1_network, 'na'), ';',
COALESCE(recommendationoptions_1_storage, 'na'), ';',
'na', ';',
COALESCE(recommendationoptions_1_projectedutilizationmetrics_cpu_maximum, 'na'), ';',
COALESCE(recommendationoptions_1_projectedutilizationmetrics_memory_maximum, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_desiredcapacity, 'na')
) AS option_details

) option_details
, cast(NULL as varchar(1)) as tags

FROM
Expand Down Expand Up @@ -298,19 +297,19 @@ UNION SELECT
AND recommendationoptions_3_ondemandprice != '') THEN TRY((CAST(current_ondemandprice AS double) - CAST(recommendationoptions_3_ondemandprice AS double)) * 730) ELSE 0E0 END
) as max_estimatedmonthlysavings_value_medium
, CONCAT(
recommendationoptions_2_performancerisk, ';',
recommendationoptions_2_configuration_instancetype, ';',
recommendationoptions_2_migrationeffort, ';',
recommendationoptions_2_memory, ';',
recommendationoptions_2_vcpus, ';',
recommendationoptions_2_network, ';',
recommendationoptions_2_storage, ';',
'', ';', --platform diff
recommendationoptions_2_projectedutilizationmetrics_cpu_maximum, ';',
recommendationoptions_2_projectedutilizationmetrics_memory_maximum, ';',
recommendationoptions_2_configuration_desiredcapacity, ';'
COALESCE(recommendationoptions_2_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_instancetype, 'na'), ';',
COALESCE(recommendationoptions_2_migrationeffort, 'na'), ';',
COALESCE(recommendationoptions_2_memory, 'na'), ';',
COALESCE(recommendationoptions_2_vcpus, 'na'), ';',
COALESCE(recommendationoptions_2_network, 'na'), ';',
COALESCE(recommendationoptions_2_storage, 'na'), ';',
'na', ';',
COALESCE(recommendationoptions_2_projectedutilizationmetrics_cpu_maximum, 'na'), ';',
COALESCE(recommendationoptions_2_projectedutilizationmetrics_memory_maximum, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_desiredcapacity, 'na')
) AS option_details

) option_details
, cast(NULL as varchar(1)) as tags

FROM
Expand Down Expand Up @@ -405,19 +404,19 @@ UNION SELECT
AND recommendationoptions_3_ondemandprice != '') THEN TRY((CAST(current_ondemandprice AS double) - CAST(recommendationoptions_3_ondemandprice AS double)) * 730) ELSE 0E0 END
) as max_estimatedmonthlysavings_value_medium
, CONCAT(
recommendationoptions_3_performancerisk, ';',
recommendationoptions_3_configuration_instancetype, ';',
recommendationoptions_3_migrationeffort, ';',
recommendationoptions_3_memory, ';',
recommendationoptions_3_vcpus, ';',
recommendationoptions_3_network, ';',
recommendationoptions_3_storage, ';',
'', ';', --platform diff
recommendationoptions_3_projectedutilizationmetrics_cpu_maximum, ';',
recommendationoptions_3_projectedutilizationmetrics_memory_maximum, ';',
recommendationoptions_3_configuration_desiredcapacity, ';'
COALESCE(recommendationoptions_3_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_instancetype, 'na'), ';',
COALESCE(recommendationoptions_3_migrationeffort, 'na'), ';',
COALESCE(recommendationoptions_3_memory, 'na'), ';',
COALESCE(recommendationoptions_3_vcpus, 'na'), ';',
COALESCE(recommendationoptions_3_network, 'na'), ';',
COALESCE(recommendationoptions_3_storage, 'na'), ';',
'na', ';',
COALESCE(recommendationoptions_3_projectedutilizationmetrics_cpu_maximum, 'na'), ';',
COALESCE(recommendationoptions_3_projectedutilizationmetrics_memory_maximum, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_desiredcapacity, 'na')
) AS option_details

) option_details
, cast(NULL as varchar(1)) as tags

FROM
Expand Down
61 changes: 32 additions & 29 deletions cid/builtin/core/data/queries/co/ebs_volume_options.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ SELECT
) as max_estimatedmonthlysavings_value_medium,

CONCAT(
currentperformancerisk, ';', -- as performancerisk
currentconfiguration_volumetype, ';', -- as volumetype
currentconfiguration_volumesize, ';', -- as volumesize
currentconfiguration_volumebaselineiops, ';', -- as volumebaselineiops
currentconfiguration_volumebaselinethroughput, ';', -- as volumebaselinethroughput
currentconfiguration_volumeburstiops, ';', -- as volumeburstiops
currentconfiguration_volumeburstthroughput, ';' -- as volumeburstthroughput
COALESCE(currentperformancerisk, 'na'), ';',
COALESCE(currentconfiguration_volumetype, 'na'), ';',
COALESCE(currentconfiguration_volumesize, 'na'), ';',
COALESCE(currentconfiguration_volumebaselineiops, 'na'), ';',
COALESCE(currentconfiguration_volumebaselinethroughput, 'na'), ';',
COALESCE(currentconfiguration_volumeburstiops, 'na'), ';',
COALESCE(currentconfiguration_volumeburstthroughput, 'na'), ';'
) as option_details,
tags as tags

Expand Down Expand Up @@ -144,14 +144,15 @@ UNION SELECT
) as max_estimatedmonthlysavings_value_medium,

CONCAT(
recommendationoptions_1_performancerisk, ';', -- as performancerisk,
recommendationoptions_1_configuration_volumetype, ';', -- as volumetype,
recommendationoptions_1_configuration_volumesize, ';', -- as volumesize,
recommendationoptions_1_configuration_volumebaselineiops, ';', -- as volumebaselineiops,
recommendationoptions_1_configuration_volumebaselinethroughput, ';', -- as volumebaselinethroughput,
recommendationoptions_1_configuration_volumeburstiops, ';', -- as volumeburstiops,
recommendationoptions_1_configuration_volumeburstthroughput, ';' -- as volumeburstthroughput,
COALESCE(recommendationoptions_1_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumetype, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumesize, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumebaselineiops, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumebaselinethroughput, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumeburstiops, 'na'), ';',
COALESCE(recommendationoptions_1_configuration_volumeburstthroughput, 'na'), ';'
) as option_details,

tags as tags

FROM
Expand Down Expand Up @@ -224,14 +225,15 @@ UNION SELECT


CONCAT(
recommendationoptions_2_performancerisk, ';', -- as performancerisk,
recommendationoptions_2_configuration_volumetype, ';', -- as volumetype,
recommendationoptions_2_configuration_volumesize, ';', -- as volumesize,
recommendationoptions_2_configuration_volumebaselineiops, ';', -- as volumebaselineiops,
recommendationoptions_2_configuration_volumebaselinethroughput, ';', -- as volumebaselinethroughput,
recommendationoptions_2_configuration_volumeburstiops, ';', -- as volumeburstiops,
recommendationoptions_2_configuration_volumeburstthroughput, ';' -- as volumeburstthroughput,
COALESCE(recommendationoptions_2_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumetype, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumesize, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumebaselineiops, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumebaselinethroughput, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumeburstiops, 'na'), ';',
COALESCE(recommendationoptions_2_configuration_volumeburstthroughput, 'na'), ';'
) as option_details,

tags as tags

FROM
Expand Down Expand Up @@ -303,19 +305,20 @@ WHERE
) as max_estimatedmonthlysavings_value_medium,

CONCAT(
recommendationoptions_3_performancerisk, ';', -- as performancerisk,
recommendationoptions_3_configuration_volumetype, ';', -- as volumetype,
recommendationoptions_3_configuration_volumesize, ';', -- as volumesize,
recommendationoptions_3_configuration_volumebaselineiops, ';', -- as volumebaselineiops,
recommendationoptions_3_configuration_volumebaselinethroughput, ';', -- as volumebaselinethroughput,
recommendationoptions_3_configuration_volumeburstiops, ';', -- as volumeburstiops,
recommendationoptions_3_configuration_volumeburstthroughput, ';' -- as volumeburstthroughput,
COALESCE(recommendationoptions_3_performancerisk, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumetype, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumesize, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumebaselineiops, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumebaselinethroughput, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumeburstiops, 'na'), ';',
COALESCE(recommendationoptions_3_configuration_volumeburstthroughput, 'na'), ';'
) as option_details,

tags as tags

FROM
compute_optimizer_ebs_volume_lines
WHERE
volumearn LIKE '%arn:%'
AND recommendationoptions_3_configuration_volumetype <> ''
)
)
Loading

0 comments on commit e7afad0

Please sign in to comment.