Skip to content

Incorrect state returned in VPCEndpoint Object #2496

Closed as not planned
Closed as not planned
@gilbahat

Description

Describe the bug

VPCEndpoint object reports its state as "available" (lowercase). this does not conform to the state types in the ec2 types package, and thus vpcEndpoint.State == types.StateAvailable will always fail.

Expected Behavior

VPCEndpoint state should conform to state types in the ec2 types, including capitalization so that comparisons will work as expected

Current Behavior

VPCEndpoint object reports its state as "available" (lowercase). this does not conform to the state types in the ec2 types package.

Reproduction Steps


// not sure how to do this with all the SDK init stuff. this is as close as I can get for now.

import (
	ec2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
	"github.com/aws/aws-sdk-go/aws"
)

func main() {

input := &ec2.DescribeVpcEndpointsInput{
			for paginator.HasMorePages() {
				page, err := paginator.NextPage(ctx)
				if err != nil {
					return fmt.Errorf("failed to describe VPC endpoint: %w", err)
				}
				if len(page.VpcEndpoints) != 0 {
					vpcEndpoint = &page.VpcEndpoints[0]
					if vpcEndpoint != nil && vpcEndpoint.State == ec2Types.StateAvailable {
						return "found"
					}
				}
			}
}

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]

Compiler and Version used

go version go1.21.6 darwin/amd64

Operating System and version

Darwin heka 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:10 PST 2023; root:xnu-10002.61.3~2/RELEASE_X86_64 x86_64

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions