agentcore_cli.utils.aws_utils
agentcore_cli.utils.aws_utils
¶
AWS utility functions for AgentCore CLI.
authenticate_with_ecr(region=None)
¶
Get ECR authentication command for Docker login.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str | None
|
Optional region name. If not provided, uses the default region. |
None
|
Returns:
Type | Description |
---|---|
tuple[bool, str]
|
Tuple[bool, str]: A tuple containing success status and either the auth command or an error message. |
Source code in agentcore_cli/utils/aws_utils.py
get_aws_account_id()
¶
Get the AWS account ID for the current credentials.
Returns:
Type | Description |
---|---|
str | None
|
Optional[str]: The AWS account ID or None if credentials are invalid. |
Source code in agentcore_cli/utils/aws_utils.py
Python | |
---|---|
get_aws_region()
¶
Get the configured AWS region from the current session.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The current AWS region name. |
get_aws_session(region=None, profile=None)
¶
Get a boto3 session with optional region configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str | None
|
Optional AWS region name. If not provided, uses the default region. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Session |
Session
|
A boto3 session object. |
Source code in agentcore_cli/utils/aws_utils.py
get_ecr_repository_uri(repo_name, region=None)
¶
Get the URI for an ECR repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repo_name
|
str
|
The name of the ECR repository. |
required |
region
|
str | None
|
Optional region name. If not provided, uses the default region. |
None
|
Returns:
Type | Description |
---|---|
str | None
|
Optional[str]: The repository URI or None if repository does not exist. |
Source code in agentcore_cli/utils/aws_utils.py
validate_aws_credentials()
¶
Check if AWS credentials are configured.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if valid credentials are found, False otherwise. |