CreateUser() public method

Creates a new IAM user for your AWS account.

For information about limitations on the number of IAM users you can create, see Limitations on IAM Entities in the IAM User Guide.

/// The request was rejected because it attempted to create a resource that already exists. /// /// The request was rejected because it attempted to create resources beyond the current /// AWS account limits. The error message describes the limit exceeded. /// /// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public CreateUser ( CreateUserRequest request ) : CreateUserResponse
request Amazon.IdentityManagement.Model.CreateUserRequest Container for the necessary parameters to execute the CreateUser service method.
return Amazon.IdentityManagement.Model.CreateUserResponse
Ejemplo n.º 1
0
        private static void CreateUser()
        {
            Console.WriteLine("** Create User **");
            var iamClient = new AmazonIdentityManagementServiceClient();
            var request = new CreateUserRequest
            {
                UserName = "******",
                Path = @"/IT/architecture/"
            };

            var response = iamClient.CreateUser(request);

            Console.WriteLine("User Created");

        }
Ejemplo n.º 2
0
 public static string CreateTestUser(AmazonIdentityManagementServiceClient client)
 {
     string username = "******" + DateTime.Now.Ticks;
     client.CreateUser(new CreateUserRequest() { UserName = username, Path = TEST_PATH });
     return username;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Just playing with this for now.
        /// </summary>
        /// <param name="aprofile"></param>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public string CreateIAMAccount(string aprofile, string username, string password)
        {
            string IRReturning = "Yop";
            var credential = new Amazon.Runtime.StoredProfileAWSCredentials(aprofile);
            var iam = new AmazonIdentityManagementServiceClient(credential);

            CreateUserRequest request = new CreateUserRequest();
            request.UserName = username;

            var repo = iam.CreateUser(request);
            var det = repo.ResponseMetadata;

            CreateAccessKeyRequest KeyRequest = new CreateAccessKeyRequest();
            KeyRequest.UserName = username;




            return IRReturning;
        }
Ejemplo n.º 4
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();
        }