コード例 #1
0
        public async Task OneTimeTearDown()
        {
            var accessKeyId     = EnvironmentHelper.GetEnvironmentVariable("CLEANUP_AWS_ACCESS_KEY_ID");
            var secretAccessKey = EnvironmentHelper.GetEnvironmentVariable("CLEANUP_AWS_SECRET_ACCESS_KEY");

            using (var sqsClient = string.IsNullOrEmpty(accessKeyId) ? SqsTransportExtensions.CreateSQSClient() :
                                   new AmazonSQSClient(accessKeyId, secretAccessKey))
                using (var snsClient = string.IsNullOrEmpty(accessKeyId) ? SqsTransportExtensions.CreateSnsClient() :
                                       new AmazonSimpleNotificationServiceClient(accessKeyId, secretAccessKey))
                    using (var s3Client = string.IsNullOrEmpty(accessKeyId) ? SqsTransportExtensions.CreateS3Client() :
                                          new AmazonS3Client(accessKeyId, secretAccessKey))
                    {
                        await Cleanup.DeleteAllResourcesWithPrefix(sqsClient, snsClient, s3Client, NamePrefix).ConfigureAwait(false);
                    }
        }