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

DescribeVpcEndpoints returns the State value in lowercase instead of UpperCamelCase #2785

Closed
2 of 3 tasks
rajramo61 opened this issue Sep 12, 2024 · 3 comments
Closed
2 of 3 tasks
Assignees
Labels
bug This issue is a bug. duplicate This issue is a duplicate. p2 This is a standard priority issue

Comments

@rajramo61
Copy link

rajramo61 commented Sep 12, 2024

Acknowledgements

Describe the bug

Issue: When we make call to DescribeVpcEndpoints it returns this State field with value in all characters lower case (available) contrary to what the client State constant defines first character in upper case(Available).

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I expect DescribeVpcEndpoints returns the State field with enum using the same casing as defined in the State.
For example the string value for State should be like Failed and not like failed .

Current Behavior

DescribeVpcEndpoints returns the State field string value in all lower case like failed.

Reproduction Steps

Here is the sample code to reproduce the issue.
Replace with real vpcEndpointId .
if the result says Expected Success then there is no issue and if it returns Manipulated Success then this bug exists.

package main

import (
	"context"
	"fmt"
	"log"
	"strings"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/ec2"
	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
)


func main() {
	ctx := context.TODO()
	cfg, err := config.LoadDefaultConfig(ctx)
	if err != nil {
		log.Fatal(err)
	}
	client := ec2.NewFromConfig(cfg)
	input := &ec2.DescribeVpcEndpointsInput{
		VpcEndpointIds: []string{"<vpc-endpoint-id>"},
	}
	vpcEndpointsOutput, err := client.DescribeVpcEndpoints(ctx, input)
	if err != nil {
		fmt.Println("failed", err)
	}
	state := vpcEndpointsOutput.VpcEndpoints[0].State
	fmt.Println(state)
	states := types.StatePending.Values()
	for _, s := range states {
		if strings.ToLower(string(s)) == strings.ToLower(string(state)) {
			fmt.Println("checking the correct value")
			fmt.Println(s)
			if s == types.StateAvailable {
				fmt.Println("Manipulated Success")
			}
		}
	}
	if state == types.StateAvailable {
		fmt.Println("Expected Success")
	}
}

Possible Solution

Not sure if this issue is related to deserialization of issue at the server and client values for State.

Additional Information/Context

NA

AWS Go SDK V2 Module Versions Used

This list is too big. The ticket creation failed so I omitted the information, I can provide the details in the comment later.

Compiler and Version used

go version go1.23.0 darwin/amd64

Operating System and version

macOS Sonoma Version 14.6.1

@rajramo61 rajramo61 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 12, 2024
@RanVaknin RanVaknin self-assigned this Sep 12, 2024
@bhavya2109sharma bhavya2109sharma self-assigned this Sep 12, 2024
@bhavya2109sharma bhavya2109sharma added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 12, 2024
@bhavya2109sharma
Copy link
Contributor

Hello @rajramo61

Thanks for reaching out.

I have reproduced and confirmed that this is an issue. This was also reported in the past and not yet fixed by the EC2 service team #2864 , and I am tracking internal ticket (#70319347). I will reach out to the service team once again to try and get them to fix it.

I'll be closing this issue in favor of tracking it in the original reported github issue

Thanks,
Bhavya

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@rajdwi
Copy link

rajdwi commented Sep 13, 2024

Thanks @bhavya2109sharma for the updates!
Not sure if it would be a good idea to close this ticket but I would leave it up to you.
With this ticket being closed, someone else might create a new ticket for the same issue as folks mostly check the open tickets. The original ticket is open with older version of sdk which most of the folks won't check.

@RanVaknin RanVaknin added the duplicate This issue is a duplicate. label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. duplicate This issue is a duplicate. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants