Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.
Die Anzahl und Größe der Amazon SNS SNS-Ressourcen in einem AWS Konto sind begrenzt. Weitere Informationen finden Sie unter Amazon Simple Notification Service-Endpunkte und -Kontingente.
Erstellung von Datenschutzrichtlinien mithilfe des SDK AWS
Erstellen Sie mithilfe des AWS SDK eine Amazon SNS SNS-Datenschutzrichtlinie.
So erstellen Sie eine Datenschutzrichtlinie zusammen mit einem Amazon-SNS-Thema (AWS SDK)
Verwenden Sie die folgenden Optionen, um eine neue Datenschutzrichtlinie zusammen mit einem standardmäßigen Amazon-SNS-Thema zu erstellen:
/**
* For information regarding CreateTopic see this documentation topic:
*
* https://docs.aws.amazon.com/code-samples/latest/catalog/javav2-sns-src-main-java-com-example-sns-CreateTopic.java.html
*/
public static String createSNSTopicWithDataProtectionPolicy(SnsClient snsClient, String topicName, String dataProtectionPolicy) {
try {
CreateTopicRequest request = CreateTopicRequest.builder()
.name(topicName)
.dataProtectionPolicy(dataProtectionPolicy)
.build();
CreateTopicResponse result = snsClient.createTopic(request);
return result.topicArn();
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
return "";
}
So erstellen oder rufen Sie eine Datenschutzrichtlinie für ein vorhandenes Amazon-SNS-Thema ab (AWS SDK)
Verwenden Sie die folgenden Optionen, um eine neue Datenschutzrichtlinie zusammen mit einem standardmäßigen Amazon-SNS-Thema zu erstellen oder abzurufen:
public static void putDataProtectionPolicy(SnsClient snsClient, String topicName, String dataProtectionPolicy) {
try {
PutDataProtectionPolicyRequest request = PutDataProtectionPolicyRequest.builder()
.resourceArn(topicName)
.dataProtectionPolicy(dataProtectionPolicy)
.build();
PutDataProtectionPolicyResponse result = snsClient.putDataProtectionPolicy(request);
System.out.println("\n\nStatus was " + result.sdkHttpResponse().statusCode()
+ "\n\nTopic " + request.resourceArn()
+ " DataProtectionPolicy " + request.dataProtectionPolicy());
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
public static void getDataProtectionPolicy(SnsClient snsClient, String topicName) {
try {
GetDataProtectionPolicyRequest request = GetDataProtectionPolicyRequest.builder()
.resourceArn(topicName)
.build();
GetDataProtectionPolicyResponse result = snsClient.getDataProtectionPolicy(request);
System.out.println("\n\nStatus is " + result.sdkHttpResponse().statusCode()
+ "\n\nDataProtectionPolicy: \n\n" + result.dataProtectionPolicy());
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}