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

[S3] Parse AWS configuration with support for profile section #2969

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

mannreis
Copy link
Contributor

@mannreis mannreis commented Aug 8, 2024

Hello 👋!

I've faced a minor problem on my setup when I have a profile section on the configuration file [1] (valid with aws tools). In such case the netcdf library fails to load the AWS config, not critical but not obvious.

This is a quick fix I did for my myself, but looking at the parser and aws config specification I see parsing problems with:

  • Token delimiter characters in the values
  • Support for comments
  • Multiline service configuration

I'm not sure to which extend you want to support loading the AWS config when the building with the internal S3 implementation.

Thanks!

[1]
~/.aws/credentials

[default]
aws_access_key_id=123
aws_secret_access_key=456

[user1]
aws_access_key_id=123
aws_secret_access_key=789

~/.aws/config

[default]
region=us-west-2
output=json

[profile user1]
region=us-east-1
output=text

@DennisHeimbigner
Copy link
Collaborator

Let me make sure I understand.

  1. When the profile name is specified as e.g "[user1]", the file (either credentials and config) parse correctly.
  2. When the profile name is specified as e.g "[profile user1]", the file (either credentials and config) does not parse.

Have I stated the problem correctly?

@mannreis
Copy link
Contributor Author

mannreis commented Aug 9, 2024

Exactly!

@WardF WardF self-assigned this Aug 12, 2024
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner left a comment

Choose a reason for hiding this comment

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

The best way to create a file in bash/sh is to use this method:

https://jinnabaalu.medium.com/create-a-file-in-bash-using-eof-af5af33c0d1f

@WardF
Copy link
Member

WardF commented Aug 19, 2024

Just checking in @DennisHeimbigner and @mannreis in regards to the latest changes requests. It looks like @mannreis made some changes, how does this look now @DennisHeimbigner ?

Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner left a comment

Choose a reason for hiding this comment

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

One more change, please. Remove the .aws directory at the end of the shell script so that automake distcheck will not fail.

@WardF WardF merged commit 62583f1 into Unidata:main Aug 20, 2024
109 checks 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.

3 participants