Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logout option to rain console #274

Merged
merged 3 commits into from
Feb 19, 2024

Conversation

khmoryz
Copy link
Collaborator

@khmoryz khmoryz commented Feb 11, 2024

Issue

#267

Description of changes:

Add console logout option.

$ ./rain console -l
(explain: Browser starts immediately and access to the sign-out URL)

$ ./rain console -lu 
Open the following URL in your browser: https://signin.aws.amazon.com/oauth?Action=logout&redirect_uri=https://aws.amazon.com

Impact of this change
URL generation messages have changed.

before: Generating sign-in URL
after: Generating URL

Because, generated URL is not only sign-in URL.

Concern

This feature is tested only on Mac.
Not tested on Linux/Windows because of the time-consuming preparation.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -21,7 +21,7 @@ cfn-lint, Guard and more:

## Key features

* **Interactive deployments**: With `rain deploy`, rain packages your CloudFormation templates using [`aws cloudformation package`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/package.html), prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.
* **Interactive deployments**: With `rain deploy`, rain packages your CloudFormation templates, prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you edit this file directly? It is generated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't edit this file directly.
I tried again in the latest commit, but I got the same result.

❯ git log -n 1
commit 14666afa1ae8a679862853f4a6c28e01d2b3f99d (HEAD -> main, origin/main, origin/HEAD)
Merge: 7ddc5c2 130e805
Author: Eric Z. Beard <ericzbeard@gmail.com>
Date:   Tue Feb 13 10:59:57 2024 -0800

    Merge pull request #275 from aws-cloudformation/dependabot/go_modules/golang.org/x/term-0.17.0
    
    Bump golang.org/x/term from 0.16.0 to 0.17.0

❯ git status 
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

❯ go generate ./...
go: downloading golang.org/x/term v0.17.0
go: downloading golang.org/x/sys v0.17.0

❯ git diff README.md 
diff --git a/README.md b/README.md
index 501f01b..f5d283f 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ cfn-lint, Guard and more:
 
 ## Key features
 
-* **Interactive deployments**: With `rain deploy`, rain packages your CloudFormation templates using [`aws cloudformation package`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/package.html), prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.
+* **Interactive deployments**: With `rain deploy`, rain packages your CloudFormation templates, prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.
 
 * **Consistent formatting of CloudFormation templates**: Using `rain fmt`, you can format your CloudFormation templates to a consistent standard or reformat a template from JSON to YAML (or YAML to JSON if you prefer). Rain preserves your comments when using YAML and switches use of [intrinsic functions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html) to use the short syntax where possible.
 
@@ -51,8 +51,7 @@ Usage:
 
 Stack commands:
   cat         Get the CloudFormation template from a running stack
-  ccdeploy    Deploy a local template directly using the Cloud Control API (Experimental!)
-  ccrm        Delete a deployment created by ccdeploy (Experimental!)
+  cc          Interact with templates using Cloud Control API instead of CloudFormation
   deploy      Deploy a CloudFormation stack from a local template
   logs        Show the event log for the named stack
   ls          List running CloudFormation stacks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess the sentence is added directly.

using aws cloudformation package

Because the sentence doesn't appear in README.tmpl

  • Interactive deployments: With rain deploy, rain packages your CloudFormation templates, prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.

https://github.com/aws-cloudformation/rain/blob/main/docs/README.tmpl#L24

May I add the sentence to README.tmlp?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I removed that one and haven't regenerated the README yet.

@@ -20,6 +20,7 @@ import (
var signinURI string
var consoleURI string

const signoutURI = "https://signin.aws.amazon.com/oauth?Action=logout&redirect_uri=https://aws.amazon.com"
Copy link
Contributor

Choose a reason for hiding this comment

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

What about govcloud?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fixed in 5851bc2

export AWS_REGION=us-gov-east-1

❯ go run cmd/aws-console/main.go -lu                                 
Open the following URL in your browser: https://signin.amazonaws-us-gov.com/oauth?Action=logout&redirect_uri=https://amazonaws-us-gov.com

❯ export AWS_REGION=ap-northeast-1  

❯ go run cmd/aws-console/main.go -lu
Open the following URL in your browser: https://signin.aws.amazon.com/oauth?Action=logout&redirect_uri=https://aws.amazon.com

Copy link
Contributor

@ericzbeard ericzbeard left a comment

Choose a reason for hiding this comment

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

Two comments - about generating the readme, and using a different url for govcloud. @khmoryz

@khmoryz
Copy link
Collaborator Author

khmoryz commented Feb 18, 2024

@ericzbeard
Thanks for your review.
Could you check this, please?

@ericzbeard ericzbeard merged commit ff7bd65 into aws-cloudformation:main Feb 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants