Skip to content

Commit

Permalink
add-marketplace-v2 (#965)
Browse files Browse the repository at this point in the history
* add-marketplace-v2
  • Loading branch information
iakov-aws authored Oct 17, 2024
1 parent af936cf commit c826d1e
Showing 1 changed file with 179 additions and 0 deletions.
179 changes: 179 additions & 0 deletions dashboards/aws-marketplace/aws-marketplace-spg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ dashboards:
dependsOn:
datasets:
- marketplace_view
- marketplace_licenses_grants_view
name: AWS Marketplace Single Pane of Glass (SPG)
dashboardId: aws-marketplace
category: Additional
templateId: aws-marketplace
theme: MIDNIGHT
datasets:
marketplace_view:
data:
Expand Down Expand Up @@ -134,6 +136,157 @@ datasets:
- marketplace_view
schedules:
- default
marketplace_licenses_grants_view:
data:
DataSetId: ff35b25e-c8d1-4859-b388-ce4d6cbeb506
Name: marketplace_licenses_grants_view
PhysicalTableMap:
1ecbb2ac-1ceb-4653-ab08-dc11fdfeb1b1:
RelationalTable:
DataSourceArn: ${athena_datasource_arn}
Catalog: AwsDataCatalog
Schema: ${athena_database_name}
Name: account_map
InputColumns:
- Name: account_id
Type: STRING
- Name: account_name
Type: STRING
623cef5c-7541-4cb2-9474-53cb0e222d67:
RelationalTable:
DataSourceArn: ${athena_datasource_arn}
Catalog: AwsDataCatalog
Schema: ${athena_database_name}
Name: marketplace_licenses_grants_view
InputColumns:
- Name: management_account_id
Type: STRING
- Name: subscribed_account_id
Type: STRING
- Name: grantee_account_id
Type: STRING
- Name: license_create_time
Type: DATETIME
- Name: license_start_date
Type: DATETIME
- Name: license_end_date
Type: DATETIME
- Name: license_id
Type: STRING
- Name: productname
Type: STRING
- Name: seller
Type: STRING
- Name: agreement_id
Type: STRING
- Name: license_status
Type: STRING
- Name: productsku
Type: STRING
- Name: license_issuer
Type: STRING
- Name: homeregion
Type: STRING
- Name: license_version
Type: STRING
- Name: grant_name
Type: STRING
- Name: grant_id
Type: STRING
- Name: grant_status
Type: STRING
- Name: grant_version
Type: STRING
- Name: granted_operations
Type: STRING
- Name: activation_override_behavior
Type: STRING
d16218ab-6c10-4003-8a81-b34b069e67b3:
RelationalTable:
DataSourceArn: ${athena_datasource_arn}
Catalog: AwsDataCatalog
Schema: ${athena_database_name}
Name: account_map
InputColumns:
- Name: account_id
Type: STRING
- Name: account_name
Type: STRING
LogicalTableMap:
06338664-ffcb-4fd1-855d-2127ac84c2e7:
Alias: Intermediate Table
Source:
JoinInstruction:
LeftOperand: 4f337cdb-d675-4e91-8427-4dce84259a54
RightOperand: 35faf219-45ae-4689-a98d-d34ad579dbf5
Type: LEFT
OnClause: '{grantee_account_id} = {account_id}'
35faf219-45ae-4689-a98d-d34ad579dbf5:
Alias: account_map
DataTransforms:
- RenameColumnOperation:
ColumnName: account_name
NewColumnName: grantee_account_name
Source:
PhysicalTableId: d16218ab-6c10-4003-8a81-b34b069e67b3
4526a4cc-5d48-4da0-bec4-e476cdcd0721:
Alias: Intermediate Table (2)
DataTransforms:
- ProjectOperation:
ProjectedColumns:
- management_account_id
- subscribed_account_id
- grantee_account_id
- license_create_time
- license_start_date
- license_end_date
- license_id
- productname
- seller
- agreement_id
- license_status
- productsku
- license_issuer
- homeregion
- license_version
- grant_name
- grant_id
- grant_status
- grant_version
- granted_operations
- activation_override_behavior
- account_id
- grantee_account_name
- subscribed_account_id_from_account_map
- subscribed_account_name
Source:
JoinInstruction:
LeftOperand: 06338664-ffcb-4fd1-855d-2127ac84c2e7
RightOperand: f072c6f3-34bf-4cbb-a446-e4711c93e782
Type: LEFT
OnClause: '{subscribed_account_id} = {subscribed_account_id_from_account_map}'
4f337cdb-d675-4e91-8427-4dce84259a54:
Alias: marketplace_licenses_grants_view
Source:
PhysicalTableId: 623cef5c-7541-4cb2-9474-53cb0e222d67
f072c6f3-34bf-4cbb-a446-e4711c93e782:
Alias: account_map for subscribed
DataTransforms:
- RenameColumnOperation:
ColumnName: account_id
NewColumnName: subscribed_account_id_from_account_map
- RenameColumnOperation:
ColumnName: account_name
NewColumnName: subscribed_account_name
Source:
PhysicalTableId: 1ecbb2ac-1ceb-4653-ab08-dc11fdfeb1b1
ImportMode: DIRECT_QUERY
dependsOn:
views:
- marketplace_licenses_grants_view
- account_map
schedules:
- default
views:
marketplace_view:
dependsOn:
Expand Down Expand Up @@ -168,3 +321,29 @@ views:
"${cur_table_name}"
WHERE ((("bill_billing_period_start_date" >= ("date_trunc"('month', current_timestamp) - INTERVAL '36' MONTH)) AND (CAST("concat"("year", '-', "month", '-01') AS date) >= ("date_trunc"('month', current_date) - INTERVAL '36' MONTH))) AND ("bill_billing_entity" = 'AWS Marketplace'))
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
marketplace_licenses_grants_view:
data: |-
CREATE VIEW marketplace_licenses_grants_view AS
SELECT
CAST(NULL AS varchar) AS management_account_id,
CAST(NULL AS varchar) AS subscribed_account_id,
CAST(NULL AS varchar) AS grantee_account_id,
CAST(NULL AS timestamp) AS license_create_time,
CAST(NULL AS varchar) AS license_id,
CAST(NULL AS varchar) AS productname,
CAST(NULL AS varchar) AS seller,
CAST(NULL AS varchar) AS agreement_id,
CAST(NULL AS varchar) AS license_status,
CAST(NULL AS timestamp) AS license_start_date,
CAST(NULL AS timestamp) AS license_end_date,
CAST(NULL AS varchar) AS productsku,
CAST(NULL AS varchar) AS license_issuer,
CAST(NULL AS varchar) AS homeregion,
CAST(NULL AS varchar) AS license_version,
CAST(NULL AS varchar) AS grant_name,
CAST(NULL AS varchar) AS grant_id,
CAST(NULL AS varchar) AS grant_status,
CAST(NULL AS varchar) AS grant_version,
CAST(NULL AS varchar) AS granted_operations,
CAST(NULL AS varchar) AS activation_override_behavior
WHERE 1 = 0

0 comments on commit c826d1e

Please sign in to comment.