bpmetadata

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package bpmetadata generates and validates metadata for Terraform blueprint packages.

bpmetadata is a tool that generates metadata for Terraform packages that are structured based on the CFT Module Template. Executing the cli at the root of a Terraform blueprint package or pointing to one with a "path" flag will generate "metadata.yaml". Additionally a UI-display specific metadata file can also be generated by providing the cli with a "display" flag.

Downloading the CFT CLI

Download the CFT CLI as:

curl https://storage.googleapis.com/cft-cli/<VERSION>/cft-<PLATFORM>-amd64 --output cft

Where:

  • VERSION can be set to "latest" or to a specific semver e.g. "v0.5.0". It is recommended to use the "latest" version.
  • PLATFORM can be set as "linux", "windows" or "darwin".

e.g. the latest version of the CLI for linux can be downloaded as:

curl https://storage.googleapis.com/cft-cli/latest/cft-linux-amd64 --output cft

This will download the CLI binary to the current working directory.

Generating metadata for a Terraform package

Prerequisite: The Terraform package should conform to the folder structure defined by the CFT Module Template. A vanilla package can be generated using `cookiecutter` as explained in the CFT Module Template's documentation.

Generate metadata using the CLI by pointing the CLI to the root of the Terraform package as:

cft blueprint metadata -p <SOLUTION_ROOT_PATH> -d

This will generate two files i.e. "metadata.yaml" and "metadata.display.yaml" for each root and sub-modules available in the Terraform Blueprint. "metadata.yaml" is mostly auto generated while "metadata.display.yaml" is expected to be hand-authored.

All fields (auto generated and manually authored) supported by the metadata schema can be found under the top-level struct type BlueprintMetadata.

Refer to sample versions of metadata.yaml and metadata.display.yaml for the canonical Terraform package.

For all available flags for the CLI, use help for cft as:

cft blueprint metadata -h

Validating metadata for schema consistencies

Validate metadata for your root and sub modules with the CFT CLI as:

cft blueprint metadata -v

This will output a success message i.e. "metadata is valid" if all fields in all metadata files are consistent with the BlueprintMetadata schema. Otherwise, error messages for invalid field names, types or values will be shown.

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "metadata",
	Short: "Generates blueprint metadata",
	Long:  `Generates metadata.yaml for specified blueprint`,
	Args:  cobra.NoArgs,
	RunE:  generate,
}
View Source
var Log = log.New()

bpmetadata log15 handler

Functions

func WriteMetadata

func WriteMetadata(obj *BlueprintMetadata, bpPath, fileName string) error

Types

type BlueprintActuationTool

type BlueprintActuationTool struct {
	// Gen: auto-generated - set as "Terraform" for now until
	//more flavors are supported.
	Flavor string `json:"flavor,omitempty" yaml:"flavor,omitempty"`

	// Required version for the actuation tool.
	// Gen: auto-generated - For Terraform this is the `required_version`
	// set in `terraform` block. E.g.
	// terraform {
	//   required_version = ">= 0.13"
	// }
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
}

type BlueprintArchitecture added in v0.5.4

type BlueprintArchitecture struct {
	// Gen: auto-generated - the URL & list content following the "## Architecture" tag e.g.
	// ## Architecture
	// ![Blueprint Architecture](assets/architecture.png)
	// 1. Step no. 1
	// 2. Step no. 2
	// 3. Step no. 3
	DiagramURL string `json:"diagramUrl" yaml:"diagramUrl"`

	// Gen: auto-generated - the list items following the "## Architecture" tag.
	Description []string `json:"description" yaml:"description"`
}

type BlueprintAuthor added in v0.6.0

type BlueprintAuthor struct {
	// Name of template author or organization.
	// Gen: manually-authored
	Title string `json:"title" yaml:"title"`

	// Description of the author.
	// Gen: manually-authored
	Description string `json:"description,omitempty"  yaml:"description,omitempty"`

	// Link to the author's website.
	// Gen: manually-authored
	URL string `json:"url,omitempty" yaml:"url,omitempty"`
}

type BlueprintCloudProduct added in v0.5.4

type BlueprintCloudProduct struct {
	// A top-level (e.g. "Compute Engine") or secondary (e.g. "Binary Authorization")
	// product used in the blueprint.
	// Gen: manually-authored
	ProductId string `json:"productId,omitempty" yaml:"productId,omitempty"`

	// Url for the product.
	// Gen: manually-authored
	PageURL string `json:"pageUrl" yaml:"pageUrl"`

	// A label string for the product, if it is not an integrated GCP product.
	// E.g. "Data Studio"
	// Gen: manually-authored
	Label string `json:"label,omitempty" yaml:"label,omitempty"`

	// Is the product's landing page external to the GCP console e.g.
	// lookerstudio.google.com
	// Gen: manually-authored
	IsExternal bool `json:"isExternal,omitempty" yaml:"isExternal,omitempty"`
}

