AWSTemplateFormatVersion: "2010-09-09" Description: Creates an S3 bucket in eu-north-1 and ap-northeast-1 in a remote account Parameters: CentralRoleArn: Type: String Description: The IAM role name for the role that is trusted by the destination role. DevRoleArn: Type: String Description: The IAM role to be assumed and used to create a CloudFormation stack containing an S3 bucket. Resources: DevStackTokyo: Type: Custom::CfnStackMaker Version: 1.0 Properties: ServiceToken: !GetAtt CfnAssumeRoleLambda.Arn RoleArn: !Ref DevRoleArn TemplateURL: https://s3.amazonaws.com/aws-quickstart/quickstart-examples/samples/cloudformation-cross-account/examples/bucket.yaml ParentStackId: !Ref AWS::StackId Region: ap-northeast-1 CfnParameters: Tag: Tokyo DevStackStockholm: Type: Custom::CfnStackMaker Version: 1.0 Properties: ServiceToken: !GetAtt CfnAssumeRoleLambda.Arn RoleArn: !Ref DevRoleArn TemplateURL: https://s3.amazonaws.com/aws-quickstart/quickstart-examples/samples/cloudformation-cross-account/examples/bucket.yaml ParentStackId: !Ref AWS::StackId Region: eu-north-1 CfnParameters: Tag: Stockholm CfnAssumeRoleLambda: Type: AWS::Lambda::Function Properties: Handler: lambda_function.lambda_handler MemorySize: 128 Role: !Ref CentralRoleArn Runtime: python3.6 Timeout: 900 Code: S3Bucket: 'aws-quickstart' S3Key: 'quickstart-examples/samples/cloudformation-cross-account/functions/packages/CfnStackAssumeRole/lambda.zip' Outputs: DestinationAccountId: Value: !GetAtt DevStackTokyo.AccountId DevAccountTokyoBucket: Value: !GetAtt DevStackTokyo.BucketName DevAccountStockholmBucket: Value: !GetAtt DevStackStockholm.BucketName