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

metadata: Add helper to get AWS_EXECUTION_ENV #164

Merged
merged 1 commit into from
Jun 29, 2023
Merged
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
9 changes: 9 additions & 0 deletions granulate_utils/metadata/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#

import logging
import os
from dataclasses import dataclass
from http.client import NOT_FOUND
from typing import Dict, List, Optional, Union
Expand Down Expand Up @@ -196,3 +197,11 @@ def _fetch() -> Optional[Metadata]:
" The most likely reason is that we're not installed on a an AWS, GCP or Azure instance."
)
return None


def get_aws_execution_env() -> Optional[str]:
"""
Possible values include:
- AWS_ECS_FARGATE
"""
return os.environ.get("AWS_EXECUTION_ENV")