bpmetadata

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 24, 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 metatda",
	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 {
	// Set as "Terraform" for now until more flavors are supported.
	Flavor string `json:"flavor,omitempty" yaml:"flavor,omitempty"`

	// Required version for the actuation tool.
	// Autogenerated: 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 {
	DiagramURL  string   `json:"diagramUrl" yaml:"diagramUrl"`
	Description []string `json:"description" yaml:"description"`
}

type BlueprintAuthor added in v0.6.0

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

	// Description of the author.
	Description string `json:"description,omitempty"  yaml:"description,omitempty"`

	// Link to the author's website.
	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.
	ProductId string `json:"productId,omitempty" yaml:"productId,omitempty"`

	// Url for the product.
	PageURL string `json:"pageUrl" yaml:"pageUrl"`

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

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

A GCP cloud product used in the blueprint. Manually authored.

type BlueprintContent

type BlueprintContent struct {
	// Diagrams are manually entered.
	Architecture  BlueprintArchitecture  `json:"architecture,omitempty" yaml:"architecture,omitempty"`
	Diagrams      []BlueprintDiagram     `json:"diagrams,omitempty" yaml:"diagrams,omitempty"`
	Documentation []BlueprintListContent `json:"documentation,omitempty" yaml:"documentation,omitempty"`
	SubBlueprints []BlueprintMiscContent `json:"subBlueprints,omitempty" yaml:"subBlueprints,omitempty"`
	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 {
	// Autogenerated: Set using the content defined under "### Cost" as a link
	// with a description E.g.
	// ### Cost
	// [View cost details](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 preconfigured variables.

type BlueprintDescription

type BlueprintDescription struct {

	// Autogenerated: Markdown after "### Tagline".
	Tagline string `json:"tagline,omitempty" yaml:"tagline,omitempty"`

	// Autogenerated: Markdown after "### Detailed".
	Detailed string `json:"detailed,omitempty" yaml:"detailed,omitempty"`

	// Autogenerated: Markdown after "### PreDeploy".
	PreDeploy string `json:"preDeploy,omitempty" yaml:"preDeploy,omitempty"`

	// Autogenerated: Markdown after "### Html".
	HTML string `json:"html,omitempty" yaml:"html,omitempty"`

	// Autogenerated: Markdown after "### EulaUrls".
	EulaURLs []string `json:"eulaUrls,omitempty" yaml:"eulaUrls,omitempty"`

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

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"`
}

BlueprintDiagram is manually entered.

type BlueprintInfo

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

	// Blueprint source location and source type.
	// Autogen details in BlueprintRepoDetail.
	Source *BlueprintRepoDetail `json:"source" yaml:"source"`

	// Last released semantic version for the packaged blueprint.
	// Autogenerated: 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.
	// Autogen details in BlueprintActuationTool.
	ActuationTool BlueprintActuationTool `json:"actuationTool,omitempty" yaml:"actuationTool,omitempty"`

	// Various types of descriptions associated with the blueprint.
	// Autogen details in BlueprintDescription.
	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. Otherwise, it
	// can be manually authored.
	Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`

	// The time estimate for configuring and deploying the blueprint.
	// Autogen details in BlueprintTimeEstimate.
	DeploymentDuration BlueprintTimeEstimate `json:"deploymentDuration,omitempty" yaml:"deploymentDuration,omitempty"`

	// The cost estimate for the blueprint based on preconfigured variables.
	// Autogen details in BlueprintCostEstimate.
	CostEstimate BlueprintCostEstimate `json:"costEstimate,omitempty" yaml:"costEstimate,omitempty"`

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

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

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

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

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

	// Support offered, if any for the blueprint.
	// 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.
	SingleDeployment bool `json:"singleDeployment,omitempty" yaml:"singleDeployment,omitempty"`
}

type BlueprintInterface

type BlueprintInterface struct {
	Variables []BlueprintVariable `json:"variables,omitempty" yaml:"variables,omitempty"`
	// VariableGroups are manually entered.
	VariableGroups []BlueprintVariableGroup `json:"variableGroups,omitempty" yaml:"variableGroups,omitempty"`
	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 {
	yaml.ResourceMeta `json:",inline" yaml:",inline"`
	Spec              BlueprintMetadataSpec `json:"spec" yaml:"spec"`
}

BlueprintMetadata defines the overall structure for blueprint metadata.

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 {
	Info         BlueprintInfo         `json:"info,omitempty" yaml:"info,omitempty"`
	Content      BlueprintContent      `json:"content,omitempty" yaml:"content,omitempty"`
	Interfaces   BlueprintInterface    `json:"interfaces,omitempty" yaml:"interfaces,omitempty"`
	Requirements BlueprintRequirements `json:"requirements,omitempty" yaml:"requirements,omitempty"`
	UI           BlueprintUI           `json:"ui,omitempty" yaml:"ui,omitempty"`
}

BlueprintMetadataSpec defines the spec portion of the blueprint metadata. All immediate types within BlueprintMetadataSpec are inline and will not appear as nodes in 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"
	PolicyId string `json:"policyId" yaml:"policyId"`

	// If not set, it is assumed any version of this org policy
	// prevents successful deployment of this solution.
	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.
	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.
	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.
	QuotaType map[QuotaType]string `json:"quotaType" yaml:"quotaType"`
}

type BlueprintRepoDetail

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

	// Set as "git" for now until more types are supported.
	SourceType string `json:"sourceType" yaml:"sourceType"`

	// optional directory location for a submodule
	Dir string `json:"dir,omitempty" yaml:"dir,omitempty"`
}

type BlueprintRequirements

type BlueprintRequirements struct {
	Roles    []BlueprintRoles `json:"roles,omitempty" yaml:"roles,omitempty"`
	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.
	Title string `json:"title" yaml:"title"`

	// Software version.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`

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

	// Link to license page.
	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.
	Type SoftwareGroupType `json:"type,omitempty" yaml:"type,omitempty" jsonschema:"enum=SG_UNSPECIFIED,enum=SG_OS"`

	// Software components belonging to this group.
	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.
	Description string `json:"description" yaml:"description"`

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

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

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

A description of a support option

type BlueprintTimeEstimate added in v0.5.4

type BlueprintTimeEstimate struct {
	// Autogenerated: 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.
	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.
	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.
	Variables map[string]*DisplayVariable `json:"variables,omitempty" yaml:"variables,omitempty"`

	// Sections is a generic structure for grouping inputs together.
	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.
	OutputMessage string `json:"outputMessage,omitempty" yaml:"outputMessage,omitempty"`

	// List of suggested actions to take.
	SuggestedActions []UIActionItem `json:"suggestedActions,omitempty" yaml:"suggestedActions,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"`
}

BlueprintVariableGroup is manually entered.

type DisplaySection added in v0.6.0

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

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

	// Section tooltip.
	Tooltip string `json:"tooltip,omitempty" yaml:"tooltip,omitempty"`

	// Section subtext.
	Subtext string `json:"subtext,omitempty" yaml:"subtext,omitempty"`

	// The name of the parent section (if parent is not the root section).
	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.
	Name string `json:"name" yaml:"name"`

	// Visible title for the variable on the UI. If not present,
	// Name will be used for the Title.
	Title string `json:"title" yaml:"title"`

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

	// Variable tooltip.
	Tooltip string `json:"tooltip,omitempty" yaml:"tooltip,omitempty"`

	// Placeholder text (when there is no default).
	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.
	Validation string `json:"validation,omitempty" yaml:"validation,omitempty"`

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

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

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

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

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

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

	// Max value for numeric types.
	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.
	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
	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 {
	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.
	ZoneProperty string `json:"zoneProperty,omitempty" yaml:"zoneProperty,omitempty"`

	// Property-specific extensions.
	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.
	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.
	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.
	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.
	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