D’autres exemples de kits AWS SDK sont disponibles dans le référentiel GitHub AWS Doc SDK Examples
Utilisation de UpdateCertificateOptions avec un kit AWS SDK ou une interface de ligne de commande
Les exemples de code suivants illustrent comment utiliser UpdateCertificateOptions.
- C++
-
- kit SDK pour C++
-
Note
Il y en a plus sur GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS
. //! Update an AWS Certificate Manager (ACM) certificate option. /*! \param certificateArn: The Amazon Resource Name (ARN) of a certificate. \param loggingEnabled: Boolean specifying logging enabled. \param clientConfiguration: AWS client configuration. \return bool: Function succeeded. */ bool AwsDoc::ACM::updateCertificateOption(const Aws::String &certificateArn, bool loggingEnabled, const Aws::Client::ClientConfiguration &clientConfiguration) { Aws::ACM::ACMClient acmClient(clientConfiguration); Aws::ACM::Model::UpdateCertificateOptionsRequest request; request.SetCertificateArn(certificateArn); Aws::ACM::Model::CertificateOptions options; if (loggingEnabled) { options.SetCertificateTransparencyLoggingPreference( Aws::ACM::Model::CertificateTransparencyLoggingPreference::ENABLED); } else { options.SetCertificateTransparencyLoggingPreference( Aws::ACM::Model::CertificateTransparencyLoggingPreference::DISABLED); } request.SetOptions(options); Aws::ACM::Model::UpdateCertificateOptionsOutcome outcome = acmClient.UpdateCertificateOptions(request); if (!outcome.IsSuccess()) { std::cerr << "UpdateCertificateOption error: " << outcome.GetError().GetMessage() << std::endl; return false; } else { std::cout << "Success: The option '" << (loggingEnabled ? "enabled" : "disabled") << "' has been set for " "the certificate with the ARN '" << certificateArn << "'." << std::endl; return true; } }-
Pour plus de détails sur l’API, consultez UpdateCertificateOptions dans la Référence des API du kit AWS SDK pour C++.
-
- CLI
-
- AWS CLI
-
Pour mettre à jour les options de certificat
La commande
update-certificate-optionssuivante permet de désactiver la journalisation de la transparence des certificats :aws acm update-certificate-options --certificate-arnarn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012--optionsCertificateTransparencyLoggingPreference=DISABLED-
Pour plus de détails sur l’API, consultez UpdateCertificateOptions
dans la Référence des commandes de l’AWS CLI.
-
ResendValidationEmail
API Gateway