From 86cba9129f984fffb314140b0cca986675a1745a Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Tue, 27 Aug 2024 14:19:04 +0100 Subject: [PATCH] Add DiscoveryConfigStatus AWS EC2 resource counters (proto) (#45553) * Add DiscoveryConfigStatus AWS EC2 resource counters (proto) This PR adds counters for AWS Instances found/enrolled/failed for a given DiscoveryConfig and Integration. * use a map to index on the integration name --- .../discoveryconfig/v1/discoveryconfig.pb.go | 249 ++++++++++++++++-- .../discoveryconfig/v1/discoveryconfig.proto | 23 ++ 2 files changed, 243 insertions(+), 29 deletions(-) diff --git a/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go b/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go index b2284615ea35..ce9a871e1e50 100644 --- a/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go +++ b/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go @@ -275,6 +275,8 @@ type DiscoveryConfigStatus struct { DiscoveredResources uint64 `protobuf:"varint,3,opt,name=discovered_resources,json=discoveredResources,proto3" json:"discovered_resources,omitempty"` // last_sync_time is the timestamp when the Discovery Config was last sync. LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"` + // IntegrationDiscoveredResources maps an integration to discovered resources summary. + IntegrationDiscoveredResources map[string]*IntegrationDiscoveredSummary `protobuf:"bytes,6,rep,name=integration_discovered_resources,json=integrationDiscoveredResources,proto3" json:"integration_discovered_resources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *DiscoveryConfigStatus) Reset() { @@ -337,6 +339,130 @@ func (x *DiscoveryConfigStatus) GetLastSyncTime() *timestamppb.Timestamp { return nil } +func (x *DiscoveryConfigStatus) GetIntegrationDiscoveredResources() map[string]*IntegrationDiscoveredSummary { + if x != nil { + return x.IntegrationDiscoveredResources + } + return nil +} + +// IntegrationDiscoveredSummary contains the a summary for each resource type that was discovered. +type IntegrationDiscoveredSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // AWSEC2 contains the summary for the AWS EC2 discovered instances. + AwsEc2 *ResourcesDiscoveredSummary `protobuf:"bytes,1,opt,name=aws_ec2,json=awsEc2,proto3" json:"aws_ec2,omitempty"` +} + +func (x *IntegrationDiscoveredSummary) Reset() { + *x = IntegrationDiscoveredSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntegrationDiscoveredSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntegrationDiscoveredSummary) ProtoMessage() {} + +func (x *IntegrationDiscoveredSummary) ProtoReflect() protoreflect.Message { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IntegrationDiscoveredSummary.ProtoReflect.Descriptor instead. +func (*IntegrationDiscoveredSummary) Descriptor() ([]byte, []int) { + return file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDescGZIP(), []int{3} +} + +func (x *IntegrationDiscoveredSummary) GetAwsEc2() *ResourcesDiscoveredSummary { + if x != nil { + return x.AwsEc2 + } + return nil +} + +// ResourcesDiscoveredSummary represents the AWS resources that were discovered. +type ResourcesDiscoveredSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Found holds the count of resources found. + // After a resource is found, it starts the sync process and ends in either an enrolled or a failed resource. + Found uint64 `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` + // Enrolled holds the count of the resources that were successfully enrolled. + Enrolled uint64 `protobuf:"varint,2,opt,name=enrolled,proto3" json:"enrolled,omitempty"` + // Failed holds the count of the resources that failed to enroll. + Failed uint64 `protobuf:"varint,3,opt,name=failed,proto3" json:"failed,omitempty"` +} + +func (x *ResourcesDiscoveredSummary) Reset() { + *x = ResourcesDiscoveredSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourcesDiscoveredSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourcesDiscoveredSummary) ProtoMessage() {} + +func (x *ResourcesDiscoveredSummary) ProtoReflect() protoreflect.Message { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourcesDiscoveredSummary.ProtoReflect.Descriptor instead. +func (*ResourcesDiscoveredSummary) Descriptor() ([]byte, []int) { + return file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDescGZIP(), []int{4} +} + +func (x *ResourcesDiscoveredSummary) GetFound() uint64 { + if x != nil { + return x.Found + } + return 0 +} + +func (x *ResourcesDiscoveredSummary) GetEnrolled() uint64 { + if x != nil { + return x.Enrolled + } + return 0 +} + +func (x *ResourcesDiscoveredSummary) GetFailed() uint64 { + if x != nil { + return x.Failed + } + return 0 +} + var File_teleport_discoveryconfig_v1_discoveryconfig_proto protoreflect.FileDescriptor var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ @@ -383,8 +509,8 @@ var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ 0x75, 0x62, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, - 0x63, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x22, 0x91, - 0x02, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, + 0x63, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x22, 0xe7, + 0x04, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, @@ -400,8 +526,43 @@ var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, - 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2a, 0xa8, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x12, 0xa0, 0x01, 0x0a, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x74, 0x65, + 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x1e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x1a, 0x8c, 0x01, 0x0a, 0x23, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4f, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, + 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x52, 0x1c, 0x61, 0x77, 0x73, 0x5f, + 0x65, 0x63, 0x32, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x22, 0x70, 0x0a, 0x1c, 0x49, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, + 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x50, 0x0a, 0x07, 0x61, 0x77, 0x73, 0x5f, + 0x65, 0x63, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x52, 0x06, 0x61, 0x77, 0x73, 0x45, 0x63, 0x32, 0x22, 0x66, 0x0a, 0x1a, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, + 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x2a, 0xa8, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, @@ -434,36 +595,42 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDescGZIP() []byte } var file_teleport_discoveryconfig_v1_discoveryconfig_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_teleport_discoveryconfig_v1_discoveryconfig_proto_goTypes = []interface{}{ - (DiscoveryConfigState)(0), // 0: teleport.discoveryconfig.v1.DiscoveryConfigState - (*DiscoveryConfig)(nil), // 1: teleport.discoveryconfig.v1.DiscoveryConfig - (*DiscoveryConfigSpec)(nil), // 2: teleport.discoveryconfig.v1.DiscoveryConfigSpec - (*DiscoveryConfigStatus)(nil), // 3: teleport.discoveryconfig.v1.DiscoveryConfigStatus - (*v1.ResourceHeader)(nil), // 4: teleport.header.v1.ResourceHeader - (*types.AWSMatcher)(nil), // 5: types.AWSMatcher - (*types.AzureMatcher)(nil), // 6: types.AzureMatcher - (*types.GCPMatcher)(nil), // 7: types.GCPMatcher - (*types.KubernetesMatcher)(nil), // 8: types.KubernetesMatcher - (*types.AccessGraphSync)(nil), // 9: types.AccessGraphSync - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (DiscoveryConfigState)(0), // 0: teleport.discoveryconfig.v1.DiscoveryConfigState + (*DiscoveryConfig)(nil), // 1: teleport.discoveryconfig.v1.DiscoveryConfig + (*DiscoveryConfigSpec)(nil), // 2: teleport.discoveryconfig.v1.DiscoveryConfigSpec + (*DiscoveryConfigStatus)(nil), // 3: teleport.discoveryconfig.v1.DiscoveryConfigStatus + (*IntegrationDiscoveredSummary)(nil), // 4: teleport.discoveryconfig.v1.IntegrationDiscoveredSummary + (*ResourcesDiscoveredSummary)(nil), // 5: teleport.discoveryconfig.v1.ResourcesDiscoveredSummary + nil, // 6: teleport.discoveryconfig.v1.DiscoveryConfigStatus.IntegrationDiscoveredResourcesEntry + (*v1.ResourceHeader)(nil), // 7: teleport.header.v1.ResourceHeader + (*types.AWSMatcher)(nil), // 8: types.AWSMatcher + (*types.AzureMatcher)(nil), // 9: types.AzureMatcher + (*types.GCPMatcher)(nil), // 10: types.GCPMatcher + (*types.KubernetesMatcher)(nil), // 11: types.KubernetesMatcher + (*types.AccessGraphSync)(nil), // 12: types.AccessGraphSync + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp } var file_teleport_discoveryconfig_v1_discoveryconfig_proto_depIdxs = []int32{ - 4, // 0: teleport.discoveryconfig.v1.DiscoveryConfig.header:type_name -> teleport.header.v1.ResourceHeader + 7, // 0: teleport.discoveryconfig.v1.DiscoveryConfig.header:type_name -> teleport.header.v1.ResourceHeader 2, // 1: teleport.discoveryconfig.v1.DiscoveryConfig.spec:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigSpec 3, // 2: teleport.discoveryconfig.v1.DiscoveryConfig.status:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigStatus - 5, // 3: teleport.discoveryconfig.v1.DiscoveryConfigSpec.aws:type_name -> types.AWSMatcher - 6, // 4: teleport.discoveryconfig.v1.DiscoveryConfigSpec.azure:type_name -> types.AzureMatcher - 7, // 5: teleport.discoveryconfig.v1.DiscoveryConfigSpec.gcp:type_name -> types.GCPMatcher - 8, // 6: teleport.discoveryconfig.v1.DiscoveryConfigSpec.kube:type_name -> types.KubernetesMatcher - 9, // 7: teleport.discoveryconfig.v1.DiscoveryConfigSpec.access_graph:type_name -> types.AccessGraphSync + 8, // 3: teleport.discoveryconfig.v1.DiscoveryConfigSpec.aws:type_name -> types.AWSMatcher + 9, // 4: teleport.discoveryconfig.v1.DiscoveryConfigSpec.azure:type_name -> types.AzureMatcher + 10, // 5: teleport.discoveryconfig.v1.DiscoveryConfigSpec.gcp:type_name -> types.GCPMatcher + 11, // 6: teleport.discoveryconfig.v1.DiscoveryConfigSpec.kube:type_name -> types.KubernetesMatcher + 12, // 7: teleport.discoveryconfig.v1.DiscoveryConfigSpec.access_graph:type_name -> types.AccessGraphSync 0, // 8: teleport.discoveryconfig.v1.DiscoveryConfigStatus.state:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigState - 10, // 9: teleport.discoveryconfig.v1.DiscoveryConfigStatus.last_sync_time:type_name -> google.protobuf.Timestamp - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 13, // 9: teleport.discoveryconfig.v1.DiscoveryConfigStatus.last_sync_time:type_name -> google.protobuf.Timestamp + 6, // 10: teleport.discoveryconfig.v1.DiscoveryConfigStatus.integration_discovered_resources:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigStatus.IntegrationDiscoveredResourcesEntry + 5, // 11: teleport.discoveryconfig.v1.IntegrationDiscoveredSummary.aws_ec2:type_name -> teleport.discoveryconfig.v1.ResourcesDiscoveredSummary + 4, // 12: teleport.discoveryconfig.v1.DiscoveryConfigStatus.IntegrationDiscoveredResourcesEntry.value:type_name -> teleport.discoveryconfig.v1.IntegrationDiscoveredSummary + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() } @@ -508,6 +675,30 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() { return nil } } + file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntegrationDiscoveredSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourcesDiscoveredSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} @@ -516,7 +707,7 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc, NumEnums: 1, - NumMessages: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto b/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto index e2942b070808..c327ea721c2c 100644 --- a/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto +++ b/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto @@ -66,6 +66,12 @@ message DiscoveryConfigStatus { uint64 discovered_resources = 3; // last_sync_time is the timestamp when the Discovery Config was last sync. google.protobuf.Timestamp last_sync_time = 4; + + reserved 5; + reserved "aws_ec2_instances_discovered"; + + // IntegrationDiscoveredResources maps an integration to discovered resources summary. + map integration_discovered_resources = 6; } // DiscoveryConfigState is the state of the discovery config resource. @@ -80,3 +86,20 @@ enum DiscoveryConfigState { // DISCOVERY_CONFIG_STATE_SYNCING is used when the discovery process has started but didn't finished yet. DISCOVERY_CONFIG_STATE_SYNCING = 3; } + +// IntegrationDiscoveredSummary contains the a summary for each resource type that was discovered. +message IntegrationDiscoveredSummary { + // AWSEC2 contains the summary for the AWS EC2 discovered instances. + ResourcesDiscoveredSummary aws_ec2 = 1; +} + +// ResourcesDiscoveredSummary represents the AWS resources that were discovered. +message ResourcesDiscoveredSummary { + // Found holds the count of resources found. + // After a resource is found, it starts the sync process and ends in either an enrolled or a failed resource. + uint64 found = 1; + // Enrolled holds the count of the resources that were successfully enrolled. + uint64 enrolled = 2; + // Failed holds the count of the resources that failed to enroll. + uint64 failed = 3; +}