servicediscovery compatability issue with localstack #2557
Unanswered
codefromthecrypt
asked this question in
Q&A
Replies: 1 comment 2 replies
-
The AWS SDKs are designed for and are only guaranteed to work against the public AWS services. The If you're using an alternative implementation of the service that doesn't work this way, you can technically remove the svc := servicediscovery.NewFromConfig(cfg, func (o *servicediscovery.Options) {
o.APIOptions = append(o.APIOptions, func (stack *middleware.Stack) error {
// this technically returns an error if the middleware doesn't exist, and on some servicediscovery
// ops that IS the case, but we don't care
stack.Finalize.Remove("EndpointHostPrefix")
return nil
})
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
DiscoverInstances prefixes "data-" to the hostname, rendering localhost (specifically localstack) tests useless, as the hostname "data-localhost" doesn't exist.
Expected Behavior
I would like to use all servicediscovery functions. I'm not sure why others work and DiscoverInstances specifically does this
Current Behavior
I end up with an error like this:
Reproduction Steps
localstack requires an authenticated docker image (localstack-pro) to run, so probably reproduction won't help as much, but the command that fails looks like this:
Possible Solution
maybe there is a way to avoid this part of the stack. I don't mind a workaround for testing.
Additional Information/Context
where the prefix happens: https://github.com/aws/aws-sdk-go-v2/blob/main/service/servicediscovery/api_op_DiscoverInstances.go#L193
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.22.1 darwin/arm64
Operating System and version
macOS 14.4
Beta Was this translation helpful? Give feedback.
All reactions