import * as cdk from '@aws-cdk/core' ; import * as iam from '@aws-cdk/aws-iam' ; export interface RequiredResourcesStackProps extends cdk . StackProps { /**
     * The AWS Account ID to add to the IAM Role trust policy.
     * Any role from this AWS Account will be able to assume the
     * two roles created
     */ trustedAccount : string ; } export class RequiredResourcesStack extends cdk . Stack { constructor ( scope , id , props ) { super ( scope , id , props ) ; const readRole = new iam . Role ( this , 'ReadRole' , { assumedBy : new iam . AccountPrincipal ( props . trustedAccount ) , roleName : 'cdk-readOnlyRole' } ) ; readRole . addManagedPolicy ( iam . ManagedPolicy . fromAwsManagedPolicyName ( 'ReadOnlyAccess' ) ) ; } }