public static void ClassCleanup() { using (var s3ControlClient = new AmazonS3ControlClient()) { s3ControlClient.DeleteAccessPoint(new DeleteAccessPointRequest { AccountId = _accountId, Name = _accesspointName }); Amazon.S3.Util.AmazonS3Util.DeleteS3BucketWithObjects(Client, _bucketName); } }
protected IAmazonS3Control CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonS3ControlConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonS3ControlClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }
public static void Setup(TestContext context) { using (var stsClient = new AmazonSecurityTokenServiceClient()) using (var s3ControlClient = new AmazonS3ControlClient()) { _accountId = stsClient.GetCallerIdentity(new GetCallerIdentityRequest()).Account; _bucketName = S3TestUtils.CreateBucketWithWait(Client); var response = s3ControlClient.CreateAccessPoint(new CreateAccessPointRequest { AccountId = _accountId, Bucket = _bucketName, Name = _accesspointName }); _accesspointArn = new Arn { AccountId = _accountId, Partition = "aws", Region = s3ControlClient.Config.RegionEndpoint.SystemName, Service = "s3", Resource = "accesspoint:" + _accesspointName }.ToString(); } }