AWSSDK_DotNet.IntegrationTests.Tests.S3.S3TestUtils.CreateBucketWithWait C# (CSharp) Method

CreateBucketWithWait() public static method

public static CreateBucketWithWait ( IAmazonS3 s3Client ) : string
s3Client IAmazonS3
return string
        public static string CreateBucketWithWait(IAmazonS3 s3Client)
        {
            string bucketName = CreateBucket(s3Client);
            WaitForBucket(s3Client, bucketName, 30);
            return bucketName;
        }

Usage Example

Example #1
0
        public void TestKmsOverHttp()
        {
            var config = new AmazonS3Config
            {
                RegionEndpoint = AWSConfigs.RegionEndpoint,
                UseHttp        = true
            };

            using (var client = new AmazonS3Client(config))
            {
                var bucketName = S3TestUtils.CreateBucketWithWait(client);
                try
                {
                    var putObjectRequest = new PutObjectRequest
                    {
                        BucketName  = bucketName,
                        Key         = key,
                        ContentBody = testContents,
                        ServerSideEncryptionMethod = ServerSideEncryptionMethod.AWSKMS
                    };
                    Action action = () =>
                    {
                        client.PutObject(putObjectRequest);
                    };

                    AssertExtensions.ExpectException(action, typeof(AmazonClientException));
                }
                finally
                {
                    AmazonS3Util.DeleteS3BucketWithObjects(client, bucketName);
                }
            }
        }
All Usage Examples Of AWSSDK_DotNet.IntegrationTests.Tests.S3.S3TestUtils::CreateBucketWithWait