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

Conversation

Laren-AWS
Copy link
Contributor

The resilient service scenario hardcoded the region in the startup script and required it be sent to the Python web server.

This updates the web server to use ec2_metadata.region so that the web server uses the same region as the instance and sending the region is no longer required.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Laren-AWS Laren-AWS self-assigned this Oct 11, 2023
@github-actions github-actions bot added the Python This issue relates to the AWS SDK for Python (boto3) label Oct 11, 2023
@Laren-AWS Laren-AWS added Task Python This issue relates to the AWS SDK for Python (boto3) On Call Review needed This work needs an on-call review Text Review not needed This contains no text which needs review and removed Python This issue relates to the AWS SDK for Python (boto3) labels Oct 11, 2023
@cpyle0819
Copy link
Contributor

Don't forget your readmes.

Use SSM.SendCommand to restart the web server on the instance.
self.ssm_client.send_command(
    InstanceIds=[instance_id], 
    DocumentName='AWS-RunShellScript',
    Parameters={'commands': ['cd / && sudo python3 server.py 80 us-west-2']})

@ford-at-aws ford-at-aws force-pushed the fix-resilient-service-region branch from 6e0101e to eb8c6e8 Compare October 13, 2023 13:59
@ford-at-aws ford-at-aws added On Call Review complete On call review complete and removed On Call Review needed This work needs an on-call review labels Oct 13, 2023
@ford-at-aws ford-at-aws merged commit 10ec2aa into awsdocs:main Oct 13, 2023
13 of 14 checks passed
ford-at-aws pushed a commit that referenced this pull request Dec 15, 2023
* Use EC2 instance metadata to get the region instead of passing in a hardcoded value.

* Use branch version of server.py for testing.

* Get server script from main.

* Remove region from spec.
@Laren-AWS Laren-AWS deleted the fix-resilient-service-region branch June 10, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Call Review complete On call review complete Python This issue relates to the AWS SDK for Python (boto3) Text Review not needed This contains no text which needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants