title: Applying Terraform On Two Different AWS Accounts In the Same Plan
body: <p>We're currently porting some of our CloudFormation templates to Terraform.  In one of these templates we use a custom resource with a Lambda function.  </p>
  
  <p>The purpose of the function is to assume a role in our main AWS account; where R53 DNS is managed, and add a newly generated CloudFront dns there.</p>
  
  <p>I am wondering if there's a way to do this in terraform, such that:</p>
  
  <ol>
  <li>create the cloudfront resource, alb, etc on the dev/qa/prod accounts</li>
  <li>add the r53 recordset to the main account</li>
  </ol>
  
  <p>All within the same terraform plan.  Can I choose an IAM role when creating a resource? Or choose the account where the resource should be created?</p>
  
  <p>The only reference I have found is <a href="https://hackernoon.com/terraform-with-aws-assume-role-21567505ea98" rel="nofollow noreferrer">here</a></p>