示例#1
0
        public void SetUp()
        {
            _awsConfiguration = new AwsConfiguration
            {
                AwsEndpoint = TestConfiguration.AwsEndpoint,
                Credentials = new TestSuiteCredentials()
            };

            _iamClient = new AmazonIdentityManagementServiceClient(
                new AmazonIdentityManagementServiceConfig
                {
                    RegionEndpoint = _awsConfiguration.AwsEndpoint,
                    ProxyHost = _awsConfiguration.ProxyHost,
                    ProxyPort = _awsConfiguration.ProxyPort
                });

            var user = _iamClient.CreateUser(new CreateUserRequest
            {
                UserName = _userName
            }).User;

            _roleToAssume = _iamClient.CreateRoleToAssume(user);
            _awsConfiguration.RoleName = _roleToAssume.Arn;

            _s3Client = new AmazonS3Client(new AmazonS3Config { RegionEndpoint = _awsConfiguration.AwsEndpoint });

            DeletePreviousTestStack();
        }