google

package
v0.9.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BigQueryDatasetUsageSchema = []*schema.UsageItem{
	{Key: "monthly_queries_tb", ValueType: schema.Float64, DefaultValue: 0},
}
View Source
var BigQueryTableUsageSchema = []*schema.UsageItem{
	{Key: "monthly_streaming_inserts_mb", ValueType: schema.Float64, DefaultValue: 0},
	{Key: "monthly_storage_write_api_gb", ValueType: schema.Float64, DefaultValue: 0},
	{Key: "monthly_storage_read_api_tb", ValueType: schema.Float64, DefaultValue: 0},
	{Key: "monthly_active_storage_gb", ValueType: schema.Float64, DefaultValue: 0},
	{Key: "monthly_long_term_storage_gb", ValueType: schema.Float64, DefaultValue: 0},
}
View Source
var CloudFunctionsFunctionUsageSchema = []*schema.UsageItem{
	{Key: "request_duration_ms", ValueType: schema.Int64, DefaultValue: 0},
	{Key: "monthly_function_invocations", ValueType: schema.Int64, DefaultValue: 0},
	{Key: "monthly_outbound_data_gb", ValueType: schema.Float64, DefaultValue: 0},
}
View Source
var ComputeRouterNATUsageSchema = []*schema.UsageItem{
	{Key: "assigned_vms", ValueType: schema.Int64, DefaultValue: 0},
	{Key: "monthly_data_processed_gb", ValueType: schema.Float64, DefaultValue: 0},
}
View Source
var ComputeVPNTunnelUsageSchema = []*schema.UsageItem{}
View Source
var DNSManagedZoneUsageSchema = []*schema.UsageItem{}
View Source
var DNSRecordSetUsageSchema = []*schema.UsageItem{
	{Key: "monthly_queries", ValueType: schema.Int64, DefaultValue: 0},
}
View Source
var LoggingUsageSchema = []*schema.UsageItem{
	{Key: "monthly_logging_data_gb", ValueType: schema.Float64, DefaultValue: 0},
}
View Source
var MonitoringMetricDescriptorUsageSchema = []*schema.UsageItem{
	{Key: "monthly_monitoring_data_mb", ValueType: schema.Int64, DefaultValue: 0},
	{Key: "monthly_api_calls", ValueType: schema.Int64, DefaultValue: 0},
}
View Source
var PubSubSubscriptionUsageSchema = []*schema.UsageItem{
	{Key: "monthly_message_data_tb", ValueType: schema.Float64, DefaultValue: 0.0},
	{Key: "storage_gb", ValueType: schema.Float64, DefaultValue: 0},
	{Key: "snapshot_storage_gb", ValueType: schema.Float64, DefaultValue: 0.0},
}
View Source
var PubSubTopicUsageSchema = []*schema.UsageItem{
	{Key: "monthly_message_data_tb", ValueType: schema.Float64, DefaultValue: 0.0},
}
View Source
var RedisInstanceUsageSchema = []*schema.UsageItem{}
View Source
var RegionUsageSchema = []*schema.UsageItem{
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_east1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_east2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_northeast1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_northeast2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_northeast3"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_south1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_south2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_southeast1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "asia_southeast2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "australia_southeast1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "australia_southeast2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_central2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_north1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_west1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_west2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_west3"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_west4"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "europe_west6"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "northamerica_northeast1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "northamerica_northeast2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "southamerica_east1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "southamerica_west1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_central1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_east1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_east4"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_west1"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_west2"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_west3"},
	{ValueType: schema.Float64, DefaultValue: 0, Key: "us_west4"},
}

RegionUsageSchema is the schema representation of the RegionsUsage type. This can be used as a schema.SubResourceUsage to define a structure that's commonly used with resources that vary on a per region basis.

