title: How to download from Google Cloud Storage by Alpakka-gcs without providing secret-key?
body: <p>I'm using <a href="https://doc.akka.io/docs/alpakka/current/google-cloud-storage.html" rel="nofollow noreferrer">Alpakka-gcs</a> connecting to GCS from google-compute-engine perfectly if I provide gcs-secret-key on application.conf like the below.</p>
  <pre><code>alpakka.google.cloud.storage {
    project-id = &quot;project_id&quot;
    client-email = &quot;client_email&quot;
    private-key = &quot;************gcs-secret-key************&quot;
    base-url = &quot;https://www.googleapis.com/&quot; // default
    base-path = &quot;/storage/v1&quot; // default
    token-url = &quot;https://www.googleapis.com/oauth2/v4/token&quot; // default
    token-scope = &quot;https://www.googleapis.com/auth/devstorage.read_write&quot; // default
  }
  
  </code></pre>
  <p>My question is
  how to connect compute-engine already having a credential without providing secret-key for alpakka.</p>
  <p>The below code sample is working fine but I want to know alpakka way.</p>
  <pre class="lang-scala prettyprint-override"><code>  def downloadObject(objectName:String, destFilePath: String): Unit = {
  
      import com.google.cloud.storage.BlobId
      import com.google.cloud.storage.StorageOptions
      import java.nio.file.Paths
      def credential:GoogleCredentials = ComputeEngineCredentials.create()
      val storage = StorageOptions.newBuilder.setCredentials(credential).setProjectId(projectId).build.getService
  
      val blob = storage.get(BlobId.of(bucketName, objectName))
      blob.downloadTo(Paths.get(destFilePath))
    }
  </code></pre>