Deploy via sfdx
Choose the appropriate region for you:
Make sure ACLs disabled is true
Block all public access is true
Once created, navigate to your new created bucket. Go to the permissions tab and copy the below code into the 'Cross-origin resource sharing (CORS)' settings (Be sure to add your salesforce domain in AllowedOrigins (EG https://reidsdevorg2-dev-ed.lightning.force.com)):
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"HEAD",
"POST",
"PUT",
"DELETE"
],
"AllowedOrigins": [
"YOUR SALESFORCE DOMAIN HERE",
],
"ExposeHeaders": [
"Access-Control-Allow-Origin"
]
}
]
In the search bar navigate to IAM. Select 'Users' on the left side of the menu. Select 'Add users'.
Name your user (recommend putting salesforce in the name) and select 'Access key - Programmatic access' for the credential type.
Select 'Next: Permissions' and 'Attach existing policies directly', search for 'AmazonS3FullAccess' and check that policy. Select 'Next: Tags', Select 'Create user'.
Warning BE SURE TO COPY THE
ACCESS KEY ID
AND THESECRET ACCESS KEY
BEFORE CLOSING THIS PAGE.
In Salesforce, Setup > Custom Code > Custom Metadata Types > Amazon S3
Select 'Manage Amazon S3's'
Create a new Amazon_S3__mdt record named Amazon_S3_Integration
Fill out the information in the record from S3. Create a Bucket for sandbox testing, just be sure put 'sandbox' in the name to differenciate.
Navigate to Lightning page and search 'Amazon s3 Files', drag component to page and configure as needed.