你能提供一个关于这个问题的样本吗?我已经尝试了一些方法,但还没有成功。如何在我的主账户上为其他人创建账户?
@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;
}
我知道,我写的代码没有任何意义,但我只是想尝试一下。我正在等待你关于这个主题的帮助。
ErrorMessage: You cannot add accounts to your organization while it is initializing. Try again later.