Profile manager
async_boto.core.profile_manager
AWSProfileManager
AWSProfileManager(logger=None)
Handles AWS profiles similar to boto3 but without dependencies. Supports standard credential files and SSO authentication.
Source code in async_boto/core/profile_manager.py
17 18 19 20 21 22 23 24 25 26 27 28 | |
logger
instance-attribute
logger = logger or getLogger('AWSProfileManager')
get_profile
get_profile(profile_name=None)
Get a specific AWS profile.
Args: profile_name: The name of the profile to get. If None, will try to get the default profile or use AWS environment variables.
Returns: Profile data as a dictionary
Raises: ValueError: If the profile doesn't exist or no default can be found
Source code in async_boto/core/profile_manager.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
get_credentials
get_credentials(profile_name=None)
Get AWS credentials from profile or environment variables
Args: profile_name: The name of the profile to get credentials from. If None, will try to get the default profile or use AWS environment variables.
Returns: Dictionary with aws_access_key_id, aws_secret_access_key, aws_session_token (if available), and region_name (if available)
Source code in async_boto/core/profile_manager.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | |
get_credentials_async
async
get_credentials_async(profile_name=None, client_func=None)
Get AWS credentials asynchronously
Args: profile_name: The name of the profile to get credentials from client_func: Function to create an async client
Returns: Credentials dictionary
Source code in async_boto/core/profile_manager.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | |
list_profiles
list_profiles()
List all available AWS profiles
Returns: List of profile names
Source code in async_boto/core/profile_manager.py
544 545 546 547 548 549 550 551 552 | |
get_available_regions
get_available_regions(service_name='s3')
Get available regions for a service. This is a simplified implementation that returns common regions.
Args: service_name: AWS service name (ignored in this implementation)
Returns: List of region names
Source code in async_boto/core/profile_manager.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | |