Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to connect to GCP Bucket from AEM Managed Services

Avatar

Level 4

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 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @mrudul ,

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.Bu...

Hope that helps!

Regards,
Santosh

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @mrudul ,

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.Bu...

Hope that helps!

Regards,
Santosh

Avatar

Community Advisor

Hi @mrudul - 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