|
5 | 5 | using Amazon.DynamoDBv2; |
6 | 6 | using Amazon.Kinesis; |
7 | 7 | using Amazon.S3; |
| 8 | +using Amazon.SimpleNotificationService; |
8 | 9 | using Amazon.SQS; |
9 | 10 | using TestSimpleApp.AWSSDK.Core; |
10 | 11 |
|
|
20 | 21 | .AddSingleton<IAmazonS3>(provider => new AmazonS3Client(new AmazonS3Config { ServiceURL = "http://localstack:4566", ForcePathStyle = true })) |
21 | 22 | .AddSingleton<IAmazonSQS>(provider => new AmazonSQSClient(new AmazonSQSConfig { ServiceURL = "http://localstack:4566" })) |
22 | 23 | .AddSingleton<IAmazonKinesis>(provider => new AmazonKinesisClient(new AmazonKinesisConfig { ServiceURL = "http://localstack:4566" })) |
| 24 | + .AddSingleton<IAmazonSimpleNotificationService>(provider => new AmazonSimpleNotificationServiceClient(new AmazonSimpleNotificationServiceConfig { ServiceURL = "http://localstack:4566" })) |
23 | 25 | // Bedrock services are not supported by localstack, so we mock the API responses on the aws-application-signals-tests-testsimpleapp server. |
24 | 26 | .AddSingleton<IAmazonBedrock>(provider => new AmazonBedrockClient(new AmazonBedrockConfig { ServiceURL = "http://localhost:8080" })) |
25 | 27 | .AddSingleton<IAmazonBedrockRuntime>(provider => new AmazonBedrockRuntimeClient(new AmazonBedrockRuntimeConfig { ServiceURL = "http://localhost:8080" })) |
|
30 | 32 | .AddKeyedSingleton<IAmazonS3>("fault-s3", new AmazonS3Client(AmazonClientConfigHelper.CreateConfig<AmazonS3Config>(true))) |
31 | 33 | .AddKeyedSingleton<IAmazonSQS>("fault-sqs", new AmazonSQSClient(AmazonClientConfigHelper.CreateConfig<AmazonSQSConfig>(true))) |
32 | 34 | .AddKeyedSingleton<IAmazonKinesis>("fault-kinesis", new AmazonKinesisClient(new AmazonKinesisConfig { ServiceURL = "http://localstack:4566" })) |
| 35 | + .AddKeyedSingleton<IAmazonSimpleNotificationService>("fault-sns", new AmazonSimpleNotificationServiceClient(new AmazonSimpleNotificationServiceConfig { ServiceURL = "http://localstack:4566" })) |
33 | 36 | //error client |
34 | 37 | .AddKeyedSingleton<IAmazonDynamoDB>("error-ddb", new AmazonDynamoDBClient(AmazonClientConfigHelper.CreateConfig<AmazonDynamoDBConfig>())) |
35 | 38 | .AddKeyedSingleton<IAmazonS3>("error-s3", new AmazonS3Client(AmazonClientConfigHelper.CreateConfig<AmazonS3Config>())) |
36 | 39 | .AddKeyedSingleton<IAmazonSQS>("error-sqs", new AmazonSQSClient(AmazonClientConfigHelper.CreateConfig<AmazonSQSConfig>())) |
37 | 40 | .AddKeyedSingleton<IAmazonKinesis>("error-kinesis", new AmazonKinesisClient(new AmazonKinesisConfig { ServiceURL = "http://localstack:4566" })) |
| 41 | + .AddKeyedSingleton<IAmazonSimpleNotificationService>("error-sns", new AmazonSimpleNotificationServiceClient(new AmazonSimpleNotificationServiceConfig { ServiceURL = "http://localstack:4566" })) |
38 | 42 | .AddSingleton<S3Tests>() |
39 | 43 | .AddSingleton<DynamoDBTests>() |
40 | 44 | .AddSingleton<SQSTests>() |
41 | 45 | .AddSingleton<KinesisTests>() |
| 46 | + .AddSingleton<SNSTests>() |
42 | 47 | .AddSingleton<BedrockTests>(); |
43 | 48 |
|
44 | 49 | var app = builder.Build(); |
|
121 | 126 | app.MapGet("kinesis/fault", (KinesisTests kinesis) => kinesis.Fault()).WithName("kinesis-fault").WithOpenApi(); |
122 | 127 | app.MapGet("kinesis/error", (KinesisTests kinesis) => kinesis.Error()).WithName("kinesis-error").WithOpenApi(); |
123 | 128 |
|
| 129 | +app.MapGet("sns/createtopic/some-topic", (SNSTests sns) => sns.CreateTopic()) |
| 130 | + .WithName("create-topic") |
| 131 | + .WithOpenApi(); |
| 132 | + |
| 133 | +app.MapGet("sns/publish/some-topic", (SNSTests sns) => sns.Publish()) |
| 134 | + .WithName("publish") |
| 135 | + .WithOpenApi(); |
| 136 | + |
124 | 137 | app.MapGet("bedrock/getguardrail/get-guardrail", (BedrockTests bedrock) => bedrock.GetGuardrail()) |
125 | 138 | .WithName("get-guardrail") |
126 | 139 | .WithOpenApi(); |
|
0 commit comments