https://pulumi.com logo
#general
Title
# general
f

flat-guitar-86436

08/28/2019, 9:23 PM
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

future-barista-68134

08/28/2019, 10:04 PM
This blog post on adopting existing resources may be helpful to you https://www.pulumi.com/blog/adopting-existing-cloud-resources-into-pulumi/
w

white-balloon-205

08/28/2019, 10:55 PM
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

flat-guitar-86436

08/29/2019, 2:31 PM
thanks to both of you, { import } is so clean
2 Views