Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clutch
Commits
05d8f07a
Unverified
Commit
05d8f07a
authored
3 years ago
by
Mike Cutalo
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
aws: multi account support (#1873)
parent
6faeb14c
wrapperForTimeSeries2
FixCordonNotes
GA4
RHF
add-capacity-info
add-list-pr-gh-api
add-origin
add-tabledetails-notes
addCaseInsensitiveAutocomplete
addSgTimeout
addTimeoutForSG
allIcons
auditAPI
auditBE
auditFE
autoSubmit
autoSubmitResolvers
autocomplete-clear-value
callbackToSetIndex
caseInsens1
catalog-config-extension
catalog-ql-patch
changeGridLines
chartTests
clickAutocomplete
codecov
colorsFile
custom-title-logo
darkModeTest1
datetimevalid
ddb-scale-factor-fix
deletePodLocationNotes
direct-client
docshousekeeping
downloadConfigEnvoy
dschaller-patch-1
dschaller-patch-2
dschaller-patch-3
dynamodb-status-chips
enable-partial-failures-for-pods
envoyTriageViaK8sDash
errorBoundaryLocation
eslintdocs
expSimplification
exportEmotionThings
expose-k8s-clientsets
feedbackMaxLength
first-of-type-fix
firstgogogo
fix-autocomplete-project-catalog
fix-github-app-auth-refresh
fixAlignOfIcons
fixDASHSpacing
fixDashSpacingPart1
frontend-autocomplete-patch
frontend-catalog-navigate-patch
frontend-highlight-parent
frontend-project-selector-patch
frontend-warning-extension
gcp-0.10.3
get-logs
ghrl
go-1-18
go-1.19-in-ci
go-actions-1-18
golangci
goworkspace
hooksForAutoRefresh
horizontalExpansion
housekeepingclutch
inputTransformers
jest-coverage-fix
jg/github
jslaughter-patch-1
k8sDashAutosubmit
license-update
load-state-error
lowercaseAutocomplete
main
matv5
matv5-base
matv5-core
matv5-core-input
matv5-core-layout
matv5-joined
matv5-wizard
matv5-workflows
metricsAPI
metricsProtos
minimistClutch
moarTests
moartests
mockProjects
mui-5-upgrade
mui-v5
mui-v5-codemods
mui-v5-core
mui5
muiv5-upgrade
nodeNameInCordonNode
nps-anytime
nps-collector
nps-custom-patch
openSourceReactMarkdownPane
otherEventTimes
override-search
paperMinWidth
pcDefaultProjects
pcResetState
pcSearch
pcSubtext
project-api-mocks
project-api-optional-compute-deps
project-catalog
project-catalog-config-patch
project-catalog-config-skeleton
project-catalog-details
project-catalog-scaffold
project-selector-autocomplete
project-selector-testing
proto-get-endpoint
protoForDeploys
qLinks1
qLinksF
qLinksForProjSelector
quickLinks1
quicklinks1
refreshDropdown
reloadIntervalForProjSelector
remove-utm-params
removeBottomFeedbackButton
removeIcon
renderTestTimeseriesChart
renovate-patch
renovate/actions-setup-node-3.x
renovate/actions-stale-6.x
renovate/actions-upload-artifact-3.x
renovate/babel-monorepo
renovate/cypress-10.x
renovate/cypress-9.x
renovate/docker-build-push-action-3.x
renovate/docker-login-action-2.x
renovate/docker-setup-buildx-action-2.x
renovate/esbuild-0.x
renovate/eslint-plugin-jest-26.x
renovate/font-awesome
renovate/github.com-aws-aws-sdk-go-v2-1.x
renovate/github.com-aws-aws-sdk-go-v2-config-1.x
renovate/github.com-aws-aws-sdk-go-v2-credentials-1.x
renovate/github.com-aws-aws-sdk-go-v2-service-autoscaling-1.x
renovate/github.com-aws-aws-sdk-go-v2-service-kinesis-1.x
renovate/github.com-aws-aws-sdk-go-v2-service-s3-1.x
renovate/github.com-aws-smithy-go-1.x
renovate/github.com-bufbuild-buf-1.x
renovate/github.com-coreos-go-oidc-v3-3.x
renovate/github.com-envoyproxy-protoc-gen-validate-0.x
renovate/github.com-gogo-status-1.x
renovate/github.com-golang-migrate-migrate-v4-4.x
renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x
renovate/github.com-jhump-protoreflect-1.x
renovate/github.com-lib-pq-1.x
renovate/github.com-masterminds-squirrel-1.x
renovate/github.com-shurcool-githubv4-digest
renovate/github.com-shurcool-graphql-digest
renovate/github.com-slack-go-slack-0.x
renovate/github.com-stretchr-testify-1.x
renovate/github.com-uber-go-tally-v4-4.x
renovate/github.com-yoheimuta-go-protoparser-v4-4.x
renovate/go-1.x
renovate/go.temporal.io-sdk-1.x
renovate/go.temporal.io-sdk-contrib-tally-0.x
renovate/go.uber.org-zap-1.x
renovate/golang-1.x
renovate/golang.org-x-net-digest
renovate/google.golang.org-genproto-digest
renovate/google.golang.org-grpc-1.x
renovate/google.golang.org-grpc-cmd-protoc-gen-go-grpc-1.x
renovate/google.golang.org-protobuf-1.x
renovate/hookform-devtools-3.x
renovate/hookform-devtools-4.x
renovate/hookform-resolvers-2.x
renovate/k8s.io-api-0.x
renovate/k8s.io-apimachinery-0.x
renovate/k8s.io-client-go-0.x
renovate/k8s.io-utils-digest
renovate/kubernetes-go
renovate/lock-file-maintenance
renovate/major-1-kubernetes-go
renovate/major-10-definitelytyped
renovate/major-10-kubernetes-go
renovate/major-11-kubernetes-go
renovate/major-18-definitelytyped
renovate/major-18-react-monorepo
renovate/major-19-eslint
renovate/major-2-kubernetes-go
renovate/major-27-definitelytyped
renovate/major-27-unittest
renovate/major-28-definitelytyped
renovate/major-28-unittest
renovate/major-29-definitelytyped
renovate/major-3-kubernetes-go
renovate/major-4-eslint
renovate/major-6-font-awesome
renovate/major-8-eslint
renovate/material-table-1.x
renovate/material-table-2.x
renovate/nivo-monorepo
renovate/node-16.x
renovate/node-17.x
renovate/node-18.x
renovate/node-19.x
renovate/npm-axios-vulnerability
renovate/npm-prismjs-vulnerability
renovate/npm-protobufjs-vulnerability
renovate/postgres-15.x
renovate/react-hook-thunk-reducer-0.x
renovate/react-scripts-5.x
renovate/webpack-4.x
replaceNivoWithRechartsForEnvoy
responsiveTable
return-partial-errors
revert-2270-addCaseInsensitiveAutocomplete
revert-2348-timeago-patch
safetyCheckForAccounts
scaffold-non-wizard
scaffold-update
scaffoldingYarn
scatterPlotTimeline
select-grouping
select-patch
shortlink-protos
shortlink-scaffolding
shortlink-wip
sl-bug-fix
sl-patch
slowloris
smonero-patch-1
spacingAdjustment
sperry-SubmitFeedback-API
sperry-add-prop
sperry-autocomplete-fix-experimentations
sperry-enableFeedback-prop
sperry-feedback-docs
sperry-globally-enable-wizard
sperry-project-links-proto
sperry-project-selector-autocomplete
sperry-query-params
sperry-remove-npswizard-featureflag
sperry-resize-hpa-notes
sperry-stats-prefix
sperry-update-package
state-hydration
state-hydration-alerts
state-hydration-selector
state-hydration-short-links
state-hydration-storage
supportStylingOfCharts
temporal-client
tfAdornment
themeProvider
timeago-component
todosPublic
toggleButtonGroup
toggleTest
transientProps
trimPrefixForAWS
typographyNoWrap
typographyfix
update-card-styling
updatePodEventProto
validate-pattern-at-runtime
wrapper2
wrapperForTimeSeries
No related merge requests found
Changes
45
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
api/aws/dynamodb/v1/dynamodb.proto
+8
-2
api/aws/dynamodb/v1/dynamodb.proto
api/aws/ec2/v1/ec2.proto
+12
-6
api/aws/ec2/v1/ec2.proto
api/aws/kinesis/v1/kinesis.proto
+9
-5
api/aws/kinesis/v1/kinesis.proto
api/resolver/aws/v1/aws.proto
+22
-1
api/resolver/aws/v1/aws.proto
backend/api/aws/dynamodb/v1/dynamodb.pb.go
+152
-120
backend/api/aws/dynamodb/v1/dynamodb.pb.go
backend/api/aws/dynamodb/v1/dynamodb.pb.validate.go
+24
-0
backend/api/aws/dynamodb/v1/dynamodb.pb.validate.go
backend/api/aws/ec2/v1/ec2.pb.go
+259
-195
backend/api/aws/ec2/v1/ec2.pb.go
backend/api/aws/ec2/v1/ec2.pb.validate.go
+48
-0
backend/api/aws/ec2/v1/ec2.pb.validate.go
backend/api/aws/kinesis/v1/kinesis.pb.go
+93
-58
backend/api/aws/kinesis/v1/kinesis.pb.go
backend/api/aws/kinesis/v1/kinesis.pb.validate.go
+64
-4
backend/api/aws/kinesis/v1/kinesis.pb.validate.go
backend/api/resolver/aws/v1/aws.pb.go
+89
-44
backend/api/resolver/aws/v1/aws.pb.go
backend/api/resolver/aws/v1/aws.pb.validate.go
+8
-0
backend/api/resolver/aws/v1/aws.pb.validate.go
backend/gateway/meta/meta_test.go
+12
-16
backend/gateway/meta/meta_test.go
backend/gateway/mux/mux.go
+1
-0
backend/gateway/mux/mux.go
backend/mock/service/awsmock/awsmock.go
+70
-17
backend/mock/service/awsmock/awsmock.go
backend/module/aws/ec2.go
+5
-5
backend/module/aws/ec2.go
backend/module/dynamodb/dynamodb.go
+2
-2
backend/module/dynamodb/dynamodb.go
backend/module/kinesis/kinesis.go
+2
-2
backend/module/kinesis/kinesis.go
backend/resolver/aws/asg.go
+17
-15
backend/resolver/aws/asg.go
backend/resolver/aws/aws.go
+42
-17
backend/resolver/aws/aws.go
with
939 additions
and
509 deletions
+939
-509
api/aws/dynamodb/v1/dynamodb.proto
+
8
-
2
View file @
05d8f07a
...
...
@@ -31,7 +31,7 @@ service DDBAPI {
message
Table
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.dynamodb.v1.Table"
,
pattern
:
"{region}/{name}"
pattern
:
"{
account}/{
region}/{name}"
};
// Enum representing the status of a table.
...
...
@@ -101,6 +101,9 @@ message Table {
// Table billing mode.
BillingMode
billing_mode
=
6
;
// The aws acccount
string
account
=
7
;
}
// A global secondary index.
...
...
@@ -152,6 +155,7 @@ message Throughput {
message
DescribeTableRequest
{
string
table_name
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
account
=
3
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
// The result of requesting a table.
...
...
@@ -167,13 +171,15 @@ message DescribeTableResponse {
message
UpdateCapacityRequest
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.dynamodb.v1.Table"
,
pattern
:
"{region}/{table_name}"
pattern
:
"{
account}/{
region}/{table_name}"
};
string
table_name
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
Throughput
table_throughput
=
3
;
repeated
IndexUpdateAction
gsi_updates
=
4
;
bool
ignore_maximums
=
5
;
string
account
=
6
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
// The result of requesting a capacity update.
...
...
This diff is collapsed.
Click to expand it.
api/aws/ec2/v1/ec2.proto
+
12
-
6
View file @
05d8f07a
...
...
@@ -52,13 +52,14 @@ message AutoscalingGroupSize {
message
ResizeAutoscalingGroupRequest
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.AutoscalingGroup"
,
pattern
:
"{region}/{name}"
pattern
:
"{
account}/{
region}/{name}"
};
string
name
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
AutoscalingGroupSize
size
=
3
[
(
validate.rules
)
.
message
=
{
required
:
true
}
];
string
account
=
4
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
ResizeAutoscalingGroupResponse
{
...
...
@@ -67,7 +68,7 @@ message ResizeAutoscalingGroupResponse {
message
AutoscalingGroup
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.AutoscalingGroup"
,
pattern
:
"{region}/{name}"
pattern
:
"{
account}/{
region}/{name}"
};
string
name
=
1
;
...
...
@@ -118,16 +119,18 @@ message AutoscalingGroup {
}
repeated
Instance
instances
=
6
;
string
account
=
7
;
}
message
GetInstanceRequest
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.Instance"
,
pattern
:
"{region}/{instance_id}"
pattern
:
"{
account}{
region}/{instance_id}"
};
string
instance_id
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
account
=
3
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
GetInstanceResponse
{
...
...
@@ -139,11 +142,12 @@ message GetInstanceResponse {
message
TerminateInstanceRequest
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.Instance"
,
pattern
:
"{region}/{instance_id}"
pattern
:
"{
account}/{
region}/{instance_id}"
};
string
instance_id
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
account
=
3
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
TerminateInstanceResponse
{
...
...
@@ -152,11 +156,12 @@ message TerminateInstanceResponse {
message
RebootInstanceRequest
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.Instance"
,
pattern
:
"{region}/{instance_id}"
pattern
:
"{
account}/{
region}/{instance_id}"
};
string
instance_id
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
account
=
3
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
RebootInstanceResponse
{
...
...
@@ -165,7 +170,7 @@ message RebootInstanceResponse {
message
Instance
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.ec2.v1.Instance"
,
pattern
:
"{region}/{instance_id}"
pattern
:
"{
account}/{
region}/{instance_id}"
};
string
instance_id
=
1
;
...
...
@@ -192,4 +197,5 @@ message Instance {
string
availability_zone
=
7
;
map
<
string
,
string
>
tags
=
8
;
string
account
=
9
;
}
This diff is collapsed.
Click to expand it.
api/aws/kinesis/v1/kinesis.proto
+
9
-
5
View file @
05d8f07a
...
...
@@ -5,6 +5,7 @@ package clutch.aws.kinesis.v1;
option
go_package
=
"github.com/lyft/clutch/backend/api/aws/kinesis/v1;kinesisv1"
;
import
"google/api/annotations.proto"
;
import
"validate/validate.proto"
;
import
"api/v1/annotations.proto"
;
...
...
@@ -27,8 +28,9 @@ service KinesisAPI {
}
message
GetStreamRequest
{
string
stream_name
=
1
;
string
region
=
2
;
string
stream_name
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
string
account
=
3
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
GetStreamResponse
{
...
...
@@ -38,9 +40,10 @@ message GetStreamResponse {
}
message
UpdateShardCountRequest
{
string
stream_name
=
1
;
string
region
=
2
;
string
stream_name
=
1
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
]
;
string
region
=
2
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
]
;
int32
target_shard_count
=
3
;
string
account
=
4
[
(
validate.rules
)
.
string
=
{
min_bytes
:
1
}
];
}
message
UpdateShardCountResponse
{
...
...
@@ -49,10 +52,11 @@ message UpdateShardCountResponse {
message
Stream
{
option
(
clutch.api.v1.id
)
.
patterns
=
{
type_url
:
"clutch.aws.kinesis.v1.Stream"
,
pattern
:
"{region}/{stream_name}"
pattern
:
"{
account}/{
region}/{stream_name}"
};
string
stream_name
=
1
;
string
region
=
2
;
int32
current_shard_count
=
3
;
string
account
=
4
;
}
This diff is collapsed.
Click to expand it.
api/resolver/aws/v1/aws.proto
+
22
-
1
View file @
05d8f07a
...
...
@@ -21,10 +21,16 @@ message InstanceID {
placeholder
:
"i-1234567890"
,
},
}
];
string
region
=
2
[
(
clutch.resolver.v1.schema_field
)
=
{
display_name
:
"Region"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"regions"
},
}
];
string
account
=
3
[
(
clutch.resolver.v1.schema_field
)
=
{
display_name
:
"Account"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"accounts"
},
}
];
}
message
AutoscalingGroupName
{
...
...
@@ -45,6 +51,11 @@ message AutoscalingGroupName {
display_name
:
"Region"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"regions"
},
}
];
string
account
=
3
[
(
clutch.resolver.v1.schema_field
)
=
{
display_name
:
"Account"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"accounts"
},
}
];
}
message
KinesisStreamName
{
...
...
@@ -65,6 +76,11 @@ message KinesisStreamName {
display_name
:
"Region"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"regions"
},
}
];
string
account
=
3
[
(
clutch.resolver.v1.schema_field
)
=
{
display_name
:
"Account"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"accounts"
},
}
];
}
message
DynamodbTableName
{
...
...
@@ -85,4 +101,9 @@ message DynamodbTableName {
display_name
:
"Region"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"regions"
},
}
];
}
\ No newline at end of file
string
account
=
3
[
(
clutch.resolver.v1.schema_field
)
=
{
display_name
:
"Account"
,
option_field
:
{
include_all_option
:
true
,
include_dynamic_options
:
"accounts"
},
}
];
}
This diff is collapsed.
Click to expand it.
backend/api/aws/dynamodb/v1/dynamodb.pb.go
+
152
-
120
View file @
05d8f07a
This diff is collapsed.
Click to expand it.
backend/api/aws/dynamodb/v1/dynamodb.pb.validate.go
+
24
-
0
View file @
05d8f07a
...
...
@@ -127,6 +127,8 @@ func (m *Table) validate(all bool) error {
// no validation rules for BillingMode
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
TableMultiError
(
errors
)
}
...
...
@@ -615,6 +617,17 @@ func (m *DescribeTableRequest) validate(all bool) error {
errors
=
append
(
errors
,
err
)
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
DescribeTableRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
DescribeTableRequestMultiError
(
errors
)
}
...
...
@@ -933,6 +946,17 @@ func (m *UpdateCapacityRequest) validate(all bool) error {
// no validation rules for IgnoreMaximums
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
UpdateCapacityRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
UpdateCapacityRequestMultiError
(
errors
)
}
...
...
This diff is collapsed.
Click to expand it.
backend/api/aws/ec2/v1/ec2.pb.go
+
259
-
195
View file @
05d8f07a
This diff is collapsed.
Click to expand it.
backend/api/aws/ec2/v1/ec2.pb.validate.go
+
48
-
0
View file @
05d8f07a
...
...
@@ -226,6 +226,17 @@ func (m *ResizeAutoscalingGroupRequest) validate(all bool) error {
}
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
ResizeAutoscalingGroupRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
ResizeAutoscalingGroupRequestMultiError
(
errors
)
}
...
...
@@ -497,6 +508,8 @@ func (m *AutoscalingGroup) validate(all bool) error {
}
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
AutoscalingGroupMultiError
(
errors
)
}
...
...
@@ -618,6 +631,17 @@ func (m *GetInstanceRequest) validate(all bool) error {
errors
=
append
(
errors
,
err
)
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
GetInstanceRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
GetInstanceRequestMultiError
(
errors
)
}
...
...
@@ -871,6 +895,17 @@ func (m *TerminateInstanceRequest) validate(all bool) error {
errors
=
append
(
errors
,
err
)
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
TerminateInstanceRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
TerminateInstanceRequestMultiError
(
errors
)
}
...
...
@@ -1095,6 +1130,17 @@ func (m *RebootInstanceRequest) validate(all bool) error {
errors
=
append
(
errors
,
err
)
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
RebootInstanceRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
RebootInstanceRequestMultiError
(
errors
)
}
...
...
@@ -1313,6 +1359,8 @@ func (m *Instance) validate(all bool) error {
// no validation rules for Tags
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
InstanceMultiError
(
errors
)
}
...
...
This diff is collapsed.
Click to expand it.
backend/api/aws/kinesis/v1/kinesis.pb.go
+
93
-
58
View file @
05d8f07a
...
...
@@ -7,6 +7,7 @@
package
kinesisv1
import
(
_
"github.com/envoyproxy/protoc-gen-validate/validate"
_
"github.com/lyft/clutch/backend/api/api/v1"
_
"google.golang.org/genproto/googleapis/api/annotations"
protoreflect
"google.golang.org/protobuf/reflect/protoreflect"
...
...
@@ -29,6 +30,7 @@ type GetStreamRequest struct {
StreamName
string
`protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Account
string
`protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
GetStreamRequest
)
Reset
()
{
...
...
@@ -77,6 +79,13 @@ func (x *GetStreamRequest) GetRegion() string {
return
""
}
func
(
x
*
GetStreamRequest
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
type
GetStreamResponse
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
...
...
@@ -132,6 +141,7 @@ type UpdateShardCountRequest struct {
StreamName
string
`protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
TargetShardCount
int32
`protobuf:"varint,3,opt,name=target_shard_count,json=targetShardCount,proto3" json:"target_shard_count,omitempty"`
Account
string
`protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
UpdateShardCountRequest
)
Reset
()
{
...
...
@@ -187,6 +197,13 @@ func (x *UpdateShardCountRequest) GetTargetShardCount() int32 {
return
0
}
func
(
x
*
UpdateShardCountRequest
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
type
UpdateShardCountResponse
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
...
...
@@ -233,6 +250,7 @@ type Stream struct {
StreamName
string
`protobuf:"bytes,1,opt,name=stream_name,json=streamName,proto3" json:"stream_name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
CurrentShardCount
int32
`protobuf:"varint,3,opt,name=current_shard_count,json=currentShardCount,proto3" json:"current_shard_count,omitempty"`
Account
string
`protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
Stream
)
Reset
()
{
...
...
@@ -288,6 +306,13 @@ func (x *Stream) GetCurrentShardCount() int32 {
return
0
}
func
(
x
*
Stream
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
var
File_aws_kinesis_v1_kinesis_proto
protoreflect
.
FileDescriptor
var
file_aws_kinesis_v1_kinesis_proto_rawDesc
=
[]
byte
{
...
...
@@ -296,65 +321,75 @@ var file_aws_kinesis_v1_kinesis_proto_rawDesc = []byte{
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x1a
,
0x1c
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x1a
,
0x18
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x22
,
0x4b
,
0x0a
,
0x10
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x1f
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x58
,
0x0a
,
0x11
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x35
,
0x0a
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x1d
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x3a
,
0x0c
,
0xaa
,
0xe1
,
0x1c
,
0x08
,
0x0a
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x22
,
0x80
,
0x01
,
0x0a
,
0x17
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x1f
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x2c
,
0x0a
,
0x12
,
0x74
,
0x61
,
0x72
,
0x67
,
0x65
,
0x74
,
0x5f
,
0x73
,
0x68
,
0x61
,
0x72
,
0x64
,
0x5f
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x10
,
0x74
,
0x61
,
0x72
,
0x67
,
0x65
,
0x74
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x1a
,
0x0a
,
0x18
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0xaf
,
0x01
,
0x0a
,
0x06
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x1f
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x2e
,
0x0a
,
0x13
,
0x63
,
0x75
,
0x72
,
0x72
,
0x65
,
0x6e
,
0x74
,
0x5f
,
0x73
,
0x68
,
0x61
,
0x72
,
0x64
,
0x5f
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x11
,
0x63
,
0x75
,
0x72
,
0x72
,
0x65
,
0x6e
,
0x74
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x3c
,
0xb2
,
0xe1
,
0x1c
,
0x38
,
0x0a
,
0x36
,
0x0a
,
0x1c
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x16
,
0x7b
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x7d
,
0x2f
,
0x7b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x7d
,
0x32
,
0xc2
,
0x02
,
0x0a
,
0x0a
,
0x4b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x41
,
0x50
,
0x49
,
0x12
,
0x8a
,
0x01
,
0x0a
,
0x09
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x27
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x28
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x2a
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1e
,
0x22
,
0x19
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x67
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x3a
,
0x01
,
0x2a
,
0xaa
,
0xe1
,
0x1c
,
0x02
,
0x08
,
0x02
,
0x12
,
0xa6
,
0x01
,
0x0a
,
0x10
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x2e
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x2f
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x6f
,
0x74
,
0x6f
,
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
,
0x1a
,
0x18
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x22
,
0x80
,
0x01
,
0x0a
,
0x10
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x28
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x1f
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x21
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x58
,
0x0a
,
0x11
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x35
,
0x0a
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x1d
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x3a
,
0x0c
,
0xaa
,
0xe1
,
0x1c
,
0x08
,
0x0a
,
0x06
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x22
,
0xb5
,
0x01
,
0x0a
,
0x17
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x28
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x1f
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x2c
,
0x0a
,
0x12
,
0x74
,
0x61
,
0x72
,
0x67
,
0x65
,
0x74
,
0x5f
,
0x73
,
0x68
,
0x61
,
0x72
,
0x64
,
0x5f
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x10
,
0x74
,
0x61
,
0x72
,
0x67
,
0x65
,
0x74
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x21
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x04
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x07
,
0xfa
,
0x42
,
0x04
,
0x72
,
0x02
,
0x20
,
0x01
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x1a
,
0x0a
,
0x18
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x31
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x25
,
0x22
,
0x20
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x01
,
0x2a
,
0xaa
,
0xe1
,
0x1c
,
0x02
,
0x08
,
0x03
,
0x42
,
0x3d
,
0x5a
,
0x3b
,
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
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x76
,
0x31
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0xd3
,
0x01
,
0x0a
,
0x06
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x1f
,
0x0a
,
0x0b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0a
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x2e
,
0x0a
,
0x13
,
0x63
,
0x75
,
0x72
,
0x72
,
0x65
,
0x6e
,
0x74
,
0x5f
,
0x73
,
0x68
,
0x61
,
0x72
,
0x64
,
0x5f
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x11
,
0x63
,
0x75
,
0x72
,
0x72
,
0x65
,
0x6e
,
0x74
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x18
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x04
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x46
,
0xb2
,
0xe1
,
0x1c
,
0x42
,
0x0a
,
0x40
,
0x0a
,
0x1c
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x20
,
0x7b
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x7d
,
0x2f
,
0x7b
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x7d
,
0x2f
,
0x7b
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x5f
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x7d
,
0x32
,
0xc2
,
0x02
,
0x0a
,
0x0a
,
0x4b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x41
,
0x50
,
0x49
,
0x12
,
0x8a
,
0x01
,
0x0a
,
0x09
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x12
,
0x27
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x28
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x2a
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x1e
,
0x22
,
0x19
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x67
,
0x65
,
0x74
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x3a
,
0x01
,
0x2a
,
0xaa
,
0xe1
,
0x1c
,
0x02
,
0x08
,
0x02
,
0x12
,
0xa6
,
0x01
,
0x0a
,
0x10
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x2e
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x2f
,
0x2e
,
0x63
,
0x6c
,
0x75
,
0x74
,
0x63
,
0x68
,
0x2e
,
0x61
,
0x77
,
0x73
,
0x2e
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2e
,
0x76
,
0x31
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x31
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x25
,
0x22
,
0x20
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x75
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x53
,
0x68
,
0x61
,
0x72
,
0x64
,
0x43
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x01
,
0x2a
,
0xaa
,
0xe1
,
0x1c
,
0x02
,
0x08
,
0x03
,
0x42
,
0x3d
,
0x5a
,
0x3b
,
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
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x76
,
0x31
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
var
(
...
...
This diff is collapsed.
Click to expand it.
backend/api/aws/kinesis/v1/kinesis.pb.validate.go
+
64
-
4
View file @
05d8f07a
...
...
@@ -57,9 +57,38 @@ func (m *GetStreamRequest) validate(all bool) error {
var
errors
[]
error
// no validation rules for StreamName
if
len
(
m
.
GetStreamName
())
<
1
{
err
:=
GetStreamRequestValidationError
{
field
:
"StreamName"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
// no validation rules for Region
if
len
(
m
.
GetRegion
())
<
1
{
err
:=
GetStreamRequestValidationError
{
field
:
"Region"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
GetStreamRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
GetStreamRequestMultiError
(
errors
)
...
...
@@ -290,12 +319,41 @@ func (m *UpdateShardCountRequest) validate(all bool) error {
var
errors
[]
error
// no validation rules for StreamName
if
len
(
m
.
GetStreamName
())
<
1
{
err
:=
UpdateShardCountRequestValidationError
{
field
:
"StreamName"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
// no validation rules for Region
if
len
(
m
.
GetRegion
())
<
1
{
err
:=
UpdateShardCountRequestValidationError
{
field
:
"Region"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
// no validation rules for TargetShardCount
if
len
(
m
.
GetAccount
())
<
1
{
err
:=
UpdateShardCountRequestValidationError
{
field
:
"Account"
,
reason
:
"value length must be at least 1 bytes"
,
}
if
!
all
{
return
err
}
errors
=
append
(
errors
,
err
)
}
if
len
(
errors
)
>
0
{
return
UpdateShardCountRequestMultiError
(
errors
)
}
...
...
@@ -503,6 +561,8 @@ func (m *Stream) validate(all bool) error {
// no validation rules for CurrentShardCount
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
StreamMultiError
(
errors
)
}
...
...
This diff is collapsed.
Click to expand it.
backend/api/resolver/aws/v1/aws.pb.go
+
89
-
44
View file @
05d8f07a
...
...
@@ -27,8 +27,9 @@ type InstanceID struct {
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Id
string
`protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Id
string
`protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Account
string
`protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
InstanceID
)
Reset
()
{
...
...
@@ -77,13 +78,21 @@ func (x *InstanceID) GetRegion() string {
return
""
}
func
(
x
*
InstanceID
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
type
AutoscalingGroupName
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Account
string
`protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
AutoscalingGroupName
)
Reset
()
{
...
...
@@ -132,13 +141,21 @@ func (x *AutoscalingGroupName) GetRegion() string {
return
""
}
func
(
x
*
AutoscalingGroupName
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
type
KinesisStreamName
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Account
string
`protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
KinesisStreamName
)
Reset
()
{
...
...
@@ -187,13 +204,21 @@ func (x *KinesisStreamName) GetRegion() string {
return
""
}
func
(
x
*
KinesisStreamName
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
type
DynamodbTableName
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Region
string
`protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Account
string
`protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
}
func
(
x
*
DynamodbTableName
)
Reset
()
{
...
...
@@ -242,6 +267,13 @@ func (x *DynamodbTableName) GetRegion() string {
return
""
}
func
(
x
*
DynamodbTableName
)
GetAccount
()
string
{
if
x
!=
nil
{
return
x
.
Account
}
return
""
}
var
File_resolver_aws_v1_aws_proto
protoreflect
.
FileDescriptor
var
file_resolver_aws_v1_aws_proto_rawDesc
=
[]
byte
{
...
...
@@ -252,48 +284,61 @@ var file_resolver_aws_v1_aws_proto_rawDesc = []byte{
0x6f
,
0x62
,
0x75
,
0x66
,
0x2f
,
0x64
,
0x65
,
0x73
,
0x63
,
0x72
,
0x69
,
0x70
,
0x74
,
0x6f
,
0x72
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x1a
,
0x1d
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x6c
,
0x76
,
0x65
,
0x72
,
0x2f
,
0x76
,
0x31
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x22
,
0x
82
,
0x01
,
0x0a
,
0x0a
,
0x49
,
0x6e
,
0x73
,
0x74
,
0x61
,
0x6e
,
0x63
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x22
,
0x
b9
,
0x01
,
0x0a
,
0x0a
,
0x49
,
0x6e
,
0x73
,
0x74
,
0x61
,
0x6e
,
0x63
,
0x65
,
0x49
,
0x44
,
0x12
,
0x2a
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x1a
,
0xea
,
0x9f
,
0x1d
,
0x16
,
0x0a
,
0x02
,
0x49
,
0x44
,
0x10
,
0x01
,
0x1a
,
0x0e
,
0x0a
,
0x0c
,
0x69
,
0x2d
,
0x31
,
0x32
,
0x33
,
0x34
,
0x35
,
0x36
,
0x37
,
0x38
,
0x39
,
0x30
,
0x52
,
0x02
,
0x69
,
0x64
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x3a
,
0x15
,
0xea
,
0x9f
,
0x1d
,
0x11
,
0x0a
,
0x0b
,
0x69
,
0x6e
,
0x73
,
0x74
,
0x61
,
0x6e
,
0x63
,
0x65
,
0x20
,
0x49
,
0x44
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0x98
,
0x01
,
0x0a
,
0x14
,
0x41
,
0x75
,
0x74
,
0x6f
,
0x73
,
0x63
,
0x61
,
0x6c
,
0x69
,
0x6e
,
0x67
,
0x47
,
0x72
,
0x6f
,
0x75
,
0x70
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3d
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x29
,
0xea
,
0x9f
,
0x1d
,
0x25
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x1b
,
0x0a
,
0x19
,
0x6d
,
0x79
,
0x2d
,
0x61
,
0x75
,
0x74
,
0x6f
,
0x73
,
0x63
,
0x61
,
0x6c
,
0x69
,
0x6e
,
0x67
,
0x2d
,
0x67
,
0x72
,
0x6f
,
0x75
,
0x70
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0x92
,
0x01
,
0x0a
,
0x11
,
0x4b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x26
,
0xea
,
0x9f
,
0x1d
,
0x22
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x18
,
0x0a
,
0x16
,
0x6d
,
0x79
,
0x2d
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2d
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0x92
,
0x01
,
0x0a
,
0x11
,
0x44
,
0x79
,
0x6e
,
0x61
,
0x6d
,
0x6f
,
0x64
,
0x62
,
0x54
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x26
,
0xea
,
0x9f
,
0x1d
,
0x22
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x18
,
0x0a
,
0x16
,
0x6d
,
0x79
,
0x2d
,
0x64
,
0x79
,
0x6e
,
0x61
,
0x6d
,
0x6f
,
0x64
,
0x62
,
0x2d
,
0x74
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x42
,
0x3a
,
0x5a
,
0x38
,
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
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x6c
,
0x76
,
0x65
,
0x72
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x61
,
0x77
,
0x73
,
0x76
,
0x31
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x6f
,
0x6e
,
0x12
,
0x35
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x1b
,
0xea
,
0x9f
,
0x1d
,
0x17
,
0x0a
,
0x07
,
0x41
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x0c
,
0x08
,
0x01
,
0x12
,
0x08
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x73
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x15
,
0xea
,
0x9f
,
0x1d
,
0x11
,
0x0a
,
0x0b
,
0x69
,
0x6e
,
0x73
,
0x74
,
0x61
,
0x6e
,
0x63
,
0x65
,
0x20
,
0x49
,
0x44
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0xcf
,
0x01
,
0x0a
,
0x14
,
0x41
,
0x75
,
0x74
,
0x6f
,
0x73
,
0x63
,
0x61
,
0x6c
,
0x69
,
0x6e
,
0x67
,
0x47
,
0x72
,
0x6f
,
0x75
,
0x70
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3d
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x29
,
0xea
,
0x9f
,
0x1d
,
0x25
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x1b
,
0x0a
,
0x19
,
0x6d
,
0x79
,
0x2d
,
0x61
,
0x75
,
0x74
,
0x6f
,
0x73
,
0x63
,
0x61
,
0x6c
,
0x69
,
0x6e
,
0x67
,
0x2d
,
0x67
,
0x72
,
0x6f
,
0x75
,
0x70
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x35
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x1b
,
0xea
,
0x9f
,
0x1d
,
0x17
,
0x0a
,
0x07
,
0x41
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x0c
,
0x08
,
0x01
,
0x12
,
0x08
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x73
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0xc9
,
0x01
,
0x0a
,
0x11
,
0x4b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x53
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x26
,
0xea
,
0x9f
,
0x1d
,
0x22
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x18
,
0x0a
,
0x16
,
0x6d
,
0x79
,
0x2d
,
0x6b
,
0x69
,
0x6e
,
0x65
,
0x73
,
0x69
,
0x73
,
0x2d
,
0x73
,
0x74
,
0x72
,
0x65
,
0x61
,
0x6d
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x35
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x1b
,
0xea
,
0x9f
,
0x1d
,
0x17
,
0x0a
,
0x07
,
0x41
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x0c
,
0x08
,
0x01
,
0x12
,
0x08
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x73
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x22
,
0xc9
,
0x01
,
0x0a
,
0x11
,
0x44
,
0x79
,
0x6e
,
0x61
,
0x6d
,
0x6f
,
0x64
,
0x62
,
0x54
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x3a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x26
,
0xea
,
0x9f
,
0x1d
,
0x22
,
0x0a
,
0x04
,
0x4e
,
0x61
,
0x6d
,
0x65
,
0x10
,
0x01
,
0x1a
,
0x18
,
0x0a
,
0x16
,
0x6d
,
0x79
,
0x2d
,
0x64
,
0x79
,
0x6e
,
0x61
,
0x6d
,
0x6f
,
0x64
,
0x62
,
0x2d
,
0x74
,
0x61
,
0x62
,
0x6c
,
0x65
,
0x2d
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x52
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x19
,
0xea
,
0x9f
,
0x1d
,
0x15
,
0x0a
,
0x06
,
0x52
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x22
,
0x0b
,
0x08
,
0x01
,
0x12
,
0x07
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x52
,
0x06
,
0x72
,
0x65
,
0x67
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x35
,
0x0a
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x42
,
0x1b
,
0xea
,
0x9f
,
0x1d
,
0x17
,
0x0a
,
0x07
,
0x41
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x0c
,
0x08
,
0x01
,
0x12
,
0x08
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x73
,
0x52
,
0x07
,
0x61
,
0x63
,
0x63
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x3a
,
0x0e
,
0xea
,
0x9f
,
0x1d
,
0x0a
,
0x0a
,
0x04
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x1a
,
0x02
,
0x08
,
0x01
,
0x42
,
0x3a
,
0x5a
,
0x38
,
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
,
0x72
,
0x65
,
0x73
,
0x6f
,
0x6c
,
0x76
,
0x65
,
0x72
,
0x2f
,
0x61
,
0x77
,
0x73
,
0x2f
,
0x76
,
0x31
,
0x3b
,
0x61
,
0x77
,
0x73
,
0x76
,
0x31
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
var
(
...
...
This diff is collapsed.
Click to expand it.
backend/api/resolver/aws/v1/aws.pb.validate.go
+
8
-
0
View file @
05d8f07a
...
...
@@ -61,6 +61,8 @@ func (m *InstanceID) validate(all bool) error {
// no validation rules for Region
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
InstanceIDMultiError
(
errors
)
}
...
...
@@ -163,6 +165,8 @@ func (m *AutoscalingGroupName) validate(all bool) error {
// no validation rules for Region
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
AutoscalingGroupNameMultiError
(
errors
)
}
...
...
@@ -268,6 +272,8 @@ func (m *KinesisStreamName) validate(all bool) error {
// no validation rules for Region
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
KinesisStreamNameMultiError
(
errors
)
}
...
...
@@ -373,6 +379,8 @@ func (m *DynamodbTableName) validate(all bool) error {
// no validation rules for Region
// no validation rules for Account
if
len
(
errors
)
>
0
{
return
DynamodbTableNameMultiError
(
errors
)
}
...
...
This diff is collapsed.
Click to expand it.
backend/gateway/meta/meta_test.go
+
12
-
16
View file @
05d8f07a
...
...
@@ -49,9 +49,10 @@ func TestGetAction(t *testing.T) {
func
TestResourceNames
(
t
*
testing
.
T
)
{
t
.
Parallel
()
account
:=
"default"
instanceID
:=
"i-1234567890abcdef0"
region
:=
"iad"
expectedName
:=
"iad/i-1234567890abcdef0"
expectedName
:=
"
default/
iad/i-1234567890abcdef0"
typeUrl
:=
"clutch.aws.ec2.v1.Instance"
tests
:=
[]
struct
{
...
...
@@ -68,6 +69,7 @@ func TestResourceNames(t *testing.T) {
message
:
&
ec2v1
.
TerminateInstanceRequest
{
InstanceId
:
instanceID
,
Region
:
region
,
Account
:
account
,
},
names
:
[]
*
auditv1
.
Resource
{{
TypeUrl
:
typeUrl
,
...
...
@@ -80,6 +82,7 @@ func TestResourceNames(t *testing.T) {
Instance
:
&
ec2v1
.
Instance
{
InstanceId
:
instanceID
,
Region
:
region
,
Account
:
account
,
},
},
names
:
[]
*
auditv1
.
Resource
{{
...
...
@@ -270,10 +273,11 @@ func TestExtractProtoPatternsValues(t *testing.T) {
{
id
:
"ec2 instance"
,
pb
:
&
ec2v1
.
Instance
{
Account
:
"default"
,
Region
:
"us-east-1"
,
InstanceId
:
"i-000000000"
,
},
expect
:
"us-east-1/i-000000000"
,
expect
:
"
default/
us-east-1/i-000000000"
,
shouldError
:
false
,
},
{
...
...
@@ -313,33 +317,25 @@ func TestPatternValueMapping(t *testing.T) {
{
id
:
"aws asg"
,
pb
:
&
ec2v1
.
AutoscalingGroup
{},
search
:
"us-east-1/my-asg-name"
,
search
:
"
default/
us-east-1/my-asg-name"
,
result
:
map
[
string
]
string
{
"region"
:
"us-east-1"
,
"name"
:
"my-asg-name"
,
"account"
:
"default"
,
"region"
:
"us-east-1"
,
"name"
:
"my-asg-name"
,
},
ok
:
true
,
},
{
id
:
"aws instance"
,
pb
:
&
ec2v1
.
Instance
{},
search
:
"us-east-1/i-0000000"
,
search
:
"
default/
us-east-1/i-0000000"
,
result
:
map
[
string
]
string
{
"account"
:
"default"
,
"region"
:
"us-east-1"
,
"instance_id"
:
"i-0000000"
,
},
ok
:
true
,
},
{
id
:
"test for partial match"
,
pb
:
&
ec2v1
.
Instance
{},
search
:
"us-east-1/i-0000000/meow"
,
result
:
map
[
string
]
string
{
"region"
:
"us-east-1/i-0000000"
,
"instance_id"
:
"meow"
,
},
ok
:
true
,
},
{
id
:
"k8s deployment"
,
pb
:
&
k8sapiv1
.
Deployment
{},
...
...
This diff is collapsed.
Click to expand it.
backend/gateway/mux/mux.go
+
1
-
0
View file @
05d8f07a
...
...
@@ -125,6 +125,7 @@ func (a *assetHandler) assetProviderHandler(ctx context.Context, urlPath string)
return
awsClient
.
S3StreamingGet
(
ctx
,
awsClient
.
GetPrimaryAccountAlias
(),
a
.
assetCfg
.
GetS3
()
.
Region
,
a
.
assetCfg
.
GetS3
()
.
Bucket
,
path
.
Join
(
a
.
assetCfg
.
GetS3
()
.
Key
,
strings
.
TrimPrefix
(
urlPath
,
"/static"
)),
...
...
This diff is collapsed.
Click to expand it.
backend/mock/service/awsmock/awsmock.go
+
70
-
17
View file @
05d8f07a
...
...
@@ -25,30 +25,32 @@ import (
type
svc
struct
{}
func
(
s
*
svc
)
DescribeKinesisStream
(
ctx
context
.
Context
,
region
string
,
streamName
string
)
(
*
kinesisv1
.
Stream
,
error
)
{
func
(
s
*
svc
)
DescribeKinesisStream
(
ctx
context
.
Context
,
account
,
region
,
streamName
string
)
(
*
kinesisv1
.
Stream
,
error
)
{
ret
:=
&
kinesisv1
.
Stream
{
StreamName
:
streamName
,
Region
:
region
,
Account
:
"default"
,
CurrentShardCount
:
int32
(
32
),
}
return
ret
,
nil
}
func
(
s
*
svc
)
UpdateKinesisShardCount
(
ctx
context
.
Context
,
region
string
,
streamName
string
,
targetShardCount
int32
)
error
{
func
(
s
*
svc
)
UpdateKinesisShardCount
(
ctx
context
.
Context
,
account
,
region
,
streamName
string
,
targetShardCount
int32
)
error
{
return
nil
}
func
(
s
*
svc
)
ResizeAutoscalingGroup
(
ctx
context
.
Context
,
region
string
,
name
string
,
size
*
ec2v1
.
AutoscalingGroupSize
)
error
{
func
(
s
*
svc
)
ResizeAutoscalingGroup
(
ctx
context
.
Context
,
account
,
region
,
name
string
,
size
*
ec2v1
.
AutoscalingGroupSize
)
error
{
return
nil
}
func
(
s
*
svc
)
DescribeAutoscalingGroups
(
ctx
context
.
Context
,
region
string
,
names
[]
string
)
([]
*
ec2v1
.
AutoscalingGroup
,
error
)
{
func
(
s
*
svc
)
DescribeAutoscalingGroups
(
ctx
context
.
Context
,
account
,
region
string
,
names
[]
string
)
([]
*
ec2v1
.
AutoscalingGroup
,
error
)
{
ret
:=
make
([]
*
ec2v1
.
AutoscalingGroup
,
len
(
names
))
for
idx
,
name
:=
range
names
{
ret
[
idx
]
=
&
ec2v1
.
AutoscalingGroup
{
Name
:
name
,
Region
:
region
,
Zones
:
[]
string
{
region
+
"a"
,
region
+
"b"
},
Name
:
name
,
Region
:
region
,
Account
:
"default"
,
Zones
:
[]
string
{
region
+
"a"
,
region
+
"b"
},
Size
:
&
ec2v1
.
AutoscalingGroupSize
{
Min
:
25
,
Max
:
200
,
...
...
@@ -79,12 +81,13 @@ func (s *svc) DescribeAutoscalingGroups(ctx context.Context, region string, name
return
ret
,
nil
}
func
(
s
*
svc
)
DescribeInstances
(
ctx
context
.
Context
,
region
string
,
ids
[]
string
)
([]
*
ec2v1
.
Instance
,
error
)
{
func
(
s
*
svc
)
DescribeInstances
(
ctx
context
.
Context
,
account
,
region
string
,
ids
[]
string
)
([]
*
ec2v1
.
Instance
,
error
)
{
var
ret
[]
*
ec2v1
.
Instance
for
_
,
id
:=
range
ids
{
ret
=
append
(
ret
,
&
ec2v1
.
Instance
{
InstanceId
:
id
,
Region
:
region
,
Account
:
"default"
,
State
:
ec2v1
.
Instance_State
(
rand
.
Intn
(
len
(
ec2v1
.
Instance_State_value
))),
InstanceType
:
"c3.2xlarge"
,
PublicIpAddress
:
"8.1.1.1"
,
...
...
@@ -96,26 +99,26 @@ func (s *svc) DescribeInstances(ctx context.Context, region string, ids []string
return
ret
,
nil
}
func
(
s
*
svc
)
TerminateInstances
(
ctx
context
.
Context
,
region
string
,
ids
[]
string
)
error
{
func
(
s
*
svc
)
TerminateInstances
(
ctx
context
.
Context
,
account
,
region
string
,
ids
[]
string
)
error
{
return
nil
}
func
(
s
*
svc
)
RebootInstances
(
ctx
context
.
Context
,
region
string
,
ids
[]
string
)
error
{
func
(
s
*
svc
)
RebootInstances
(
ctx
context
.
Context
,
account
,
region
string
,
ids
[]
string
)
error
{
return
nil
}
func
(
s
*
svc
)
S3StreamingGet
(
ctx
context
.
Context
,
region
string
,
bucket
string
,
key
string
)
(
io
.
ReadCloser
,
error
)
{
func
(
s
*
svc
)
S3StreamingGet
(
ctx
context
.
Context
,
account
,
region
,
bucket
,
key
string
)
(
io
.
ReadCloser
,
error
)
{
panic
(
"implement me"
)
}
func
(
s
*
svc
)
S3GetBucketPolicy
(
ctx
context
.
Context
,
region
,
bucket
,
accountID
string
)
(
*
s3
.
GetBucketPolicyOutput
,
error
)
{
func
(
s
*
svc
)
S3GetBucketPolicy
(
ctx
context
.
Context
,
account
,
region
,
bucket
,
accountID
string
)
(
*
s3
.
GetBucketPolicyOutput
,
error
)
{
return
&
s3
.
GetBucketPolicyOutput
{
Policy
:
aws
.
String
(
"{}"
),
ResultMetadata
:
middleware
.
Metadata
{},
},
nil
}
func
(
s
*
svc
)
DescribeTable
(
ctx
context
.
Context
,
region
string
,
tableName
string
)
(
*
dynamodbv1
.
Table
,
error
)
{
func
(
s
*
svc
)
DescribeTable
(
ctx
context
.
Context
,
account
,
region
,
tableName
string
)
(
*
dynamodbv1
.
Table
,
error
)
{
currentThroughput
:=
&
dynamodbv1
.
Throughput
{
ReadCapacityUnits
:
100
,
WriteCapacityUnits
:
200
,
...
...
@@ -141,7 +144,7 @@ func (s *svc) DescribeTable(ctx context.Context, region string, tableName string
return
ret
,
nil
}
func
(
s
*
svc
)
UpdateCapacity
(
ctx
context
.
Context
,
region
string
,
tableName
string
,
targetTableCapacity
*
dynamodbv1
.
Throughput
,
indexUpdates
[]
*
dynamodbv1
.
IndexUpdateAction
,
ignoreMaximums
bool
)
(
*
dynamodbv1
.
Table
,
error
)
{
func
(
s
*
svc
)
UpdateCapacity
(
ctx
context
.
Context
,
account
,
region
,
tableName
string
,
targetTableCapacity
*
dynamodbv1
.
Throughput
,
indexUpdates
[]
*
dynamodbv1
.
IndexUpdateAction
,
ignoreMaximums
bool
)
(
*
dynamodbv1
.
Table
,
error
)
{
currentThroughput
:=
&
dynamodbv1
.
Throughput
{
ReadCapacityUnits
:
100
,
WriteCapacityUnits
:
200
,
...
...
@@ -167,11 +170,61 @@ func (s *svc) UpdateCapacity(ctx context.Context, region string, tableName strin
return
ret
,
nil
}
var
accountsAndRegions
=
map
[
string
][]
string
{
"default"
:
{
"us-mock-1"
},
"staging"
:
{
"us-mock-1"
,
"us-mock-2"
},
"production"
:
{
"us-mock-1"
,
"us-mock-2"
,
"us-mock-3"
},
}
func
(
s
*
svc
)
Regions
()
[]
string
{
return
[]
string
{
"us-mock-1"
}
uniqueRegions
:=
map
[
string
]
bool
{}
for
_
,
regions
:=
range
accountsAndRegions
{
for
_
,
r
:=
range
regions
{
uniqueRegions
[
r
]
=
true
}
}
regions
:=
make
([]
string
,
len
(
uniqueRegions
))
i
:=
0
for
region
:=
range
uniqueRegions
{
regions
[
i
]
=
region
i
++
}
return
regions
}
func
(
s
*
svc
)
Accounts
()
[]
string
{
accounts
:=
[]
string
{}
for
account
:=
range
accountsAndRegions
{
accounts
=
append
(
accounts
,
account
)
}
return
accounts
}
func
(
s
*
svc
)
AccountsAndRegions
()
map
[
string
][]
string
{
return
accountsAndRegions
}
func
(
s
*
svc
)
GetAccountsInRegion
(
region
string
)
[]
string
{
accounts
:=
[]
string
{}
for
a
,
regions
:=
range
accountsAndRegions
{
for
_
,
r
:=
range
regions
{
if
r
==
region
{
accounts
=
append
(
accounts
,
a
)
}
}
}
return
accounts
}
func
(
s
*
svc
)
GetPrimaryAccountAlias
()
string
{
return
"default"
}
func
(
s
*
svc
)
GetCallerIdentity
(
ctx
context
.
Context
,
region
string
)
(
*
sts
.
GetCallerIdentityOutput
,
error
)
{
func
(
s
*
svc
)
GetCallerIdentity
(
ctx
context
.
Context
,
account
,
region
string
)
(
*
sts
.
GetCallerIdentityOutput
,
error
)
{
return
&
sts
.
GetCallerIdentityOutput
{
Account
:
aws
.
String
(
"000000000000"
),
Arn
:
aws
.
String
(
"arn:aws:sts::000000000000:fake-role"
),
...
...
@@ -179,7 +232,7 @@ func (s *svc) GetCallerIdentity(ctx context.Context, region string) (*sts.GetCal
},
nil
}
func
(
s
*
svc
)
SimulateCustomPolicy
(
ctx
context
.
Context
,
region
string
,
customPolicySimulatorParams
*
iam
.
SimulateCustomPolicyInput
)
(
*
iam
.
SimulateCustomPolicyOutput
,
error
)
{
func
(
s
*
svc
)
SimulateCustomPolicy
(
ctx
context
.
Context
,
account
,
region
string
,
customPolicySimulatorParams
*
iam
.
SimulateCustomPolicyInput
)
(
*
iam
.
SimulateCustomPolicyOutput
,
error
)
{
return
&
iam
.
SimulateCustomPolicyOutput
{
EvaluationResults
:
[]
types
.
EvaluationResult
{
{
EvalActionName
:
aws
.
String
(
"s3:GetBucketPolicy"
),
...
...
This diff is collapsed.
Click to expand it.
backend/module/aws/ec2.go
+
5
-
5
View file @
05d8f07a
...
...
@@ -17,9 +17,9 @@ type ec2API struct {
client
aws
.
Client
}
func
(
a
*
ec2API
)
ResizeAutoscalingGroup
(
ctx
context
.
Context
,
req
uest
*
ec2v1
.
ResizeAutoscalingGroupRequest
)
(
*
ec2v1
.
ResizeAutoscalingGroupResponse
,
error
)
{
func
(
a
*
ec2API
)
ResizeAutoscalingGroup
(
ctx
context
.
Context
,
req
*
ec2v1
.
ResizeAutoscalingGroupRequest
)
(
*
ec2v1
.
ResizeAutoscalingGroupResponse
,
error
)
{
// TODO: additional validation
err
:=
a
.
client
.
ResizeAutoscalingGroup
(
ctx
,
req
uest
.
Region
,
req
uest
.
Name
,
req
uest
.
Size
)
err
:=
a
.
client
.
ResizeAutoscalingGroup
(
ctx
,
req
.
Account
,
req
.
Region
,
req
.
Name
,
req
.
Size
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -27,7 +27,7 @@ func (a *ec2API) ResizeAutoscalingGroup(ctx context.Context, request *ec2v1.Resi
}
func
(
a
*
ec2API
)
TerminateInstance
(
ctx
context
.
Context
,
req
*
ec2v1
.
TerminateInstanceRequest
)
(
*
ec2v1
.
TerminateInstanceResponse
,
error
)
{
err
:=
a
.
client
.
TerminateInstances
(
ctx
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
err
:=
a
.
client
.
TerminateInstances
(
ctx
,
req
.
Account
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -36,7 +36,7 @@ func (a *ec2API) TerminateInstance(ctx context.Context, req *ec2v1.TerminateInst
}
func
(
a
*
ec2API
)
GetInstance
(
ctx
context
.
Context
,
req
*
ec2v1
.
GetInstanceRequest
)
(
*
ec2v1
.
GetInstanceResponse
,
error
)
{
instances
,
err
:=
a
.
client
.
DescribeInstances
(
ctx
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
instances
,
err
:=
a
.
client
.
DescribeInstances
(
ctx
,
req
.
Account
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -45,7 +45,7 @@ func (a *ec2API) GetInstance(ctx context.Context, req *ec2v1.GetInstanceRequest)
}
func
(
a
*
ec2API
)
RebootInstance
(
ctx
context
.
Context
,
req
*
ec2v1
.
RebootInstanceRequest
)
(
*
ec2v1
.
RebootInstanceResponse
,
error
)
{
err
:=
a
.
client
.
RebootInstances
(
ctx
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
err
:=
a
.
client
.
RebootInstances
(
ctx
,
req
.
Account
,
req
.
Region
,
[]
string
{
req
.
InstanceId
})
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
backend/module/dynamodb/dynamodb.go
+
2
-
2
View file @
05d8f07a
...
...
@@ -18,7 +18,7 @@ type dynamodbAPI struct {
}
func
(
a
*
dynamodbAPI
)
DescribeTable
(
ctx
context
.
Context
,
req
*
dynamodbv1
.
DescribeTableRequest
)
(
*
dynamodbv1
.
DescribeTableResponse
,
error
)
{
table
,
err
:=
a
.
client
.
DescribeTable
(
ctx
,
req
.
Region
,
req
.
TableName
)
table
,
err
:=
a
.
client
.
DescribeTable
(
ctx
,
req
.
Account
,
req
.
Region
,
req
.
TableName
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -27,7 +27,7 @@ func (a *dynamodbAPI) DescribeTable(ctx context.Context, req *dynamodbv1.Describ
}
func
(
a
*
dynamodbAPI
)
UpdateCapacity
(
ctx
context
.
Context
,
req
*
dynamodbv1
.
UpdateCapacityRequest
)
(
*
dynamodbv1
.
UpdateCapacityResponse
,
error
)
{
result
,
err
:=
a
.
client
.
UpdateCapacity
(
ctx
,
req
.
Region
,
req
.
TableName
,
req
.
TableThroughput
,
req
.
GsiUpdates
,
req
.
IgnoreMaximums
)
result
,
err
:=
a
.
client
.
UpdateCapacity
(
ctx
,
req
.
Account
,
req
.
Region
,
req
.
TableName
,
req
.
TableThroughput
,
req
.
GsiUpdates
,
req
.
IgnoreMaximums
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
backend/module/kinesis/kinesis.go
+
2
-
2
View file @
05d8f07a
...
...
@@ -18,7 +18,7 @@ type kinesisAPI struct {
}
func
(
a
*
kinesisAPI
)
GetStream
(
ctx
context
.
Context
,
request
*
kinesisv1
.
GetStreamRequest
)
(
*
kinesisv1
.
GetStreamResponse
,
error
)
{
stream
,
err
:=
a
.
client
.
DescribeKinesisStream
(
ctx
,
request
.
Region
,
request
.
StreamName
)
stream
,
err
:=
a
.
client
.
DescribeKinesisStream
(
ctx
,
request
.
Account
,
request
.
Region
,
request
.
StreamName
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -27,7 +27,7 @@ func (a *kinesisAPI) GetStream(ctx context.Context, request *kinesisv1.GetStream
}
func
(
a
*
kinesisAPI
)
UpdateShardCount
(
ctx
context
.
Context
,
request
*
kinesisv1
.
UpdateShardCountRequest
)
(
*
kinesisv1
.
UpdateShardCountResponse
,
error
)
{
err
:=
a
.
client
.
UpdateKinesisShardCount
(
ctx
,
request
.
Region
,
request
.
StreamName
,
request
.
TargetShardCount
)
err
:=
a
.
client
.
UpdateKinesisShardCount
(
ctx
,
request
.
Account
,
request
.
Region
,
request
.
StreamName
,
request
.
TargetShardCount
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
backend/resolver/aws/asg.go
+
17
-
15
View file @
05d8f07a
...
...
@@ -14,28 +14,30 @@ import (
func
(
r
*
res
)
resolveAutoscalingGroupsForInput
(
ctx
context
.
Context
,
input
proto
.
Message
)
(
*
resolver
.
Results
,
error
)
{
switch
i
:=
input
.
(
type
)
{
case
*
awsv1
.
AutoscalingGroupName
:
return
r
.
autoscalingGroupResults
(
ctx
,
i
.
Region
,
[]
string
{
i
.
Name
},
1
)
return
r
.
autoscalingGroupResults
(
ctx
,
i
.
Account
,
i
.
Region
,
[]
string
{
i
.
Name
},
1
)
default
:
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"unrecognized input type '%T'"
,
i
)
}
}
func
(
r
*
res
)
autoscalingGroupResults
(
ctx
context
.
Context
,
region
string
,
ids
[]
string
,
limit
uint32
)
(
*
resolver
.
Results
,
error
)
{
func
(
r
*
res
)
autoscalingGroupResults
(
ctx
context
.
Context
,
account
,
region
string
,
ids
[]
string
,
limit
uint32
)
(
*
resolver
.
Results
,
error
)
{
ctx
,
handler
:=
resolver
.
NewFanoutHandler
(
ctx
)
regions
:=
r
.
determineRegionsForOption
(
region
)
for
_
,
region
:=
range
regions
{
handler
.
Add
(
1
)
go
func
(
region
string
)
{
defer
handler
.
Done
()
groups
,
err
:=
r
.
client
.
DescribeAutoscalingGroups
(
ctx
,
region
,
ids
)
select
{
case
handler
.
Channel
()
<-
resolver
.
NewFanoutResult
(
groups
,
err
)
:
return
case
<-
handler
.
Cancelled
()
:
return
}
}(
region
)
allAccountRegions
:=
r
.
determineAccountAndRegionsForOption
(
account
,
region
)
for
account
:=
range
allAccountRegions
{
for
_
,
region
:=
range
allAccountRegions
[
account
]
{
handler
.
Add
(
1
)
go
func
(
account
,
region
string
)
{
defer
handler
.
Done
()
groups
,
err
:=
r
.
client
.
DescribeAutoscalingGroups
(
ctx
,
account
,
region
,
ids
)
select
{
case
handler
.
Channel
()
<-
resolver
.
NewFanoutResult
(
groups
,
err
)
:
return
case
<-
handler
.
Cancelled
()
:
return
}
}(
account
,
region
)
}
}
return
handler
.
Results
(
limit
)
...
...
This diff is collapsed.
Click to expand it.
backend/resolver/aws/aws.go
+
42
-
17
View file @
05d8f07a
...
...
@@ -60,6 +60,16 @@ func makeRegionOptions(regions []string) []*resolverv1.Option {
return
ret
}
func
makeAccountOptions
(
accounts
[]
string
)
[]
*
resolverv1
.
Option
{
ret
:=
make
([]
*
resolverv1
.
Option
,
len
(
accounts
))
for
i
,
account
:=
range
accounts
{
ret
[
i
]
=
&
resolverv1
.
Option
{
Value
:
&
resolverv1
.
Option_StringValue
{
StringValue
:
account
},
}
}
return
ret
}
func
New
(
cfg
*
any
.
Any
,
logger
*
zap
.
Logger
,
scope
tally
.
Scope
)
(
resolver
.
Resolver
,
error
)
{
awsClient
,
ok
:=
service
.
Registry
[
"clutch.service.aws"
]
if
!
ok
{
...
...
@@ -86,7 +96,8 @@ func New(cfg *any.Any, logger *zap.Logger, scope tally.Scope) (resolver.Resolver
}
resolver
.
HydrateDynamicOptions
(
schemas
,
map
[
string
][]
*
resolverv1
.
Option
{
"regions"
:
makeRegionOptions
(
c
.
Regions
()),
"regions"
:
makeRegionOptions
(
c
.
Regions
()),
"accounts"
:
makeAccountOptions
(
c
.
Accounts
()),
})
r
:=
&
res
{
...
...
@@ -104,15 +115,29 @@ type res struct {
schemas
resolver
.
TypeURLToSchemasMap
}
func
(
r
*
res
)
determineRegionsForOption
(
option
string
)
[]
string
{
var
regions
[]
string
switch
option
{
case
resolver
.
OptionAll
:
regions
=
r
.
client
.
Regions
()
default
:
regions
=
[]
string
{
option
}
func
(
r
*
res
)
determineAccountAndRegionsForOption
(
account
,
region
string
)
map
[
string
][]
string
{
options
:=
make
(
map
[
string
][]
string
)
//nolint:gocritic
if
account
!=
resolver
.
OptionAll
&&
region
!=
resolver
.
OptionAll
{
options
[
account
]
=
[]
string
{
region
}
return
options
// If we want to fan out to all accounts but limit region for all accounts that have that region
}
else
if
account
==
resolver
.
OptionAll
&&
region
!=
resolver
.
OptionAll
{
for
_
,
a
:=
range
r
.
client
.
GetAccountsInRegion
(
region
)
{
options
[
a
]
=
[]
string
{
region
}
}
return
options
// If we want to only limit account but fan out to all regions within that account
}
else
if
account
!=
resolver
.
OptionAll
&&
region
==
resolver
.
OptionAll
{
options
[
account
]
=
r
.
client
.
AccountsAndRegions
()[
account
]
return
options
}
return
regions
// If we have a complete fanout for both account and regions return them all
return
r
.
client
.
AccountsAndRegions
()
}
func
(
r
*
res
)
Schemas
()
resolver
.
TypeURLToSchemasMap
{
return
r
.
schemas
}
...
...
@@ -144,14 +169,14 @@ func (r *res) Search(ctx context.Context, typeURL, query string, limit uint32) (
return
nil
,
err
}
if
ok
{
return
r
.
instanceResults
(
ctx
,
patternValues
[
"region"
],
[]
string
{
patternValues
[
"instance_id"
]},
limit
)
return
r
.
instanceResults
(
ctx
,
patternValues
[
"account"
],
patternValues
[
"region"
],
[]
string
{
patternValues
[
"instance_id"
]},
limit
)
}
id
,
err
:=
normalizeInstanceID
(
query
)
if
err
!=
nil
{
return
nil
,
err
}
return
r
.
instanceResults
(
ctx
,
resolver
.
OptionAll
,
[]
string
{
id
},
limit
)
return
r
.
instanceResults
(
ctx
,
resolver
.
OptionAll
,
resolver
.
OptionAll
,
[]
string
{
id
},
limit
)
case
typeURLAutoscalingGroup
:
patternValues
,
ok
,
err
:=
meta
.
ExtractPatternValuesFromString
((
*
ec2v1api
.
AutoscalingGroup
)(
nil
),
query
)
...
...
@@ -159,9 +184,9 @@ func (r *res) Search(ctx context.Context, typeURL, query string, limit uint32) (
return
nil
,
err
}
if
ok
{
return
r
.
autoscalingGroupResults
(
ctx
,
patternValues
[
"region"
],
[]
string
{
patternValues
[
"name"
]},
limit
)
return
r
.
autoscalingGroupResults
(
ctx
,
patternValues
[
"account"
],
patternValues
[
"region"
],
[]
string
{
patternValues
[
"name"
]},
limit
)
}
return
r
.
autoscalingGroupResults
(
ctx
,
resolver
.
OptionAll
,
[]
string
{
query
},
limit
)
return
r
.
autoscalingGroupResults
(
ctx
,
resolver
.
OptionAll
,
resolver
.
OptionAll
,
[]
string
{
query
},
limit
)
case
typeURLKinesisStream
:
patternValues
,
ok
,
err
:=
meta
.
ExtractPatternValuesFromString
((
*
kinesisv1api
.
Stream
)(
nil
),
query
)
...
...
@@ -169,10 +194,10 @@ func (r *res) Search(ctx context.Context, typeURL, query string, limit uint32) (
return
nil
,
err
}
if
ok
{
return
r
.
kinesisResults
(
ctx
,
patternValues
[
"region"
],
patternValues
[
"stream_name"
],
limit
)
return
r
.
kinesisResults
(
ctx
,
patternValues
[
"account"
],
patternValues
[
"region"
],
patternValues
[
"stream_name"
],
limit
)
}
return
r
.
kinesisResults
(
ctx
,
resolver
.
OptionAll
,
query
,
limit
)
return
r
.
kinesisResults
(
ctx
,
resolver
.
OptionAll
,
resolver
.
OptionAll
,
query
,
limit
)
case
typeURLDynamodbTable
:
patternValues
,
ok
,
err
:=
meta
.
ExtractPatternValuesFromString
((
*
dynamodbv1api
.
Table
)(
nil
),
query
)
...
...
@@ -180,10 +205,10 @@ func (r *res) Search(ctx context.Context, typeURL, query string, limit uint32) (
return
nil
,
err
}
if
ok
{
return
r
.
dynamodbResults
(
ctx
,
patternValues
[
"region"
],
patternValues
[
"name"
],
limit
)
return
r
.
dynamodbResults
(
ctx
,
patternValues
[
"account"
],
patternValues
[
"region"
],
patternValues
[
"name"
],
limit
)
}
return
r
.
dynamodbResults
(
ctx
,
resolver
.
OptionAll
,
query
,
limit
)
return
r
.
dynamodbResults
(
ctx
,
resolver
.
OptionAll
,
resolver
.
OptionAll
,
query
,
limit
)
default
:
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"resolver search for '%s' not implemented"
,
typeURL
)
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help