Skip to content
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

r/aws_autoscaling_group: Semgrep Naming Scan failures #25083

Closed
ewbankkit opened this issue May 27, 2022 · 2 comments · Fixed by #17695
Closed

r/aws_autoscaling_group: Semgrep Naming Scan failures #25083

ewbankkit opened this issue May 27, 2022 · 2 comments · Fixed by #17695
Labels
linter Pertains to changes to or issues with the various linters. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Milestone

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented May 27, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Findings:

  internal/service/autoscaling/group.go 
     caps2-in-func-name
        Use correct caps in func name (i.e., HTTPS or https, not Https) (see list at
        https://github.com/hashicorp/terraform-provider-aws/tree/main/names/caps.md)

       2428┆ func expandBaselineEbsBandwidthMbpsRequest(tfMap map[string]interface{}) *autoscaling.BaselineEbsBandwidthMbpsRequest {
       2429┆ 	if tfMap == nil {
       2430┆ 		return nil
       2431┆ 	}
       2432┆ 
       2433┆ 	apiObject := &autoscaling.BaselineEbsBandwidthMbpsRequest{}
       2434┆ 
       2435┆ 	var min int
       2436┆ 	if v, ok := tfMap["min"].(int); ok {
       2437┆ 		min = v
           [hid 9 additional lines, adjust with --max-lines-per-finding] 
       24[48](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:49)┆ func expandMemoryGiBPerVCpuRequest(tfMap map[string]interface{}) *autoscaling.MemoryGiBPerVCpuRequest {
       24[49](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:50)┆ 	if tfMap == nil {
       24[50](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:51)┆ 		return nil
       2451┆ 	}
       2452┆ 
       2453┆ 	apiObject := &autoscaling.MemoryGiBPerVCpuRequest{}
       2454┆ 
       2455┆ 	var min float64
       2456┆ 	if v, ok := tfMap["min"].(float64); ok {
       2457┆ 		min = v
           [hid 9 additional lines, adjust with --max-lines-per-finding] 
       2528┆ func expandVCpuCountRequest(tfMap map[string]interface{}) *autoscaling.VCpuCountRequest {
       2529┆ 	if tfMap == nil {
       2530┆ 		return nil
       2531┆ 	}
       2532┆ 
       2533┆ 	apiObject := &autoscaling.VCpuCountRequest{}
       2534┆ 
       2535┆ 	min := 0
       2536┆ 	if v, ok := tfMap["min"].(int); ok {
       2537┆ 		min = v
           [hid 9 additional lines, adjust with --max-lines-per-finding] 
       3087┆ func flattenBaselineEbsBandwidthMbps(apiObject *autoscaling.BaselineEbsBandwidthMbpsRequest) map[string]interface{} {
       3088┆ 	if apiObject == nil {
       3089┆ 		return nil
       3090┆ 	}
       3091┆ 
       3092┆ 	tfMap := map[string]interface{}{}
       3093┆ 
       3094┆ 	if v := apiObject.Max; v != nil {
       3095┆ 		tfMap["max"] = aws.Int64Value(v)
       3096┆ 	}
           [hid 7 additional lines, adjust with --max-lines-per-finding] 
       3105┆ func flattenMemoryGiBPerVCpu(apiObject *autoscaling.MemoryGiBPerVCpuRequest) map[string]interface{} {
       3106┆ 	if apiObject == nil {
       3107┆ 		return nil
       3108┆ 	}
       3109┆ 
       3110┆ 	tfMap := map[string]interface{}{}
       3111┆ 
       3112┆ 	if v := apiObject.Max; v != nil {
       3113┆ 		tfMap["max"] = aws.Float64Value(v)
       3114┆ 	}
           [hid 7 additional lines, adjust with --max-lines-per-finding] 
       3177┆ func flattenVCpuCount(apiObject *autoscaling.VCpuCountRequest) map[string]interface{} {
       3178┆ 	if apiObject == nil {
       3179┆ 		return nil
       3180┆ 	}
       3181┆ 
       3182┆ 	tfMap := map[string]interface{}{}
       3183┆ 
       3184┆ 	if v := apiObject.Max; v != nil {
       3185┆ 		tfMap["max"] = aws.Int64Value(v)
       3186┆ 	}
           [hid 7 additional lines, adjust with --max-lines-per-finding] 
       2773┆ func expandVpcZoneIdentifiers(tfList []interface{}) *string {
       2774┆ 	vpcZoneIDs := make([]string, len(tfList))
       2775┆ 
       2776┆ 	for i, v := range tfList {
       2777┆ 		vpcZoneIDs[i] = v.(string)
       2778┆ 	}
       2779┆ 
       2780┆ 	return aws.String(strings.Join(vpcZoneIDs, ","))
       2781┆ }


  internal/service/autoscaling/group_test.go 
     caps2-in-func-name
        Use correct caps in func name (i.e., HTTPS or https, not Https) (see list at
        https://github.com/hashicorp/terraform-provider-aws/tree/main/names/caps.md)

       1728┆ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceRequirements_memoryMiBAndVCpuCount(t *testing.T) {
       1729┆ 	var group autoscaling.Group
       1730┆ 	rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
       1731┆ 	resourceName := "aws_autoscaling_group.test"
       1732┆ 
       1733┆ 	resource.ParallelTest(t, resource.TestCase{
       1734┆ 		PreCheck:          func() { acctest.PreCheck(t) },
       1735┆ 		ErrorCheck:        acctest.ErrorCheck(t, autoscaling.EndpointsID),
       1736┆ 		ProviderFactories: acctest.ProviderFactories,
       1737┆ 		CheckDestroy:      testAccCheckGroupDestroy,
           [hid [54](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:55) additional lines, adjust with --max-lines-per-finding] 
       2224┆ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceRequirements_baselineEbsBandwidthMbps(t *testing.T) {
       2225┆ 	var group autoscaling.Group
       2226┆ 	rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
       2227┆ 	resourceName := "aws_autoscaling_group.test"
       2228┆ 
       2229┆ 	resource.ParallelTest(t, resource.TestCase{
       2230┆ 		PreCheck:          func() { acctest.PreCheck(t) },
       2231┆ 		ErrorCheck:        acctest.ErrorCheck(t, autoscaling.EndpointsID),
       2232┆ 		ProviderFactories: acctest.ProviderFactories,
       2233┆ 		CheckDestroy:      testAccCheckGroupDestroy,
           [hid 75 additional lines, adjust with --max-lines-per-finding] 
       2[69](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:70)4┆ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instanceRequirements_memoryGiBPerVCpu(t *testing.T) {
       2695┆ 	var group autoscaling.Group
       2696┆ 	rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
       2697┆ 	resourceName := "aws_autoscaling_group.test"
       2698┆ 
       2699┆ 	resource.ParallelTest(t, resource.TestCase{
       2[70](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:71)0┆ 		PreCheck:          func() { acctest.PreCheck(t) },
       2701┆ 		ErrorCheck:        acctest.ErrorCheck(t, autoscaling.EndpointsID),
       2702┆ 		ProviderFactories: acctest.ProviderFactories,
       2703┆ 		CheckDestroy:      testAccCheckGroupDestroy,
           [hid [75](https://github.com/hashicorp/terraform-provider-aws/runs/6627025493?check_suite_focus=true#step:4:76) additional lines, adjust with --max-lines-per-finding] 

Some files were skipped or only partially analyzed.

Relates #24795.

@ewbankkit ewbankkit added service/autoscaling Issues and PRs that pertain to the autoscaling service. linter Pertains to changes to or issues with the various linters. labels May 27, 2022
@github-actions github-actions bot added this to the v4.17.0 milestone May 31, 2022
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

This functionality has been released in v4.17.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jul 4, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
1 participant