EcsRamRoleClient.php 596 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace AlibabaCloud\Client\Clients;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use AlibabaCloud\Client\Signature\ShaHmac1Signature;
  5. use AlibabaCloud\Client\Credentials\EcsRamRoleCredential;
  6. /**
  7. * Use the RAM role of an ECS instance to complete the authentication.
  8. */
  9. class EcsRamRoleClient extends Client
  10. {
  11. /**
  12. * @param string $roleName
  13. *
  14. * @throws ClientException
  15. */
  16. public function __construct($roleName)
  17. {
  18. parent::__construct(
  19. new EcsRamRoleCredential($roleName),
  20. new ShaHmac1Signature()
  21. );
  22. }
  23. }