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

AWS IMDSv2 Support for environment detection #963

Open
kaiba42 opened this issue Jan 17, 2024 · 0 comments · May be fixed by #967
Open

AWS IMDSv2 Support for environment detection #963

kaiba42 opened this issue Jan 17, 2024 · 0 comments · May be fixed by #967

Comments

@kaiba42
Copy link

kaiba42 commented Jan 17, 2024

Spilo is awesome and can automatically detect the environment it is running in.

To detect when it is running in AWS, it uses the Instance Metadata Service. Today, it uses v1 of the API, however AWS is transitioning to v2. Nowadays, new EC2 instance machine images often configured to only support v2.

Without support for detecting AWS using the v2 API, Spilo set the environment to PROVIDER_UNSUPPORTED, and will fail to perform certain bootstrap actions, namely backup (aka clone) restoration.

To fix this, we just need to call IMDSv2's session token endpoint in the get_provider function, and if we get a response, we know the environment is still AWS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant