=====================
**aws-authenticator**
=====================
Overview
--------
Login to AWS using CLI named profiles, IAM access key credentials, or SSO.
Prerequisites
-------------
- *Python >= 3.6*
- *aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1*
- *boto3 (https://pypi.org/project/boto3/) >= 1.17.78*
Conditional Arguments
---------------------
If authenticating with named profiles:
- AWSCLI profile name
If authenticating with IAM acccess key credentials:
- AWS access key id
- AWS secret access key
If authenticating with SSO:
- AWS account ID
- AWS SSO Permission Set (role) name
- AWS SSO login URL
Usage
-----
Installation:
.. code-block:: BASH
pip3 install aws-authenticator
# or
python3 -m pip install aws-authenticator
In Python3 authenticating with named profiles:
.. code-block:: PYTHON
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
profile_name="<profile-name>",
)
session = auth.profile()
client = session.client("<service-name>")
In Python3 authenticating with IAM access key credentials:
.. code-block:: PYTHON
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
access_key_id="<access-key-id>",
secret_access_key="<secret-access-key>",
)
session = auth.iam()
client = session.client("<service-name>")
In Python3 authenticating with SSO:
.. code-block:: PYTHON
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
sso_url="<sso-url>",
sso_role_name="<sso-role-name>",
sso_account_id="<sso-account-id>",
)
session = auth.sso()
client = session.client("<service-name>")
Testing Examples
----------------
Testing SSO-based login in Python3:
.. code-block:: PYTHON
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
sso_url="<sso-url>",
sso_role_name="<sso-role-name>",
sso_account_id="<sso-account-id>",
)
session = auth.sso()
client = session.client("sts")
response = client.get_caller_identity()
print(response)
Testing profile-based login as a script in BASH:
.. code-block:: BASH
python [/path/to/]aws_authenticator \
-m profile \
-p <profile-name>
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator",
"name": "aws_authenticator",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.6",
"maintainer_email": null,
"keywords": "AWS, login, profile, access key, SSO",
"author": "Ahmad Ferdaus Abd Razak",
"author_email": "ahmad.ferdaus.abd.razak@ni.com",
"download_url": "https://files.pythonhosted.org/packages/8b/0d/80ebaae2fb2c1bec67dc5d33558b4648cbd27bce0bcd01c05beaefc29a08/aws_authenticator-2024.1.0.1.tar.gz",
"platform": null,
"description": "=====================\n**aws-authenticator**\n=====================\n\nOverview\n--------\n\nLogin to AWS using CLI named profiles, IAM access key credentials, or SSO.\n\nPrerequisites\n-------------\n\n- *Python >= 3.6*\n- *aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1*\n- *boto3 (https://pypi.org/project/boto3/) >= 1.17.78*\n\nConditional Arguments\n---------------------\n\nIf authenticating with named profiles:\n\n- AWSCLI profile name\n\nIf authenticating with IAM acccess key credentials:\n\n- AWS access key id\n- AWS secret access key\n\nIf authenticating with SSO:\n\n- AWS account ID\n- AWS SSO Permission Set (role) name\n- AWS SSO login URL\n\nUsage\n-----\n\nInstallation:\n\n.. code-block:: BASH\n\n pip3 install aws-authenticator\n # or\n python3 -m pip install aws-authenticator\n\nIn Python3 authenticating with named profiles:\n\n.. code-block:: PYTHON\n\n import aws_authenticator\n\n auth = aws_authenticator.AWSAuthenticator(\n profile_name=\"<profile-name>\",\n )\n session = auth.profile()\n client = session.client(\"<service-name>\")\n\nIn Python3 authenticating with IAM access key credentials:\n\n.. code-block:: PYTHON\n\n import aws_authenticator\n\n auth = aws_authenticator.AWSAuthenticator(\n access_key_id=\"<access-key-id>\",\n secret_access_key=\"<secret-access-key>\",\n )\n session = auth.iam()\n client = session.client(\"<service-name>\")\n\nIn Python3 authenticating with SSO:\n\n.. code-block:: PYTHON\n\n import aws_authenticator\n\n auth = aws_authenticator.AWSAuthenticator(\n sso_url=\"<sso-url>\",\n sso_role_name=\"<sso-role-name>\",\n sso_account_id=\"<sso-account-id>\",\n )\n session = auth.sso()\n client = session.client(\"<service-name>\")\n\nTesting Examples\n----------------\n\nTesting SSO-based login in Python3:\n\n.. code-block:: PYTHON\n\n import aws_authenticator\n\n auth = aws_authenticator.AWSAuthenticator(\n sso_url=\"<sso-url>\",\n sso_role_name=\"<sso-role-name>\",\n sso_account_id=\"<sso-account-id>\",\n )\n session = auth.sso()\n client = session.client(\"sts\")\n\n response = client.get_caller_identity()\n print(response)\n\nTesting profile-based login as a script in BASH:\n\n.. code-block:: BASH\n\n python [/path/to/]aws_authenticator \\\n -m profile \\\n -p <profile-name>\n",
"bugtrack_url": null,
"license": "GPL-2.0-only",
"summary": "Login to AWS using CLI named profiles, IAM access key credentials, or SSO.",
"version": "2024.1.0.1",
"project_urls": {
"Homepage": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator",
"Repository": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator"
},
"split_keywords": [
"aws",
" login",
" profile",
" access key",
" sso"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c3c6efb305ad8de5fa7f8960a50ada0b09717182b3d4e68962f6232b27eb429e",
"md5": "536c4fcf58ed6637dc0c842a3c6520a8",
"sha256": "0c8bb363b0f9efd98d40bc6c9086036e7b56caf1ecea9b2ea356d45bab4133ee"
},
"downloads": -1,
"filename": "aws_authenticator-2024.1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "536c4fcf58ed6637dc0c842a3c6520a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.6",
"size": 3998,
"upload_time": "2024-11-12T14:06:56",
"upload_time_iso_8601": "2024-11-12T14:06:56.300417Z",
"url": "https://files.pythonhosted.org/packages/c3/c6/efb305ad8de5fa7f8960a50ada0b09717182b3d4e68962f6232b27eb429e/aws_authenticator-2024.1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8b0d80ebaae2fb2c1bec67dc5d33558b4648cbd27bce0bcd01c05beaefc29a08",
"md5": "cd85d041071d387ea4dd4ba1ea3ba197",
"sha256": "3e9a7b7a406f213f3b6cad21b6e1483257b1d793737266c6c3e01fe71fe14e4e"
},
"downloads": -1,
"filename": "aws_authenticator-2024.1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "cd85d041071d387ea4dd4ba1ea3ba197",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.6",
"size": 2833,
"upload_time": "2024-11-12T14:06:57",
"upload_time_iso_8601": "2024-11-12T14:06:57.901324Z",
"url": "https://files.pythonhosted.org/packages/8b/0d/80ebaae2fb2c1bec67dc5d33558b4648cbd27bce0bcd01c05beaefc29a08/aws_authenticator-2024.1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 14:06:57",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "fer1035_python",
"gitlab_project": "modules",
"lcname": "aws_authenticator"
}