cli/bpmetadata/proto/bpmetadata.proto (437 lines of code) (raw):

syntax = "proto3"; package google.cloud.config.bpmetadata; import "google/protobuf/struct.proto"; import "bpmetadata_ui.proto"; // TODO: update copybara configuration for go to java package transformation option go_package = "github.com/GoogleCloudPlatform/cloud-foundation-toolkit/cli/bpmetadata"; // 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 nested messages that can include both auto-generated and manually authored) message BlueprintMetadata { // APIVersion is the apiVersion field of a metadata file // Gen: auto-generated string api_version = 1; // @gotags: json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" // Kind is the kind field of a metadata file // Gen: auto-generated string kind = 2; // @gotags: json:"kind,omitempty" yaml:"kind,omitempty" // ResourceTypeMeta is the metadata field of a metadata file // Gen: partial ResourceTypeMeta metadata = 3; // @gotags: json:"metadata,omitempty" yaml:"metadata,omitempty" // BlueprintMetadataSpec is the metadata specification for the blueprint // Gen: partial BlueprintMetadataSpec spec = 4; // @gotags: yaml:"spec" json:"spec" } message ResourceTypeMeta { // Name is the metadata.name field of a Resource // Gen: auto-generated string name = 1; // @gotags: json:"name,omitempty" yaml:"name,omitempty" // Labels is the metadata.labels field of a Resource // Gen: manually-authored map<string, string> labels = 2; // @gotags: json:"labels,omitempty" yaml:"labels,omitempty" // Annotations is the metadata.annotations field of a Resource. // Gen: auto-generated map<string, string> annotations = 3; // @gotags: json:"annotations,omitempty" yaml:"annotations,omitempty" } // BlueprintMetadataSpec defines the spec portion of the blueprint metadata. message BlueprintMetadataSpec { // BlueprintInfo defines the basic information of the blueprint. // Gen: partial BlueprintInfo info = 1; // @gotags: json:"info,omitempty" yaml:"info,omitempty" // BlueprintContent defines the detail for blueprint related content such as // related documentation, diagrams, examples etc. // Gen: partial BlueprintContent content = 2; // @gotags: json:"content,omitempty" yaml:"content,omitempty" // BlueprintInterface defines the input and output variables for the blueprint. // Gen: partial BlueprintInterface interfaces = 3; // @gotags: json:"interfaces,omitempty" yaml:"interfaces,omitempty" // BlueprintRequirements defines the roles required and the associated services // that need to be enabled to provision blueprint resources. // Gen: auto-generated BlueprintRequirements requirements = 4; // @gotags: json:"requirements,omitempty" yaml:"requirements,omitempty" // BlueprintUI defines the user interface for the blueprint. // Gen: partial BlueprintUI ui = 5; // @gotags: json:"ui,omitempty" yaml:"ui,omitempty" } // BlueprintInfo defines the basic information of the blueprint. message BlueprintInfo { // Title for the blueprint. // Gen: auto-generated - First H1 text in readme.md. string title = 1; // @gotags: 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. BlueprintRepoDetail source = 2; // @gotags: 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" // } string version = 3; // @gotags: json:"version,omitempty" yaml:"version,omitempty" // Actuation tool e.g. Terraform and its required version. // Gen: auto-generated BlueprintActuationTool actuation_tool = 4; // @gotags: json:"actuationTool,omitempty" yaml:"actuationTool,omitempty" // Various types of descriptions associated with the blueprint. // Gen: auto-generated BlueprintDescription description = 5; // @gotags: 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 string icon = 6; // @gotags: json:"icon,omitempty" yaml:"icon,omitempty" // The time estimate for configuring and deploying the blueprint. // Gen: auto-generated BlueprintTimeEstimate deployment_duration = 7; // @gotags: json:"deploymentDuration,omitempty" yaml:"deploymentDuration,omitempty" // The cost estimate for the blueprint based on preconfigured variables. // Gen: auto-generated BlueprintCostEstimate cost_estimate = 8; // @gotags: json:"costEstimate,omitempty" yaml:"costEstimate,omitempty" // A list of GCP cloud products used in the blueprint. // Gen: manually-authored repeated BlueprintCloudProduct cloud_products = 9; // @gotags: json:"cloudProducts,omitempty" yaml:"cloudProducts,omitempty" // A configuration of fixed and dynamic GCP quotas that apply to the blueprint. // Gen: manually-authored repeated BlueprintQuotaDetail quota_details = 10; // @gotags: json:"quotaDetails,omitempty" yaml:"quotaDetails,omitempty" // Details on the author producing the blueprint. // Gen: manually-authored BlueprintAuthor author = 11; // @gotags: json:"author,omitempty" yaml:"author,omitempty" // Details on software installed as part of the blueprint. // Gen: manually-authored repeated BlueprintSoftwareGroup software_groups = 12; // @gotags: json:"softwareGroups,omitempty" yaml:"softwareGroups,omitempty" // Support offered, if any for the blueprint. // Gen: manually-authored BlueprintSupport support_info = 13; // @gotags: json:"supportInfo,omitempty" yaml:"supportInfo,omitempty" // A list of GCP org policies to be checked for successful deployment. // Gen: manually-authored repeated BlueprintOrgPolicyCheck org_policy_checks = 14; // @gotags: json:"orgPolicyChecks,omitempty" yaml:"orgPolicyChecks,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 bool single_deployment = 15; // @gotags: json:"singleDeployment,omitempty" yaml:"singleDeployment,omitempty" } // BlueprintContent defines the detail for blueprint related content such as // related documentation, diagrams, examples etc. message BlueprintContent { // Gen: auto-generated BlueprintArchitecture architecture = 1; // @gotags: json:"architecture,omitempty" yaml:"architecture,omitempty" // Gen: manually-authored repeated BlueprintDiagram diagrams = 2; // @gotags: 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) repeated BlueprintListContent documentation = 3; // @gotags: json:"documentation,omitempty" yaml:"documentation,omitempty" // Gen: auto-generated - blueprints under the modules/ folder. repeated BlueprintMiscContent sub_blueprints = 4; // @gotags: json:"subBlueprints,omitempty" yaml:"subBlueprints,omitempty" // Gen: auto-generated - examples under the examples/ folder. repeated BlueprintMiscContent examples = 5; // @gotags: json:"examples,omitempty" yaml:"examples,omitempty" } // BlueprintInterface defines the input and output variables for the blueprint. message BlueprintInterface { // Gen: auto-generated - all defined variables for the blueprint repeated BlueprintVariable variables = 1; // @gotags: json:"variables,omitempty" yaml:"variables,omitempty" // Gen: manually-authored repeated BlueprintVariableGroup variable_groups = 2; // @gotags: json:"variableGroups,omitempty" yaml:"variableGroups,omitempty" // Gen: auto-generated - all defined outputs for the blueprint repeated BlueprintOutput outputs = 3; // @gotags: json:"outputs,omitempty" yaml:"outputs,omitempty" } // BlueprintRequirements defines the roles required and the associated services // that need to be enabled to provision blueprint resources. message BlueprintRequirements { // 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", // ] // } repeated BlueprintRoles roles = 1; // @gotags: 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. repeated string services = 2; // @gotags: json:"services,omitempty" yaml:"services,omitempty" // Required provider versions. // Gen: auto-generated from required providers block. repeated ProviderVersion provider_versions = 3; // @gotags: json:"providerVersions,omitempty" yaml:"providerVersions,omitempty" } // ProviderVersion defines the required version for a provider. message ProviderVersion { // Provider source of form [hostname]/namespace/name. // Hostname is optional defaulting to Terraform registry. // Gen: auto-generated from required providers block. string source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty" // Version constraint string. // Gen: auto-generated from required providers block. string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty" } // BlueprintUI is the top-level structure for holding UI specific metadata. message BlueprintUI { // The top-level input section that defines the list of variables and // their sections on the deployment page. // Gen: partial BlueprintUIInput input = 1; // @gotags: 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 BlueprintUIOutput runtime = 2; // @gotags: json:"runtime,omitempty" yaml:"runtime,omitempty" } message BlueprintRepoDetail { // Gen: auto-generated - URL from the .git dir. // Can be manually overridden with a custom URL if needed. string repo = 1; // @gotags: json:"repo" yaml:"repo" // Gen: auto-generated - set as "git" for now until more // types are supported. string source_type = 2; // @gotags: json:"sourceType" yaml:"sourceType" // Gen: auto-generated - not set for root modules but // set as the module name for submodules, if found. string dir = 3; // @gotags: json:"dir,omitempty" yaml:"dir,omitempty" } // BlueprintActuationTool defines the actuation tool used to provision the blueprint. message BlueprintActuationTool { // Gen: auto-generated - set as "Terraform" for now until //more flavors are supported. string flavor = 1; // @gotags: 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" // } string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty" } // All descriptions are set with the markdown content immediately // after each type's heading declaration in readme.md. message BlueprintDescription { // Gen: auto-generated - Markdown after "### Tagline". string tagline = 1; // @gotags: json:"tagline,omitempty" yaml:"tagline,omitempty" // Gen: auto-generated - Markdown after "### Detailed". string detailed = 2; // @gotags: json:"detailed,omitempty" yaml:"detailed,omitempty" // Gen: auto-generated - Markdown after "### PreDeploy". string pre_deploy = 3; // @gotags: json:"preDeploy,omitempty" yaml:"preDeploy,omitempty" // Gen: auto-generated - Markdown after "### Html". string html = 4; // @gotags: json:"html,omitempty" yaml:"html,omitempty" // Gen: auto-generated - Markdown after "### EulaUrls". repeated string eula_urls = 5; // @gotags: json:"eulaUrls,omitempty" yaml:"eulaUrls,omitempty" // Gen: auto-generated - Markdown after "### Architecture" // Deprecated. Use BlueprintContent.Architecture instead. repeated string architecture = 6; // @gotags: json:"architecture,omitempty" yaml:"architecture,omitempty" } // A time estimate in secs required for configuring and deploying the blueprint. message BlueprintTimeEstimate { // Gen: auto-generated - Set using the content defined under "### DeploymentTime" E.g. // ### DeploymentTime // - Configuration: X secs // - Deployment: Y secs int64 configuration_secs = 1; // @gotags: json:"configurationSecs,omitempty" yaml:"configurationSecs,omitempty" int64 deployment_secs = 2; // @gotags: json:"deploymentSecs,omitempty" yaml:"deploymentSecs,omitempty" } // The cost estimate for the blueprint based on pre-configured variables. message BlueprintCostEstimate { // 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) string description = 1; // @gotags: json:"description" yaml:"description" string url = 2; // @gotags: json:"url" yaml:"url" } // GCP cloud product(s) used in the blueprint. message BlueprintCloudProduct { // A top-level (e.g. "Compute Engine") or secondary (e.g. "Binary Authorization") // product used in the blueprint. // Gen: manually-authored string product_id = 1; // @gotags: json:"productId,omitempty" yaml:"productId,omitempty" // Url for the product. // Gen: manually-authored string page_url = 2; // @gotags: 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 string label = 3; // @gotags: 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 bool is_external = 4; // @gotags: json:"isExternal,omitempty" yaml:"isExternal,omitempty" } // BlueprintOrgPolicyCheck defines GCP org policies to be checked // for successful deployment message BlueprintOrgPolicyCheck { // Id for the policy e.g. "compute-vmExternalIpAccess" // Gen: manually-authored string policy_id = 1; // @gotags: 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 repeated string required_values = 2; // @gotags: json:"requiredValues,omitempty" yaml:"requiredValues,omitempty" } // QuotaResourceType defines the type of resource a quota is applied to. enum QuotaResourceType { QRT_UNDEFINED = 0; QRT_RESOURCE_TYPE_GCE_INSTANCE = 1; QRT_RESOURCE_TYPE_GCE_DISK = 2; } // BlueprintQuotaDetail defines the quota details for a blueprint. message BlueprintQuotaDetail { // 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 string dynamic_variable = 1; // @gotags: 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 QuotaResourceType resource_type = 2; // @gotags: json:"resourceType" yaml:"resourceType" // QuotaType is a key/value pair of the actual quotas and their corresponding // values. Valid keys for quota_type can be: // MACHINE_TYPE, // CPUs, // DISK_TYPE OR // SIZE_GB. // Gen: manually-authored map<string, string> quota_type = 3; // @gotags: json:"quotaType" yaml:"quotaType" } // BlueprintAuthor defines the author of a blueprint. message BlueprintAuthor { // Name of template author or organization. // Gen: manually-authored string title = 1; // @gotags: json:"title" yaml:"title" // Description of the author. // Gen: manually-authored string description = 2; // @gotags: json:"description,omitempty" yaml:"description,omitempty" // Link to the author's website. // Gen: manually-authored string url = 3; // @gotags: json:"url,omitempty" yaml:"url,omitempty" } // SoftwareGroupType is a string enum representing the different types of software groups. enum SoftwareGroupType { // UNSPECIFIED is the default value for SoftwareGroupType. SG_UNSPECIFIED = 0; // OS is a software group that represents an operating system. SG_OS = 1; } // A group of related software components for the blueprint. message BlueprintSoftwareGroup { // Pre-defined software types. // Gen: manually-authored SoftwareGroupType type = 1; // @gotags: json:"type,omitempty" yaml:"type,omitempty" // Software components belonging to this group. // Gen: manually-authored repeated BlueprintSoftware software = 2; // @gotags: json:"software,omitempty" yaml:"software,omitempty" } // A description of a piece of a single software component // installed by the blueprint. message BlueprintSoftware { // User-visible title. // Gen: manually-authored string title = 1; // @gotags: json:"title" yaml:"title" // Software version. // Gen: manually-authored string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty" // Link to development site or marketing page for this software. // Gen: manually-authored string url = 3; // @gotags: json:"url,omitempty" yaml:"url,omitempty" // Link to license page. // Gen: manually-authored string license_url = 4; // @gotags: json:"licenseUrl,omitempty" yaml:"licenseUrl,omitempty" } // A description of a support option message BlueprintSupport { // Description of the support option. // Gen: manually-authored string description = 1; // @gotags: json:"description" yaml:"description" // Link to the page providing this support option. // Gen: manually-authored string url = 2; // @gotags: json:"url,omitempty" yaml:"url,omitempty" // The organization or group that provides the support option (e.g.: // "Community", "Google"). // Gen: manually-authored string entity = 3; // @gotags: json:"entity,omitempty" yaml:"entity,omitempty" // Whether to show the customer's support ID. // Gen: manually-authored bool show_support_id = 4; // @gotags: json:"showSupportId,omitempty" yaml:"showSupportId,omitempty" } message BlueprintArchitecture { // 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 string diagram_url = 1; // @gotags: json:"diagramUrl" yaml:"diagramUrl" // Gen: auto-generated - the list items following the "## Architecture" tag. repeated string description = 2; // @gotags: json:"description" yaml:"description" } message BlueprintMiscContent { string name = 1; // @gotags: json:"name" yaml:"name" string location = 2; // @gotags: json:"location,omitempty" yaml:"location,omitempty" } message BlueprintDiagram { string name = 1; // @gotags: json:"name" yaml:"name" string alt_text = 2; // @gotags: json:"altText,omitempty" yaml:"altText,omitempty" string description = 3; // @gotags: json:"description,omitempty" yaml:"description,omitempty" } message BlueprintListContent { string title = 1; // @gotags: json:"title" yaml:"title" string url = 2; // @gotags: json:"url,omitempty" yaml:"url,omitempty" } message BlueprintVariable { string name = 1; // @gotags: json:"name,omitempty" yaml:"name,omitempty" string description = 2; // @gotags: json:"description,omitempty" yaml:"description,omitempty" string var_type = 3; // @gotags: json:"varType,omitempty" yaml:"varType,omitempty" google.protobuf.Value default_value = 4; // @gotags: json:"defaultValue,omitempty" yaml:"defaultValue,omitempty" bool required = 5; // @gotags: json:"required,omitempty" yaml:"required,omitempty" // Incoming connections to this variable. // Connections are outputs from other blueprints that can be potentially // connected to this variable. // Gen: manually-authored. repeated BlueprintConnection connections = 6; // @gotags: json:"connections,omitempty" yaml:"connections,omitempty" } // Defines an incoming connection from a blueprint. message BlueprintConnection { // Source of the connection. // Gen: manually-authored. ConnectionSource source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty" // Connection specifications. // Gen: manually-authored. ConnectionSpec spec = 2; // @gotags: json:"spec,omitempty" yaml:"spec,omitempty" } // Defines the source of a connection. message ConnectionSource { // Source of the connection. Defined using the same format as module source // of form [hostname]/namespace/name/provider for registry references and // unprefixed github.com URLs for github references. // Gen: manually-authored. string source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty" // Version constraint syntax using the same format as module version // constraints. // Gen: manually-authored. string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty" } // Defines the specifications of a connection. message ConnectionSpec { // Output expression identifying output being connected to variable. // This can be the output name or more complex expression like attribuite notation. // Gen: manually-authored. string output_expr = 1; // @gotags: json:"outputExpr,omitempty" yaml:"outputExpr,omitempty" // Optional dot separated attribuite notation to connect to a specific object field of the input variable. // Gen: manually-authored. optional string input_path = 2; // @gotags: json:"inputPath,omitempty" yaml:"inputPath,omitempty" } // BlueprintVariableGroup is manually entered. message BlueprintVariableGroup { string name = 1; // @gotags: json:"name" yaml:"name" string description = 2; // @gotags: json:"description,omitempty" yaml:"description,omitempty" repeated string variables = 3; // @gotags: json:"variables,omitempty" yaml:"variables,omitempty" } message BlueprintOutput { string name = 1; // @gotags: json:"name" yaml:"name" string description = 2; // @gotags: json:"description,omitempty" yaml:"description,omitempty" // Serialized type representation of the output value. // Gen: manually-authored but will be automated in the future. optional google.protobuf.Value type = 3; // @gotags: json:"type,omitempty" yaml:"type,omitempty" } message BlueprintRoles { string level = 1; // @gotags: json:"level" yaml:"level" repeated string roles = 2; // @gotags: json:"roles" yaml:"roles" }