import * as pulumi from "@pulumi/pulumi" ; import * as common from "./common" ; import * as groups from "./groups" ; import * as policies from "./policies" ; export type BaselineIamOptions = { policies ? : policies . BaselineIamPoliciesOptions ; groups ? : groups . BaselineIamGroupsOptions ; } ; export class BaselineIam extends pulumi . ComponentResource { public readonly policies : policies . BaselineIamPolicies ; public readonly groups : groups . BaselineIamGroups ; constructor ( name , args = { } , opts ? ) { super ( `${ common . groupName }:index:BaselineIam` , name , args , opts ) ; const defineIamPassPolicy = args . policies && args . policies . defineUseExistingIamRolesPolicy ; let defineIamPassGroup = args . groups && args . groups . defineUseExistingIamRolesGroup ; defineIamPassGroup = defineIamPassGroup === undefined ? true : defineIamPassGroup ; if ( defineIamPassGroup === true && defineIamPassPolicy === false ) { throw Error ( "'defineUseExistingIamRolesGroup' can't be true when 'defineUseExistingIamRolesPolicy' is false" ) ; } if ( defineIamPassGroup === true ) { args . policies = args . policies === undefined ? { } : args . policies ; args . policies . defineUseExistingIamRolesPolicy = true ; } this . policies = new policies . BaselineIamPolicies ( name , args . policies , { parent : this } ) ; const groupsArgs = { ... args . groups , useExistingIamRolesPolicy : this . policies . useExistingIamRoles , } ; this . groups = new groups . BaselineIamGroups ( name , groupsArgs , { parent : this } ) ; } }