|
1 | 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2 | 2 | # SPDX-License-Identifier: Apache-2.0.
|
3 |
| -import subprocess |
4 | 3 |
|
5 | 4 | from builder.core.action import Action
|
6 | 5 | from builder.core.host import current_os, current_arch
|
@@ -427,26 +426,9 @@ def _common_setup(self, env):
|
427 | 426 |
|
428 | 427 | pass
|
429 | 428 |
|
430 |
| - def get_sts_caller_identity(self): |
431 |
| - try: |
432 |
| - # Run AWS CLI command to get STS caller identity |
433 |
| - result = subprocess.run(['aws', 'sts', 'get-caller-identity'], stdout=subprocess.PIPE, |
434 |
| - stderr=subprocess.PIPE, text=True) |
435 |
| - # Check if the command was successful |
436 |
| - if result.returncode == 0: |
437 |
| - # Parse the JSON output |
438 |
| - caller_identity = json.loads(result.stdout) |
439 |
| - print("Caller Identity:", json.dumps(caller_identity, indent=4)) |
440 |
| - else: |
441 |
| - print(f"Error: {result.stderr}") |
442 |
| - |
443 |
| - except Exception as e: |
444 |
| - print(f"An error occurred: {e}") |
445 |
| - |
446 | 429 | def run(self, env):
|
447 | 430 | # A special environment variable indicating that we want to dump test environment variables to a specified file.
|
448 | 431 | env_dump_file = env.shell.getenv("AWS_SETUP_CRT_TEST_ENVIRONMENT_DUMP_FILE")
|
449 |
| - print(f"waahm7: {self.get_sts_caller_identity()}") |
450 | 432 |
|
451 | 433 | # Bail if not running tests
|
452 | 434 | if not env.project.needs_tests(env) and not env_dump_file:
|
|
0 commit comments