npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@backtostage/plugin-catalog-backend-module-gcp

v0.2.5

Published

This is an extension module to the plugin-catalog-backend plugin, providing extensions targeted at GCP.

Downloads

220

Readme

Catalog Backend Module for GCP

This is an extension module to the plugin-catalog-backend plugin, providing extensions targeted at GCP.

Getting started

You will have to add the provider in the catalog initialization code of your backend. They are not installed by default, therefore you have to add a dependency on @backtostage/plugin-catalog-backend-module-gcp to your backend package.

# From your Backstage root directory
yarn add --cwd packages/backend @backtostage/plugin-catalog-backend-module-gcp

Cloud SQL - GoogleSQLDatabaseEntityProvider

To your new backend file, add:

import { catalogModuleGoogleSQLDatabaseEntityProvider } from '@backtostage/plugin-catalog-backend-module-gcp';


backend.add(
  catalogModuleGoogleSQLDatabaseEntityProvider,
);

Memorystore Redis - GoogleRedisDatabaseEntityProvider

To your new backend file, add:

import { catalogModuleGoogleRedisDatabaseEntityProvider } from '@backtostage/plugin-catalog-backend-module-gcp';


backend.add(
  catalogModuleGoogleRedisDatabaseEntityProvider,
);

Project - GoogleOrganizationProjectEntityProvider

To your new backend file, add:

import { catalogModuleGoogleOrganizationProjectEntityProvider } from '@backtostage/plugin-catalog-backend-module-gcp';


backend.add(
  catalogModuleGoogleOrganizationProjectEntityProvider,
);

Configuration

To use this provider, you'll need a Google Service Account. Once generated, store the path to this file in the GOOGLE_APPLICATION_CREDENTIALS environment variable.

You can find more details about this in the official docs

Then you can add a gcp config to the catalog providers configuration:

catalog:
  providers:
    gcp:
      # the project id need to be the GCP Project where your Resources are present
      - project: my-gcp-project-id
        ownerLabel: team # string
        componentLabel: app # string
        cloudsql:
          resourceType: SQL  # string
          suffix: sql  # string
          disabled: true # boolean
        redis:
          resourceType: Redis  # string
          location: us-central1 # string
          suffix: memorystoreredis  # string
          disabled: true # boolean
        schedule: # same options as in TaskScheduleDefinition
          # supports cron, ISO duration, "human duration" as used in code
          frequency: { minutes: 30 }
          # supports ISO duration, "human duration" as used in code
          timeout: { minutes: 3 }
      # you can configure a organization too. If the project is provided, this config will be skipped
      - organization:
          query: "parent:organizations/XPTO"
          resourceType: Project
        schedule: # same options as in TaskScheduleDefinition
          # supports cron, ISO duration, "human duration" as used in code
          frequency: { minutes: 30 }
          # supports ISO duration, "human duration" as used in code
          timeout: { minutes: 3 }

This provider supports multiple projects using different configurations.

  • project (required when not using organization import): Project ID of the project for which to list Cloud SQL instances. You can omit that field if you want the provider to load all projects in your organization to load other resources.

  • organization (optional):

    • query (optional):

      • Default: `` Query param to Google API
      • You can narrow the search based in your needs. When not provided a empty value is used. Please follow the API format to configure this param
    • resourceType (optional):

      • Default: GCP Project.
      • The provider will set the type based in this information.
    • disabled (optional):

      • Default: false.
      • The entity provider will skip this configuration when disabled.
  • ownerLabel (optional):

    • Default: owner.
    • The provider will look for user defined labels to find the Resource Owner.
    • You can provide the label name where the owner name is present, if the label isn't present the owner will be set unknown.
  • componentLabel (optional):

    • Default: component.
    • The provider will look for user defined labels to find the Resource dependencyOf.
    • You can provide the label name where the component name is present, if the label isn't present dependencyOf will be skipped.
  • cloudsql (optional):

    • resourceType (optional):
      • Default: CloudSQL.
      • The provider will set the type based in this information.
    • suffix (optional):
      • Default: cloudsql.
      • The provider will set the suffix to create a unique name for this resource.
    • disabled (optional):
      • Default: false.
      • The entity provider will skip this configuration when disabled.
    • namespaceByProject (optional):
      • Default: false.
      • The entity provider will use the project in namespace field. The namespace default is used when nothing is defined in this config.
  • redis (optional):

    • resourceType (optional):
      • Default: Memorystore Redis.
      • The provider will set the type based in this information.
    • suffix (optional):
      • Default: redis.
      • The provider will set the suffix to create a unique name for this resource.
    • location (optional):
      • Default: `` Wildcard value to Google API
      • You can narrow the location to list. When not provided instances from all locations will be listed
    • disabled (optional):
      • Default: false.
      • The entity provider will skip this configuration when disabled.
    • namespaceByProject (optional):
      • Default: false.
      • The entity provider will use the project in namespace field. The namespace default is used when nothing is defined in this config.
  • schedule (required):

    • frequency: How often you want the task to run. The system does its best to avoid overlapping invocations.
    • timeout: The maximum amount of time that a single task invocation can take.
    • initialDelay (optional): The amount of time that should pass before the first invocation happens.
    • scope (optional): 'global' or 'local'. Sets the scope of concurrency control.