DEV Community

Cover image for [Cloudforet] Enable Google Billing Plugin

[Cloudforet] Enable Google Billing Plugin

Choonho Son on February 28, 2024

In a Cloudfore Version 1.12.x, there is a concept of managed plugins which are already registered by code. But plugin-google-billing-cost-datasourc...
Collapse
 
vivs profile image
vivekPrasa • Edited

@choonho

Executing above plugin yaml throwing below error.

Image description

I have followed below steps and got my google billing plugin enabled with data source.

Register Google billing plugin

spacectl exec register repository.Plugin -f google_billing_plugin.yaml
Enter fullscreen mode Exit fullscreen mode
name: Google Billing Data Source
service_type: cost_analysis.DataSource
image: spaceone/plugin-google-billing-cost-datasource
capability: {}
tags:
  description: Google Cloud Billing Data Source
  icon: https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/google_cloud.svg
  long_description: Google Cloud Billing is a service that provides cost data for
    resources being used by subscriptions. This plugin can use the Cost Management
    API to collect billing data on all subscriptions in the billing account.
template: {}

Enter fullscreen mode Exit fullscreen mode

Verify plugin

 spacectl list plugin -p repository_id=<local-repo>
Enter fullscreen mode Exit fullscreen mode

Image description

Register billing data source

 spacectl exec register cost_analysis.DataSource -f google_billing_datasource.yaml
Enter fullscreen mode Exit fullscreen mode
name: Google Cost Explorer Data Source
data_source_type: EXTERNAL
provider: google_cloud
secret_type: USE_SERVICE_ACCOUNT_SECRET
plugin_info:
  plugin_id: plugin-google-billing-cost-datasource
Enter fullscreen mode Exit fullscreen mode

Image description

Collapse
 
choonho profile image
Choonho Son • Edited

Great. Thank you for update.

For Docker image registry, "spaceone" is not upgrading new plugin images. "spaceone" registry is for old user who does not want to upgrade cloudforet.

I recommend Docker image registry from "spaceone" to "cloudforet"

So

name: Google Billing Data Source
service_type: cost_analysis.DataSource
image: cloudforet/plugin-google-billing-cost-datasource
capability: {}
tags:
  description: Google Cloud Billing Data Source
  icon: https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/google_cloud.svg
  long_description: Google Cloud Billing is a service that provides cost data for
    resources being used by subscriptions. This plugin can use the Cost Management
    API to collect billing data on all subscriptions in the billing account.
template: {}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
vivs profile image
vivekPrasa

Sure will update. Thanks !

Collapse
 
choonho profile image
Choonho Son

Enable BigQuery for Google billing

cloud.google.com/billing/docs/how-...

Collapse
 
koshy_koshy_3365c335c2a5c profile image
Koshy Koshy

@choonho

root@spacectl-6bfdd6896b-6mjcz:~# cat google_billing_datasource.yaml
name: Google Cost Explorer Data Source
data_source_type: EXTERNAL
provider: google_cloud
secret_type: USE_SERVICE_ACCOUNT_SECRET
plugin_info:
plugin_id: plugin-google-billing-cost-datasource
root@spacectl-6bfdd6896b-6mjcz:~# spacectl exec register cost_analysis.DataSource -f google_billing_datasource.yaml
ERROR: Server is unavailable. (channel = 10.244.3.133:50051, message = module 'spaceone.api.cost_analysis.plugin.cost_pb2' has no attribute 'AccountInfo')

I am geting this error while registering the plugin.