GCP cloud product(s) used in the blueprint.

type BlueprintContent

type BlueprintContent struct {
	// Gen: auto-generated
	Architecture BlueprintArchitecture `json:"architecture,omitempty" yaml:"architecture,omitempty"`

	// Gen: manually-authored
	Diagrams []BlueprintDiagram `json:"diagrams,omitempty" yaml:"diagrams,omitempty"`

	// Gen: auto-generated - the list content following the "## Documentation" tag. E.g.
	// ## Documentation
	// - [Hosting a Static Website](https://cloud.google.com/storage/docs/hosting-static-website)
	Documentation []BlueprintListContent `json:"documentation,omitempty" yaml:"documentation,omitempty"`

	// Gen: auto-generated - blueprints under the modules/ folder.
	SubBlueprints []BlueprintMiscContent `json:"subBlueprints,omitempty" yaml:"subBlueprints,omitempty"`

	// Gen: auto-generated - examples under the examples/ folder.
	Examples []BlueprintMiscContent `json:"examples,omitempty" yaml:"examples,omitempty"`
}

BlueprintContent defines the detail for blueprint related content such as related documentation, diagrams, examples etc.

type BlueprintCostEstimate added in v0.5.4

type BlueprintCostEstimate struct {
	// Gen: auto-generated - Set using the content defined under "### Cost" as a link
	// with a description E.g.
	// ### Cost
	// [$20.00](https://cloud.google.com/products/calculator?hl=en_US&_ga=2.1665458.-226505189.1675191136#id=02fb0c45-cc29-4567-8cc6-f72ac9024add)
	Description string `json:"description" yaml:"description"`
	URL         string `json:"url" yaml:"url"`
}

The cost estimate for the blueprint based on pre-configured variables.

type BlueprintDescription

type BlueprintDescription struct {
	// Gen: auto-generated - Markdown after "### Tagline".
	Tagline string `json:"tagline,omitempty" yaml:"tagline,omitempty"`

	// Gen: auto-generated - Markdown after "### Detailed".
	Detailed string `json:"detailed,omitempty" yaml:"detailed,omitempty"`

	// Gen: auto-generated - Markdown after "### PreDeploy".
	PreDeploy string `json:"preDeploy,omitempty" yaml:"preDeploy,omitempty"`

	// Gen: auto-generated - Markdown after "### Html".
	HTML string `json:"html,omitempty" yaml:"html,omitempty"`

	// Gen: auto-generated - Markdown after "### EulaUrls".
	EulaURLs []string `json:"eulaUrls,omitempty" yaml:"eulaUrls,omitempty"`

	// Gen: auto-generated - Markdown after "### Architecture"
	// Deprecated. Use BlueprintContent.Architecture instead.
	Architecture []string `json:"architecture,omitempty" yaml:"architecture,omitempty"`
}

All descriptions are set with the markdown content immediately after each type's heading declaration in readme.md.

type BlueprintDiagram

type BlueprintDiagram struct {
	Name        string `json:"name" yaml:"name"`
	AltText     string `json:"altText,omitempty" yaml:"altText,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type BlueprintInfo

type BlueprintInfo struct {
	// Title for the blueprint.
	// Gen: auto-generated - First H1 text in readme.md.
	Title string `json:"title" yaml:"title"`

	// Blueprint source location and source type.
	// Gen: auto-generated - user will be prompted if repo information can not
	// be determined from the blueprint path.
	Source *BlueprintRepoDetail `json:"source,omitempty" yaml:"source,omitempty"`

	// Last released semantic version for the packaged blueprint.
	// Gen: auto-generated - From the `module_name` attribute of
	// the `provider_meta "google"` block.
	// E.g.
	// provider_meta "google" {
	//  module_name = "blueprints/terraform/terraform-google-log-analysis/v0.1.5"
	// }
	Version string `json:"version,omitempty" yaml:"version,omitempty"`

	// Actuation tool e.g. Terraform and its required version.
	// Gen: auto-generated
	ActuationTool BlueprintActuationTool `json:"actuationTool,omitempty" yaml:"actuationTool,omitempty"`

	// Various types of descriptions associated with the blueprint.
	// Gen: auto-generated
	Description *BlueprintDescription `json:"description,omitempty" yaml:"description,omitempty"`

	// Path to an image representing the icon for the blueprint.
	// Will be set as "assets/icon.png", if present.
	// Gen: auto-generated
	Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`

	// The time estimate for configuring and deploying the blueprint.
	// Gen: auto-generated
	DeploymentDuration BlueprintTimeEstimate `json:"deploymentDuration,omitempty" yaml:"deploymentDuration,omitempty"`

	// The cost estimate for the blueprint based on preconfigured variables.
	// Gen: auto-generated
	CostEstimate BlueprintCostEstimate `json:"costEstimate,omitempty" yaml:"costEstimate,omitempty"`

	// A list of GCP cloud products used in the blueprint.
	// Gen: manually-authored
	CloudProducts []BlueprintCloudProduct `json:"cloudProducts,omitempty" yaml:"cloudProducts,omitempty"`

	// A list of GCP org policies to be checked for successful deployment.
	// Gen: manually-authored
	OrgPolicyChecks []BlueprintOrgPolicyCheck `json:"orgPolicyChecks,omitempty" yaml:"orgPolicyChecks,omitempty"`

	// A configuration of fixed and dynamic GCP quotas that apply to the blueprint.
	// Gen: manually-authored
	QuotaDetails []BlueprintQuotaDetail `json:"quotaDetails,omitempty" yaml:"quotaDetails,omitempty"`

	// Details on the author producing the blueprint.
	// Gen: manually-authored
	Author BlueprintAuthor `json:"author,omitempty" yaml:"author,omitempty"`

	// Details on software installed as part of the blueprint.
	// Gen: manually-authored
	SoftwareGroups []BlueprintSoftwareGroup `json:"softwareGroups,omitempty" yaml:"softwareGroups,omitempty"`

	// Support offered, if any for the blueprint.
	// Gen: manually-authored
	SupportInfo BlueprintSupport `json:"supportInfo,omitempty" yaml:"supportInfo,omitempty"`

	// Specifies if the blueprint supports single or multiple deployments per GCP project.
	// If set to true, the blueprint can not be deployed more than once in the same GCP project.
	// Gen: manually-authored
	SingleDeployment bool `json:"singleDeployment,omitempty" yaml:"singleDeployment,omitempty"`
}

