Commit b9821ddd authored by Scarlett Perry's avatar Scarlett Perry
Browse files

Merge branch 'main' into sperry-add-GetSurveys-module

parents 86ef66a7 8af26634
Showing with 769 additions and 90 deletions
+769 -90
......@@ -8,7 +8,7 @@ COPY Makefile .
RUN make frontend
# Backend build.
FROM golang:1.17.2-buster as gobuild
FROM golang:1.17.3-buster as gobuild
WORKDIR /go/src/github.com/lyft/clutch
COPY ./backend ./backend
COPY ./tools/preflight-checks.sh ./tools/preflight-checks.sh
......
......@@ -10,6 +10,20 @@ message Config {
repeated string regions = 1 [ (validate.rules).repeated = {min_items : 1} ];
ClientConfig client_config = 2;
DynamodbConfig dynamodb_config = 3;
// The current account alias display name, if this is not set the default will be "default"
// The account alias display name will be used when resolving resources.
// EG: if this is set to "production" a resource would be referenced like so
// "production/us-east-1/my-asg"
string primary_account_alias_display_name = 4;
// If you are using an aws configuration file, this overrides the default profile that is loaded.
// TODO: This is currently not implemented, but was created to prevent confusion between
// primary_account_alias_display_name
string aws_config_profile_name = 5;
// A list of additional accounts you would like clutch to be able to operate in
repeated AWSAccount additional_accounts = 6;
}
message ClientConfig {
......@@ -31,4 +45,17 @@ message ScalingLimits {
float max_scale_factor = 3;
// enables whether the service can override safety limits. Defaults to false
bool enable_override = 4;
}
\ No newline at end of file
}
message AWSAccount {
// The account alias for this account
string alias = 1 [ (validate.rules).string = {min_bytes : 1} ];
// The account number for the aws account
string account_number = 2 [ (validate.rules).string = {min_bytes : 1} ];
// The IAM role to use when performing operations against this account
// NOTE: The role that Clutch assumes by default must have proper permissions
// to assume the role below
string iam_role = 3 [ (validate.rules).string = {min_bytes : 1} ];
// The list of regions you would like to operate in
repeated string regions = 4 [ (validate.rules).repeated = {min_items : 1} ];
}
......@@ -29,6 +29,17 @@ type Config struct {
Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig,proto3" json:"client_config,omitempty"`
DynamodbConfig *DynamodbConfig `protobuf:"bytes,3,opt,name=dynamodb_config,json=dynamodbConfig,proto3" json:"dynamodb_config,omitempty"`
// The current account alias display name, if this is not set the default will be "default"
// The account alias display name will be used when resolving resources.
// EG: if this is set to "production" a resource would be referenced like so
// "production/us-east-1/my-asg"
PrimaryAccountAliasDisplayName string `protobuf:"bytes,4,opt,name=primary_account_alias_display_name,json=primaryAccountAliasDisplayName,proto3" json:"primary_account_alias_display_name,omitempty"`
// If you are using an aws configuration file, this overrides the default profile that is loaded.
// TODO: This is currently not implemented, but was created to prevent confusion between
// primary_account_alias_display_name
AwsConfigProfileName string `protobuf:"bytes,5,opt,name=aws_config_profile_name,json=awsConfigProfileName,proto3" json:"aws_config_profile_name,omitempty"`
// A list of additional accounts you would like clutch to be able to operate in
AdditionalAccounts []*AWSAccount `protobuf:"bytes,6,rep,name=additional_accounts,json=additionalAccounts,proto3" json:"additional_accounts,omitempty"`
}
func (x *Config) Reset() {
......@@ -84,6 +95,27 @@ func (x *Config) GetDynamodbConfig() *DynamodbConfig {
return nil
}
func (x *Config) GetPrimaryAccountAliasDisplayName() string {
if x != nil {
return x.PrimaryAccountAliasDisplayName
}
return ""
}
func (x *Config) GetAwsConfigProfileName() string {
if x != nil {
return x.AwsConfigProfileName
}
return ""
}
func (x *Config) GetAdditionalAccounts() []*AWSAccount {
if x != nil {
return x.AdditionalAccounts
}
return nil
}
type ClientConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -255,6 +287,83 @@ func (x *ScalingLimits) GetEnableOverride() bool {
return false
}
type AWSAccount struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The account alias for this account
Alias string `protobuf:"bytes,1,opt,name=alias,proto3" json:"alias,omitempty"`
// The account number for the aws account
AccountNumber string `protobuf:"bytes,2,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
// The IAM role to use when performing operations against this account
// NOTE: The role that Clutch assumes by default must have proper permissions
// to assume the role below
IamRole string `protobuf:"bytes,3,opt,name=iam_role,json=iamRole,proto3" json:"iam_role,omitempty"`
// The list of regions you would like to operate in
Regions []string `protobuf:"bytes,4,rep,name=regions,proto3" json:"regions,omitempty"`
}
func (x *AWSAccount) Reset() {
*x = AWSAccount{}
if protoimpl.UnsafeEnabled {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AWSAccount) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AWSAccount) ProtoMessage() {}
func (x *AWSAccount) ProtoReflect() protoreflect.Message {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AWSAccount.ProtoReflect.Descriptor instead.
func (*AWSAccount) Descriptor() ([]byte, []int) {
return file_config_service_aws_v1_aws_proto_rawDescGZIP(), []int{4}
}
func (x *AWSAccount) GetAlias() string {
if x != nil {
return x.Alias
}
return ""
}
func (x *AWSAccount) GetAccountNumber() string {
if x != nil {
return x.AccountNumber
}
return ""
}
func (x *AWSAccount) GetIamRole() string {
if x != nil {
return x.IamRole
}
return ""
}
func (x *AWSAccount) GetRegions() []string {
if x != nil {
return x.Regions
}
return nil
}
var File_config_service_aws_v1_aws_proto protoreflect.FileDescriptor
var file_config_service_aws_v1_aws_proto_rawDesc = []byte{
......@@ -263,7 +372,7 @@ var file_config_service_aws_v1_aws_proto_rawDesc = []byte{
0x6f, 0x12, 0x1c, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x1a,
0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x03, 0x0a, 0x06, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07,
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e,
......@@ -276,36 +385,61 @@ var file_config_service_aws_v1_aws_proto_rawDesc = []byte{
0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
0x0e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22,
0x31, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x21, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69,
0x65, 0x73, 0x22, 0x64, 0x0a, 0x0e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x12, 0x52, 0x0a, 0x0e, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x5f,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63,
0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x61, 0x6c,
0x69, 0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x69,
0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x0d, 0x53, 0x63, 0x61,
0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x17, 0x6d, 0x61,
0x78, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x5f,
0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06,
0x22, 0x04, 0x28, 0x01, 0x40, 0x01, 0x52, 0x14, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x61, 0x64, 0x43,
0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x18,
0x6d, 0x61, 0x78, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69,
0x74, 0x79, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09,
0xfa, 0x42, 0x06, 0x22, 0x04, 0x28, 0x01, 0x40, 0x01, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x57, 0x72,
0x69, 0x74, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73,
0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x66, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x53,
0x63, 0x61, 0x6c, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72,
0x69, 0x64, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2f, 0x62, 0x61,
0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x76, 0x31, 0x3b,
0x61, 0x77, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x0e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x4a, 0x0a, 0x22, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1e, 0x70, 0x72, 0x69,
0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73,
0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x61,
0x77, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,
0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x77,
0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x59, 0x0a, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x28, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41,
0x57, 0x53, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x31, 0x0a,
0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a,
0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73,
0x22, 0x64, 0x0a, 0x0e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x12, 0x52, 0x0a, 0x0e, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69,
0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75,
0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e,
0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67,
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x0d, 0x53, 0x63, 0x61, 0x6c, 0x69,
0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x17, 0x6d, 0x61, 0x78, 0x5f,
0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x5f, 0x75, 0x6e,
0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x22, 0x04,
0x28, 0x01, 0x40, 0x01, 0x52, 0x14, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x61, 0x64, 0x43, 0x61, 0x70,
0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x18, 0x6d, 0x61,
0x78, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79,
0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42,
0x06, 0x22, 0x04, 0x28, 0x01, 0x40, 0x01, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x57, 0x72, 0x69, 0x74,
0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x28,
0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x66, 0x61, 0x63, 0x74,
0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x53, 0x63, 0x61,
0x6c, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64,
0x65, 0x22, 0xa3, 0x01, 0x0a, 0x0a, 0x41, 0x57, 0x53, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x1d, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12,
0x2e, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01,
0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12,
0x22, 0x0a, 0x08, 0x69, 0x61, 0x6d, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x07, 0x69, 0x61, 0x6d, 0x52,
0x6f, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04,
0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07,
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74, 0x63,
0x68, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x77, 0x73,
0x2f, 0x76, 0x31, 0x3b, 0x61, 0x77, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
......@@ -320,22 +454,24 @@ func file_config_service_aws_v1_aws_proto_rawDescGZIP() []byte {
return file_config_service_aws_v1_aws_proto_rawDescData
}
var file_config_service_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_config_service_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_config_service_aws_v1_aws_proto_goTypes = []interface{}{
(*Config)(nil), // 0: clutch.config.service.aws.v1.Config
(*ClientConfig)(nil), // 1: clutch.config.service.aws.v1.ClientConfig
(*DynamodbConfig)(nil), // 2: clutch.config.service.aws.v1.DynamodbConfig
(*ScalingLimits)(nil), // 3: clutch.config.service.aws.v1.ScalingLimits
(*AWSAccount)(nil), // 4: clutch.config.service.aws.v1.AWSAccount
}
var file_config_service_aws_v1_aws_proto_depIdxs = []int32{
1, // 0: clutch.config.service.aws.v1.Config.client_config:type_name -> clutch.config.service.aws.v1.ClientConfig
2, // 1: clutch.config.service.aws.v1.Config.dynamodb_config:type_name -> clutch.config.service.aws.v1.DynamodbConfig
3, // 2: clutch.config.service.aws.v1.DynamodbConfig.scaling_limits:type_name -> clutch.config.service.aws.v1.ScalingLimits
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
4, // 2: clutch.config.service.aws.v1.Config.additional_accounts:type_name -> clutch.config.service.aws.v1.AWSAccount
3, // 3: clutch.config.service.aws.v1.DynamodbConfig.scaling_limits:type_name -> clutch.config.service.aws.v1.ScalingLimits
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_config_service_aws_v1_aws_proto_init() }
......@@ -392,6 +528,18 @@ func file_config_service_aws_v1_aws_proto_init() {
return nil
}
}
file_config_service_aws_v1_aws_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AWSAccount); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -399,7 +547,7 @@ func file_config_service_aws_v1_aws_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_config_service_aws_v1_aws_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
......
......@@ -125,6 +125,44 @@ func (m *Config) validate(all bool) error {
}
}
// no validation rules for PrimaryAccountAliasDisplayName
// no validation rules for AwsConfigProfileName
for idx, item := range m.GetAdditionalAccounts() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ConfigValidationError{
field: fmt.Sprintf("AdditionalAccounts[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ConfigValidationError{
field: fmt.Sprintf("AdditionalAccounts[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigValidationError{
field: fmt.Sprintf("AdditionalAccounts[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return ConfigMultiError(errors)
}
......@@ -570,3 +608,145 @@ var _ interface {
Cause() error
ErrorName() string
} = ScalingLimitsValidationError{}
// Validate checks the field values on AWSAccount with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AWSAccount) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AWSAccount with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AWSAccountMultiError, or
// nil if none found.
func (m *AWSAccount) ValidateAll() error {
return m.validate(true)
}
func (m *AWSAccount) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetAlias()) < 1 {
err := AWSAccountValidationError{
field: "Alias",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(m.GetAccountNumber()) < 1 {
err := AWSAccountValidationError{
field: "AccountNumber",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(m.GetIamRole()) < 1 {
err := AWSAccountValidationError{
field: "IamRole",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(m.GetRegions()) < 1 {
err := AWSAccountValidationError{
field: "Regions",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return AWSAccountMultiError(errors)
}
return nil
}
// AWSAccountMultiError is an error wrapping multiple validation errors
// returned by AWSAccount.ValidateAll() if the designated constraints aren't met.
type AWSAccountMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AWSAccountMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AWSAccountMultiError) AllErrors() []error { return m }
// AWSAccountValidationError is the validation error returned by
// AWSAccount.Validate if the designated constraints aren't met.
type AWSAccountValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AWSAccountValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AWSAccountValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AWSAccountValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AWSAccountValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AWSAccountValidationError) ErrorName() string { return "AWSAccountValidationError" }
// Error satisfies the builtin error interface
func (e AWSAccountValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAWSAccount.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AWSAccountValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AWSAccountValidationError{}
......@@ -5,15 +5,15 @@ go 1.16
require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/Masterminds/squirrel v1.5.1
github.com/aws/aws-sdk-go-v2 v1.10.0
github.com/aws/aws-sdk-go-v2/config v1.9.0
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.13.0
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.6.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.20.0
github.com/aws/aws-sdk-go-v2/service/kinesis v1.7.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.17.0
github.com/aws/aws-sdk-go-v2/service/sts v1.8.0
github.com/aws/smithy-go v1.8.1
github.com/aws/aws-sdk-go-v2 v1.11.0
github.com/aws/aws-sdk-go-v2/config v1.10.0
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.14.0
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.7.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.21.0
github.com/aws/aws-sdk-go-v2/service/kinesis v1.8.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.18.0
github.com/aws/aws-sdk-go-v2/service/sts v1.9.0
github.com/aws/smithy-go v1.9.0
github.com/bradleyfalzon/ghinstallation v1.1.1
github.com/bufbuild/buf v0.56.0
github.com/cactus/go-statsd-client/statsd v0.0.0-20200623234511-94959e3146b2
......@@ -36,7 +36,7 @@ require (
github.com/iancoleman/strcase v0.2.0
github.com/jhump/protoreflect v1.10.1
github.com/joho/godotenv v1.4.0
github.com/lib/pq v1.10.3
github.com/lib/pq v1.10.4
github.com/m3db/prometheus_client_golang v0.8.1 // indirect
github.com/m3db/prometheus_client_model v0.1.0 // indirect
github.com/m3db/prometheus_common v0.1.0 // indirect
......
......@@ -122,66 +122,70 @@ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZo
github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0=
github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2 v1.10.0 h1:+dCJ5W2HiZNa4UtaIc5ljKNulm0dK0vS5dxb5LdDOAA=
github.com/aws/aws-sdk-go-v2 v1.10.0/go.mod h1:U/EyyVvKtzmFeQQcca7eBotKdlpcP2zzU6bXBYcf7CE=
github.com/aws/aws-sdk-go-v2 v1.11.0 h1:HxyD62DyNhCfiFGUHqJ/xITD6rAjJ7Dm/2nLxLmO4Ag=
github.com/aws/aws-sdk-go-v2 v1.11.0/go.mod h1:SQfA+m2ltnu1cA0soUkj4dRSsmITiVQUJvBIZjzfPyQ=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.0.0 h1:yVUAwvJC/0WNPbyl0nA3j1L6CW1CN8wBubCRqtG7JLI=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.0.0/go.mod h1:Xn6sxgRuIDflLRJFj5Ev7UxABIkNbccFPV/p8itDReM=
github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU=
github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw=
github.com/aws/aws-sdk-go-v2/config v1.9.0 h1:SkREVSwi+J8MSdjhJ96jijZm5ZDNleI0E4hHCNivh7s=
github.com/aws/aws-sdk-go-v2/config v1.9.0/go.mod h1:qhK5NNSgo9/nOSMu3HyE60WHXZTWTHTgd5qtIF44vOQ=
github.com/aws/aws-sdk-go-v2/config v1.10.0 h1:4i+/7DmCQCAls5Z61giur0LOPZ3PXFwnSIw7hRamzws=
github.com/aws/aws-sdk-go-v2/config v1.10.0/go.mod h1:xuqoV5etD3N3B8Ts9je4ijgAv6mb+6NiOPFMUhwRcjA=
github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM=
github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ=
github.com/aws/aws-sdk-go-v2/credentials v1.5.0 h1:r6470olsn2qyOe2aLzK6q+wfO3dzNcMujRT3gqBgBB8=
github.com/aws/aws-sdk-go-v2/credentials v1.5.0/go.mod h1:kvqTkpzQmzri9PbsiTY+LvwFzM0gY19emlAWwBOJMb0=
github.com/aws/aws-sdk-go-v2/credentials v1.6.0 h1:L3O6osQTlzLKRmiTphw2QJuD21EFapWCX4IipiRJhAE=
github.com/aws/aws-sdk-go-v2/credentials v1.6.0/go.mod h1:rQkYdQPDXRrvPLeEuCNwSgtwMzBo9eDGWlTNC69Sh/0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.7.0 h1:FKaqk7geL3oIqSwGJt5SWUKj8uJ+qLZNqlBuqq6sFyA=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.7.0/go.mod h1:KqEkRkxm/+1Pd/rENRNbQpfblDBYeg5HDSqjB6ks8hA=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.0 h1:OpZjuUy8Jt3CA1WgJgBC5Bz+uOjE5Ppx4NFTRaooUuA=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.0/go.mod h1:5E1J3/TTYy6z909QNR0QnXGBpfESYGDqd3O0zqONghU=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4/go.mod h1:Ex7XQmbFmgFHrjUX6TN3mApKW5Hglyga+F7wZHTtYhA=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.0.7 h1:/0GQVY8J25hww4J9a+rYKDr9ryGh2KdIdR8YHBP54h0=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.0.7/go.mod h1:QXoZAXmBEHeMIFiBr3XumpTyoNTXTQbqPV+qaGX7gfY=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0 h1:zY8cNmbBXt3pzjgWgdIbzpQ6qxoCwt+Nx9JbrAf2mbY=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0/go.mod h1:NO3Q5ZTTQtO2xIg2+xTXYDiT7knSejfeDm7WGDaOo0U=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0 h1:Z3aR/OXBnkYK9zXkNkfitHX6SmUBzSsx8VMHbH4Lvhw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0/go.mod h1:anlUzBoEWglcUxUQwZA7HQOEVEnQALVZsizAapB2hq8=
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6ry18hGvE0i8yvbXoKbnZaE=
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ=
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.5 h1:zPxLGWALExNepElO0gYgoqsbqTlt4ZCrhZ7XlfJ+Qlw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.5/go.mod h1:6ZBTuDmvpCOD4Sf1i2/I3PgftlEcDGgvi8ocq64oQEg=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.13.0 h1:CUS0AgJ8kruQdxvz6fPCcLNOTbj4DsKicHocEM9WUhY=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.13.0/go.mod h1:DTbM8Wf51gH437I+0RcF5bS2oTu7yKEJWP6tZ8OJ4oc=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.6.0 h1:HDp8hUQlGU5fgNoNDp0BOthk57AuTXMTaAK1mb9c27I=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.6.0/go.mod h1:t8pYXJHxfOe/088CcNeuqQbucpq9SwO1yjheCieDDnI=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.20.0 h1:qvcoul6cfXEjiQMY1N43zaDui3FWsEpXLVxHlmWc3pk=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.20.0/go.mod h1:P+gshV4VLT7jUbWALAhV9lXDyZ40R7E/Rvr2ryBqn2s=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.0 h1:c10Z7fWxtJCoyc8rv06jdh9xrKnu7bAJiRaKWvTb2mU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.0/go.mod h1:6oXGy4GLpypD3uCh8wcqztigGgmhLToMfjavgh+VySg=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.14.0 h1:NdMPjwe+QMCgJHXEedl4PDB4sWV7YMs3b2DBeVi3/fA=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.14.0/go.mod h1:+LUc9kNVNpUC89o0y4dhPTqjQzeDdz2UvVwTBraMFNY=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.7.0 h1:S3X6RWl0TfMxNXsIzz8r3Y6YVA1HWGSx6M345Q3mQ+I=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.7.0/go.mod h1:Hh0zJ3419ET9xQBeR+y0lHIkObJwAKPbzV9nTZ0yrJ0=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.21.0 h1:cWWnqN+luwYCpU4pq8DxPsjf2iq282sgbgGCrDiY4Zs=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.21.0/go.mod h1:kK7lSKNwAqIMKVCTsfVcN82m8pvuPUf+6g/zrz/PnE0=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.4.0 h1:EtQ6hVAgNsWTiO+u9e+ziaEYyOAlEkAwLskpL40U6pQ=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.4.0/go.mod h1:vEkJTjJ8vnv0uWy2tAp7DSydWFpudMGWPQ2SFucoN1k=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.2.0 h1:uxy31f/H1bkUV2aircA9hTQT8s093u1eOeErsOXIY90=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.2.0/go.mod h1:wLLzEoPune3u08rkvNBm3BprebkWRmmCkMtTeujM3Fs=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.5.0 h1:lPLbw4Gn59uoKqvOfSnkJr54XWk5Ak1NK20ZEiSWb3U=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.5.0/go.mod h1:80NaCIH9YU3rzTTs/J/ECATjXuRqzo/wB6ukO6MZ0XY=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.3.0 h1:A2aUh9d38A2ECh76ahOQUdpJFe+Jhjk8qrfV+YbNYGY=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.3.0/go.mod h1:5h2rxfLN22pLTQ1ZoOza87rp2SnN/9UDYdYBQRmIrsE=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 h1:/T5wKsw/po118HEDvnSE8YU7TESxvZbYM2rnn+Oi7Kk=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0/go.mod h1:X5/JuOxPLU/ogICgDTtnpfaQzdQJO0yKDcpoxWLLJ8Y=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0 h1:qGZWS/WgiFY+Zgad2u0gwBHpJxz6Ne401JE7iQI1nKs=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0/go.mod h1:Mq6AEc+oEjCUlBuLiK5YwW4shSOAKCQ3tXN0sQeYoBA=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.8.0 h1:j1JV89mkJP4f9cssTWbu+anj3p2v+UWMA7qERQQqMkM=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.8.0/go.mod h1:669UCOYqQ7jA8sqwEsbIXoYrfp8KT9BeUrST0/mhCFw=
github.com/aws/aws-sdk-go-v2/service/kinesis v1.7.0 h1:BR1dH17nltcO/bRr7sW+BTOY1OekCf3KadPBTHWPIY4=
github.com/aws/aws-sdk-go-v2/service/kinesis v1.7.0/go.mod h1:IKVo9L4q2SkAfCZik0P9fdCZWppIE06l2ZfPktUNUXQ=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.9.0 h1:0BOlTqnNnrEO04oYKzDxMMe68t107pmIotn18HtVonY=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.9.0/go.mod h1:xKCZ4YFSF2s4Hnb/J0TLeOsKuGzICzcElaOKNGrVnx4=
github.com/aws/aws-sdk-go-v2/service/kinesis v1.8.0 h1:Cz26j4wGD1tJ2w/M8iLhaS81AkAGY3gEYRt0xQWjEIs=
github.com/aws/aws-sdk-go-v2/service/kinesis v1.8.0/go.mod h1:QyNCg1xtWFJVL++i6ZyVcwXZCiKTNeXHH9zZu3NHOdU=
github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.17.0 h1:VI/NYED5fJqgV1NTvfBlHJaqJd803AAkg8ZcJ8TkrvA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.17.0/go.mod h1:6mvopTtbyJcY0NfSOVtgkBlDDatYwiK1DAFr4VL0QCo=
github.com/aws/aws-sdk-go-v2/service/s3 v1.18.0 h1:7qgXYvv0ONAfmHYT2d/k7MdllM8xmcxRP7CF1Xyxdws=
github.com/aws/aws-sdk-go-v2/service/s3 v1.18.0/go.mod h1:Gwz3aVctJe6mUY9T//bcALArPUaFmNAy2rTB9qN4No8=
github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo=
github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk=
github.com/aws/aws-sdk-go-v2/service/sso v1.5.0 h1:VnrCAJTp1bDxU79UuW/D4z7bwZ7xOc7JjDKpqXL/m04=
github.com/aws/aws-sdk-go-v2/service/sso v1.5.0/go.mod h1:GsqaJOJeOfeYD88/2vHWKXegvDRofDqWwC5i48A2kgs=
github.com/aws/aws-sdk-go-v2/service/sso v1.6.0 h1:JDgKIUZOmLFu/Rv6zXLrVTWCmzA0jcTdvsT8iFIKrAI=
github.com/aws/aws-sdk-go-v2/service/sso v1.6.0/go.mod h1:Q/l0ON1annSU+mc0JybDy1Gy6dnJxIcWjphO6qJPzvM=
github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs=
github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g=
github.com/aws/aws-sdk-go-v2/service/sts v1.8.0 h1:7N7RsEVvUcvEg7jrWKU5AnSi4/6b6eY9+wG1g6W4ExE=
github.com/aws/aws-sdk-go-v2/service/sts v1.8.0/go.mod h1:dOlm91B439le5y1vtPCk5yJtbx3RdT3hRGYRY8TYKvQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.9.0 h1:rBLCnL8hQ7Sv1S4XCPYgTMI7Uhg81BkvzIiK+/of2zY=
github.com/aws/aws-sdk-go-v2/service/sts v1.9.0/go.mod h1:jLKCFqS+1T4i7HDqCP9GM4Uk75YW1cS0o82LdxpMyOE=
github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/aws/smithy-go v1.8.1 h1:9Y6qxtzgEODaLNGN+oN2QvcHvKUe4jsH8w4M+8LXzGk=
github.com/aws/smithy-go v1.8.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/aws/smithy-go v1.9.0 h1:c7FUdEqrQA1/UVKKCNDFQPNKGp4FQg3YW4Ck5SLTG58=
github.com/aws/smithy-go v1.9.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
......@@ -804,8 +808,8 @@ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg=
github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lyft/protoc-gen-star v0.5.3 h1:zSGLzsUew8RT+ZKPHc3jnf8XLaVyHzTcAFBzHtCNR20=
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
github.com/m3db/prometheus_client_golang v0.8.1 h1:t7w/tcFws81JL1j5sqmpqcOyQOpH4RDOmIe3A3fdN3w=
......
......@@ -8996,6 +8996,15 @@ export namespace clutch {
 
/** Config dynamodbConfig */
dynamodbConfig?: (clutch.config.service.aws.v1.IDynamodbConfig|null);
/** Config primaryAccountAliasDisplayName */
primaryAccountAliasDisplayName?: (string|null);
/** Config awsConfigProfileName */
awsConfigProfileName?: (string|null);
/** Config additionalAccounts */
additionalAccounts?: (clutch.config.service.aws.v1.IAWSAccount[]|null);
}
 
/** Represents a Config. */
......@@ -9016,6 +9025,15 @@ export namespace clutch {
/** Config dynamodbConfig. */
public dynamodbConfig?: (clutch.config.service.aws.v1.IDynamodbConfig|null);
 
/** Config primaryAccountAliasDisplayName. */
public primaryAccountAliasDisplayName: string;
/** Config awsConfigProfileName. */
public awsConfigProfileName: string;
/** Config additionalAccounts. */
public additionalAccounts: clutch.config.service.aws.v1.IAWSAccount[];
/**
* Verifies a Config message.
* @param message Plain object to verify
......@@ -9206,6 +9224,72 @@ export namespace clutch {
*/
public toJSON(): { [k: string]: any };
}
/** Properties of a AWSAccount. */
interface IAWSAccount {
/** AWSAccount alias */
alias?: (string|null);
/** AWSAccount accountNumber */
accountNumber?: (string|null);
/** AWSAccount iamRole */
iamRole?: (string|null);
/** AWSAccount regions */
regions?: (string[]|null);
}
/** Represents a AWSAccount. */
class AWSAccount implements IAWSAccount {
/**
* Constructs a new AWSAccount.
* @param [properties] Properties to set
*/
constructor(properties?: clutch.config.service.aws.v1.IAWSAccount);
/** AWSAccount alias. */
public alias: string;
/** AWSAccount accountNumber. */
public accountNumber: string;
/** AWSAccount iamRole. */
public iamRole: string;
/** AWSAccount regions. */
public regions: string[];
/**
* Verifies a AWSAccount message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a AWSAccount message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns AWSAccount
*/
public static fromObject(object: { [k: string]: any }): clutch.config.service.aws.v1.AWSAccount;
/**
* Creates a plain object from a AWSAccount message. Also converts values to other types if specified.
* @param message AWSAccount
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: clutch.config.service.aws.v1.AWSAccount, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this AWSAccount to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
}
}
 
......@@ -21662,6 +21662,9 @@ export const clutch = $root.clutch = (() => {
* @property {Array.<string>|null} [regions] Config regions
* @property {clutch.config.service.aws.v1.IClientConfig|null} [clientConfig] Config clientConfig
* @property {clutch.config.service.aws.v1.IDynamodbConfig|null} [dynamodbConfig] Config dynamodbConfig
* @property {string|null} [primaryAccountAliasDisplayName] Config primaryAccountAliasDisplayName
* @property {string|null} [awsConfigProfileName] Config awsConfigProfileName
* @property {Array.<clutch.config.service.aws.v1.IAWSAccount>|null} [additionalAccounts] Config additionalAccounts
*/
 
/**
......@@ -21674,6 +21677,7 @@ export const clutch = $root.clutch = (() => {
*/
function Config(properties) {
this.regions = [];
this.additionalAccounts = [];
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
......@@ -21704,6 +21708,30 @@ export const clutch = $root.clutch = (() => {
*/
Config.prototype.dynamodbConfig = null;
 
/**
* Config primaryAccountAliasDisplayName.
* @member {string} primaryAccountAliasDisplayName
* @memberof clutch.config.service.aws.v1.Config
* @instance
*/
Config.prototype.primaryAccountAliasDisplayName = "";
/**
* Config awsConfigProfileName.
* @member {string} awsConfigProfileName
* @memberof clutch.config.service.aws.v1.Config
* @instance
*/
Config.prototype.awsConfigProfileName = "";
/**
* Config additionalAccounts.
* @member {Array.<clutch.config.service.aws.v1.IAWSAccount>} additionalAccounts
* @memberof clutch.config.service.aws.v1.Config
* @instance
*/
Config.prototype.additionalAccounts = $util.emptyArray;
/**
* Verifies a Config message.
* @function verify
......@@ -21732,6 +21760,21 @@ export const clutch = $root.clutch = (() => {
if (error)
return "dynamodbConfig." + error;
}
if (message.primaryAccountAliasDisplayName != null && message.hasOwnProperty("primaryAccountAliasDisplayName"))
if (!$util.isString(message.primaryAccountAliasDisplayName))
return "primaryAccountAliasDisplayName: string expected";
if (message.awsConfigProfileName != null && message.hasOwnProperty("awsConfigProfileName"))
if (!$util.isString(message.awsConfigProfileName))
return "awsConfigProfileName: string expected";
if (message.additionalAccounts != null && message.hasOwnProperty("additionalAccounts")) {
if (!Array.isArray(message.additionalAccounts))
return "additionalAccounts: array expected";
for (let i = 0; i < message.additionalAccounts.length; ++i) {
let error = $root.clutch.config.service.aws.v1.AWSAccount.verify(message.additionalAccounts[i]);
if (error)
return "additionalAccounts." + error;
}
}
return null;
};
 
......@@ -21764,6 +21807,20 @@ export const clutch = $root.clutch = (() => {
throw TypeError(".clutch.config.service.aws.v1.Config.dynamodbConfig: object expected");
message.dynamodbConfig = $root.clutch.config.service.aws.v1.DynamodbConfig.fromObject(object.dynamodbConfig);
}
if (object.primaryAccountAliasDisplayName != null)
message.primaryAccountAliasDisplayName = String(object.primaryAccountAliasDisplayName);
if (object.awsConfigProfileName != null)
message.awsConfigProfileName = String(object.awsConfigProfileName);
if (object.additionalAccounts) {
if (!Array.isArray(object.additionalAccounts))
throw TypeError(".clutch.config.service.aws.v1.Config.additionalAccounts: array expected");
message.additionalAccounts = [];
for (let i = 0; i < object.additionalAccounts.length; ++i) {
if (typeof object.additionalAccounts[i] !== "object")
throw TypeError(".clutch.config.service.aws.v1.Config.additionalAccounts: object expected");
message.additionalAccounts[i] = $root.clutch.config.service.aws.v1.AWSAccount.fromObject(object.additionalAccounts[i]);
}
}
return message;
};
 
......@@ -21780,11 +21837,15 @@ export const clutch = $root.clutch = (() => {
if (!options)
options = {};
let object = {};
if (options.arrays || options.defaults)
if (options.arrays || options.defaults) {
object.regions = [];
object.additionalAccounts = [];
}
if (options.defaults) {
object.clientConfig = null;
object.dynamodbConfig = null;
object.primaryAccountAliasDisplayName = "";
object.awsConfigProfileName = "";
}
if (message.regions && message.regions.length) {
object.regions = [];
......@@ -21795,6 +21856,15 @@ export const clutch = $root.clutch = (() => {
object.clientConfig = $root.clutch.config.service.aws.v1.ClientConfig.toObject(message.clientConfig, options);
if (message.dynamodbConfig != null && message.hasOwnProperty("dynamodbConfig"))
object.dynamodbConfig = $root.clutch.config.service.aws.v1.DynamodbConfig.toObject(message.dynamodbConfig, options);
if (message.primaryAccountAliasDisplayName != null && message.hasOwnProperty("primaryAccountAliasDisplayName"))
object.primaryAccountAliasDisplayName = message.primaryAccountAliasDisplayName;
if (message.awsConfigProfileName != null && message.hasOwnProperty("awsConfigProfileName"))
object.awsConfigProfileName = message.awsConfigProfileName;
if (message.additionalAccounts && message.additionalAccounts.length) {
object.additionalAccounts = [];
for (let j = 0; j < message.additionalAccounts.length; ++j)
object.additionalAccounts[j] = $root.clutch.config.service.aws.v1.AWSAccount.toObject(message.additionalAccounts[j], options);
}
return object;
};
 
......@@ -22197,6 +22267,172 @@ export const clutch = $root.clutch = (() => {
return ScalingLimits;
})();
 
v1.AWSAccount = (function() {
/**
* Properties of a AWSAccount.
* @memberof clutch.config.service.aws.v1
* @interface IAWSAccount
* @property {string|null} [alias] AWSAccount alias
* @property {string|null} [accountNumber] AWSAccount accountNumber
* @property {string|null} [iamRole] AWSAccount iamRole
* @property {Array.<string>|null} [regions] AWSAccount regions
*/
/**
* Constructs a new AWSAccount.
* @memberof clutch.config.service.aws.v1
* @classdesc Represents a AWSAccount.
* @implements IAWSAccount
* @constructor
* @param {clutch.config.service.aws.v1.IAWSAccount=} [properties] Properties to set
*/
function AWSAccount(properties) {
this.regions = [];
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* AWSAccount alias.
* @member {string} alias
* @memberof clutch.config.service.aws.v1.AWSAccount
* @instance
*/
AWSAccount.prototype.alias = "";
/**
* AWSAccount accountNumber.
* @member {string} accountNumber
* @memberof clutch.config.service.aws.v1.AWSAccount
* @instance
*/
AWSAccount.prototype.accountNumber = "";
/**
* AWSAccount iamRole.
* @member {string} iamRole
* @memberof clutch.config.service.aws.v1.AWSAccount
* @instance
*/
AWSAccount.prototype.iamRole = "";
/**
* AWSAccount regions.
* @member {Array.<string>} regions
* @memberof clutch.config.service.aws.v1.AWSAccount
* @instance
*/
AWSAccount.prototype.regions = $util.emptyArray;
/**
* Verifies a AWSAccount message.
* @function verify
* @memberof clutch.config.service.aws.v1.AWSAccount
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
AWSAccount.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.alias != null && message.hasOwnProperty("alias"))
if (!$util.isString(message.alias))
return "alias: string expected";
if (message.accountNumber != null && message.hasOwnProperty("accountNumber"))
if (!$util.isString(message.accountNumber))
return "accountNumber: string expected";
if (message.iamRole != null && message.hasOwnProperty("iamRole"))
if (!$util.isString(message.iamRole))
return "iamRole: string expected";
if (message.regions != null && message.hasOwnProperty("regions")) {
if (!Array.isArray(message.regions))
return "regions: array expected";
for (let i = 0; i < message.regions.length; ++i)
if (!$util.isString(message.regions[i]))
return "regions: string[] expected";
}
return null;
};
/**
* Creates a AWSAccount message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof clutch.config.service.aws.v1.AWSAccount
* @static
* @param {Object.<string,*>} object Plain object
* @returns {clutch.config.service.aws.v1.AWSAccount} AWSAccount
*/
AWSAccount.fromObject = function fromObject(object) {
if (object instanceof $root.clutch.config.service.aws.v1.AWSAccount)
return object;
let message = new $root.clutch.config.service.aws.v1.AWSAccount();
if (object.alias != null)
message.alias = String(object.alias);
if (object.accountNumber != null)
message.accountNumber = String(object.accountNumber);
if (object.iamRole != null)
message.iamRole = String(object.iamRole);
if (object.regions) {
if (!Array.isArray(object.regions))
throw TypeError(".clutch.config.service.aws.v1.AWSAccount.regions: array expected");
message.regions = [];
for (let i = 0; i < object.regions.length; ++i)
message.regions[i] = String(object.regions[i]);
}
return message;
};
/**
* Creates a plain object from a AWSAccount message. Also converts values to other types if specified.
* @function toObject
* @memberof clutch.config.service.aws.v1.AWSAccount
* @static
* @param {clutch.config.service.aws.v1.AWSAccount} message AWSAccount
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
AWSAccount.toObject = function toObject(message, options) {
if (!options)
options = {};
let object = {};
if (options.arrays || options.defaults)
object.regions = [];
if (options.defaults) {
object.alias = "";
object.accountNumber = "";
object.iamRole = "";
}
if (message.alias != null && message.hasOwnProperty("alias"))
object.alias = message.alias;
if (message.accountNumber != null && message.hasOwnProperty("accountNumber"))
object.accountNumber = message.accountNumber;
if (message.iamRole != null && message.hasOwnProperty("iamRole"))
object.iamRole = message.iamRole;
if (message.regions && message.regions.length) {
object.regions = [];
for (let j = 0; j < message.regions.length; ++j)
object.regions[j] = message.regions[j];
}
return object;
};
/**
* Converts this AWSAccount to JSON.
* @function toJSON
* @memberof clutch.config.service.aws.v1.AWSAccount
* @instance
* @returns {Object.<string,*>} JSON object
*/
AWSAccount.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return AWSAccount;
})();
return v1;
})();
 
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment