spenczar / lektor-s3

Plugin to deploy a Lektor project to an S3 bucket
MIT License
44 stars 10 forks source link

Allow --username parameter to specify AWS credentials profile name #2

Closed kwellman closed 8 years ago

kwellman commented 8 years ago

For people who use profiles in their .aws/credentials to handle multiple accounts, this pull request adds the ability to specify the profile name using the --username parameter. If parameter not set, default profile will be used.

spenczar commented 8 years ago

Hm, I'm not sure I like using --username for this. It's a strange name to use, and we'd only be using it because it's all that Lektor gives us today.

Instead, I think it would be better to store this in a plugin configuration file, or maybe even in the .lektorproject file under the [servers] section as a new key-value pair.

Another option would be making a change to Lektor to allow adding additional credential fields in the deploy command.

What do you think?

spenczar commented 8 years ago

FYI, while we discuss this - AWS_PROFILE=whatever lektor deploy will work since boto will respect the env var.

kwellman commented 8 years ago

Yeah. --username is a little odd and confusing. I think just setting the environment variable from the command line might by the way to go.

spenczar commented 8 years ago

Okay, glad you agree. I've added some documentation to the README to point out that AWS_PROFILE is a good way to do this; I'm going to close this PR.

petahbred commented 8 years ago

Is setting the AWS_PROFILE available in the .lektorproject file?

spenczar commented 8 years ago

@psrivongse: No, we load the AWS credentials using the normal keychains provided by boto. The boto docs provide a complete description of all the ways you can pass creds in.