type BlueprintInterface

type BlueprintInterface struct {
	// Gen: auto-generated - all defined variables for the blueprint
	Variables []BlueprintVariable `json:"variables,omitempty" yaml:"variables,omitempty"`

	// Gen: manually-authored
	VariableGroups []BlueprintVariableGroup `json:"variableGroups,omitempty" yaml:"variableGroups,omitempty"`

	// Gen: auto-generated - all defined outputs for the blueprint
	Outputs []BlueprintOutput `json:"outputs,omitempty" yaml:"outputs,omitempty"`
}

BlueprintInterface defines the input and output variables for the blueprint.

type BlueprintListContent

type BlueprintListContent struct {
	Title string `json:"title" yaml:"title"`
	URL   string `json:"url,omitempty" yaml:"url,omitempty"`
}

type BlueprintMetadata

type BlueprintMetadata struct {
	// Gen: auto-generated
	yaml.ResourceMeta `json:",inline" yaml:",inline"`
	// Gen: partial
	Spec BlueprintMetadataSpec `json:"spec" yaml:"spec"`
}

BlueprintMetadata defines the overall structure for blueprint metadata. The cli command i.e. `cft blueprint metadata` attempts at auto-generating metadata if the blueprint is structured based on the TF blueprint template i.e. https://github.com/terraform-google-modules/terraform-google-module-template All fields within BlueprintMetadata and its children are denoted as: - Gen: auto-generated - <data source> - Gen: manually-authored - Gen: partial (contains child nodes that can be both auto-generated and manually authored)

func CreateBlueprintDisplayMetadata added in v0.9.0

func CreateBlueprintDisplayMetadata(bpPath string, bpDisp, bpCore *BlueprintMetadata) (*BlueprintMetadata, error)

func CreateBlueprintMetadata

func CreateBlueprintMetadata(bpPath string, bpMetadataObj *BlueprintMetadata) (*BlueprintMetadata, error)

func UnmarshalMetadata

func UnmarshalMetadata(bpPath, fileName string) (*BlueprintMetadata, error)

type BlueprintMetadataSpec

type BlueprintMetadataSpec struct {
	// Gen: partial
	Info BlueprintInfo `json:"info,omitempty" yaml:"info,omitempty"`
	// Gen: partial
	Content BlueprintContent `json:"content,omitempty" yaml:"content,omitempty"`
	// Gen: partial
	Interfaces BlueprintInterface `json:"interfaces,omitempty" yaml:"interfaces,omitempty"`
	// Gen: auto-generated
	Requirements BlueprintRequirements `json:"requirements,omitempty" yaml:"requirements,omitempty"`
	// Gen: partial
	UI BlueprintUI `json:"ui,omitempty" yaml:"ui,omitempty"`
}

BlueprintMetadataSpec defines the spec portion of the blueprint metadata.

type BlueprintMiscContent

type BlueprintMiscContent struct {
	Name     string `json:"name" yaml:"name"`
	Location string `json:"location,omitempty" yaml:"location,omitempty"`
}

type BlueprintOrgPolicyCheck added in v1.1.1

type BlueprintOrgPolicyCheck struct {
	// Id for the policy e.g. "compute-vmExternalIpAccess"
	// Gen: manually-authored
	PolicyId string `json:"policyId" yaml:"policyId"`

	// If not set, it is assumed any version of this org policy
	// prevents successful deployment of this solution.
	// Gen: manually-authored
	RequiredValues []string `json:"requiredValues,omitempty" yaml:"requiredValues,omitempty"`
}

BlueprintOrgPolicyCheck defines GCP org policies to be checked for successful deployment

type BlueprintOutput

type BlueprintOutput struct {
	Name        string `json:"name" yaml:"name"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type BlueprintQuotaDetail added in v0.5.4

type BlueprintQuotaDetail struct {
	// DynamicVariable, if provided, associates the provided input variable
	// with the corresponding resource and quota type. In its absence, the quota
	// detail is assumed to be fixed.
	// Gen: manually-authored
	DynamicVariable string `json:"dynamicVariable,omitempty" yaml:"dynamicVariable,omitempty"`

	// ResourceType is the type of resource the quota will be applied to i.e.
	// GCE Instance or Disk etc.
	// Gen: manually-authored
	ResourceType QuotaResourceType `json:"resourceType" yaml:"resourceType" jsonschema:"enum=QRT_GCE_INSTANCE,enum=QRT_GCE_DISK,enum=QRT_UNDEFINED"`

	// QuotaType is a key/value pair of the actual quotas and their corresponding
	// values.
	// Gen: manually-authored
	QuotaType map[QuotaType]string `json:"quotaType" yaml:"quotaType"`
}

type BlueprintRepoDetail

type BlueprintRepoDetail struct {
	// Gen: auto-generated - URL from the .git dir.
	// Can be manually overridden with a custom URL if needed.
	Repo string `json:"repo" yaml:"repo"`

	// Gen: auto-generated - set as "git" for now until more
	// types are supported.
	SourceType string `json:"sourceType" yaml:"sourceType"`

	// Gen: auto-generated - not set for root modules but
	// set as the module name for submodules, if found.
	Dir string `json:"dir,omitempty" yaml:"dir,omitempty"`
}

type BlueprintRequirements

type BlueprintRequirements struct {
	// Gen: auto-generated - all roles required for the blueprint in test/setup/iam.tf
	// as the "int_required_roles" local. E.g.
	// locals {
	//   int_required_roles = [
	//     "roles/compute.admin",
	//   ]
	// }
	Roles []BlueprintRoles `json:"roles,omitempty" yaml:"roles,omitempty"`

	// Gen: auto-generated - all services required for the blueprint in test/setup/main.tf
	// as "activate_apis" in the project module.
	Services []string `json:"services,omitempty" yaml:"services,omitempty"`
}

BlueprintRequirements defines the roles required and the associated services that need to be enabled to provision blueprint resources.

type BlueprintRoles

type BlueprintRoles struct {
	Level string   `json:"level" yaml:"level"`
	Roles []string `json:"roles" yaml:"roles"`
}

type BlueprintSoftware added in v0.6.0

type BlueprintSoftware struct {
	// User-visible title.
	// Gen: manually-authored
	Title string `json:"title" yaml:"title"`

	// Software version.
	// Gen: manually-authored
	Version string `json:"version,omitempty" yaml:"version,omitempty"`

	// Link to development site or marketing page for this software.
	// Gen: manually-authored
	URL string `json:"url,omitempty" yaml:"url,omitempty"`

	// Link to license page.
	// Gen: manually-authored
	LicenseURL string `json:"licenseUrl,omitempty" yaml:"licenseUrl,omitempty"`
}

A description of a piece of a single software component installed by the blueprint.

type BlueprintSoftwareGroup added in v0.6.0

type BlueprintSoftwareGroup struct {
	// Pre-defined software types.
	// Gen: manually-authored
	Type SoftwareGroupType `json:"type,omitempty" yaml:"type,omitempty" jsonschema:"enum=SG_UNSPECIFIED,enum=SG_OS"`

	// Software components belonging to this group.
	// Gen: manually-authored
	Software []BlueprintSoftware `json:"software,omitempty" yaml:"software,omitempty"`
}

A group of related software components for the blueprint.

type BlueprintSupport added in v0.6.0

type BlueprintSupport struct {
	// Description of the support option.
	// Gen: manually-authored
	Description string `json:"description" yaml:"description"`

	// Link to the page providing this support option.
	// Gen: manually-authored
	URL string `json:"url,omitempty" yaml:"url,omitempty"`

	// The organization or group that provides the support option (e.g.:
	// "Community", "Google").
	// Gen: manually-authored
	Entity string `json:"entity,omitempty" yaml:"entity,omitempty"`

	// Whether to show the customer's support ID.
	// Gen: manually-authored
	ShowSupportId bool `json:"showSupportId,omitempty" yaml:"showSupportId,omitempty"`
}

A description of a support option

type BlueprintTimeEstimate added in v0.5.4

type BlueprintTimeEstimate struct {
	// Gen: auto-generated - Set using the content defined under "### DeploymentTime" E.g.
	// ### DeploymentTime
	// - Configuration: X secs
	// - Deployment: Y secs
	ConfigurationSecs int `json:"configurationSecs,omitempty" yaml:"configurationSecs,omitempty"`
	DeploymentSecs    int `json:"deploymentSecs,omitempty" yaml:"deploymentSecs,omitempty"`
}

A time estimate in secs required for configuring and deploying the blueprint.

type BlueprintUI added in v0.6.0

type BlueprintUI struct {
	// The top-level input section that defines the list of variables and
	// their sections on the deployment page.
	// Gen: partial
	Input BlueprintUIInput `json:"input,omitempty" yaml:"input,omitempty"`

	// The top-level section for listing runtime (or blueprint output) information
	// i.e. the console URL for the VM or a button to ssh into the VM etc based on.
	// Gen: manually-authored
	Runtime BlueprintUIOutput `json:"runtime,omitempty" yaml:"runtime,omitempty"`
}

BlueprintUI is the top-level structure for holding UI specific metadata.

type BlueprintUIInput added in v0.6.0

type BlueprintUIInput struct {
	// variables is a map defining all inputs on the UI.
	// Gen: partial
	Variables map[string]*DisplayVariable `json:"variables,omitempty" yaml:"variables,omitempty"`

	// Sections is a generic structure for grouping inputs together.
	// Gen: manually-authored
	Sections []DisplaySection `json:"sections,omitempty" yaml:"sections,omitempty"`
}

BlueprintUIInput is the structure for holding Input and Input Section (i.e. groups) specific metadata.

type BlueprintUIOutput added in v0.6.0

type BlueprintUIOutput struct {
	// Short message to be displayed while the blueprint is deploying.
	// At most 128 characters.
	// Gen: manually-authored
	OutputMessage string `json:"outputMessage,omitempty" yaml:"outputMessage,omitempty"`

	// List of suggested actions to take.
	// Gen: manually-authored
	SuggestedActions []UIActionItem `json:"suggestedActions,omitempty" yaml:"suggestedActions,omitempty"`

	// Outputs is a map defining a subset of Terraform outputs on the UI
	// that may need additional UI configuration.
	// Gen: manually-authored
	Outputs map[string]DisplayOutput `json:"outputs,omitempty" yaml:"outputs,omitempty"`
}

type BlueprintVariable

type BlueprintVariable struct {
	Name         string      `json:"name,omitempty" yaml:"name,omitempty"`
	Description  string      `json:"description,omitempty" yaml:"description,omitempty"`
	VarType      string      `json:"varType,omitempty" yaml:"varType,omitempty"`
	DefaultValue interface{} `json:"defaultValue,omitempty" yaml:"defaultValue,omitempty"`
	Required     bool        `json:"required,omitempty" yaml:"required,omitempty"`
}

type BlueprintVariableGroup

type BlueprintVariableGroup struct {
	Name        string   `json:"name" yaml:"name"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
	Variables   []string `json:"variables,omitempty" yaml:"variables,omitempty"`
}

