DEV Community

Cover image for [Cloudforet] Enable Google Billing Plugin
Choonho Son
Choonho Son

Posted on • Updated on

[Cloudforet] Enable Google Billing Plugin

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-datasource is not included. To enable Google Billing in Cloudforet, we need following step.

Image description

To enable Google billing plugin, there are two prerequisite

  1. Enable Local Repository
  2. Register google billing plugin

1. Enable Local Repository

spacectl exec register repository.Repository -p name="My Private Repo" -p repository_type=local
Enter fullscreen mode Exit fullscreen mode

Image description

2. Register Google Billing Plugin

  • In a spacectl POD, save gcp-billing.yaml
---
plugin_id: plugin-google-billing-cost-datasource
name: Google Billing Data Source
image: spaceone/plugin-google-billing-cost-datasource
capability:
  supported_schema:
    - google-secret-oauth2-credentials
labels: [ ]
provider: google_cloud
resource_type: cost_analysis.DataSource
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.
Enter fullscreen mode Exit fullscreen mode

Register Plugin

spacectl exec register repository.Plugin -f gcp-billing.yaml 
Enter fullscreen mode Exit fullscreen mode

Enable Google Billing DataSource

Top comments (4)

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-...