繁体   English   中英

使用适用于Java的AWS开发工具包在AWS Organizations中创建帐户

[英]Creating Account in the AWS Organizations using AWS SDK for Java

您可以提供有关此问题的样本吗? 我已经尝试过一些,但是还没有成功。 如何在我的主帐户上为其他人创建帐户?

    @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.

您可能已经解决了这个问题,但是以防万一其他人找到了这个问题:

AWS似乎需要长期解决这些问题!

在AWS论坛中查看此主题 它于三月开放,有些(包括我)仍然有问题。 API调用是正确的,您只需要继续等待(几天或几周?),联系支持人员或在该主题上留言。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM