Exemplo n.º 1
0
        public static void ClassCleanup()
        {
            using (var s3ControlClient = new AmazonS3ControlClient())
            {
                s3ControlClient.DeleteAccessPoint(new DeleteAccessPointRequest
                {
                    AccountId = _accountId,
                    Name      = _accesspointName
                });

                Amazon.S3.Util.AmazonS3Util.DeleteS3BucketWithObjects(Client, _bucketName);
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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();
                }
        }