I found the code below at https://forums.aws.amazon.com/thread.jspa?threadID=53629:
AmazonSimpleNotificationService sns = AWSClientFactory.CreateAmazonSNSClient(key, secret);
PublishRequest req = new PublishRequest();
req.WithMessage("This is my test message");
req.WithSubject("The Test Subject");
req.WithTopicArn(topicArn);
PublishResponse result = sns.Publish(req);
But does it work in .NET Core? If so how, and what using statements?
I used this Nuget install:
Install-Package AWSSDK.SimpleNotificationService -Version 3.3.0.23
Are the methods totally different? Just poking around using Intellisense, I have found:
var req = new AmazonSimpleNotificationServiceRequest();
var client = new AmazonSimpleNotificationServiceClient();
but req. doesn't show any properties.
I've tried searching here: https://docs.aws.amazon.com/sdkfornet/v3/apidocs/Index.html but it is saying "The service is currently unavailable. Please try again after some time." (so yes, I will try later, but not sure it will have what I want anyhow).
--- Update 10/30 - This is the the only publish method of the AmazonSimpleNotificationServiceRequest() class
--- Update 2 on 10/30 - Found this post: Send SMS using AWS SNS - .Net Core
Created new question for code that I'm trying, but it's not working: How to call SNS PublishAsync from Lambda Function?
The .NET Core version of the SDK only support async operations because that is what the underlying HTTP Client in .NET Core supports. Your example with the WithXXX operations is from the older V2 version of the SDK not the current V3 modularized version.
The only difference you should need to do for V3 when using .NET Core is use async operations. For example here is a very simple console
Here is a longer example. Let me know if this works and what other types of examples you would like. I'd like to improve the .NET developer guide, https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/welcome.html.