Mengirim ulang email validasi - AWS Certificate Manager

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Mengirim ulang email validasi

Contoh berikut menunjukkan kepada Anda cara menggunakan cara menggunakan cara menggunakan cara menggunakan cara menggunakan cara menggunakan cara menggunakan ResendValidationEmailfungsi ini.

package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailRequest; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailResult; import com.amazonaws.services.certificatemanager.model.InvalidDomainValidationOptionsException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.InvalidStateException; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; /** * This sample demonstrates how to use the ResendValidationEmail function in the AWS Certificate * Manager service. * * Input parameters: * CertificateArn - Amazon Resource Name (ARN) of the certificate request. * Domain - FQDN in the certificate request. * ValidationDomain - The base validation domain that is used to send email. * */ public class AWSCertificateManagerExample { public static void main(String[] args) { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and set the input parameters. ResendValidationEmailRequest req = new ResendValidationEmailRequest(); req.setCertificateArn("arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012"); req.setDomain("gregpe.io"); req.setValidationDomain("gregpe.io"); // Create a result object. ResendValidationEmailResult result = null; try { result = client.resendValidationEmail(req); } catch(ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidDomainValidationOptionsException ex) { throw ex; } // Display the result. System.out.println(result.toString()); } }

Contoh sebelumnya mengirim ulang email validasi Anda dan menampilkan satu set kosong.