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

Fix resilient service region #5489

Merged
merged 4 commits into from
Oct 13, 2023
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: 1 addition & 1 deletion python/cross_service/resilient_service/auto_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def replace_instance_profile(
inst_ready = True
self.ssm_client.send_command(
InstanceIds=[instance_id], DocumentName='AWS-RunShellScript',
Parameters={'commands': ['cd / && sudo python3 server.py 80 us-west-2']})
Parameters={'commands': ['cd / && sudo python3 server.py 80']})
log.info("Restarted the Python web server on instance %s.", instance_id)
except ClientError as err:
raise AutoScalerError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def run():
"""
parser = argparse.ArgumentParser()
parser.add_argument('port', default=80, type=int, help="The port where the HTTP server listens.")
parser.add_argument('region', default='us-west-2', help="The AWS Region of AWS resources used by this example.")
parser.add_argument('--region', default=ec2_metadata.region, help="The AWS Region of AWS resources used by this example.")
args = parser.parse_args()

server_port = args.port
Expand Down
2 changes: 1 addition & 1 deletion workflows/resilient_service/SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ Select an instance, replace its instance profile, and reboot the instance.
self.ssm_client.send_command(
InstanceIds=[instance_id],
DocumentName='AWS-RunShellScript',
Parameters={'commands': ['cd / && sudo python3 server.py 80 us-west-2']})
Parameters={'commands': ['cd / && sudo python3 server.py 80']})
```

Tell the user all about it:
Expand Down
2 changes: 1 addition & 1 deletion workflows/resilient_service/resources/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def run():
"""
parser = argparse.ArgumentParser()
parser.add_argument('port', default=80, type=int, help="The port where the HTTP server listens.")
parser.add_argument('region', default='us-west-2', help="The AWS Region of AWS resources used by this example.")
parser.add_argument('--region', default=ec2_metadata.region, help="The AWS Region of AWS resources used by this example.")
args = parser.parse_args()

server_port = args.port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sleep 30 # prevent "Error: Rpmdb changed underneath us"
yum install python-pip -y
python3 -m pip install boto3 ec2-metadata
wget -O server.py https://raw.githubusercontent.com/awsdocs/aws-doc-sdk-examples/main/workflows/resilient_service/resources/server.py
python3 server.py 80 us-west-2
python3 server.py 80
Loading