Installing Force for Amazon Web Services
Abstract
This document shows how to install Force.com for Amazon Web Services through the AppExchange. The Toolkit is open source. After establishing a few prerequisites, we show how to install the package from the AppExchange and configure your Amazon web services account credentials. Once you've done this, head over to one of the other documents in the Related Content section.
Create Amazon Web Services (AWS) Account
If you do not already have an Amazon Web Services account, please go to the AWS home page and sign up for an Account.
After completing the registration process, Amazon will email you the required access Key and Secret.
Install Toolkit from AppExchange
To simplify the setup and configuration of Force.com for Amazon Web Services, we have provided an AppExchange package. This package contains the toolkit along with some samples for both S3 and EC2.
To install the package:
- Go to this link to install toolkit into a Developer Edition/Production org: [1]
- Go to this link to install toolkit into a Sandbox org: [2]
- Log in to the desired org to install the package (NOTE: It is ideal to try this out in a Developer Edition prior to installing it in a Production org)
- Continue to follow the installation wizard step by step until the package successfully completes installation.
For more instructions on installing AppExchange Packages, please reference these documents:
Install Appexchange Apps Overview AppExchange Installation Step by Step Guide
After the installation is complete, to access the newly installed package, select "Force.com for Amazon Web Services" from the Apps dropdown in the upper-right hand corner of the salesforce.com application.
And that completes the installation process of Force.com for Amazon Web Services. Please continue on to the next steps detailed in this document to finalize the configuration of a few remaining required items.
Post-Installation: Configure Remote Sites
Before your application can make any web service call to Amazon S3 or EC2, you must configure your remote sites within your force.com organization to allow http and https to Amazon S3 and EC2. A remote site allows the Force.com platform between Force.com and an external web service. For this toolkit, it is required to setup 2 remote sites; one for S3 and another for EC2.
To do so, please follow these instructions:
- Log into your Developer Edition org or sandbox where you are installing the Amazon S3 toolkit
- Go to Setup->Administration Setup->Security Controls->Remote Site Settings.
- Create a two Remote Site entries for Amazon S3 and EC2 (as shown in the screenshots below)
Post-Installation: Configure Amazon Web Services Account in Force.com
Since the toolkit and samples require access to your AWS account, it is necessary to enter in your AWS Credentials into Force.com. The credentials will be stored in a custom object that was automatically created in your org during the appexchange package installation process.
To configure your AWS account credentials in Force.com:
- Make sure you are in the "Force.com for Amazon Web Services" application. To access the newly installed package, select "Force.com for Amazon Web Services" from the Apps dropdown in the upper-right hand corner of the salesforce.com application
- Click on the "AWS Credentials" tab
- Click "New"
- Enter in the Amazon provided Key and Secret codes. NOTE: The value entered in the Name field will be referenced in a future step as we continue to setup Force.com for Amazon Web Services. Please remember this value.
- Click Save
Post-Installation: Configure Action Override
This step will help configure one of the S3 samples that illustrates how to upload a file from your filesystem to S3 through an HTML FORM Post.
To enable an Action Override, follow these steps:
- If not already logged in, please log into the org you installed the Toolkit.
- Go to Setup->App Setup->Create->Objects
- Select the object labeled AWS S3 Object
- Scroll down to the section for Standard Buttons and Links
- Click Override and select the content type of Visualforce Page. And from the Content Name dropdown, select news3object. And click 'Save' when you are done.
You have now enabled the "New Action" override. Now when a user creates a new record for the object, 'AWS S3 Object', the visualforce page, 'news3object' will be initiated.
Setup Force.com IDE Project
Please note that the remaining instructions assume you have the Force.com IDE installed and are familiar with the basic functionality of Eclipse. If not, take some time to become familiar with both before proceeding.
Once the Force.com IDE is installed, please create a new Force.com Project for the org in which you installed Force.com for Amazon Web Services. Make sure to configure the Force.com Project to access all Apex Classes and Visualforce.
Configure the AWS Credential Name apex variable in the Toolkit for S3
These instructions will walk you through a simple Apex code modification to enable the Toolkit to connect to the Amazon S3 service. There are a few Apex Classes that need to be updated that will allow you to use and reference all of the S3 examples provided in the toolkit.
- Make sure you have properly created and setup a Force.com IDE Project for the org in which you installed Force.com for Amazon Web Services. If not, please see the previous section.
- Under the classes folder, there are 3 Apex Classes that need to be modified (highlighted):
- In each of those 3 classes, Edit the AWSCredentialName string variable. Set the value of this variable to the AWS Credential Name value you entered in a previous step when you created the new record in the AWS Credential custom object. This string value is used by the Toolkit to query the AWS Credential custom object to obtain the AWS key and secret values for this specific AWS Account.
- Save the Apex Class in the Force.com IDE to commit the changes to Force.com.
- To verify this modification, go back to the Force.com application, and click on S3 Samples
tab.
Configure the AWS Credential Name in the Toolkit for EC2
These instructions will walk you through a simple Apex code modification to enable the Toolkit to connect to the Amazon EC2 service.
- Make sure you have properly created and setup a Force.com IDE Project for the org in which you installed Force.com for Amazon Web Services. If not, please see the previous section.
- Under the classes folder, open the EC2ConsoleController.cls apex class.
- In the apex code, Edit the AWSCredentialName string variable. Set the value of this variable to the AWS Credential Name value you entered in a previous step when you created the new record in the AWS Credential custom object. This string value is used by the Toolkit to query the AWS Credential custom object to obtain the AWS key and secret values for this specific AWS Account.
- Save the Apex Class in the Force.com IDE to commit the changes to Force.com.
- To verify this modification, go back to the Force.com application, and click on EC2 Console tab.
Next Steps
Now it is time to start working with the Force.com for Amazon Web Services! For more details on how to work with the samples provided, please visit Using Force.com for Amazon Web Services
Appendix - Code Share
Code Share is a directory of open source code projects covering all aspects of the Force.com Platform.
Force.com for Amazon Web Services is available on Code Share. It is an alternative to installing and accessing the project from an AppExchange package. This will allow you to access the project through a SVN repository and deploy it to your force.com org .
For more information, please visit the Code Share website.