type DisplayOutput added in v1.1.8

type DisplayOutput struct {
	// OpenInNewTab defines if the Output action should be opened
	// in a new tab.
	// Gen: manually-authored
	OpenInNewTab bool `json:"openInNewTab,omitempty" yaml:"openInNewTab,omitempty"`

	// ShowInNotification defines if the Output should shown in
	// notification for the deployment.
	// Gen: manually-authored
	ShowInNotification bool `json:"showInNotification,omitempty" yaml:"showInNotification,omitempty"`
}

Additional display specific metadata pertaining to a particular Terraform output.

type DisplaySection added in v0.6.0

type DisplaySection struct {
	// The name of the section, referenced by DisplayVariable.Section
	// Section names must be unique.
	// Gen: manually-authored
	Name string `json:"name" yaml:"name"`

	// Section title.
	// If not provided, name will be used instead.
	// Gen: manually-authored
	Title string `json:"title,omitempty" yaml:"title,omitempty"`

	// Section tooltip.
	// Gen: manually-authored
	Tooltip string `json:"tooltip,omitempty" yaml:"tooltip,omitempty"`

	// Section subtext.
	// Gen: manually-authored
	Subtext string `json:"subtext,omitempty" yaml:"subtext,omitempty"`

	// The name of the parent section (if parent is not the root section).
	// Gen: manually-authored
	Parent string `json:"parent,omitempty" yaml:"parent,omitempty"`
}

A logical group of variables. [Section][]s may also be grouped into sub-sections.

type DisplayVariable added in v0.6.0

type DisplayVariable struct {
	// The variable name from the corresponding standard metadata file.
	// Gen: auto-generated - the Terraform variable name
	Name string `json:"name" yaml:"name"`

	// Visible title for the variable on the UI. If not present,
	// Name will be used for the Title.
	// Gen: auto-generated - the Terraform variable converted to title case e.g.
	// variable "bucket_admins" will convert to "Bucket Admins" as the title.
	Title string `json:"title" yaml:"title"`

	// A flag to hide or show the variable on the UI.
	// Gen: manually-authored
	Invisible bool `json:"invisible,omitempty" yaml:"invisible,omitempty"`

	// Variable tooltip.
	// Gen: manually-authored
	Tooltip string `json:"tooltip,omitempty" yaml:"tooltip,omitempty"`

	// Placeholder text (when there is no default).
	// Gen: manually-authored
	Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty"`

	// Text describing the validation rules for the property. Typically shown
	// after an invalid input.
	// Optional. UTF-8 text. No markup. At most 128 characters.
	// Gen: manually-authored
	Validation string `json:"validation,omitempty" yaml:"validation,omitempty"`

	// Regex based validation rules for the variable.
	// Gen: manually-authored
	RegExValidation string `json:"regexValidation,omitempty" yaml:"regexValidation,omitempty"`

	// Minimum no. of inputs for the input variable.
	// Gen: manually-authored
	MinimumItems int `json:"minItems,omitempty" yaml:"minItems,omitempty"`

	// Max no. of inputs for the input variable.
	// Gen: manually-authored
	MaximumItems int `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`

	// Minimum length for string values.
	// Gen: manually-authored
	MinimumLength int `json:"minLength,omitempty" yaml:"minLength,omitempty"`

	// Max length for string values.
	// Gen: manually-authored
	MaximumLength int `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`

	// Minimum value for numeric types.
	// Gen: manually-authored
	Minimum float32 `json:"min,omitempty" yaml:"min,omitempty"`

	// Max value for numeric types.
	// Gen: manually-authored
	Maximum float32 `json:"max,omitempty" yaml:"max,omitempty"`

	// The name of a section to which this variable belongs.
	// variables belong to the root section if this field is
	// not set.
	// Gen: manually-authored
	Section string `json:"section,omitempty" yaml:"section,omitempty"`

	// UI extension associated with the input variable.
	// E.g. for rendering a GCE machine type selector:
	//
	// xGoogleProperty:
	//   type: GCE_MACHINE_TYPE
	//   zoneProperty: myZone
	//   gceMachineType:
	//     minCpu: 2
	//     minRamGb: 6
	// Gen: manually-authored
	XGoogleProperty GooglePropertyExtension `json:"xGoogleProperty,omitempty" yaml:"xGoogleProperty,omitempty"`
}

Additional display specific metadata pertaining to a particular input variable.

type ExtensionType added in v0.6.0

type ExtensionType string
const (
	ExtTypeUndefined ExtensionType = "ET_UNDEFINED"

	// General formats.
	EmailAddress    ExtensionType = "ET_EMAIL_ADDRESS"
	MultiLineString ExtensionType = "ET_MULTI_LINE_STRING"

	// GCE related.
	GCEDiskImage       ExtensionType = "ET_GCE_DISK_IMAGE"
	GCEDiskType        ExtensionType = "ET_GCE_DISK_TYPE"
	GCEDiskSize        ExtensionType = "ET_GCE_DISK_SIZE"
	GCEMachineType     ExtensionType = "ET_GCE_MACHINE_TYPE"
	GCENetwork         ExtensionType = "ET_GCE_NETWORK"
	GCEZone            ExtensionType = "ET_GCE_ZONE"
	GCESubnetwork      ExtensionType = "ET_GCE_SUBNETWORK"
	GCERegion          ExtensionType = "ET_GCE_REGION"
	GCEGPUType         ExtensionType = "ET_GCE_GPU_TYPE"
	GCEGPUCount        ExtensionType = "ET_GCE_GPU_COUNT"
	GCEExternalIP      ExtensionType = "ET_GCE_EXTERNAL_IP"
	GCEIPForwarding    ExtensionType = "ET_GCE_IP_FORWARDING"
	GCEFirewall        ExtensionType = "ET_GCE_FIREWALL"
	GCEFirewallRange   ExtensionType = "ET_GCE_FIREWALL_RANGE"
	GCEGenericResource ExtensionType = "ET_GCE_GENERIC_RESOURCE"

	// GCS related.
	GCSBucket ExtensionType = "ET_GCS_BUCKET"

	// IAM related.
	IAMServiceAccount ExtensionType = "ET_IAM_SERVICE_ACCOUNT"
)

type ExternalIPType added in v0.6.0

type ExternalIPType string
const (
	IPUnspecified ExternalIPType = "IP_UNSPECIFIED"
	IPEphemeral   ExternalIPType = "IP_EPHEMERAL"
	IPNone        ExternalIPType = "NONE"
)

type GCEDiskSizeExtension added in v0.6.0

type GCEDiskSizeExtension struct {
	// The allowable range of disk sizes depends on the disk type. This field
	// references another variable from the schema, which must have type GCEDiskType.
	DiskTypeVariable string `json:"diskTypeVariable" yaml:"diskTypeVariable"`
}

