-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Support non-standard AWS regions #7997
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
Conversation
@unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) | ||
def test_nonstandard_regions(create_boto_client, monkeypatch): | ||
""" | ||
Ensure that non-standard AWS regions can be used vertically. | ||
""" | ||
monkeypatch.setenv("MOTO_ALLOW_NONEXISTENT_REGION", "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we want to patch the config option before LS starts. What's a proper way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately there is no good way of doing as at all. especially not in a test. config.py seems good for the runtime
987c703
to
d0c26fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice addition!
ec2_client.create_key_pair(KeyName="foo") | ||
|
||
# Create a resource in LocalStack store | ||
sqs_client = create_boto_client("sqs", region_name="pluto-central-2a") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D
@unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) | ||
def test_nonstandard_regions(create_boto_client, monkeypatch): | ||
""" | ||
Ensure that non-standard AWS regions can be used vertically. | ||
""" | ||
monkeypatch.setenv("MOTO_ALLOW_NONEXISTENT_REGION", "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately there is no good way of doing as at all. especially not in a test. config.py seems good for the runtime
thanks guys |
import unittest | ||
|
||
|
||
@unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually use monkeypatch.setattr(config, "ALLOW_NONSTANDARD_REGIONS", True)
here.
Any reason you're using unittest in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason at all, it just didn't cross my mind. I'll fix it when I retouch this next time
Introduces a new config option
ALLOW_NONSTANDARD_REGIONS
which disables strict validation of AWS regions.Closes #7993