debian-mirror-gitlab/app/services/google_cloud/get_cloudsql_instances_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
548 B
Ruby
Raw Normal View History

2022-08-27 11:52:29 +05:30
# frozen_string_literal: true
module GoogleCloud
class GetCloudsqlInstancesService < ::GoogleCloud::BaseService
CLOUDSQL_KEYS = %w[GCP_PROJECT_ID GCP_CLOUDSQL_INSTANCE_NAME GCP_CLOUDSQL_VERSION].freeze
def execute
group_vars_by_environment(CLOUDSQL_KEYS).map do |environment_scope, value|
{
ref: environment_scope,
gcp_project: value['GCP_PROJECT_ID'],
instance_name: value['GCP_CLOUDSQL_INSTANCE_NAME'],
version: value['GCP_CLOUDSQL_VERSION']
}
end
end
end
end