type GCEExternalIPExtension added in v0.6.0

type GCEExternalIPExtension struct {
	// NetworkVariable is used to indicate the network variable in the schema
	// this external IP belongs to.
	NetworkVariable string `json:"networkVariable" yaml:"networkVariable"`

	// Type specifies if the external IP is ephemeral or static.
	// Defaults to ephemeral if not specified.
	Type ExternalIPType `json:"type,omitempty" yaml:"type,omitempty" jsonschema:"enum=IP_UNSPECIFIED,enum=IP_EPHEMERAL,enum=NONE"`

	// Flag to denote if an external IP should be configurable.
	NotConfigurable bool `json:"notConfigurable,omitempty" yaml:"notConfigurable,omitempty"`

	// Flag to denote if static IPs are allowed for the external IP.
	AllowStaticIPs bool `json:"allowStaticIPs,omitempty" yaml:"allowStaticIPs,omitempty"`
}

type GCEFirewallExtension added in v0.6.0

type GCEFirewallExtension struct {
	// NetworkVariable is used to indicate the network variable in the schema
	// this external IP belongs to.
	NetworkVariable string `json:"networkVariable" yaml:"networkVariable"`
}

type GCEFirewallRangeExtension added in v0.6.0

type GCEFirewallRangeExtension struct {
	// FirewallVariable is used to indicate the firewall variable with the type
	// GCEFirewall in the schema to which this firewall range belongs to.
	FirewallVariable string `json:"firewallVariable" yaml:"firewallVariable"`
}

type GCEGPUCountExtension added in v0.6.0

type GCEGPUCountExtension struct {
	// This field references another variable from the schema,
	// which must have type GCEMachineType.
	MachineTypeVariable string `json:"machineTypeVariable" yaml:"machineTypeVariable"`
}

type GCEGPUTypeExtension added in v0.6.0

type GCEGPUTypeExtension struct {
	MachineType string   `json:"machineType" yaml:"machineType"`
	GPUType     []string `json:"gpuType,omitempty" yaml:"gpuType,omitempty"`
}

type GCEGenericResourceExtension added in v0.6.0

type GCEGenericResourceExtension struct {
	// GCE resource type to be fetched. This field references another
	// property from the schema, which must have type GCEGenericResource.
	ResourceVariable string `json:"resourceVariable" yaml:"resourceVariable"`
}

type GCEIPForwardingExtension added in v0.6.0

type GCEIPForwardingExtension struct {
	// NetworkVariable is used to indicate the network variable in the schema
	// this external IP belongs to.
	NetworkVariable string `json:"networkVariable" yaml:"networkVariable"`
	NotConfigurable bool   `json:"notConfigurable,omitempty" yaml:"notConfigurable,omitempty"`
}

type GCELocationExtension added in v0.6.0

type GCELocationExtension struct {
	AllowlistedZones   []string `json:"allowlistedZones,omitempty" yaml:"allowlistedZones,omitempty"`
	AllowlistedRegions []string `json:"allowlistedRegions,omitempty" yaml:"allowlistedRegions,omitempty"`
}

type GCEMachineTypeExtension added in v0.6.0

type GCEMachineTypeExtension struct {
	// Minimum cpu. Used to filter the list of selectable machine types.
	MinCPU int `json:"minCpu,omitempty" yaml:"minCpu,omitempty"`

	// Minimum ram. Used to filter the list of selectable machine types.
	MinRAMGB float32 `json:"minRamGb,omitempty" yaml:"minRamGb,omitempty"`

	// If true, custom machine types will not be selectable.
	// More info:
	// https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type
	DisallowCustomMachineTypes bool `json:"disallowCustomMachineTypes,omitempty" yaml:"disallowCustomMachineTypes,omitempty"`
}

type GCENetworkExtension added in v0.6.0

type GCENetworkExtension struct {
	// AllowSharedVpcs indicates this solution can receive
	// shared VPC selflinks (fully qualified compute links).
	AllowSharedVPCs bool `json:"allowSharedVpcs,omitempty" yaml:"allowSharedVpcs,omitempty"`
	// Used to indicate to which machine type this network interface will be
	// attached to.
	MachineTypeVariable string `json:"machineTypeVariable" yaml:"machineTypeVariable"`
	// Label that will be in front of each Network Interface.
	Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"`
}

type GCESubnetworkExtension added in v0.6.0

type GCESubnetworkExtension struct {
	// Subnetwork variable requires a network context in order to determine the
	// set of available subnetworks. This field references another
	// variable from the schema, which must have type GCENetwork.
	NetworkVariable string `json:"networkVariable" yaml:"networkVariable"`
}

type GooglePropertyExtension added in v0.6.0

