From 35ecf41e3a178c5869cdfefe798135d49fc4012f Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Sat, 12 Oct 2024 09:55:43 +0000 Subject: [PATCH 1/3] Improve docs for terraform mappings & remove scope This improves the docs and removes the scope mapping. The scope mapping was previously used in conjunction with the `overmind_mappings` Terraform output that allowed the mapping to select the correct scope. This has since been fixed with a much smarter matching system which means that this isn't needed. The docs were removed a while ago and we're now going to remove all of this functionality --- account.proto | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/account.proto b/account.proto index fdf76de..3e0ee4a 100644 --- a/account.proto +++ b/account.proto @@ -386,7 +386,7 @@ message AdapterMetadata { // The category that these items fall under AdapterCategory category = 2; // The list of other types that this can be linked to, eg eks-cluster -> - // eks-node-group + // eks-node-group repeated string potentialLinks = 3; // A descriptive name of the types of items that are returned by this // adapter e.g. "EKS Cluster" @@ -458,19 +458,46 @@ enum AdapterCategory { ADAPTER_CATEGORY_AI = 8; } +// The methods that this adapter supports, and the description of how to use +// them message AdapterSupportedQueryMethods{ - bool get = 1; // description of the Get method + // Whether or not the GET method is supported + bool get = 1; + // Description of the query that should be passed to the GET method string getDescription = 2; - bool list = 3; // description of the List method + + // Whether or not the LIST method is supported + bool list = 3; + // Description of how the LIST method works string listDescription = 4; - bool search = 5; // description of the Search method + + // Whether or not the SEARCH method is supported + bool search = 5; + // Description of the query that should be passed to the SEARCH method string searchDescription = 6; } +// When Overmind ingests Terraform changes, it needs to be able to map from a +// given Terrafrom resource, to that same resource in Overmind. This is achieved +// by using the TerraformMapping object. It translaes the details of a Terraform +// resource into a query that Overmind can run. +// +// NOTE: The queries that are generated by this mapping use the wildcard scope +// `*` and therefore could return multiple items. Overmind will compare the +// attributes of these items to determine the most likely candidate for a mch +// and select that. message TerraformMapping { - QueryMethod terraformMethod = 1; // eg get - string terraformQueryMap = 2; // eg ap aws_eks_node_group.arn - string terraformScope = 3; // eg ${provider_mapping.cluster_name}.${values.metadata[0].namespace} + // The method thae the query should use + QueryMethod terraformMethod = 1; + + // How to map data from the terraform resource to the "query" field in the + // resulting mapping query. This uses HCL syntax e.g. + // resource_type.attribute_name + // + // Usually this will be the attribute that uniquely identifies the resource + // such as `aws_instance.id` or `aws_iam_role.arn`. You can also index into + // arrays e.g. `kubernetes_replication_controller.metadata[0].name` + string terraformQueryMap = 2; } message SubmitSourceHeartbeatResponse {} From b14c8a81085ea9540e53d6a1ac761343f8ecb98b Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Sun, 13 Oct 2024 12:05:19 +0000 Subject: [PATCH 2/3] Fix my terrible spelling --- account.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/account.proto b/account.proto index 3e0ee4a..242c4c6 100644 --- a/account.proto +++ b/account.proto @@ -478,8 +478,8 @@ message AdapterSupportedQueryMethods{ } // When Overmind ingests Terraform changes, it needs to be able to map from a -// given Terrafrom resource, to that same resource in Overmind. This is achieved -// by using the TerraformMapping object. It translaes the details of a Terraform +// given Terraform resource, to that same resource in Overmind. This is achieved +// by using the TerraformMapping object. It translates the details of a Terraform // resource into a query that Overmind can run. // // NOTE: The queries that are generated by this mapping use the wildcard scope @@ -487,7 +487,7 @@ message AdapterSupportedQueryMethods{ // attributes of these items to determine the most likely candidate for a mch // and select that. message TerraformMapping { - // The method thae the query should use + // The method that the query should use QueryMethod terraformMethod = 1; // How to map data from the terraform resource to the "query" field in the From 80328abb8a4d8ffbb606a11c2defcbfbea01109b Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Mon, 14 Oct 2024 09:07:59 +0000 Subject: [PATCH 3/3] Reserve old field number --- account.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/account.proto b/account.proto index 242c4c6..6de3c52 100644 --- a/account.proto +++ b/account.proto @@ -498,6 +498,8 @@ message TerraformMapping { // such as `aws_instance.id` or `aws_iam_role.arn`. You can also index into // arrays e.g. `kubernetes_replication_controller.metadata[0].name` string terraformQueryMap = 2; + + reserved 3; } message SubmitSourceHeartbeatResponse {}