You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all,
I'm trying to update my code from v1 to v2 and one of my functions needs to get a partition Id from a specified region, but when looking into the v2 equivalent I found I need to use either the aws.EndpointResolverWithOptions.ResolveEndpoint or the aws.EndpointResolverWithOptionsFunc.ResolveEndpoint which take in a service, region and an optional interface of options, but when I try to call it to retrieve the partition Id I get a missing parameter of
not enough arguments in call to aws.EndpointResolverWithOptions.ResolveEndpoint
have (string, string)
want ("github.com/aws/aws-sdk-go-v2/aws".EndpointResolverWithOptions, string, string, ...interface{})
I'm unsure as to how to fill in the necessary field, I have had a discussion telling me to create a custom endpoint resolver but I am unsure as to how to go about doing that any examples will help greatly thank you; This is the full function I'm trying to use:
func GetPartition() string {
region, err := GetRegion(arguments.GetRegion())
if err != nil || region == "" {
return "aws"
}
e, err := aws.EndpointResolverWithOptions.ResolveEndpoint("s3", region)
if err || e.PartitionID == "" {
return "aws"
}
return e.PartitionID
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey all,
I'm trying to update my code from v1 to v2 and one of my functions needs to get a partition Id from a specified region, but when looking into the v2 equivalent I found I need to use either the
aws.EndpointResolverWithOptions.ResolveEndpoint
or theaws.EndpointResolverWithOptionsFunc.ResolveEndpoint
which take in a service, region and an optional interface of options, but when I try to call it to retrieve the partition Id I get a missing parameter ofI'm unsure as to how to fill in the necessary field, I have had a discussion telling me to create a custom endpoint resolver but I am unsure as to how to go about doing that any examples will help greatly thank you; This is the full function I'm trying to use:
Beta Was this translation helpful? Give feedback.
All reactions