aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.42k stars 398 forks source link

Migrate to using aws sdk go v2 #1852

Open efekarakus opened 3 years ago

efekarakus commented 3 years ago

We should look into migrating to using aws-sdk-go-v2. Some of the benefits:

There is a guide on migrating from v1 to v2: https://aws.github.io/aws-sdk-go-v2/docs/migrating, most notably I think we'll have to change session everywhere to using the config pkg.

When we decide to undertake this effort, during the transition period we'll depend on both v1 and v2:

  1. All new code will have to strictly use v2
  2. Migrate one-by-one each aws dependency under: https://github.com/aws/copilot-cli/tree/mainline/internal/pkg/aws
  3. Unfortunately, we currently have dependencies in these packages outside of internal/aws as well:
    internal/pkg/cli
    internal/pkg/config
    internal/pkg/deploy
    internal/pkg/deploy/cloudformation
    internal/pkg/deploy/cloudformation/stack
    internal/pkg/describe
    internal/pkg/ecs
    internal/pkg/initialize
    internal/pkg/logging
    internal/pkg/manifest
    internal/pkg/stream
    internal/pkg/task
    internal/pkg/template
    internal/pkg/term/selector
  4. Clean up with go mod tidy
efekarakus commented 3 years ago

This works needs https://github.com/aws/copilot-cli/issues/1855 to be implemented first.

takashi-uchida commented 1 year ago

Do you happen to have any updates on the migration to aws-sdk-go-v2?

dannyrandall commented 1 year ago

Hey @takashi-uchida! We haven't started work on this yet.šŸ˜” I'm curious if there's something you're looking forward to from Copilot migrating to v2?

takashi-uchida commented 1 year ago

@dannyrandall Thanks for getting back to me.

The first is the SSO authentication method. This has already been addressed in the following issue, but it took me a while to get to this issue. https://github.com/aws/copilot-cli/issues/4359

Second, Cloudformation now allows cross-region references, making incorporating Cloudfront and other resources more accessible.

This is a little off from v2... When I think about creating an authentication function for Cognito, I feel that the method presented in the other issue should be updated as it does not work as it is. https://github.com/aws/copilot-cli/issues/2050#issuecomment-812838310 https://github.com/aws/copilot-cli/issues/3465

dannyrandall commented 1 year ago

Thanks @takashi-uchida! The SSO authentication method makes sense, that'll be a nice benefit up upgrading to v2.šŸ˜Š

For your second item - are you referring to the crossRegionReferences field for CDK stacks? If so, I don't think we'll get the feature from upgrading to aws-sdk-go-v2, but it looks interesting! Could you share a little more how you would like to use that feature in Copilot?

And for the Cognito authentication functions - Feel free to share any issues you're having on one of those issues, but I wonder if you might be able to use CDK Overrides that we recently released? Maybe that approach would work better for you than addons.šŸ˜Š

Thanks for the feedback, we appreciate it!

takashi-uchida commented 1 year ago

@dannyrandall My apologies. It appears that I was incorrect regarding cross-region. As for the Cognito implementation, it might be better to use the CDK.

Thank you very much.