Blob Storage with AWS parameter storage

Vote:
 

Hello,

I've added a blob storage section to my web.config for use with AWS.  See the section below.

My question is it possible to create a custom provider to read from my parameter store and populate the accesskey and the secret key at runtime.

I'm aware of the EpiServer.Framework.Blob library (https://world.optimizely.com/csclasslibraries/cms/EPiServer.Framework.Blobs.BlobProviderBuilder?version=11) but I'm unsure if it's possible to implement a solution using the provide classes.

Any help would be greatly appreciated.

  <episerver.framework  updateDatabaseSchema="true" xdt:Transform="SetAttributes" configBuilders="AwsParameterStoreBuilder">
    <appData basePath="App_Data" xdt:Transform="Replace"/>
      <!--Enable Local Login-->
      <securityEntity xdt:Transform="Remove" />
      <!--End Enable Local Login-->
    <blob defaultProvider="s3blobs" >
        <providers>
            <add name="s3blobs"
                type="EPiServer.Amazon.Blobs.AmazonBlobProvider,EPiServer.Amazon"
                accessKey=""
                secretKey=""
                region="us-west-2"
                bucket="aapc-epi-dev"
               xdt:Transform="Replace" xdt:Locator="Match(name)"/>
        </providers>
    </blob>

Thank you,

Kevin Fox
  </episerver.framework>

#261940
Edited, Sep 08, 2021 22:40
Vote:
 

Hi,

If I read code correctly, accessKey and secretKey are passed in via configuration.

Best I could think of is:

  • create new provider (inherit from AmazonBlobProvider)
  • override Initialize method
  • read secrets from the secure store and replace those in passed in NameValueCollection config parameter
  • call base Initialize method with mutated config object
#261982
Sep 09, 2021 7:58
Vote:
 

Solution worked !!!! Thank you for all of your help Valdis.

#263091
Sep 14, 2021 13:51
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.