type GooglePropertyExtension struct {
	// Gen: manually-authored
	Type ExtensionType `` /* 472-byte string literal not displayed */

	// Some properties (e.g. GCE_MACHINE_TYPE) require a zone context in order to
	// determine the set of allowable values. This field references another
	// property from the schema, which must have type GCE_ZONE.
	// Gen: manually-authored
	ZoneProperty string `json:"zoneProperty,omitempty" yaml:"zoneProperty,omitempty"`

	// Property-specific extensions.
	// Gen: manually-authored (all property extensions and their child properties)
	GCEMachineType    GCEMachineTypeExtension     `json:"gceMachineType,omitempty" yaml:"gceMachineType,omitempty"`
	GCEDiskSize       GCEDiskSizeExtension        `json:"gceDiskSize,omitempty" yaml:"gceDiskSize,omitempty"`
	GCESubnetwork     GCESubnetworkExtension      `json:"gceSubnetwork,omitempty" yaml:"gceSubnetwork,omitempty"`
	GCEResource       GCEGenericResourceExtension `json:"gceResource,omitempty" yaml:"gceResource,omitempty"`
	GCEGPUType        GCEGPUTypeExtension         `json:"gceGpuType,omitempty" yaml:"gceGpuType,omitempty"`
	GCEGPUCount       GCEGPUCountExtension        `json:"gceGpuCount,omitempty" yaml:"gceGpuCount,omitempty"`
	GCENetwork        GCENetworkExtension         `json:"gceNetwork,omitempty" yaml:"gceNetwork,omitempty"`
	GCEExternalIP     GCEExternalIPExtension      `json:"gceExternalIp,omitempty" yaml:"gceExternalIp,omitempty"`
	GCEIPForwarding   GCEIPForwardingExtension    `json:"gceIpForwarding,omitempty" yaml:"gceIpForwarding,omitempty"`
	GCEFirewall       GCEFirewallExtension        `json:"gceFirewall,omitempty" yaml:"gceFirewall,omitempty"`
	GCEFirewallRange  GCEFirewallRangeExtension   `json:"gceFirewallRange,omitempty" yaml:"gceFirewallRange,omitempty"`
	GCEZone           GCELocationExtension        `json:"gceZone,omitempty" yaml:"gceZone,omitempty"`
	GCERegion         GCELocationExtension        `json:"gceRegion,omitempty" yaml:"gceRegion,omitempty"`
	IAMServiceAccount IAMServiceAccountExtension  `json:"iamServiceAccount,omitempty" yaml:"iamServiceAccount,omitempty"`
}

An extension for variables defined as part of DisplayVariable. The extension defines Google-specifc metadata necessary for choosing an appropriate input widget or adding restrictions to GCP-specific resources.

type IAMServiceAccountExtension added in v0.6.0

type IAMServiceAccountExtension struct {
	// List of IAM roles that to  grant to a new SA, or the roles to filter
	// existing SAs with.
	Roles []string `json:"roles" yaml:"roles"`
}

type QuotaResourceType added in v0.5.4

type QuotaResourceType string
const (
	QuotaResTypeUndefined   QuotaResourceType = "QRT_UNDEFINED"
	QuotaResTypeGCEInstance QuotaResourceType = "QRT_GCE_INSTANCE"
	QuotaResTypeGCEDisk     QuotaResourceType = "QRT_GCE_DISK"
)

type QuotaType added in v0.5.4

type QuotaType string
const (
	MachineType QuotaType = "MACHINE_TYPE"
	CPUs        QuotaType = "CPUs"
	DiskType    QuotaType = "DISK_TYPE"
	DiskSizeGB  QuotaType = "SIZE_GB"
)

type SoftwareGroupType added in v0.6.0

type SoftwareGroupType string
const (
	SG_Unspecified SoftwareGroupType = "SG_UNSPECIFIED"
	SG_OS          SoftwareGroupType = "SG_OS"
)

type UIActionItem added in v0.6.0

type UIActionItem struct {
	// Summary heading for the item.
	// Required. Accepts string expressions. At most 64 characters.
	// Gen: manually-authored
	Heading string `json:"heading" yaml:"heading"`

	// Longer description of the item.
	// At least one description or snippet is required.
	// Accepts string expressions. HTML <code>&lt;a href&gt;</code>
	// tags only. At most 512 characters.
	// Gen: manually-authored
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// Fixed-width formatted code snippet.
	// At least one description or snippet is required.
	// Accepts string expressions. UTF-8 text. At most 512 characters.
	// Gen: manually-authored
	Snippet string `json:"snippet,omitempty" yaml:"snippet,omitempty"`

	// If present, this expression determines whether the item is shown.
	// Should be in the form of a Boolean expression e.g. outputs().hasExternalIP
	// where `externalIP` is the output.
	// Gen: manually-authored
	ShowIf string `json:"showIf,omitempty" yaml:"showIf,omitempty"`
}

An item appearing in a list of required or suggested steps.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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