aws-sdk-go-v2 icon indicating copy to clipboard operation
aws-sdk-go-v2 copied to clipboard

route53: Missing Waiters that were in v1 SDK

Open qhenkart opened this issue 4 years ago • 3 comments

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug The route53 package in v2 has no waiters, however the package in v1 does

Version of AWS SDK for Go? 1.2

Version of Go (go version)? 1.16

To Reproduce (observed behavior) https://docs.aws.amazon.com/sdk-for-go/api/service/route53/#Route53.WaitUntilResourceRecordSetsChanged

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/route53#Client

Expected behavior The waiter to exist in v2 like it did in v1

Additional context basically the same issue as #1111 but a different package

qhenkart avatar Feb 20 '21 20:02 qhenkart

Thanks for reporting this issue @qhenkart. The v2 SDK did not pull over all modeled waiters from the v1 SDK. The AWS Route53 waiters are an example of some of the waiters that have not been ported yet. These waiters were not ported due to a change in how the APIs model their features, and waiters like Route53's have not been added yet.

We'll use this GitHub issue to track this waiter for Route53.

jasdel avatar Mar 03 '21 17:03 jasdel

I ended up making the waiter myself which was pretty easy. You can see how the package was created in v1 https://github.com/aws/aws-sdk-go/blob/v1.37.15/service/route53/waiters.go#L28 and how in v2 they are made similarly https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.2.0/service/s3/api_op_HeadBucket.go#L240

I created it myself here https://github.com/ethereum/go-ethereum/blob/master/cmd/devp2p/dns_route53.go#L161-L181

	for _, change := range changesToCheck {
		log.Info(fmt.Sprintf("Waiting for change request %s", *change.ChangeInfo.Id))
		wreq := &route53.GetChangeInput{Id: change.ChangeInfo.Id}
		var count int
		for {
			wresp, err := c.api.GetChange(context.TODO(), wreq)
			if err != nil {
				return err
			}

			count++

			if wresp.ChangeInfo.Status == types.ChangeStatusInsync || count >= maxRetryLimit {
				break
			}

			time.Sleep(30 * time.Second)
		}
	}
	return nil
}

qhenkart avatar Oct 22 '21 09:10 qhenkart

@qhenkart I also implemented a waiter, but it's not a question of how easy it is to do. In previous tickets it was left uncertain if they were going to be ported or not. If they are not going to be, issues like this (which have been open since February of 2020) need to be closed with clarity and guidance. Ambiguity, having to search through issues is a lot less productive than just seeing in the docs that

We decided to remove the waiters for these services and you'll need to reimplement them yourselves. Here's a nice starter <INSERT CODE DUMP>

shairozan avatar Oct 25 '21 20:10 shairozan

Waiter was added back in v.1.4.0 of the route53 module. https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/route53#NewResourceRecordSetsChangedWaiter

skmcgrail avatar Sep 28 '22 15:09 skmcgrail

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Sep 28 '22 15:09 github-actions[bot]