Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

add-to-ECS: select profile, region, and cluster #175

Merged
merged 12 commits into from
Nov 11, 2022

Conversation

mgritter
Copy link
Contributor

@mgritter mgritter commented Nov 8, 2022

This covers:

  • asking for a profile name
  • selecting a region from a list
  • listing the clusters in a region

This covers:
  * asking for a profile name
  * selecting a region from a list
  * listing the clusters in a region
@mgritter mgritter requested a review from a team November 8, 2022 05:07
@mgritter
Copy link
Contributor Author

mgritter commented Nov 8, 2022

Example interaction:

mark@ubuntu:~/akita-cli$ bin/akita ecs  
? Which of your AWS profiles should Akita use to configure ECS? mgritter
[INFO] Successfully loaded AWS credentials.
? In which AWS region is your ECS cluster? us-west-2
[ERROR] Could not find any ECS clusters in this region. Please select a different one or hit Ctrl+C to exit.
? In which AWS region is your ECS cluster?  [Use arrows to move, type to filter, ? for more help]
> default
  find all clusters
  af-south-1
  ap-east-1
  ap-northeast-1
  ap-northeast-2
  ap-northeast-3
[INFO] Interrupted!

Comment on lines 173 to 175
if awsRegionFlag != "" {
wf.awsRegion = awsRegionFlag
err = wf.createSession()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have set this up so that if command-line arguments are provided, we do not prompt for that step at all.

The intent is that specifying all the command-line flags should be the same whether or not the program is running interactively. However, an alternative is that in interactive mode we could use the flags as the default and ask for confirmation. I'm still undecided, so feedback about when we ask for confirmation would be welcome: only at the end? At each step? Not at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if we waited until the end to confirm, but provided a command-line flag to skip this final confirmation?

Copy link
Member

@liujed liujed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look at this in more detail later, but here are a couple of quick comments.

go.mod Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
@mgritter mgritter marked this pull request as draft November 8, 2022 23:11
@mgritter
Copy link
Contributor Author

mgritter commented Nov 8, 2022

Converting to draft until sdk v2 conversion is complete.

Copy link
Member

@liujed liujed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments. I'll do the rest of the review when the change to SDK v2 lands.

cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
Use DescribeRegions to populate region list, but continue fallback of having a list available; this API requires AIM permissions!
Check permissions on operations and attempt to report them in a friendly fashion.
@mgritter mgritter changed the title First checkpoint on add-to-ECS command. add-to-ECS: select profile, region, and cluster Nov 11, 2022
@mgritter mgritter marked this pull request as ready for review November 11, 2022 01:03
@mgritter mgritter requested review from liujed and a team November 11, 2022 01:03
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
Comment on lines +277 to +279
if name == "" {
return ""
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cluster may not have a name.

cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/aws_api.go Outdated Show resolved Hide resolved
cmd/internal/ecs/aws_api.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
@liujed
Copy link
Member

liujed commented Nov 11, 2022

GitHub appears confused.
image

mgritter and others added 9 commits November 11, 2022 16:44
Fix module import.
Check for absence of any ECS clusters.
UnrecognizedClientException handling.
@mgritter mgritter merged commit 84168a6 into main Nov 11, 2022
@mgritter mgritter deleted the mgritter/ecs_command_and_profile_selection branch November 11, 2022 23:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants