Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Working with IAM server certificates with AWS SDK for PHP Version 3 - AWS SDK for PHP

Working with IAM server certificates with AWS SDK for PHP Version 3

To enable HTTPS connections to your website or application on AWS, you need an SSL/TLS server certificate. To use a certificate that you obtained from an external provider with your website or application on AWS, you must upload the certificate to IAM or import it into AWS Certificate Manager.

The following examples show how to:

All the example code for the AWS SDK for PHP is available here on GitHub.

Credentials

Before running the example code, configure your AWS credentials, as described in Credentials. Then import the AWS SDK for PHP, as described in Basic usage.

List server certificates

Imports

require 'vendor/autoload.php'; use Aws\Exception\AwsException; use Aws\Iam\IamClient;

Sample Code

$client = new IamClient([ 'profile' => 'default', 'region' => 'us-west-2', 'version' => '2010-05-08' ]); try { $result = $client->listServerCertificates(); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); }

Retrieve a server certificate

Imports

require 'vendor/autoload.php'; use Aws\Exception\AwsException; use Aws\Iam\IamClient;

Sample Code

$client = new IamClient([ 'profile' => 'default', 'region' => 'us-west-2', 'version' => '2010-05-08' ]); try { $result = $client->getServerCertificate([ // ServerCertificateName is required 'ServerCertificateName' => 'string', ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); }

Update a server certificate

Imports

require 'vendor/autoload.php'; use Aws\Exception\AwsException; use Aws\Iam\IamClient;

Sample Code

$client = new IamClient([ 'profile' => 'default', 'region' => 'us-west-2', 'version' => '2010-05-08' ]); try { $result = $client->updateServerCertificate([ // ServerCertificateName is required 'ServerCertificateName' => 'string', 'NewServerCertificateName' => 'string', ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); }

Delete a server certificate

Imports

require 'vendor/autoload.php'; use Aws\Exception\AwsException; use Aws\Iam\IamClient;

Sample Code

$client = new IamClient([ 'profile' => 'default', 'region' => 'us-west-2', 'version' => '2010-05-08' ]); try { $result = $client->deleteServerCertificate([ // ServerCertificateName is required 'ServerCertificateName' => 'string', ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.