Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/c7n_gcp/provider.py: 89%
18 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 06:51 +0000
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 06:51 +0000
1# Copyright The Cloud Custodian Authors.
2# SPDX-License-Identifier: Apache-2.0
4from c7n.registry import PluginRegistry
5from c7n.provider import Provider, clouds
7from .client import Session
8from functools import partial
10from c7n_gcp.resources.resource_map import ResourceMap
13@clouds.register('gcp')
14class GoogleCloud(Provider):
16 display_name = 'GCP'
17 resource_prefix = 'gcp'
18 resources = PluginRegistry('%s.resources' % resource_prefix)
19 resource_map = ResourceMap
21 def initialize(self, options):
22 return options
24 def initialize_policies(self, policy_collection, options):
25 return policy_collection
27 def get_session_factory(self, options):
28 """Get a credential/session factory for api usage."""
29 return partial(
30 Session, project_id=options.account_id, impersonate_service=options.assume_role)
33resources = GoogleCloud.resources