Add environment variable support for AWS profiles and regions#297
Merged
samuhale merged 1 commit intoaws:masterfrom Jul 29, 2025
Merged
Add environment variable support for AWS profiles and regions#297samuhale merged 1 commit intoaws:masterfrom
samuhale merged 1 commit intoaws:masterfrom
Conversation
Implements support for standard AWS environment variables: - AWS_PROFILE for specifying AWS profile - AWS_REGION and AWS_DEFAULT_REGION for specifying region This addresses GitHub issues: - aws#278: AWS Profiles – support for standard environment variables - aws#166: Support setting region as env var and/or mount option Changes: - Modified get_aws_profile() to check AWS_PROFILE environment variable - Modified get_target_region() to check AWS_REGION and AWS_DEFAULT_REGION - Added comprehensive test coverage for environment variable functionality - Updated README with documentation and examples - Maintains backward compatibility with existing behavior The implementation follows standard AWS CLI precedence: 1. Mount options take highest precedence 2. Environment variables are checked next 3. Config files and instance metadata are fallbacks This improves usability in containerized environments, CI/CD pipelines, and other automated deployment scenarios.
samuhale
approved these changes
Jul 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements support for standard AWS environment variables:
This addresses GitHub issues:
Changes:
The implementation follows standard AWS CLI precedence:
This improves usability in containerized environments, CI/CD pipelines, and other automated deployment scenarios.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.