File tree Expand file tree Collapse file tree
src/cloudforet/cost_analysis/manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,19 @@ class DataSourceManager(BaseManager):
1616 def init_response (options ):
1717 plugin_metadata = PluginMetadata ()
1818 plugin_metadata .validate ()
19+ currency = options .get ("currency" , "USD" )
1920
2021 if "bucket_name" in options :
22+ provider = options .get ("provider" , "google_cloud" )
23+ source = "additional_info.Project ID"
24+ target = "data.project_id"
25+ if provider == "aws" :
26+ source = "additional_info.Account ID"
27+ target = "data.account_id"
28+ elif provider == "azure" :
29+ source = "additional_info.Subscription Id"
30+ target = "data.subscription_id"
31+
2132 return {
2233 "metadata" : {
2334 "data_source_rules" : [
@@ -26,14 +37,14 @@ def init_response(options):
2637 "conditions_policy" : "ALWAYS" ,
2738 "actions" : {
2839 "match_service_account" : {
29- "source" : "additional_info.Project ID" ,
30- "target" : "data.project_id" ,
40+ "source" : source ,
41+ "target" : target ,
3142 }
3243 },
3344 "options" : {"stop_processing" : True },
3445 }
3546 ],
36- "currency" : "KRW" ,
47+ "currency" : currency ,
3748 }
3849 }
3950
You can’t perform that action at this time.
0 commit comments