common

package
v0.0.0-...-f1ded2b Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// KeyProject is the key for project in Terraform Provider Configuration
	KeyProject = "project"
	// SelfPackagePath is the golang path for this package.
	SelfPackagePath = "github.com/tampakrap/provider-upjet-gcp-beta/config/common"

	// ExtractResourceIDFuncPath holds the GCP resource ID extractor func name
	ExtractResourceIDFuncPath = "github.com/tampakrap/provider-upjet-gcp-beta/config/common.ExtractResourceID()"
	ExtractProjectIDFuncPath  = "github.com/tampakrap/provider-upjet-gcp-beta/config/common.ExtractProjectID()"
	ExtractFolderIDFuncPath   = "github.com/tampakrap/provider-upjet-gcp-beta/config/common.ExtractFolderID()"
	// VersionV1Beta1 is used for resources that meet the v1beta1 criteria
	// here: https://github.com/upbound/arch/pull/33
	VersionV1Beta1 = "v1beta1"
)

Variables

View Source
var (
	// PathSelfLinkExtractor is the golang path to SelfLinkExtractor function
	// in this package.
	PathSelfLinkExtractor = SelfPackagePath + ".SelfLinkExtractor()"
)

Functions

func ExtractFolderID

func ExtractFolderID() reference.ExtractValueFn

func ExtractProjectID

func ExtractProjectID() reference.ExtractValueFn

func ExtractResourceID

func ExtractResourceID() reference.ExtractValueFn

ExtractResourceID extracts the value of `spec.atProvider.id` from a Terraformed resource. If mr is not a Terraformed resource, returns an empty string.

func GetField

func GetField(from map[string]interface{}, path string) (string, error)

GetField returns the value of field as a string in a map[string]interface{},

fails properly otherwise.

func GetNameFromFullyQualifiedID

func GetNameFromFullyQualifiedID(tfstate map[string]interface{}) (string, error)

GetNameFromFullyQualifiedID extracts external-name from GCP ID Example: projects/{{project}}/zones/{{zone}}/instances/{{name}}

func SelfLinkExtractor

func SelfLinkExtractor() reference.ExtractValueFn

SelfLinkExtractor extracts URI of the resources from "status.atProvider.selfLink" which is quite common among all GCP resources.

Types

This section is empty.

Jump to

Keyboard shortcuts

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