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

inventory plugins - Hard code fall-back region to connect to when trying to pull a list of regions #1552

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/1551-ec2_inventory-no-region.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- aws_ec2 inventory plugin - fix ``NoRegionError`` when no regions are provided and region isn't specified (https://github.com/ansible-collections/amazon.aws/issues/1551).
3 changes: 2 additions & 1 deletion plugins/plugin_utils/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def _set_frozen_credentials(self):
def _describe_regions(self, service):
# Try pulling a list of regions from the service
try:
client = self.client(service)
initial_region = self.region or "us-east-1"
client = self.client(service, region=initial_region)
resp = client.describe_regions()
except AttributeError:
# Not all clients support describe
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/inventory_aws_ec2/aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
time=10m
time=15m

cloud/aws