Use the Metadata API to rotate the S3 credentials and enable access to AWS. To update the S3 credentials you must retrieve the metadata of S3 connectors, modify the S3 credentials, and deploy the metadata.
Familiarize Yourself with Salesforce CLI
You can retrieve or deploy S3 connector metadata by using Salesforce CLI. We recommend that you get familiar with using either of the options to ensure a smooth update of S3 credentials.
Define the Metadata of the S3 Connector
You can use an unpackage.xml file to define the metadata to retrieve. In this case, include the DataConnectorS3 metadata type. Include all the S3 connectors that you want to update the credentials for. This sample unpackage.xml file illustrates how to work with S3 connector metadata. A best practice is to name the unpackage.xml file with a low-level qualifier of .xml such as DataConnectorS3.xml.
1mkdir <location to unzip>2cd <location to unzip>3unzip <filename.zip to unzip> (the default filename will be unpackaged.xml)
Here’s how the extracted folder structure looks like.
Edit the files referenced in the s3DataConnectors directory. Update the attributes s3AccessKey and s3SecretKey. Here’s a sample of the contents of the files for S3 connectors metadata.
After changes are made to all S3 Connectors files, create a zipped package. Make sure that the package.xml file is at the top-most level of the package. Navigate down to the unpackaged directory and run this command.
1cd <location of unzipped files>2zip -r -X s3Connectors.zip *
To verify if the metadata is deployed, refresh an impacted data stream where the S3 access key and secret key are modified. Click Refresh Now on at least one of the data streams to validate the change. A successful refresh indicates a successful update of S3 credentials.