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

Add method for attempting dynamical region fetching for AWSSystemsManagerParameterStoreBackend #34

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

ValeriyWorld
Copy link
Contributor

@ValeriyWorld ValeriyWorld commented Dec 19, 2023

Adds 2 additional methods to retrieve was region for AWSSystemsManagerParameterStoreBackend.
Prioritisation of getting region:

  1. We try to get it from environment variables
  2. If there are no such variable we try to get it from collector_config.yaml
  3. If config does not contains information about region too we are trying to get it from AWS Instance Metadata Service (we assume ODD deployed to EKS)

If none of this worked - we put None, and get error as we can not setup boto3 connection.

@ValeriyWorld ValeriyWorld self-assigned this Dec 19, 2023
@github-actions github-actions bot added the enhancement New feature or request label Dec 19, 2023
@ValeriyWorld ValeriyWorld merged commit 03a0aac into main Dec 19, 2023
1 check passed
@ValeriyWorld ValeriyWorld deleted the feature/dynamic_region_fetching branch December 19, 2023 11:37
try:
# Token is required for IMDSv2
token_response = requests.put(
"http://169.254.169.254/latest/api/token",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it feels obvious due there is the AWS context around. But I would a comment about IP - what is it? where it comes from? etc.

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

Successfully merging this pull request may close these issues.

2 participants