I start from a brand new root account and I want t...
# general
f
I start from a brand new root account and I want to reference the root account in my pulumi program:
Copy code
export const rootAccount = new aws.organizations.Account(INFRA_CONFIG.REFERENCE_ACCOUNT_NAME, {
  email: INFRA_CONFIG.ROOT_ACCOUNT_EMAIL,
  iamUserAccessToBilling: 'ALLOW',
  parentId: rootOrgUnit.id
});
is it possible to do that? Pulumi error because this user already exist
since the email is taken, no root account is created
f
This blog post on adopting existing resources may be helpful to you https://www.pulumi.com/blog/adopting-existing-cloud-resources-into-pulumi/
w
Note that if you want to just reference an existing resource, instead of to adopt and manage an existing resource, you can just use
aws.organizations.Account.get
.
👍 1
f
thanks to both of you, { import } is so clean