public async Task SetTopicConfigurationTests() { using (var snsClient = new AmazonSimpleNotificationServiceClient()) { string topicName = UtilityMethods.GenerateName("events-test"); var snsCreateResponse = await snsClient.CreateTopicAsync(topicName); var bucketName = await UtilityMethods.CreateBucketAsync(Client, "SetTopicConfigurationTests"); try { await snsClient.AuthorizeS3ToPublishAsync(snsCreateResponse.TopicArn, bucketName); PutBucketNotificationRequest putRequest = new PutBucketNotificationRequest { BucketName = bucketName, TopicConfigurations = new List <TopicConfiguration> { new TopicConfiguration { Id = "the-topic-test", Topic = snsCreateResponse.TopicArn, Events = new List <EventType> { EventType.ObjectCreatedPut } } } }; await Client.PutBucketNotificationAsync(putRequest); var getResponse = WaitUtils.WaitForComplete( () => { return(Client.GetBucketNotificationAsync(bucketName).Result); }, (r) => { return(r.TopicConfigurations.Count > 0); }); Assert.Equal(1, getResponse.TopicConfigurations.Count); Assert.Equal(1, getResponse.TopicConfigurations[0].Events.Count); Assert.Equal(EventType.ObjectCreatedPut, getResponse.TopicConfigurations[0].Events[0]); #pragma warning disable 618 Assert.Equal("s3:ObjectCreated:Put", getResponse.TopicConfigurations[0].Event); #pragma warning restore 618 Assert.Equal("the-topic-test", getResponse.TopicConfigurations[0].Id); Assert.Equal(snsCreateResponse.TopicArn, getResponse.TopicConfigurations[0].Topic); } finally { await snsClient.DeleteTopicAsync(snsCreateResponse.TopicArn); await UtilityMethods.DeleteBucketWithObjectsAsync(Client, bucketName); } } }