config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExternalNameConfigs = map[string]config.ExternalName{
	"grafana_api_key":                           config.IdentifierFromProvider,
	"grafana_service_account":                   config.IdentifierFromProvider,
	"grafana_service_account_permission":        config.IdentifierFromProvider,
	"grafana_service_account_token":             config.IdentifierFromProvider,
	"grafana_cloud_api_key":                     config.IdentifierFromProvider,
	"grafana_cloud_stack":                       config.IdentifierFromProvider,
	"grafana_cloud_stack_service_account":       config.IdentifierFromProvider,
	"grafana_cloud_stack_service_account_token": config.IdentifierFromProvider,
	"grafana_contact_point":                     config.IdentifierFromProvider,
	"grafana_dashboard_permission":              config.IdentifierFromProvider,
	"grafana_dashboard":                         config.IdentifierFromProvider,
	"grafana_data_source":                       config.IdentifierFromProvider,
	"grafana_folder_permission":                 config.IdentifierFromProvider,
	"grafana_folder":                            config.IdentifierFromProvider,
	"grafana_message_template":                  config.IdentifierFromProvider,
	"grafana_mute_timing":                       config.IdentifierFromProvider,
	"grafana_notification_policy":               config.IdentifierFromProvider,
	"grafana_oncall_escalation_chain":           config.IdentifierFromProvider,
	"grafana_oncall_escalation":                 config.IdentifierFromProvider,
	"grafana_oncall_integration":                config.IdentifierFromProvider,
	"grafana_oncall_on_call_shift":              config.IdentifierFromProvider,
	"grafana_oncall_outgoing_webhook":           config.IdentifierFromProvider,
	"grafana_oncall_route":                      config.IdentifierFromProvider,
	"grafana_oncall_schedule":                   config.IdentifierFromProvider,
	"grafana_report":                            config.IdentifierFromProvider,
	"grafana_rule_group":                        config.IdentifierFromProvider,
	"grafana_synthetic_monitoring_check":        config.IdentifierFromProvider,
	"grafana_synthetic_monitoring_installation": config.IdentifierFromProvider,
	"grafana_synthetic_monitoring_probe":        config.IdentifierFromProvider,
	"grafana_team":                              config.IdentifierFromProvider,
	"grafana_user":                              config.IdentifierFromProvider,
	"grafana_organization":                      config.IdentifierFromProvider,
	"grafana_organization_preferences":          config.IdentifierFromProvider,
}

ExternalNameConfigs contains all external name configurations for this provider.

View Source
var GroupMap = map[string]GroupKindCalculator{

	"grafana_contact_point":       ReplaceGroupWords("alerting", 0),
	"grafana_message_template":    ReplaceGroupWords("alerting", 0),
	"grafana_mute_timing":         ReplaceGroupWords("alerting", 0),
	"grafana_notification_policy": ReplaceGroupWords("alerting", 0),
	"grafana_rule_group":          ReplaceGroupWords("alerting", 0),

	"grafana_cloud_api_key":                     ReplaceGroupWords("cloud", 1),
	"grafana_cloud_stack":                       ReplaceGroupWords("cloud", 1),
	"grafana_cloud_stack_service_account":       ReplaceGroupWords("cloud", 1),
	"grafana_cloud_stack_service_account_token": ReplaceGroupWords("cloud", 1),

	"grafana_report": ReplaceGroupWords("enterprise", 0),

	"grafana_oncall_escalation":       ReplaceGroupWords("oncall", 1),
	"grafana_oncall_escalation_chain": ReplaceGroupWords("oncall", 1),
	"grafana_oncall_integration":      ReplaceGroupWords("oncall", 1),
	"grafana_oncall_on_call_shift":    ReplaceGroupWords("oncall", 1),
	"grafana_oncall_outgoing_webhook": ReplaceGroupWords("oncall", 1),
	"grafana_oncall_route":            ReplaceGroupWords("oncall", 1),
	"grafana_oncall_schedule":         ReplaceGroupWords("oncall", 1),

	"grafana_api_key":                    ReplaceGroupWords("oss", 0),
	"grafana_data_source":                ReplaceGroupWords("oss", 0),
	"grafana_dashboard":                  ReplaceGroupWords("oss", 0),
	"grafana_dashboard_permission":       ReplaceGroupWords("oss", 0),
	"grafana_folder":                     ReplaceGroupWords("oss", 0),
	"grafana_folder_permission":          ReplaceGroupWords("oss", 0),
	"grafana_service_account":            ReplaceGroupWords("oss", 0),
	"grafana_service_account_permission": ReplaceGroupWords("oss", 0),
	"grafana_service_account_token":      ReplaceGroupWords("oss", 0),
	"grafana_team":                       ReplaceGroupWords("oss", 0),
	"grafana_user":                       ReplaceGroupWords("oss", 0),
	"grafana_organization":               ReplaceGroupWords("oss", 0),
	"grafana_organization_preferences":   ReplaceGroupWords("oss", 0),

	"grafana_synthetic_monitoring_check":        ReplaceGroupWords("sm", 2),
	"grafana_synthetic_monitoring_installation": ReplaceGroupWords("sm", 2),
	"grafana_synthetic_monitoring_probe":        ReplaceGroupWords("sm", 2),
}

GroupMap contains all overrides we'd like to make to the default group search. Keep the same structure as in the Terraform docs: https://registry.terraform.io/providers/grafana/grafana/latest/docs

View Source
var KindMap = map[string]string{}

KindMap contains kind string overrides.

Functions

func ExternalNameConfigurations added in v0.0.11

func ExternalNameConfigurations() config.ResourceOption

ExternalNameConfigurations applies all external name configs listed in the table ExternalNameConfigs and sets the version of those resources to v1beta1 assuming they will be tested.

func ExternalNameConfigured added in v0.0.11

func ExternalNameConfigured() []string

ExternalNameConfigured returns the list of all resources whose external name is configured manually.

func GetProvider

func GetProvider() *ujconfig.Provider

GetProvider returns provider configuration

func GroupKindOverrides added in v0.0.11

func GroupKindOverrides() config.ResourceOption

GroupKindOverrides overrides the group and kind of the resource if it matches any entry in the GroupMap.

func KindOverrides added in v0.0.11

func KindOverrides() config.ResourceOption

KindOverrides overrides the kind of the resources given in KindMap.

Types

type GroupKindCalculator added in v0.0.11

type GroupKindCalculator func(resource string) (string, string)

GroupKindCalculator returns the correct group and kind name for given TF resource.

func ReplaceGroupWords added in v0.0.11

func ReplaceGroupWords(group string, count int) GroupKindCalculator

ReplaceGroupWords uses given group as the group of the resource and removes a number of words in resource name before calculating the kind of the resource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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