How to connect to GCP Bucket from AEM Managed Services | Community
Skip to main content
Level 3
June 6, 2022
Solved

How to connect to GCP Bucket from AEM Managed Services

  • June 6, 2022
  • 2 replies
  • 850 views

Hi, 

We have a requirement to connect to GCP and download the binaries into AEM DAM

So, currently, we are planning to read environment variables using the below API. 

Has anyone worked on this implementation? 

Our first hurdle is how to set and read Environment variables in AEM Managed services.
Any leads/advise would be appreciated.

import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Bucket;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageOptions;


StorageOptions.Builder b = StorageOptions.newBuilder().setProjectId("mygcp-aem-intg-lwr");
Storage storage = b.build().getService();

Page<Bucket> buckets = storage.list();
for (Bucket bucket : buckets.iterateAll()) {

}


Thanks, 

Mrudul

@p_v_nair 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SantoshSai

Hi @mrudulmo ,

I believe there is nothing do from AEM side, this question seems to be more related to Google Cloud Storage API - you may try looking into API docs here https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Bucket

Hope that helps!

Regards,
Santosh

2 replies

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
June 7, 2022

Hi @mrudulmo ,

I believe there is nothing do from AEM side, this question seems to be more related to Google Cloud Storage API - you may try looking into API docs here https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Bucket

Hope that helps!

Regards,
Santosh

Santosh Sai
Fanindra_Surat
Community Advisor
Community Advisor
June 7, 2022

Hi @mrudulmo - What are the values that you are trying to read from the environment variables? Do they vary per AEM's environment like DEV, QA, Stage and Prod? If yes, any reason why runmodes don't fit into your requirement?

 

Thanks,

Fani