sparse-intern-71089
01/13/2020, 9:39 PMshy-microphone-28807
01/13/2020, 9:42 PMaws.organizations.Account[]
astonishing-cartoon-37000
01/13/2020, 9:42 PMpulumi.Output<aws.organizations.Account[]>
right?shy-microphone-28807
01/13/2020, 9:43 PMshy-microphone-28807
01/13/2020, 9:43 PMnew aws.organizations.Account
astonishing-cartoon-37000
01/13/2020, 9:51 PMconst account = new aws.organizations.Account("foo", {email: "<mailto:foo12345@bar.com|foo12345@bar.com>"}, {})
const accountid = account.id;
seems to behave as expected for me.astonishing-cartoon-37000
01/13/2020, 9:53 PMaccountid
being of type pulumi.Output<string>
shy-microphone-28807
01/13/2020, 9:53 PMaccount.id
astonishing-cartoon-37000
01/13/2020, 9:54 PMshy-microphone-28807
01/13/2020, 9:54 PMconst sourceAccounts = [account1, account2, …]
astonishing-cartoon-37000
01/13/2020, 9:55 PMastonishing-cartoon-37000
01/13/2020, 9:56 PMastonishing-cartoon-37000
01/13/2020, 9:57 PMconst accountids = accounts.map(account => account.id)
astonishing-cartoon-37000
01/13/2020, 9:58 PMpulumi.Output<string>[]
shy-microphone-28807
01/13/2020, 9:58 PMshy-microphone-28807
01/13/2020, 9:58 PMshy-microphone-28807
01/13/2020, 9:58 PMshy-microphone-28807
01/13/2020, 10:01 PMlogging.ts
and businessUnit.ts
and i am trying to use the acount.id from businessUnit in logging to set up the policy, and then the log bucket in businessUnit to send logs to the right placeshy-microphone-28807
01/13/2020, 10:02 PMastonishing-cartoon-37000
01/13/2020, 10:03 PMshy-microphone-28807
01/13/2020, 10:06 PMastonishing-cartoon-37000
01/13/2020, 10:06 PMshy-microphone-28807
01/13/2020, 10:12 PMconst sourceAccounts = [account1, account2, …]
const accountids = sourceAccounts.map(account => account.id)
shy-microphone-28807
01/13/2020, 10:12 PMshy-microphone-28807
01/13/2020, 10:13 PMimport * as logging from "./logging"
shy-microphone-28807
01/13/2020, 10:14 PMimport * as account1 from "account1"
import * as account 2 from "account2"
shy-microphone-28807
01/13/2020, 10:14 PMshy-microphone-28807
01/13/2020, 10:14 PMid called on undefined
because of the circular logicshy-microphone-28807
01/13/2020, 10:19 PMshy-microphone-28807
01/13/2020, 10:20 PMconst account = new aws.organizations.Account("foo", {email: "<mailto:foo12345@bar.com|foo12345@bar.com>"}, {})
import * as logging from "./logging"
shy-microphone-28807
01/13/2020, 10:21 PMastonishing-cartoon-37000
01/13/2020, 10:52 PMastonishing-cartoon-37000
01/13/2020, 10:54 PMimport { Logger } from "./logging"
const account1 = new aws.organizations.Account("foo", {email: "<mailto:foo12345@bar.com|foo12345@bar.com>"}, {})
const account1Logger = new Logger(account1)
or
import { createLogger } from "./logging"
const account1 = new aws.organizations.Account("foo", {email: "<mailto:foo12345@bar.com|foo12345@bar.com>"}, {})
const account1Logger = createLogger(account1)
astonishing-cartoon-37000
01/13/2020, 10:55 PM