Skip to content

Commit 7dce0d2

Browse files
authored
Merge pull request #75 from fujiwara/fix/resolve-endpoint
fix resolve ECS endpoint.
2 parents 3ee1c41 + 09c191b commit 7dce0d2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ecsta.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,16 @@ func (app *Ecsta) SetCluster(ctx context.Context) error {
283283
}
284284

285285
func (app *Ecsta) Endpoint(ctx context.Context) (string, error) {
286-
out, err := app.ecs.DiscoverPollEndpoint(ctx, &ecs.DiscoverPollEndpointInput{
287-
Cluster: &app.cluster,
288-
})
286+
param := ecs.EndpointParameters{
287+
Region: aws.String(app.region),
288+
UseFIPS: aws.Bool(false),
289+
UseDualStack: aws.Bool(false),
290+
}
291+
eo, err := app.ecs.Options().EndpointResolverV2.ResolveEndpoint(ctx, param)
289292
if err != nil {
290-
return "", fmt.Errorf("failed to discover poll endpoint: %w", err)
293+
return "", fmt.Errorf("failed to resolve endpoint: %w", err)
291294
}
292-
return *out.Endpoint, nil
295+
return eo.URI.String(), nil
293296
}
294297

295298
func (app *Ecsta) findContainerName(ctx context.Context, task types.Task, name string) (string, error) {

0 commit comments

Comments
 (0)