diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go index fd46f5f75b..16f5317ea3 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go @@ -67,7 +67,65 @@ func (x ProvisionResponse_ProvisionResponseStatus) Number() protoreflect.EnumNum // Deprecated: Use ProvisionResponse_ProvisionResponseStatus.Descriptor instead. func (ProvisionResponse_ProvisionResponseStatus) EnumDescriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{1, 0} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{2, 0} +} + +// ResourceContext is the context used to create a new resource +// This includes the direct dependencies of the new resource, that can impact +// the resource creation. +type ResourceContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Dependencies []*Resource `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *ResourceContext) Reset() { + *x = ResourceContext{} + if protoimpl.UnsafeEnabled { + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceContext) ProtoMessage() {} + +func (x *ResourceContext) ProtoReflect() protoreflect.Message { + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[0] + 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 ResourceContext.ProtoReflect.Descriptor instead. +func (*ResourceContext) Descriptor() ([]byte, []int) { + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceContext) GetResource() *Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceContext) GetDependencies() []*Resource { + if x != nil { + return x.Dependencies + } + return nil } type ProvisionRequest struct { @@ -81,13 +139,13 @@ type ProvisionRequest struct { ExistingResources []*Resource `protobuf:"bytes,3,rep,name=existing_resources,json=existingResources,proto3" json:"existing_resources,omitempty"` // The resource FTL would like to exist after this provisioning run. // This includes all new, existing, and changes resources in this change. - DesiredResources []*Resource `protobuf:"bytes,4,rep,name=desired_resources,json=desiredResources,proto3" json:"desired_resources,omitempty"` + DesiredResources []*ResourceContext `protobuf:"bytes,4,rep,name=desired_resources,json=desiredResources,proto3" json:"desired_resources,omitempty"` } func (x *ProvisionRequest) Reset() { *x = ProvisionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[0] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -100,7 +158,7 @@ func (x *ProvisionRequest) String() string { func (*ProvisionRequest) ProtoMessage() {} func (x *ProvisionRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[0] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -113,7 +171,7 @@ func (x *ProvisionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ProvisionRequest.ProtoReflect.Descriptor instead. func (*ProvisionRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{0} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{1} } func (x *ProvisionRequest) GetFtlClusterId() string { @@ -137,7 +195,7 @@ func (x *ProvisionRequest) GetExistingResources() []*Resource { return nil } -func (x *ProvisionRequest) GetDesiredResources() []*Resource { +func (x *ProvisionRequest) GetDesiredResources() []*ResourceContext { if x != nil { return x.DesiredResources } @@ -156,7 +214,7 @@ type ProvisionResponse struct { func (x *ProvisionResponse) Reset() { *x = ProvisionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[1] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -169,7 +227,7 @@ func (x *ProvisionResponse) String() string { func (*ProvisionResponse) ProtoMessage() {} func (x *ProvisionResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[1] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -182,7 +240,7 @@ func (x *ProvisionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ProvisionResponse.ProtoReflect.Descriptor instead. func (*ProvisionResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{1} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{2} } func (x *ProvisionResponse) GetProvisioningToken() string { @@ -205,12 +263,16 @@ type StatusRequest struct { unknownFields protoimpl.UnknownFields ProvisioningToken string `protobuf:"bytes,1,opt,name=provisioning_token,json=provisioningToken,proto3" json:"provisioning_token,omitempty"` + // The set of desired_resources used to initiate this provisioning request + // We need this as input here, so we can populate any resource fields in them + // when the provisioning finishes + DesiredResources []*Resource `protobuf:"bytes,2,rep,name=desired_resources,json=desiredResources,proto3" json:"desired_resources,omitempty"` } func (x *StatusRequest) Reset() { *x = StatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[2] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -223,7 +285,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[2] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -236,7 +298,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{2} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{3} } func (x *StatusRequest) GetProvisioningToken() string { @@ -246,6 +308,13 @@ func (x *StatusRequest) GetProvisioningToken() string { return "" } +func (x *StatusRequest) GetDesiredResources() []*Resource { + if x != nil { + return x.DesiredResources + } + return nil +} + type StatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -262,7 +331,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -275,7 +344,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -288,7 +357,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{3} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{4} } func (m *StatusResponse) GetStatus() isStatusResponse_Status { @@ -352,7 +421,7 @@ type PlanRequest struct { func (x *PlanRequest) Reset() { *x = PlanRequest{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -365,7 +434,7 @@ func (x *PlanRequest) String() string { func (*PlanRequest) ProtoMessage() {} func (x *PlanRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -378,7 +447,7 @@ func (x *PlanRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PlanRequest.ProtoReflect.Descriptor instead. func (*PlanRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{4} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{5} } func (x *PlanRequest) GetProvisioning() *ProvisionRequest { @@ -400,7 +469,7 @@ type PlanResponse struct { func (x *PlanResponse) Reset() { *x = PlanResponse{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[5] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -413,7 +482,7 @@ func (x *PlanResponse) String() string { func (*PlanResponse) ProtoMessage() {} func (x *PlanResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[5] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -426,7 +495,7 @@ func (x *PlanResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PlanResponse.ProtoReflect.Descriptor instead. func (*PlanResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{5} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{6} } func (x *PlanResponse) GetPlan() string { @@ -445,7 +514,7 @@ type StatusResponse_ProvisioningRunning struct { func (x *StatusResponse_ProvisioningRunning) Reset() { *x = StatusResponse_ProvisioningRunning{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[6] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -458,7 +527,7 @@ func (x *StatusResponse_ProvisioningRunning) String() string { func (*StatusResponse_ProvisioningRunning) ProtoMessage() {} func (x *StatusResponse_ProvisioningRunning) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[6] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -471,7 +540,7 @@ func (x *StatusResponse_ProvisioningRunning) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningRunning.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningRunning) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{3, 0} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{4, 0} } type StatusResponse_ProvisioningFailed struct { @@ -485,7 +554,7 @@ type StatusResponse_ProvisioningFailed struct { func (x *StatusResponse_ProvisioningFailed) Reset() { *x = StatusResponse_ProvisioningFailed{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[7] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -498,7 +567,7 @@ func (x *StatusResponse_ProvisioningFailed) String() string { func (*StatusResponse_ProvisioningFailed) ProtoMessage() {} func (x *StatusResponse_ProvisioningFailed) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[7] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -511,7 +580,7 @@ func (x *StatusResponse_ProvisioningFailed) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningFailed.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningFailed) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{3, 1} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{4, 1} } func (x *StatusResponse_ProvisioningFailed) GetErrorMessage() string { @@ -526,13 +595,15 @@ type StatusResponse_ProvisioningSuccess struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Properties []*ResourceProperty `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty"` + // Some fields in the resources might have been populated + // during the provisioning. The new state is returned here + UpdatedResources []*Resource `protobuf:"bytes,1,rep,name=updated_resources,json=updatedResources,proto3" json:"updated_resources,omitempty"` } func (x *StatusResponse_ProvisioningSuccess) Reset() { *x = StatusResponse_ProvisioningSuccess{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[8] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -545,7 +616,7 @@ func (x *StatusResponse_ProvisioningSuccess) String() string { func (*StatusResponse_ProvisioningSuccess) ProtoMessage() {} func (x *StatusResponse_ProvisioningSuccess) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[8] + mi := &file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -558,12 +629,12 @@ func (x *StatusResponse_ProvisioningSuccess) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningSuccess.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningSuccess) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{3, 2} + return file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP(), []int{4, 2} } -func (x *StatusResponse_ProvisioningSuccess) GetProperties() []*ResourceProperty { +func (x *StatusResponse_ProvisioningSuccess) GetUpdatedResources() []*Resource { if x != nil { - return x.Properties + return x.UpdatedResources } return nil } @@ -581,42 +652,59 @@ var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDesc = []byte{ 0x30, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x86, 0x02, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x74, 0x6c, 0x5f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x66, 0x74, 0x6c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x58, 0x0a, 0x11, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x79, - 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xef, 0x01, 0x0a, 0x11, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x64, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x4c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x45, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, - 0x09, 0x53, 0x55, 0x42, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, - 0x4e, 0x4f, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x53, 0x10, 0x02, 0x22, 0x3e, 0x0a, 0x0d, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, - 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xfe, 0x03, 0x0a, + 0x6f, 0x22, 0xab, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4f, + 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, + 0x8d, 0x02, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x74, 0x6c, 0x5f, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x74, + 0x6c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x5f, + 0x0a, 0x11, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x10, 0x64, + 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, + 0xef, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x64, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x4c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x45, 0x0a, 0x17, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x42, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x53, 0x10, + 0x02, 0x22, 0x98, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x58, 0x0a, 0x11, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x64, 0x65, 0x73, 0x69, + 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x83, 0x04, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, @@ -641,57 +729,57 @@ var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDesc = []byte{ 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6a, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x53, - 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6f, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x58, + 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x66, 0x0a, 0x0b, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x57, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, + 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0c, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x22, 0x0a, 0x0c, 0x50, 0x6c, + 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6c, + 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x32, 0xb1, + 0x03, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x50, + 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, + 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x76, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x04, 0x50, 0x6c, + 0x61, 0x6e, 0x12, 0x2e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x69, 0x65, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x66, 0x0a, - 0x0b, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x22, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x32, 0xb1, 0x03, 0x0a, 0x18, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1d, - 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, - 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x2e, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, - 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5b, 0x50, - 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, - 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x5b, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, 0x35, 0x2f, 0x66, + 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -707,45 +795,48 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDescGZIP() []byte { } var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_goTypes = []any{ (ProvisionResponse_ProvisionResponseStatus)(0), // 0: xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.ProvisionResponseStatus - (*ProvisionRequest)(nil), // 1: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest - (*ProvisionResponse)(nil), // 2: xyz.block.ftl.v1beta1.provisioner.ProvisionResponse - (*StatusRequest)(nil), // 3: xyz.block.ftl.v1beta1.provisioner.StatusRequest - (*StatusResponse)(nil), // 4: xyz.block.ftl.v1beta1.provisioner.StatusResponse - (*PlanRequest)(nil), // 5: xyz.block.ftl.v1beta1.provisioner.PlanRequest - (*PlanResponse)(nil), // 6: xyz.block.ftl.v1beta1.provisioner.PlanResponse - (*StatusResponse_ProvisioningRunning)(nil), // 7: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningRunning - (*StatusResponse_ProvisioningFailed)(nil), // 8: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningFailed - (*StatusResponse_ProvisioningSuccess)(nil), // 9: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess - (*Resource)(nil), // 10: xyz.block.ftl.v1beta1.provisioner.Resource - (*ResourceProperty)(nil), // 11: xyz.block.ftl.v1beta1.provisioner.ResourceProperty + (*ResourceContext)(nil), // 1: xyz.block.ftl.v1beta1.provisioner.ResourceContext + (*ProvisionRequest)(nil), // 2: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest + (*ProvisionResponse)(nil), // 3: xyz.block.ftl.v1beta1.provisioner.ProvisionResponse + (*StatusRequest)(nil), // 4: xyz.block.ftl.v1beta1.provisioner.StatusRequest + (*StatusResponse)(nil), // 5: xyz.block.ftl.v1beta1.provisioner.StatusResponse + (*PlanRequest)(nil), // 6: xyz.block.ftl.v1beta1.provisioner.PlanRequest + (*PlanResponse)(nil), // 7: xyz.block.ftl.v1beta1.provisioner.PlanResponse + (*StatusResponse_ProvisioningRunning)(nil), // 8: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningRunning + (*StatusResponse_ProvisioningFailed)(nil), // 9: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningFailed + (*StatusResponse_ProvisioningSuccess)(nil), // 10: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess + (*Resource)(nil), // 11: xyz.block.ftl.v1beta1.provisioner.Resource (*v1.PingRequest)(nil), // 12: xyz.block.ftl.v1.PingRequest (*v1.PingResponse)(nil), // 13: xyz.block.ftl.v1.PingResponse } var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_depIdxs = []int32{ - 10, // 0: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest.existing_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource - 10, // 1: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest.desired_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource - 0, // 2: xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.status:type_name -> xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.ProvisionResponseStatus - 7, // 3: xyz.block.ftl.v1beta1.provisioner.StatusResponse.running:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningRunning - 8, // 4: xyz.block.ftl.v1beta1.provisioner.StatusResponse.failed:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningFailed - 9, // 5: xyz.block.ftl.v1beta1.provisioner.StatusResponse.success:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess - 1, // 6: xyz.block.ftl.v1beta1.provisioner.PlanRequest.provisioning:type_name -> xyz.block.ftl.v1beta1.provisioner.ProvisionRequest - 11, // 7: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess.properties:type_name -> xyz.block.ftl.v1beta1.provisioner.ResourceProperty - 12, // 8: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Ping:input_type -> xyz.block.ftl.v1.PingRequest - 1, // 9: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Provision:input_type -> xyz.block.ftl.v1beta1.provisioner.ProvisionRequest - 5, // 10: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Plan:input_type -> xyz.block.ftl.v1beta1.provisioner.PlanRequest - 3, // 11: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Status:input_type -> xyz.block.ftl.v1beta1.provisioner.StatusRequest - 13, // 12: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Ping:output_type -> xyz.block.ftl.v1.PingResponse - 2, // 13: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Provision:output_type -> xyz.block.ftl.v1beta1.provisioner.ProvisionResponse - 6, // 14: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Plan:output_type -> xyz.block.ftl.v1beta1.provisioner.PlanResponse - 4, // 15: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Status:output_type -> xyz.block.ftl.v1beta1.provisioner.StatusResponse - 12, // [12:16] is the sub-list for method output_type - 8, // [8:12] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 11, // 0: xyz.block.ftl.v1beta1.provisioner.ResourceContext.resource:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource + 11, // 1: xyz.block.ftl.v1beta1.provisioner.ResourceContext.dependencies:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource + 11, // 2: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest.existing_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource + 1, // 3: xyz.block.ftl.v1beta1.provisioner.ProvisionRequest.desired_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.ResourceContext + 0, // 4: xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.status:type_name -> xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.ProvisionResponseStatus + 11, // 5: xyz.block.ftl.v1beta1.provisioner.StatusRequest.desired_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource + 8, // 6: xyz.block.ftl.v1beta1.provisioner.StatusResponse.running:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningRunning + 9, // 7: xyz.block.ftl.v1beta1.provisioner.StatusResponse.failed:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningFailed + 10, // 8: xyz.block.ftl.v1beta1.provisioner.StatusResponse.success:type_name -> xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess + 2, // 9: xyz.block.ftl.v1beta1.provisioner.PlanRequest.provisioning:type_name -> xyz.block.ftl.v1beta1.provisioner.ProvisionRequest + 11, // 10: xyz.block.ftl.v1beta1.provisioner.StatusResponse.ProvisioningSuccess.updated_resources:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource + 12, // 11: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Ping:input_type -> xyz.block.ftl.v1.PingRequest + 2, // 12: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Provision:input_type -> xyz.block.ftl.v1beta1.provisioner.ProvisionRequest + 6, // 13: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Plan:input_type -> xyz.block.ftl.v1beta1.provisioner.PlanRequest + 4, // 14: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Status:input_type -> xyz.block.ftl.v1beta1.provisioner.StatusRequest + 13, // 15: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Ping:output_type -> xyz.block.ftl.v1.PingResponse + 3, // 16: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Provision:output_type -> xyz.block.ftl.v1beta1.provisioner.ProvisionResponse + 7, // 17: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Plan:output_type -> xyz.block.ftl.v1beta1.provisioner.PlanResponse + 5, // 18: xyz.block.ftl.v1beta1.provisioner.ProvisionerPluginService.Status:output_type -> xyz.block.ftl.v1beta1.provisioner.StatusResponse + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() } @@ -756,7 +847,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() if !protoimpl.UnsafeEnabled { file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ProvisionRequest); i { + switch v := v.(*ResourceContext); i { case 0: return &v.state case 1: @@ -768,7 +859,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ProvisionResponse); i { + switch v := v.(*ProvisionRequest); i { case 0: return &v.state case 1: @@ -780,7 +871,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*StatusRequest); i { + switch v := v.(*ProvisionResponse); i { case 0: return &v.state case 1: @@ -792,7 +883,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*StatusResponse); i { + switch v := v.(*StatusRequest); i { case 0: return &v.state case 1: @@ -804,7 +895,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*PlanRequest); i { + switch v := v.(*StatusResponse); i { case 0: return &v.state case 1: @@ -816,7 +907,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*PlanResponse); i { + switch v := v.(*PlanRequest); i { case 0: return &v.state case 1: @@ -828,7 +919,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*StatusResponse_ProvisioningRunning); i { + switch v := v.(*PlanResponse); i { case 0: return &v.state case 1: @@ -840,7 +931,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*StatusResponse_ProvisioningFailed); i { + switch v := v.(*StatusResponse_ProvisioningRunning); i { case 0: return &v.state case 1: @@ -852,6 +943,18 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*StatusResponse_ProvisioningFailed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*StatusResponse_ProvisioningSuccess); i { case 0: return &v.state @@ -864,7 +967,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { } } } - file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[3].OneofWrappers = []any{ + file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_msgTypes[4].OneofWrappers = []any{ (*StatusResponse_Running)(nil), (*StatusResponse_Failed)(nil), (*StatusResponse_Success)(nil), @@ -875,7 +978,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDesc, NumEnums: 1, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto index b7cd274b60..5776de495d 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto @@ -8,6 +8,14 @@ import "xyz/block/ftl/v1beta1/provisioner/resource.proto"; option go_package = "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1beta1/provisioner;provisioner"; option java_multiple_files = true; +// ResourceContext is the context used to create a new resource +// This includes the direct dependencies of the new resource, that can impact +// the resource creation. +message ResourceContext { + Resource resource = 1; + repeated Resource dependencies = 2; +} + message ProvisionRequest { string ftl_cluster_id = 1; string module = 2; @@ -17,7 +25,7 @@ message ProvisionRequest { // The resource FTL would like to exist after this provisioning run. // This includes all new, existing, and changes resources in this change. - repeated Resource desired_resources = 4; + repeated ResourceContext desired_resources = 4; } message ProvisionResponse { @@ -33,6 +41,11 @@ message ProvisionResponse { message StatusRequest { string provisioning_token = 1; + + // The set of desired_resources used to initiate this provisioning request + // We need this as input here, so we can populate any resource fields in them + // when the provisioning finishes + repeated Resource desired_resources = 2; } message StatusResponse { @@ -43,7 +56,9 @@ message StatusResponse { } message ProvisioningSuccess { - repeated ResourceProperty properties = 3; + // Some fields in the resources might have been populated + // during the provisioning. The new state is returned here + repeated Resource updated_resources = 1; } oneof status { diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.pb.go b/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.pb.go index 59e73e69ce..6a53552d0b 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.pb.go +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.pb.go @@ -20,74 +20,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ResourceProperty is an implementation specific property of the resource populated at creation time -type ResourceProperty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ResourceProperty) Reset() { - *x = ResourceProperty{} - if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceProperty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceProperty) ProtoMessage() {} - -func (x *ResourceProperty) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0] - 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 ResourceProperty.ProtoReflect.Descriptor instead. -func (*ResourceProperty) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *ResourceProperty) GetResourceId() string { - if x != nil { - return x.ResourceId - } - return "" -} - -func (x *ResourceProperty) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ResourceProperty) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - // Resource is an abstract resource extracted from FTL Schema. -// -// we use convention of prefixing field names with out_ if they are populated -// by the provisioning engine type Resource struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -95,14 +28,8 @@ type Resource struct { // id unique within the module ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - // Additional implementation specific properties populated - // when the resource was created - OutProperties []*ResourceProperty `protobuf:"bytes,2,rep,name=out_properties,json=outProperties,proto3" json:"out_properties,omitempty"` - // direct downstream dependencies this Resource depends on - Dependencies []*Resource `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"` // Types that are assignable to Resource: // - // *Resource_Ftl // *Resource_Postgres // *Resource_Mysql Resource isResource_Resource `protobuf_oneof:"resource"` @@ -111,7 +38,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -124,7 +51,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -137,7 +64,7 @@ func (x *Resource) ProtoReflect() protoreflect.Message { // Deprecated: Use Resource.ProtoReflect.Descriptor instead. func (*Resource) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{1} + return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{0} } func (x *Resource) GetResourceId() string { @@ -147,20 +74,6 @@ func (x *Resource) GetResourceId() string { return "" } -func (x *Resource) GetOutProperties() []*ResourceProperty { - if x != nil { - return x.OutProperties - } - return nil -} - -func (x *Resource) GetDependencies() []*Resource { - if x != nil { - return x.Dependencies - } - return nil -} - func (m *Resource) GetResource() isResource_Resource { if m != nil { return m.Resource @@ -168,13 +81,6 @@ func (m *Resource) GetResource() isResource_Resource { return nil } -func (x *Resource) GetFtl() *FtlClusterResource { - if x, ok := x.GetResource().(*Resource_Ftl); ok { - return x.Ftl - } - return nil -} - func (x *Resource) GetPostgres() *PostgresResource { if x, ok := x.GetResource().(*Resource_Postgres); ok { return x.Postgres @@ -193,10 +99,6 @@ type isResource_Resource interface { isResource_Resource() } -type Resource_Ftl struct { - Ftl *FtlClusterResource `protobuf:"bytes,101,opt,name=ftl,proto3,oneof"` -} - type Resource_Postgres struct { Postgres *PostgresResource `protobuf:"bytes,102,opt,name=postgres,proto3,oneof"` } @@ -205,60 +107,24 @@ type Resource_Mysql struct { Mysql *MysqlResource `protobuf:"bytes,103,opt,name=mysql,proto3,oneof"` } -func (*Resource_Ftl) isResource_Resource() {} - func (*Resource_Postgres) isResource_Resource() {} func (*Resource_Mysql) isResource_Resource() {} -type FtlClusterResource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FtlClusterResource) Reset() { - *x = FtlClusterResource{} - if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FtlClusterResource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FtlClusterResource) ProtoMessage() {} - -func (x *FtlClusterResource) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2] - 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 FtlClusterResource.ProtoReflect.Descriptor instead. -func (*FtlClusterResource) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{2} -} - type PostgresResource struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // fields populated after the resource has been created + OutReadEndpoint string `protobuf:"bytes,101,opt,name=out_read_endpoint,json=outReadEndpoint,proto3" json:"out_read_endpoint,omitempty"` + OutWriteEndpoint string `protobuf:"bytes,102,opt,name=out_write_endpoint,json=outWriteEndpoint,proto3" json:"out_write_endpoint,omitempty"` } func (x *PostgresResource) Reset() { *x = PostgresResource{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[3] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -271,7 +137,7 @@ func (x *PostgresResource) String() string { func (*PostgresResource) ProtoMessage() {} func (x *PostgresResource) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[3] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -284,19 +150,37 @@ func (x *PostgresResource) ProtoReflect() protoreflect.Message { // Deprecated: Use PostgresResource.ProtoReflect.Descriptor instead. func (*PostgresResource) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{3} + return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{1} +} + +func (x *PostgresResource) GetOutReadEndpoint() string { + if x != nil { + return x.OutReadEndpoint + } + return "" +} + +func (x *PostgresResource) GetOutWriteEndpoint() string { + if x != nil { + return x.OutWriteEndpoint + } + return "" } type MysqlResource struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // fields populated after the resource has been created + OutReadEndpoint string `protobuf:"bytes,101,opt,name=out_read_endpoint,json=outReadEndpoint,proto3" json:"out_read_endpoint,omitempty"` + OutWriteEndpoint string `protobuf:"bytes,102,opt,name=out_write_endpoint,json=outWriteEndpoint,proto3" json:"out_write_endpoint,omitempty"` } func (x *MysqlResource) Reset() { *x = MysqlResource{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[4] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -309,7 +193,7 @@ func (x *MysqlResource) String() string { func (*MysqlResource) ProtoMessage() {} func (x *MysqlResource) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[4] + mi := &file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -322,7 +206,21 @@ func (x *MysqlResource) ProtoReflect() protoreflect.Message { // Deprecated: Use MysqlResource.ProtoReflect.Descriptor instead. func (*MysqlResource) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{4} + return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP(), []int{2} +} + +func (x *MysqlResource) GetOutReadEndpoint() string { + if x != nil { + return x.OutReadEndpoint + } + return "" +} + +func (x *MysqlResource) GetOutWriteEndpoint() string { + if x != nil { + return x.OutWriteEndpoint + } + return "" } var File_xyz_block_ftl_v1beta1_provisioner_resource_proto protoreflect.FileDescriptor @@ -333,52 +231,40 @@ var file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDesc = []byte{ 0x6e, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xcc, 0x03, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, - 0x12, 0x5a, 0x0a, 0x0e, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x0d, 0x6f, - 0x75, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x0c, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x49, 0x0a, - 0x03, 0x66, 0x74, 0x6c, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x46, - 0x74, 0x6c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x48, 0x00, 0x52, 0x03, 0x66, 0x74, 0x6c, 0x12, 0x51, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, - 0x67, 0x72, 0x65, 0x73, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, - 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, - 0x00, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x05, 0x6d, - 0x79, 0x73, 0x71, 0x6c, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, - 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x05, - 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x14, 0x0a, 0x12, 0x46, 0x74, 0x6c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x50, 0x6f, 0x73, 0x74, 0x67, - 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, - 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x5b, 0x50, 0x01, - 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, - 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, - 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x22, 0xd4, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x18, + 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x08, 0x70, 0x6f, + 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, + 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, + 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x6c, 0x0a, 0x10, + 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, + 0x6f, 0x75, 0x74, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x69, 0x0a, 0x0d, 0x4d, 0x79, + 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6f, + 0x75, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x61, 0x64, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x75, 0x74, 0x5f, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x66, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x5b, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, + 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, + 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -393,25 +279,20 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescGZIP() []byte return file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDescData } -var file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_xyz_block_ftl_v1beta1_provisioner_resource_proto_goTypes = []any{ - (*ResourceProperty)(nil), // 0: xyz.block.ftl.v1beta1.provisioner.ResourceProperty - (*Resource)(nil), // 1: xyz.block.ftl.v1beta1.provisioner.Resource - (*FtlClusterResource)(nil), // 2: xyz.block.ftl.v1beta1.provisioner.FtlClusterResource - (*PostgresResource)(nil), // 3: xyz.block.ftl.v1beta1.provisioner.PostgresResource - (*MysqlResource)(nil), // 4: xyz.block.ftl.v1beta1.provisioner.MysqlResource + (*Resource)(nil), // 0: xyz.block.ftl.v1beta1.provisioner.Resource + (*PostgresResource)(nil), // 1: xyz.block.ftl.v1beta1.provisioner.PostgresResource + (*MysqlResource)(nil), // 2: xyz.block.ftl.v1beta1.provisioner.MysqlResource } var file_xyz_block_ftl_v1beta1_provisioner_resource_proto_depIdxs = []int32{ - 0, // 0: xyz.block.ftl.v1beta1.provisioner.Resource.out_properties:type_name -> xyz.block.ftl.v1beta1.provisioner.ResourceProperty - 1, // 1: xyz.block.ftl.v1beta1.provisioner.Resource.dependencies:type_name -> xyz.block.ftl.v1beta1.provisioner.Resource - 2, // 2: xyz.block.ftl.v1beta1.provisioner.Resource.ftl:type_name -> xyz.block.ftl.v1beta1.provisioner.FtlClusterResource - 3, // 3: xyz.block.ftl.v1beta1.provisioner.Resource.postgres:type_name -> xyz.block.ftl.v1beta1.provisioner.PostgresResource - 4, // 4: xyz.block.ftl.v1beta1.provisioner.Resource.mysql:type_name -> xyz.block.ftl.v1beta1.provisioner.MysqlResource - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 1, // 0: xyz.block.ftl.v1beta1.provisioner.Resource.postgres:type_name -> xyz.block.ftl.v1beta1.provisioner.PostgresResource + 2, // 1: xyz.block.ftl.v1beta1.provisioner.Resource.mysql:type_name -> xyz.block.ftl.v1beta1.provisioner.MysqlResource + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() } @@ -421,18 +302,6 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() { } if !protoimpl.UnsafeEnabled { file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ResourceProperty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Resource); i { case 0: return &v.state @@ -444,19 +313,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() { return nil } } - file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*FtlClusterResource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*PostgresResource); i { case 0: return &v.state @@ -468,7 +325,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() { return nil } } - file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*MysqlResource); i { case 0: return &v.state @@ -481,8 +338,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() { } } } - file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[1].OneofWrappers = []any{ - (*Resource_Ftl)(nil), + file_xyz_block_ftl_v1beta1_provisioner_resource_proto_msgTypes[0].OneofWrappers = []any{ (*Resource_Postgres)(nil), (*Resource_Mysql)(nil), } @@ -492,7 +348,7 @@ func file_xyz_block_ftl_v1beta1_provisioner_resource_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xyz_block_ftl_v1beta1_provisioner_resource_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.proto b/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.proto index 935cd8d66b..58cc1d6c30 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.proto +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/resource.proto @@ -5,39 +5,30 @@ package xyz.block.ftl.v1beta1.provisioner; option go_package = "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1beta1/provisioner;provisioner"; option java_multiple_files = true; -// ResourceProperty is an implementation specific property of the resource populated at creation time -message ResourceProperty { - string resource_id = 1; - string key = 2; - string value = 3; -} - // Resource is an abstract resource extracted from FTL Schema. -// -// we use convention of prefixing field names with out_ if they are populated -// by the provisioning engine message Resource { // id unique within the module string resource_id = 1; - // Additional implementation specific properties populated - // when the resource was created - repeated ResourceProperty out_properties = 2; - - // direct downstream dependencies this Resource depends on - repeated Resource dependencies = 3; - oneof resource { - FtlClusterResource ftl = 101; PostgresResource postgres = 102; MysqlResource mysql = 103; } } // Resource types +// +// we use convention of prefixing field names with out_ if they are populated +// after being provisioned by the provisioning engine -message FtlClusterResource {} - -message PostgresResource {} +message PostgresResource { + // fields populated after the resource has been created + string out_read_endpoint = 101; + string out_write_endpoint = 102; +} -message MysqlResource {} +message MysqlResource { + // fields populated after the resource has been created + string out_read_endpoint = 101; + string out_write_endpoint = 102; +} diff --git a/cmd/devel-provisioner/main.go b/cmd/devel-provisioner/main.go index 58b01cf5c8..2c6739d351 100644 --- a/cmd/devel-provisioner/main.go +++ b/cmd/devel-provisioner/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "encoding/json" "os" "time" @@ -32,29 +33,24 @@ func main() { ".", "ftl-provisioner-cloudformation", provisionerconnect.NewProvisionerPluginServiceClient, + plugin.WithEnvars("FTL_PROVISIONER_CF_DB_SUBNET_GROUP=aurora-postgres-subnet-group"), ) if err != nil { panic(err) } + desired := []*provisioner.Resource{{ + ResourceId: "foobardb", + Resource: &provisioner.Resource_Postgres{ + Postgres: &provisioner.PostgresResource{}, + }, + }} + req := &provisioner.ProvisionRequest{ FtlClusterId: "ftl-test-1", Module: "test-module", ExistingResources: []*provisioner.Resource{}, - DesiredResources: []*provisioner.Resource{{ - ResourceId: "foodb", - Resource: &provisioner.Resource_Postgres{ - Postgres: &provisioner.PostgresResource{}, - }, - Dependencies: []*provisioner.Resource{{ - // Fetch these properties properly from the cluster - Resource: &provisioner.Resource_Ftl{}, - OutProperties: []*provisioner.ResourceProperty{{ - Key: "aws:ftl-cluster:rds-subnet-group", - Value: "aurora-postgres-subnet-group", - }}, - }}, - }}, + DesiredResources: inContext(desired), } plan, err := client.Client.Plan(ctx, connect.NewRequest(&provisioner.PlanRequest{ @@ -85,6 +81,7 @@ func main() { println("polling: " + resp.Msg.ProvisioningToken) status, err := client.Client.Status(ctx, connect.NewRequest(&provisioner.StatusRequest{ ProvisioningToken: resp.Msg.ProvisioningToken, + DesiredResources: desired, })) if err != nil { panic(err) @@ -93,8 +90,12 @@ func main() { panic(fail.Failed.ErrorMessage) } else if success, ok := status.Msg.Status.(*provisioner.StatusResponse_Success); ok { println("finished!") - for _, p := range success.Success.Properties { - println(" ", p.ResourceId, "\t", p.Key, "\t", p.Value) + for _, r := range success.Success.UpdatedResources { + jsn, err := json.MarshalIndent(r, "", " ") + if err != nil { + panic(err) + } + println(string(jsn)) } break } @@ -102,3 +103,11 @@ func main() { } println("done") } + +func inContext(resources []*provisioner.Resource) []*provisioner.ResourceContext { + var result []*provisioner.ResourceContext + for _, r := range resources { + result = append(result, &provisioner.ResourceContext{Resource: r}) + } + return result +} diff --git a/cmd/ftl-provisioner-cloudformation/provisioner.go b/cmd/ftl-provisioner-cloudformation/provisioner.go index b64045e556..7f4d8f3815 100644 --- a/cmd/ftl-provisioner-cloudformation/provisioner.go +++ b/cmd/ftl-provisioner-cloudformation/provisioner.go @@ -22,19 +22,29 @@ import ( "github.com/TBD54566975/ftl/common/plugin" ) +const ( + PropertyDBReadEndpoint = "db:read_endpoint" + PropertyDBWriteEndpoint = "db:write_endpoint" +) + +type Config struct { + DatabaseSubnetGroupARN string `help:"ARN for the subnet group to be used to create Databases in" env:"FTL_PROVISIONER_CF_DB_SUBNET_GROUP"` +} + type CloudformationProvisioner struct { client *cloudformation.Client + confg *Config } var _ provisionerconnect.ProvisionerPluginServiceHandler = (*CloudformationProvisioner)(nil) -func NewCloudformationProvisioner(ctx context.Context, config struct{}) (context.Context, *CloudformationProvisioner, error) { +func NewCloudformationProvisioner(ctx context.Context, config Config) (context.Context, *CloudformationProvisioner, error) { client, err := createClient(ctx) if err != nil { return nil, nil, fmt.Errorf("failed to create cloudformation client: %w", err) } - return ctx, &CloudformationProvisioner{client: client}, nil + return ctx, &CloudformationProvisioner{client: client, confg: &config}, nil } func (c *CloudformationProvisioner) Ping(context.Context, *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error) { @@ -68,7 +78,7 @@ func (c *CloudformationProvisioner) Provision(ctx context.Context, req *connect. func (c *CloudformationProvisioner) createChangeSet(ctx context.Context, req *provisioner.ProvisionRequest) (*cloudformation.CreateChangeSetOutput, bool, error) { stack := stackName(req) changeSet := generateChangeSetName(stack) - templateStr, err := createTemplate(req) + templateStr, err := c.createTemplate(req) if err != nil { return nil, false, fmt.Errorf("failed to create cloudformation template: %w", err) } @@ -99,10 +109,10 @@ func generateChangeSetName(stack string) string { return sanitize(stack) + strconv.FormatInt(time.Now().Unix(), 10) } -func createTemplate(req *provisioner.ProvisionRequest) (string, error) { +func (c *CloudformationProvisioner) createTemplate(req *provisioner.ProvisionRequest) (string, error) { template := goformation.NewTemplate() - for _, resource := range req.DesiredResources { - if err := resourceToCF(req.FtlClusterId, req.Module, template, resource); err != nil { + for _, resourceCtx := range req.DesiredResources { + if err := c.resourceToCF(req.FtlClusterId, req.Module, template, resourceCtx.Resource); err != nil { return "", err } } @@ -114,19 +124,15 @@ func createTemplate(req *provisioner.ProvisionRequest) (string, error) { return string(bytes), nil } -func resourceToCF(cluster, module string, template *goformation.Template, resource *provisioner.Resource) error { +func (c *CloudformationProvisioner) resourceToCF(cluster, module string, template *goformation.Template, resource *provisioner.Resource) error { if _, ok := resource.Resource.(*provisioner.Resource_Postgres); ok { - subnetGroup, err := findRDSSubnetGroup(resource) - if err != nil { - return err - } clusterID := cloudformationResourceID(resource.ResourceId, "cluster") instanceID := cloudformationResourceID(resource.ResourceId, "instance") template.Resources[clusterID] = &rds.DBCluster{ Engine: ptr("aurora-postgresql"), MasterUsername: ptr("root"), ManageMasterUserPassword: ptr(true), - DBSubnetGroupName: ptr(subnetGroup), + DBSubnetGroupName: ptr(c.confg.DatabaseSubnetGroupARN), EngineMode: ptr("provisioned"), ServerlessV2ScalingConfiguration: &rds.DBCluster_ServerlessV2ScalingConfiguration{ MinCapacity: ptr(0.5), @@ -142,31 +148,17 @@ func resourceToCF(cluster, module string, template *goformation.Template, resour } addOutput(template.Outputs, goformation.GetAtt(clusterID, "Endpoint.Address"), &CloudformationOutputKey{ ResourceID: resource.ResourceId, - PropertyName: "db:endpoint-write", + PropertyName: PropertyDBWriteEndpoint, }) addOutput(template.Outputs, goformation.GetAtt(clusterID, "ReadEndpoint.Address"), &CloudformationOutputKey{ ResourceID: resource.ResourceId, - PropertyName: "db:endpoint-read", + PropertyName: PropertyDBReadEndpoint, }) return nil } return errors.New("unsupported resource type") } -func findRDSSubnetGroup(resource *provisioner.Resource) (string, error) { - key := "aws:ftl-cluster:rds-subnet-group" - for _, dep := range resource.Dependencies { - if _, ok := dep.Resource.(*provisioner.Resource_Ftl); ok { - for _, p := range dep.OutProperties { - if p.Key == key { - return p.Value, nil - } - } - } - } - return "", errors.New("can not create a database, as property was not found: " + key) -} - func ftlTags(cluster, module string) []tags.Tag { return []tags.Tag{{ Key: "ftl:module", diff --git a/cmd/ftl-provisioner-cloudformation/status.go b/cmd/ftl-provisioner-cloudformation/status.go index 1e11b47ed0..0adb8d5f51 100644 --- a/cmd/ftl-provisioner-cloudformation/status.go +++ b/cmd/ftl-provisioner-cloudformation/status.go @@ -32,7 +32,7 @@ func (c *CloudformationProvisioner) Status(ctx context.Context, req *connect.Req case types.StackStatusCreateFailed: return failure(&stack) case types.StackStatusCreateComplete: - return success(&stack) + return success(&stack, req.Msg.DesiredResources) case types.StackStatusRollbackInProgress: return failure(&stack) case types.StackStatusRollbackFailed: @@ -44,13 +44,13 @@ func (c *CloudformationProvisioner) Status(ctx context.Context, req *connect.Req case types.StackStatusDeleteFailed: return failure(&stack) case types.StackStatusDeleteComplete: - return success(&stack) + return success(&stack, req.Msg.DesiredResources) case types.StackStatusUpdateInProgress: return running() case types.StackStatusUpdateCompleteCleanupInProgress: return running() case types.StackStatusUpdateComplete: - return success(&stack) + return success(&stack, req.Msg.DesiredResources) case types.StackStatusUpdateFailed: return failure(&stack) case types.StackStatusUpdateRollbackInProgress: @@ -60,15 +60,15 @@ func (c *CloudformationProvisioner) Status(ctx context.Context, req *connect.Req } } -func success(stack *types.Stack) (*connect.Response[provisioner.StatusResponse], error) { - props, err := propertiesFromOutput(stack.Outputs) +func success(stack *types.Stack, resources []*provisioner.Resource) (*connect.Response[provisioner.StatusResponse], error) { + err := updateResources(stack.Outputs, resources) if err != nil { return nil, err } return connect.NewResponse(&provisioner.StatusResponse{ Status: &provisioner.StatusResponse_Success{ Success: &provisioner.StatusResponse_ProvisioningSuccess{ - Properties: props, + UpdatedResources: resources, }, }, }), nil @@ -92,19 +92,31 @@ func failure(stack *types.Stack) (*connect.Response[provisioner.StatusResponse], }), nil } -func propertiesFromOutput(outputs []types.Output) ([]*provisioner.ResourceProperty, error) { - var result []*provisioner.ResourceProperty +func updateResources(outputs []types.Output, update []*provisioner.Resource) error { for _, output := range outputs { key, err := decodeOutputKey(output) if err != nil { - return nil, fmt.Errorf("failed to decode output key: %w", err) + return fmt.Errorf("failed to decode output key: %w", err) + } + for _, resource := range update { + if resource.ResourceId == key.ResourceID { + if postgres, ok := resource.Resource.(*provisioner.Resource_Postgres); ok { + switch key.PropertyName { + case PropertyDBReadEndpoint: + postgres.Postgres.OutReadEndpoint = *output.OutputValue + case PropertyDBWriteEndpoint: + postgres.Postgres.OutWriteEndpoint = *output.OutputValue + } + } else if mysql, ok := resource.Resource.(*provisioner.Resource_Mysql); ok { + switch key.PropertyName { + case PropertyDBReadEndpoint: + mysql.Mysql.OutReadEndpoint = *output.OutputValue + case PropertyDBWriteEndpoint: + mysql.Mysql.OutWriteEndpoint = *output.OutputValue + } + } + } } - - result = append(result, &provisioner.ResourceProperty{ - ResourceId: key.ResourceID, - Key: key.PropertyName, - Value: *output.OutputValue, - }) } - return result, nil + return nil } diff --git a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts index 1c24300b64..a02708f0ff 100644 --- a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts +++ b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts @@ -5,7 +5,54 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { Resource, ResourceProperty } from "./resource_pb.js"; +import { Resource } from "./resource_pb.js"; + +/** + * ResourceContext is the context used to create a new resource + * This includes the direct dependencies of the new resource, that can impact + * the resource creation. + * + * @generated from message xyz.block.ftl.v1beta1.provisioner.ResourceContext + */ +export class ResourceContext extends Message { + /** + * @generated from field: xyz.block.ftl.v1beta1.provisioner.Resource resource = 1; + */ + resource?: Resource; + + /** + * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.Resource dependencies = 2; + */ + dependencies: Resource[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.ResourceContext"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource", kind: "message", T: Resource }, + { no: 2, name: "dependencies", kind: "message", T: Resource, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResourceContext { + return new ResourceContext().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResourceContext { + return new ResourceContext().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResourceContext { + return new ResourceContext().fromJsonString(jsonString, options); + } + + static equals(a: ResourceContext | PlainMessage | undefined, b: ResourceContext | PlainMessage | undefined): boolean { + return proto3.util.equals(ResourceContext, a, b); + } +} /** * @generated from message xyz.block.ftl.v1beta1.provisioner.ProvisionRequest @@ -32,9 +79,9 @@ export class ProvisionRequest extends Message { * The resource FTL would like to exist after this provisioning run. * This includes all new, existing, and changes resources in this change. * - * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.Resource desired_resources = 4; + * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.ResourceContext desired_resources = 4; */ - desiredResources: Resource[] = []; + desiredResources: ResourceContext[] = []; constructor(data?: PartialMessage) { super(); @@ -47,7 +94,7 @@ export class ProvisionRequest extends Message { { no: 1, name: "ftl_cluster_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "module", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "existing_resources", kind: "message", T: Resource, repeated: true }, - { no: 4, name: "desired_resources", kind: "message", T: Resource, repeated: true }, + { no: 4, name: "desired_resources", kind: "message", T: ResourceContext, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ProvisionRequest { @@ -145,6 +192,15 @@ export class StatusRequest extends Message { */ provisioningToken = ""; + /** + * The set of desired_resources used to initiate this provisioning request + * We need this as input here, so we can populate any resource fields in them + * when the provisioning finishes + * + * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.Resource desired_resources = 2; + */ + desiredResources: Resource[] = []; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -154,6 +210,7 @@ export class StatusRequest extends Message { static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.StatusRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "provisioning_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "desired_resources", kind: "message", T: Resource, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): StatusRequest { @@ -303,9 +360,12 @@ export class StatusResponse_ProvisioningFailed extends Message { /** - * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.ResourceProperty properties = 3; + * Some fields in the resources might have been populated + * during the provisioning. The new state is returned here + * + * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.Resource updated_resources = 1; */ - properties: ResourceProperty[] = []; + updatedResources: Resource[] = []; constructor(data?: PartialMessage) { super(); @@ -315,7 +375,7 @@ export class StatusResponse_ProvisioningSuccess extends Message [ - { no: 3, name: "properties", kind: "message", T: ResourceProperty, repeated: true }, + { no: 1, name: "updated_resources", kind: "message", T: Resource, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): StatusResponse_ProvisioningSuccess { diff --git a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/resource_pb.ts b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/resource_pb.ts index 4bea1bf1ec..7d4e064505 100644 --- a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/resource_pb.ts +++ b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/resource_pb.ts @@ -6,63 +6,9 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -/** - * ResourceProperty is an implementation specific property of the resource populated at creation time - * - * @generated from message xyz.block.ftl.v1beta1.provisioner.ResourceProperty - */ -export class ResourceProperty extends Message { - /** - * @generated from field: string resource_id = 1; - */ - resourceId = ""; - - /** - * @generated from field: string key = 2; - */ - key = ""; - - /** - * @generated from field: string value = 3; - */ - value = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.ResourceProperty"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resource_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ResourceProperty { - return new ResourceProperty().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ResourceProperty { - return new ResourceProperty().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ResourceProperty { - return new ResourceProperty().fromJsonString(jsonString, options); - } - - static equals(a: ResourceProperty | PlainMessage | undefined, b: ResourceProperty | PlainMessage | undefined): boolean { - return proto3.util.equals(ResourceProperty, a, b); - } -} - /** * Resource is an abstract resource extracted from FTL Schema. * - * we use convention of prefixing field names with out_ if they are populated - * by the provisioning engine - * * @generated from message xyz.block.ftl.v1beta1.provisioner.Resource */ export class Resource extends Message { @@ -73,31 +19,10 @@ export class Resource extends Message { */ resourceId = ""; - /** - * Additional implementation specific properties populated - * when the resource was created - * - * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.ResourceProperty out_properties = 2; - */ - outProperties: ResourceProperty[] = []; - - /** - * direct downstream dependencies this Resource depends on - * - * @generated from field: repeated xyz.block.ftl.v1beta1.provisioner.Resource dependencies = 3; - */ - dependencies: Resource[] = []; - /** * @generated from oneof xyz.block.ftl.v1beta1.provisioner.Resource.resource */ resource: { - /** - * @generated from field: xyz.block.ftl.v1beta1.provisioner.FtlClusterResource ftl = 101; - */ - value: FtlClusterResource; - case: "ftl"; - } | { /** * @generated from field: xyz.block.ftl.v1beta1.provisioner.PostgresResource postgres = 102; */ @@ -120,9 +45,6 @@ export class Resource extends Message { static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.Resource"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "resource_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "out_properties", kind: "message", T: ResourceProperty, repeated: true }, - { no: 3, name: "dependencies", kind: "message", T: Resource, repeated: true }, - { no: 101, name: "ftl", kind: "message", T: FtlClusterResource, oneof: "resource" }, { no: 102, name: "postgres", kind: "message", T: PostgresResource, oneof: "resource" }, { no: 103, name: "mysql", kind: "message", T: MysqlResource, oneof: "resource" }, ]); @@ -144,41 +66,22 @@ export class Resource extends Message { } } -/** - * @generated from message xyz.block.ftl.v1beta1.provisioner.FtlClusterResource - */ -export class FtlClusterResource extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.FtlClusterResource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FtlClusterResource { - return new FtlClusterResource().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FtlClusterResource { - return new FtlClusterResource().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FtlClusterResource { - return new FtlClusterResource().fromJsonString(jsonString, options); - } - - static equals(a: FtlClusterResource | PlainMessage | undefined, b: FtlClusterResource | PlainMessage | undefined): boolean { - return proto3.util.equals(FtlClusterResource, a, b); - } -} - /** * @generated from message xyz.block.ftl.v1beta1.provisioner.PostgresResource */ export class PostgresResource extends Message { + /** + * fields populated after the resource has been created + * + * @generated from field: string out_read_endpoint = 101; + */ + outReadEndpoint = ""; + + /** + * @generated from field: string out_write_endpoint = 102; + */ + outWriteEndpoint = ""; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -187,6 +90,8 @@ export class PostgresResource extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.PostgresResource"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 101, name: "out_read_endpoint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 102, name: "out_write_endpoint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PostgresResource { @@ -210,6 +115,18 @@ export class PostgresResource extends Message { * @generated from message xyz.block.ftl.v1beta1.provisioner.MysqlResource */ export class MysqlResource extends Message { + /** + * fields populated after the resource has been created + * + * @generated from field: string out_read_endpoint = 101; + */ + outReadEndpoint = ""; + + /** + * @generated from field: string out_write_endpoint = 102; + */ + outWriteEndpoint = ""; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -218,6 +135,8 @@ export class MysqlResource extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "xyz.block.ftl.v1beta1.provisioner.MysqlResource"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 101, name: "out_read_endpoint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 102, name: "out_write_endpoint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): MysqlResource {