Documentation
¶
Index ¶
- Constants
- func IsNukeable(resourceType string, resourceTypes []string, excludeResourceTypes []string) bool
- func ListResourceTypes() []string
- func NukeAllResources(ctx context.Context, account *GcpProjectResources, regions []string, ...) error
- type GcpConfig
- type GcpProjectResources
- type GcpResource
- type GcpResources
- type Query
Constants ¶
const GlobalRegion = "global"
GlobalRegion is the region name used for GCP resources that are not region-scoped.
Variables ¶
This section is empty.
Functions ¶
func IsNukeable ¶ added in v0.47.0
IsNukeable checks whether a resource type should be nuked based on the requested resource types and exclude lists. An empty include list or the special value "all" means nuke everything, minus any excluded types.
func ListResourceTypes ¶
func ListResourceTypes() []string
ListResourceTypes returns a sorted list of resources which can be passed to --resource-type
func NukeAllResources ¶
func NukeAllResources(ctx context.Context, account *GcpProjectResources, regions []string, collector *reporting.Collector) error
NukeAllResources nukes all GCP resources across the given regions.
Types ¶
type GcpConfig ¶ added in v0.47.0
GcpConfig holds the configuration needed to initialize a GCP resource.
type GcpProjectResources ¶
type GcpProjectResources = resources.GcpProjectResources
GcpProjectResources is a struct that represents the resources found in a single GCP project.
type GcpResource ¶
type GcpResource = resources.GcpResource
GcpResource is an interface that represents a single GCP resource.
func GetAllRegisteredResources ¶ added in v0.47.0
func GetAllRegisteredResources() []*GcpResource
GetAllRegisteredResources returns pointers to all registered GCP resources (both global and regional), without initializing them.
func GetAndInitRegisteredResources ¶ added in v0.47.0
func GetAndInitRegisteredResources(cfg resources.GcpConfig, region string) []*GcpResource
GetAndInitRegisteredResources returns initialized GCP resources for the given region. Global resources are returned for GlobalRegion; regional resources for any other region.
type GcpResources ¶
type GcpResources = resources.GcpResources
GcpResources is a struct to hold multiple instances of GcpResource.
type Query ¶ added in v0.47.0
type Query struct {
ProjectID string
ResourceTypes []string
ExcludeResourceTypes []string
Regions []string
ExcludeRegions []string
ExcludeAfter *time.Time
IncludeAfter *time.Time
Timeout *time.Duration
ExcludeFirstSeen bool
}
Query represents the desired parameters for scanning GCP resources. This mirrors the aws.Query struct for interface consistency.