-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding CFT scanning support for the resources: #1149
Conversation
shreyas-phansalkar-189
commented
Feb 10, 2022
- aws_qldb_ledger
- aws_ecs_cluster
- aws_apigatewayv2_api
- aws_db_event_subscription
- aws_neptune_cluster_instance
- aws_globalaccelerator_accelerator
- aws_waf_size_constraint_set
- aws_athena_workgroup
- aws_qldb_ledger - aws_ecs_cluster - aws_apigatewayv2_api - aws_db_event_subscription - aws_neptune_cluster_instance - aws_globalaccelerator_accelerator - aws_waf_size_constraint_set - aws_athena_workgroup
// GetAPIGatewayV2ApiConfig returns config for aws_apigatewayv2_api resource | ||
func GetAPIGatewayV2ApiConfig(a *apigatewayv2.Api) []AWSResourceConfig { | ||
|
||
corsConfigData := make([]CorsConfigurationBlock, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add null check here
} | ||
|
||
// GetDBEventSubscriptionConfig returns config for aws_db_event_subscription resource | ||
func GetDBEventSubscriptionConfig(db *rds.EventSubscription) []AWSResourceConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer using single letter names like its being done with every other resource
func GetEcsClusterConfig(e *ecs.Cluster) []AWSResourceConfig { | ||
|
||
clusterSettingsData := make([]ClusterSettingsBlock, len(e.ClusterSettings)) | ||
for i := 0; i < len(e.ClusterSettings); i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use range
here to make code cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldnt we need i for indexing the clusterSettingsData array ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try this:
for i := range e.ClusterSettings {
.....
}
- api-gatewayv2-api.go - db-event-subscription.go Changes made: - added a nil check for CorsConfiguration - changed variable name in db-event-subscription.go
|
||
func setExecCommandConfigBlock(e *ecs.Cluster) []ExecuteCommandConfiguration { | ||
|
||
execCommandConfigData := make([]ExecuteCommandConfiguration, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add null check
|
||
func setLogConfigurationBlock(e *ecs.Cluster) []LogConfigurationBlock { | ||
|
||
logConfigData := make([]LogConfigurationBlock, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add null check
func setSizeConstraintSet(w *waf.SizeConstraintSet) []SizeConstraintSetBlock { | ||
sizeConstraintSet := make([]SizeConstraintSetBlock, len(w.SizeConstraints)) | ||
|
||
for i := 0; i < len(w.SizeConstraints); i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i := range w.SizeConstraints {}
this could be cleaner
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |