Integrate aws s3 using named credentials in salesforce -- w3web.net

How to Integrate Amazon S3 into Salesforce Uses of Named Credentials and checked the results Status=OK, StatusCode=200 after connected Amazon AWS S3 through the anonymous window in Salesforce | Integrate aws s3 using named credentials in Salesforce

Hey guys, today in this post we are going to learn about How to Integrate Amazon S3 with Salesforce Step-By-Step.

A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your code doesn’t have to. You can also skip remote site settings, which are otherwise required for callouts to external sites, for the site defined in the named credential.

Named Credentials also include an OutboundNetworkConnection field that you can use to route callouts through a private connection. By separating the endpoint URL and authentication from the callout definition, named credentials make callouts easier to maintain. For example, if an endpoint URL changes, you update only the named credential. All callouts that reference the named credential simply continue to work. To know more about named credentials, go with Link

First we need create Named Credentials to integrate Amazon S3 for the Authentication.

There are many steps to integrate Amazon S3 with Salesforce.

Final Output

aws integration with salesforce -- w3web.net

  • Find the below steps

Create Free Account on Amazon S3

Step 1:- First we need to Sign Up a personal account. Click here for create account. It is free not chargeable money, They will ask to verify your bank account detail for your verify Name as per your bank account.

Amazon S3 Sign Up -- w3web.net

Generate the AWSAccessKeyId & AWSSecretKey

Step 2:- Now you have created new account on amazonaws. After that login you credential and go to your username top right and Click on “My Security Credentials”

AWS My Security Credentials  -- w3web.net

After that click on “My Security Credential” to generate the AWSAccessKeyId & AWSSecretKey. After that we will get download excel file, where we got Key & Secret that will apply on during creating the Named Credential.

Download the excel file to get (AWSAccessKeyId & AWSSecretKey)

Download the excel aws -- w3web.net

AWS S# AWSSecretKey -- w3web.net

Create Named Credentials in Salesforce

Step 3:- Well done, Now you got AWSAccessKeyId & AWSSecretKey from Amazon AWS.

Then we need to create Named Credentials in Salesforce.

Login into Salesforce Application, navigate to Setup -> Named Credentials and then Click on New Named Credentials.

Provide the Label, Name (Auto populate), URL, Identity Type (Named Principal), AWS Access Key ID , AWS Secret Access Key, AWS Region and AWS Service.

Named Credentials in Salesforce -- w3web.net

Keep in minds some points during creating URL

  • Scheme should be start always https://
  • As we are connecting with Amazon S3, so instance name will be s3. If you wanted to connect with EC2 then instance name will be ec2 ( all in small )
  • Region name, you need to provide the region name here. To get the region name go back to Amazon S3 Console and in the URL you will get something like ?region= ap-south-1.
  • So you need to use value after ?region=, in the example value is ap-south-1
  • For AWS S3 it will remain same as amazonaws.com/ ( Do not remove / from the URL ).

aws region -- w3web.net

Now the value for URL field will look like :- https://s3.ap-south-1.amazonaws.com/

Create Apex Class Controller in Salesforce

From Developer Console ➡ File ➡ New ➡ Apex Class

Step 4:- To test the setup and configuration check It is working on not.

Open anonymous window in Salesforce and execute Apex Class Controller. IntegrateAwsS3Ctrl.getAwsIntegrate();

IntegrateAwsS3Ctrl.apxc [Apex Class Controller]

Show result Status & StatusCode

Step 5:- Now you can see the below result along with Status=OK, StatusCode=200.

aws integration with salesforce -- w3web.net

Further post that would you like to learn in lightning component.

Related Topics | You May Also Like

Hi, This is Vijay behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time.

2 thoughts on “How to Integrate Amazon S3 into Salesforce Uses of Named Credentials and checked the results Status=OK, StatusCode=200 after connected Amazon AWS S3 through the anonymous window in Salesforce | Integrate aws s3 using named credentials in Salesforce”

Leave a Comment