Can you give a sample about this question? I've tried something about it but not have succeeded yet. How can I create an account for someone else on my master account?
@Bean
public AWSOrganizations createAwsAccount(){
CreateAccountRequest createAccountRequest = new CreateAccountRequest();
createAccountRequest.setAccountName("newAccount");
createAccountRequest.setEmail("newAccount@yandex.com");
createAccountRequest.setIamUserAccessToBilling("ALLOW");
//createAccountRequest.setRoleName("");
AWSCredentials awsCredentials = new ProfileCredentialsProvider().getCredentials();
final AWSOrganizations awsOrganizations = AWSOrganizationsClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();
awsOrganizations.createAccount(createAccountRequest);
return awsOrganizations;
}
I know, the code I wrote does not make any sense but I just wanted to try something. I'm waiting for your help about this subject.
ErrorMessage: You cannot add accounts to your organization while it is initializing. Try again later.