mantil-io / mantil

Build your AWS Lambda-based Go backends quicker than ever
https://www.mantil.com
MIT License
110 stars 3 forks source link

Improve CLI communication - aws uninstall #59

Closed ksokolic closed 2 years ago

ksokolic commented 2 years ago

aws uninstall help

ksenijakordisokolic@Florence Work % mantil aws uninstall --help
Uninstall Mantil from AWS account

USAGE
mantil aws uninstall [account-name] [flags]

ARGUMENTS
Argument account-name is for referencing that account in Mantil.
If not provided default account dev will be used.

FLAGS
--aws-access-key-id string       Access key ID for the AWS account, must be used with the aws-secret-access-key and aws-region flags.
--aws-env                        Use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION environment variables for AWS authentication.
--aws-profile string             Use the given profile for AWS authentication.
--aws-region string              Region for the AWS account, must be used with and aws-access-key-id and aws-secret-access-key flags.
--aws-secret-access-key string   Secret access key for the AWS account, must be used with the aws-access-key-id and aws-region flags.
--dry-run                        Don't start install/uninstall just show what credentials will be used.

EXAMPLES
You must provide credentials for Mantil to access your AWS account.
There are three ways to provide credentials.

$ mantil aws install --aws-access-key-id=AKIAIOSFODNN7EXAMPLE --aws-secret-access-key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY —aws-region=us-east-1
=> specifies access keys as arguments

$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$ export AWS_DEFAULT_REGION=us-east-1
$ mantil aws install --aws-env
=> reads access keys from environment variables
reference: [https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)

$ mantil aws install —aws-profile=my-named-profile
=> uses your named AWS profile from ~/.aws/config
reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

GLOBAL FLAGS
--help       Show command help.
--no-color   Don't use colors in output.

LEARN MORE
Visit [https://docs.mantil.io](https://docs.mantil.io/) to learn more.
For further support contact us at hello@mantil.com. 

aws uninstall happy path - ask for confirmation

ksenijakordisokolic@Florence Work % mantil aws uninstall --aws-profile Ksenija
? You are going to uninstall account dev. This action cannot be reversed. To confirm, type the account name: 

==> Destroying AWS infrastructure...
Destroying Cloudwatch log groups... Done. 
Removing IAM Roles... Done.
Removing DynamoDB database... Done. 
Destroying Mantil Lambda functions... Done. 
Destroying SQS forwarder... Done.
Destroying API Gateway... Done.
Destroying setup stack...Done.
==> Uninstall successful!
0 items added, 0 changed, 63 destroyed
==> Removing setup stack...Done.

aws uninstall error Option 1: write more concise error

ksokolic commented 2 years ago

aws uninstall output should be:

%  mantil aws uninstall my-node --aws-profile Ksenija
? You are going to destroy node my-node. This action cannot be reversed. To confirm, type yes: (y/N)

* Grab your seat and stay patient. This will take a while.

Destroying AWS infrastructure
   Initializing, done.
   Planning changes, done.
   Destroying infrastructure: 100% (36/36), done.

Destroying setup stack: 100% (4/4), done.

Mantil node [name] destroyed: 
- S3 bucket
- Lambda functions
- API Gateways
- IAM Roles
- DynamoDB table
- Cloudwatch log groups
- CloudFormation stack

* We are sorry to see you go. Help us make Mantil better by letting us know what you didn’t like at hello@mantil.com.

Look&feel can be checked at GoogleDoc.

IvanVlasic commented 2 years ago

To confirm, type yes: (y/N)

Treba mi pojasnjenje za ovo. Jel ovo y/N ono sto korisnik upisuje ili je to dio teksta. jel mogu upisati samo yes, ili samo y ili oboje?

ksokolic commented 2 years ago

y/N je ono što user upisuje. Može upisati ili yes ili y, ako ne upiše ništa smatramo da je odustao od naredbe (tj kao da je upisao no).