View Source
var SecretManagerSecretUsageSchema = []*schema.UsageItem{
	{Key: "active_secret_versions", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_access_operations", DefaultValue: 0, ValueType: schema.Int64},
	{Key: "monthly_rotation_notifications", DefaultValue: 0, ValueType: schema.Int64},
}

SecretManagerSecretUsageSchema defines a list which represents the usage schema of SecretManagerSecret.

View Source
var SecretManagerSecretVersionUsageSchema = []*schema.UsageItem{
	{Key: "monthly_access_operations", DefaultValue: 0, ValueType: schema.Int64},
}

SecretManagerSecretVersionUsageSchema defines a list which represents the usage schema of SecretManagerSecretVersion.

Functions

This section is empty.

Types

type ArtifactRegistryRepository added in v0.9.16

type ArtifactRegistryRepository struct {
	Address   string
	Region    string
	Continent string

	// StorageGB represents a usage cost that defines the amount of gb the artifact registry uses on a per monthly basis.
	StorageGB *float64 `infracost_usage:"storage_gb"`
	// MonthlyEgressDataTransferGB represents a complex usage cost that defines data transfer to different regions in the
	// google cloud infra. This does not include outbound internet egress (e.g. downloading artifact data to a local machine).
	MonthlyEgressDataTransferGB *RegionsUsage `infracost_usage:"monthly_egress_data_transfer_gb"`
}

ArtifactRegistryRepository struct represents a GCP artifact Registry. Artifact registry is essentially a next generation version of google's container registry. It allows users to store container images and language packages in the GCP.

Pricing for Artifact Registry is based on storage amounts and data transfer.

Resource information: https://cloud.google.com/artifact-registry Pricing information: https://cloud.google.com/artifact-registry/pricing

func (*ArtifactRegistryRepository) BuildResource added in v0.9.16

func (r *ArtifactRegistryRepository) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid ArtifactRegistryRepository struct. It returns ArtifactRegistryRepository as a schema.Resource with two main cost components: storage costs & egress costs.

Storage costs:

priced at $0.10 a month after artifact registry usage is > 0.5 GB. We ignore the free tier as there
is no way to currently tell if other artifact registry resources have gone beyond this free usage tier.

Network costs:

  1. free within the same region
  2. free from multi-region to a region within the same continent, e.g. europe -> europe-west1
  3. $0.01 when between different regions in North America continent
  4. $0.02 when between different regions in Europe continent
  5. $0.05 when between different regions in AsiaPacific continent
  6. $0.15 when between any region and Oceania continent
  7. $0.08 for all other intercontinental data transfer

This method is called after the resource is initialised by an IaC provider. See providers folder for more information.

func (*ArtifactRegistryRepository) PopulateUsage added in v0.9.16

func (r *ArtifactRegistryRepository) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.UsageData into the ArtifactRegistryRepository. It uses the `infracost_usage` struct tags to populate data into the ArtifactRegistryRepository.

type BigQueryDataset added in v0.9.17

type BigQueryDataset struct {
	Address          string
	Region           string
	MonthlyQueriesTB *float64 `infracost_usage:"monthly_queries_tb"`
}

func (*BigQueryDataset) BuildResource added in v0.9.17

func (r *BigQueryDataset) BuildResource() *schema.Resource

func (*BigQueryDataset) PopulateUsage added in v0.9.17

func (r *BigQueryDataset) PopulateUsage(u *schema.UsageData)

type BigQueryTable added in v0.9.17

type BigQueryTable struct {
	Address                   string
	Region                    string
	MonthlyStreamingInsertsMB *float64 `infracost_usage:"monthly_streaming_inserts_mb"`
	MonthlyStorageWriteAPIGB  *float64 `infracost_usage:"monthly_storage_write_api_gb"`
	MonthlyStorageReadAPITB   *float64 `infracost_usage:"monthly_storage_read_api_tb"`
	MonthlyActiveStorageGB    *float64 `infracost_usage:"monthly_active_storage_gb"`
	MonthlyLongTermStorageGB  *float64 `infracost_usage:"monthly_long_term_storage_gb"`
}

func (*BigQueryTable) BuildResource added in v0.9.17

func (r *BigQueryTable) BuildResource() *schema.Resource

func (*BigQueryTable) PopulateUsage added in v0.9.17

func (r *BigQueryTable) PopulateUsage(u *schema.UsageData)

type CloudFunctionsFunction added in v0.9.17

type CloudFunctionsFunction struct {
	Address                    string
	Region                     string
	AvailableMemoryMB          *int64
	RequestDurationMs          *int64   `infracost_usage:"request_duration_ms"`
	MonthlyFunctionInvocations *int64   `infracost_usage:"monthly_function_invocations"`
	MonthlyOutboundDataGB      *float64 `infracost_usage:"monthly_outbound_data_gb"`
}

func (*CloudFunctionsFunction) BuildResource added in v0.9.17

func (r *CloudFunctionsFunction) BuildResource() *schema.Resource

func (*CloudFunctionsFunction) PopulateUsage added in v0.9.17

func (r *CloudFunctionsFunction) PopulateUsage(u *schema.UsageData)

type ComputeRouterNAT added in v0.9.17

type ComputeRouterNAT struct {
	Address                string
	Region                 string
	AssignedVMs            *int64   `infracost_usage:"assigned_vms"`
	MonthlyDataProcessedGB *float64 `infracost_usage:"monthly_data_processed_gb"`
}

func (*ComputeRouterNAT) BuildResource added in v0.9.17

func (r *ComputeRouterNAT) BuildResource() *schema.Resource

func (*ComputeRouterNAT) PopulateUsage added in v0.9.17

func (r *ComputeRouterNAT) PopulateUsage(u *schema.UsageData)

type ComputeVPNTunnel added in v0.9.17

type ComputeVPNTunnel struct {
	Address string
	Region  string
}

func (*ComputeVPNTunnel) BuildResource added in v0.9.17

func (r *ComputeVPNTunnel) BuildResource() *schema.Resource

func (*ComputeVPNTunnel) PopulateUsage added in v0.9.17

func (r *ComputeVPNTunnel) PopulateUsage(u *schema.UsageData)

type DNSManagedZone added in v0.9.17

type DNSManagedZone struct {
	Address string
}

func (*DNSManagedZone) BuildResource added in v0.9.17

func (r *DNSManagedZone) BuildResource() *schema.Resource

func (*DNSManagedZone) PopulateUsage added in v0.9.17

func (r *DNSManagedZone) PopulateUsage(u *schema.UsageData)

type DNSRecordSet added in v0.9.17

type DNSRecordSet struct {
	Address        string
	MonthlyQueries *int64 `infracost_usage:"monthly_queries"`
}

func (*DNSRecordSet) BuildResource added in v0.9.17

func (r *DNSRecordSet) BuildResource() *schema.Resource

func (*DNSRecordSet) PopulateUsage added in v0.9.17

func (r *DNSRecordSet) PopulateUsage(u *schema.UsageData)

type Logging added in v0.9.17

type Logging struct {
	Address              string
	MonthlyLoggingDataGB *float64 `infracost_usage:"monthly_logging_data_gb"`
}

func (*Logging) BuildResource added in v0.9.17

func (r *Logging) BuildResource() *schema.Resource

func (*Logging) PopulateUsage added in v0.9.17

func (r *Logging) PopulateUsage(u *schema.UsageData)

type MonitoringMetricDescriptor added in v0.9.17

type MonitoringMetricDescriptor struct {
	Address                 string
	MonthlyMonitoringDataMB *int64 `infracost_usage:"monthly_monitoring_data_mb"`
	MonthlyAPICalls         *int64 `infracost_usage:"monthly_api_calls"`
}

func (*MonitoringMetricDescriptor) BuildResource added in v0.9.17

func (r *MonitoringMetricDescriptor) BuildResource() *schema.Resource

func (*MonitoringMetricDescriptor) PopulateUsage added in v0.9.17

func (r *MonitoringMetricDescriptor) PopulateUsage(u *schema.UsageData)

type PubSubSubscription added in v0.9.17

type PubSubSubscription struct {
	Address              string
	MonthlyMessageDataTB *float64 `infracost_usage:"monthly_message_data_tb"`
	StorageGB            *float64 `infracost_usage:"storage_gb"`
	SnapshotStorageGB    *float64 `infracost_usage:"snapshot_storage_gb"`
}

func (*PubSubSubscription) BuildResource added in v0.9.17

func (r *PubSubSubscription) BuildResource() *schema.Resource

func (*PubSubSubscription) PopulateUsage added in v0.9.17

func (r *PubSubSubscription) PopulateUsage(u *schema.UsageData)

type PubSubTopic added in v0.9.17

type PubSubTopic struct {
	Address              string
	MonthlyMessageDataTB *float64 `infracost_usage:"monthly_message_data_tb"`
}

func (*PubSubTopic) BuildResource added in v0.9.17

func (r *PubSubTopic) BuildResource() *schema.Resource

func (*PubSubTopic) PopulateUsage added in v0.9.17

func (r *PubSubTopic) PopulateUsage(u *schema.UsageData)

type RedisInstance added in v0.9.17

type RedisInstance struct {
	Address      string
	Region       string
	Tier         string
	MemorySizeGB float64
}

func (*RedisInstance) BuildResource added in v0.9.17

func (r *RedisInstance) BuildResource() *schema.Resource

func (*RedisInstance) PopulateUsage added in v0.9.17

func (r *RedisInstance) PopulateUsage(u *schema.UsageData)

type RegionUsage added in v0.9.16

type RegionUsage struct {
	Key   string
	Value float64
}

RegionUsage defines a hard definition in the regions map.

type RegionsUsage added in v0.9.16

type RegionsUsage struct {
	AsiaEast1              *float64 `infracost_usage:"asia_east1"`
	AsiaEast2              *float64 `infracost_usage:"asia_east2"`
	AsiaNortheast1         *float64 `infracost_usage:"asia_northeast1"`
	AsiaNortheast2         *float64 `infracost_usage:"asia_northeast2"`
	AsiaNortheast3         *float64 `infracost_usage:"asia_northeast3"`
	AsiaSouth1             *float64 `infracost_usage:"asia_south1"`
	AsiaSouth2             *float64 `infracost_usage:"asia_south2"`
	AsiaSoutheast1         *float64 `infracost_usage:"asia_southeast1"`
	AsiaSoutheast2         *float64 `infracost_usage:"asia_southeast2"`
	AustraliaSoutheast1    *float64 `infracost_usage:"australia_southeast1"`
	AustraliaSoutheast2    *float64 `infracost_usage:"australia_southeast2"`
	EuropeCentral2         *float64 `infracost_usage:"europe_central2"`
	EuropeNorth1           *float64 `infracost_usage:"europe_north1"`
	EuropeWest1            *float64 `infracost_usage:"europe_west1"`
	EuropeWest2            *float64 `infracost_usage:"europe_west2"`
	EuropeWest3            *float64 `infracost_usage:"europe_west3"`
	EuropeWest4            *float64 `infracost_usage:"europe_west4"`
	EuropeWest6            *float64 `infracost_usage:"europe_west6"`
	NorthAmericaNortheast1 *float64 `infracost_usage:"northamerica_northeast1"`
	NorthAmericaNortheast2 *float64 `infracost_usage:"northamerica_northeast2"`
	SouthAmericaEast1      *float64 `infracost_usage:"southamerica_east1"`
	SouthAmericaWest1      *float64 `infracost_usage:"southamerica_west1"`
	USCentral1             *float64 `infracost_usage:"us_central1"`
	USEast1                *float64 `infracost_usage:"us_east1"`
	USEast4                *float64 `infracost_usage:"us_east4"`
	USWest1                *float64 `infracost_usage:"us_west1"`
	USWest2                *float64 `infracost_usage:"us_west2"`
	USWest3                *float64 `infracost_usage:"us_west3"`
	USWest4                *float64 `infracost_usage:"us_west4"`
}

RegionsUsage is a reusable type that represents a usage cost map. This can be used in resources that define a usage parameter that's changed on a per-region basis, e.g:

monthly_data_processed_gb:

asia_northeast1: 188
asia_east2: 78

can be handled by adding a usage cost property to your resource like so:

type MyResource struct {
   ...
   MonthlyDataProcessedGB *RegionsUsage `infracost_usage:"monthly_processed_gb"`
}

func (RegionsUsage) Values added in v0.9.16

func (r RegionsUsage) Values() []RegionUsage

Values returns RegionUsage as a slice which can be iterated over to create cost components. The keys of the regions returned have their underscores replaced with hypens so they can be used in product filters and cost lookups.

type SecretManagerSecret

type SecretManagerSecret struct {
	Address              string
	Region               string
	ReplicationLocations int64

	// "usage" args
	ActiveSecretVersions         *int64 `infracost_usage:"active_secret_versions"`
	MonthlyAccessOperations      *int64 `infracost_usage:"monthly_access_operations"`
	MonthlyRotationNotifications *int64 `infracost_usage:"monthly_rotation_notifications"`
}

SecretManagerSecret represents Google Secret Manager's Secret resource.

The cost of active secret versions depends on the number of replication locations. If it's more than one then the price is multiplied by the locations' quantity. Pricing API includes Free Tier, but it's not used.

More resource information here: https://cloud.google.com/secret-manager Pricing information here: https://cloud.google.com/secret-manager/pricing

func (*SecretManagerSecret) BuildResource

func (r *SecretManagerSecret) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid SecretManagerSecret. This method is called after the resource is initialised by an IaC provider. See providers folder for more information.

func (*SecretManagerSecret) PopulateUsage

func (r *SecretManagerSecret) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.UsageData into the SecretManagerSecret. It uses the `infracost_usage` struct tags to populate data into the SecretManagerSecret.

type SecretManagerSecretVersion

type SecretManagerSecretVersion struct {
	Address              string
	Region               string
	ReplicationLocations int64

	// "usage" args
	MonthlyAccessOperations *int64 `infracost_usage:"monthly_access_operations"`
}

SecretManagerSecretVersion represents one Google Secret Manager Secret's Version resource.

The cost of active secret version depends on the number of replication locations specified by its parent secret. If it's more than one then the price is multiplied by the locations' quantity. Pricing API includes Free Tier, but it's not used.

More resource information here: https://cloud.google.com/secret-manager Pricing information here: https://cloud.google.com/secret-manager/pricing

func (*SecretManagerSecretVersion) BuildResource

func (r *SecretManagerSecretVersion) BuildResource() *schema.Resource

BuildResource builds a schema.Resource from a valid SecretManagerSecretVersion. This method is called after the resource is initialised by an IaC provider. See providers folder for more information.

func (*SecretManagerSecretVersion) PopulateUsage

func (r *SecretManagerSecretVersion) PopulateUsage(u *schema.UsageData)

PopulateUsage parses the u schema.UsageData into the SecretManagerSecretVersion. It uses the `infracost_usage` struct tags to populate data into the SecretManagerSecretVersion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL