'CodePipeline S3 source from another account?

What is the way to configure CodePipeline to use as source an S3 bucket in another account? The source block in a codepipeline resource is something like:

  stage {
    name = "Source"

    action {
      name             = "ImportJar"
      owner            = "AWS"
      category         = "Source"
      provider         = "S3"
      version          = "1"

      configuration {
        S3Bucket = var.source_bucket
        S3ObjectKey = var.source_bucket_key
      }
    }
  }

However, the S3Bucket configuration field contains just the name of the S3 bucket and not the ARN. I have cross-account access set up for the bucket and the CodePipeline role has access to it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source