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

CSHARP-4463: Add aws auth connectivity examples. #1004

Merged
merged 2 commits into from Jan 11, 2023

Conversation

DmitryLukyanov
Copy link

No description provided.

@DmitryLukyanov DmitryLukyanov changed the title CSHARP-4463: Add connectivity examples. CSHARP-4463: Add aws connectivity examples. Dec 28, 2022
@DmitryLukyanov DmitryLukyanov changed the title CSHARP-4463: Add aws connectivity examples. CSHARP-4463: Add aws auth connectivity examples. Dec 28, 2022
Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

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

See comments inline.

{
/// <summary>
/// Atlas preconditions for local run:
/// 1. Get your AWS_* (aws_access_key_id, aws_secret_access_key, aws_session_token (optional, but Pay attention that the value should be regenerated from time to time.)) credentials.
Copy link
Contributor

Choose a reason for hiding this comment

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

The AWS_* environment variables should all be uppercase. e.g. AWS_ACCESS_KEY_ID

Copy link
Contributor

Choose a reason for hiding this comment

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

Pay => pay

Copy link
Contributor

Choose a reason for hiding this comment

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

/// 1. Configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
and optionally AWS_SESSION_TOKEN. If used, AWS_SESSION_TOKEN
should be regenerated periodically.

Copy link
Author

Choose a reason for hiding this comment

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

done

/// "Arn": "arn:aws:sts::%ID_VALUE%:assumed-role/%ROLE_NAME%/[user_name@mongodb.com](mailto:user_name@mongodb.com)"
/// }
/// pay attention on %ROLE_NAME%.
/// </summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

should be at the end of the comment block.

Copy link
Author

Choose a reason for hiding this comment

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

done

/// <summary>
/// Atlas preconditions for local run:
/// 1. Get your AWS_* (aws_access_key_id, aws_secret_access_key, aws_session_token (optional, but Pay attention that the value should be regenerated from time to time.)) credentials.
/// You may use `Command line or programming access` page on ..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.

..aws.amazon.com
Should this be a URL?

programming access => programmatic access

Copy link
Author

Choose a reason for hiding this comment

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

Should this be a URL?

the full url contains particular company or region related address parts. But It's possible to provide more detailed address path (changed now). Since effectively Command line or programmatic access is placed on .awsapps.com page. See what you think, we can simply remove this comment part too

/// "Account": "%ID_VALUE%",
/// "Arn": "arn:aws:sts::%ID_VALUE%:assumed-role/%ROLE_NAME%/[user_name@mongodb.com](mailto:user_name@mongodb.com)"
/// }
/// pay attention on %ROLE_NAME%.
Copy link
Contributor

Choose a reason for hiding this comment

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

Given this is a public example, we should use user@example.com or some other generic email address rather than a mongodb.com email address. As well, the email address shouldn't be formatted as a mailto link.

Copy link
Author

Choose a reason for hiding this comment

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

done

/// ...
/// in the provided roles, search for a record with a RoleName equal to %ROLE_NAME% and record his arn.
/// 5. In your atlas cluster, create a new user with AWS authentication and set AWS IAM Role ARN from #4.
/// 6. Then configure a mongoClient in the same way as it's done in these examples with MONGODB-AWS auth credentials.
Copy link
Contributor

Choose a reason for hiding this comment

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

mongoClient => MongoClient (since it's the name of a class and not a variable)

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

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

LGTM

@DmitryLukyanov DmitryLukyanov merged commit 70ed174 into mongodb:master Jan 11, 2023
dnickless pushed a commit to dnickless/mongo-csharp-driver that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants