s3

addRegion

Description

The addRegion action allows for the addition or replacement of custom region definitions for the S3 (Simple Storage Service) environment within SAS Viya. This is particularly useful for connecting to S3-compatible storage that is not hosted on AWS or for defining custom endpoints. By specifying parameters such as the host, port, and SSL settings, administrators can configure how CAS interacts with various S3 storage providers.

s3.addRegion { host="string", name="string", nossl=boolean, port=integer, region="string", sslallowed=boolean, sslport=integer, sslrequired=boolean };
Settings
ParameterDescription
hostSpecifies the server hostname or IP address that CAS connects to for the S3 service.
nameSpecifies a unique name for the region being added or replaced. This name is used to reference the configuration.
nosslWhen set to TRUE, specifies that SSL or TLS is disabled for the data transfer. The default is FALSE.
portSpecifies the HTTP port to connect to when not using SSL. If not specified, the default S3 port is used.
regionSpecifies the region code (e.g., 'us-east-1') for the region being added or replaced.
sslallowedSpecifies that SSL is permitted when communicating with the S3 environment. This is ignored if sslrequired is set to TRUE. Default is TRUE.
sslportSpecifies the HTTPS port to connect to S3 with SSL. If not specified, the default SSL port is used.
sslrequiredWhen set to TRUE, specifies that all communications with the S3 environment must use SSL. Default is TRUE.
Data Preparation View data prep sheet
No Data Creation Needed

The `s3.addRegion` action does not operate on CAS tables. It is a server-side administrative action used to configure S3 connectivity. Therefore, no data needs to be loaded into CAS to use this action.

Copied!
1/* No
2data creation is necessary for this action. */

Examples

This example demonstrates how to add a custom S3 region for a local MinIO server, which is a popular S3-compatible object storage.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 S3.addRegion /
3 name='minio-local'
4 host='192.168.1.100'
5 region='us-east-1'
6 port=9000
7 nossl=true;
8RUN;
Result :
The action will add the 'minio-local' region to the CAS server's S3 configuration. A confirmation note will be printed in the log.

This example shows how to add a new region for a secure, S3-compatible storage provider, requiring SSL. After adding the region, the `s3.listRegions` action is used to verify that the new region has been successfully configured.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 S3.addRegion /
3 name='secure-storage'
4 host='s3.custom-provider.com'
5 region='eu-central-1'
6 sslrequired=true
7 sslport=9001;
8RUN;
9 
10 S3.listRegions;
11RUN;
Result :
The log will first show a success message for the `addRegion` action. Then, the `listRegions` action will output a result table containing all configured S3 regions, including the newly added 'secure-storage' region with its specified host, port, and SSL settings.

If a region with the same name already exists, the `addRegion` action will replace its configuration. This example updates the host for the 'minio-local' region defined previously.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 S3.addRegion /
3 name='minio-local'
4 host='minio.new-domain.com'
5 region='us-east-1'
6 port=9000
7 nossl=true;
8RUN;
9 
10 S3.listRegions RESULT=r;
11 PRINT r;
12RUN;
Result :
The action will update the host for the 'minio-local' region. The subsequent `listRegions` and `print` statements will display a table confirming that the host for 'minio-local' is now 'minio.new-domain.com'.

FAQ

What is the purpose of the s3.addRegion action?
What are the mandatory parameters for the addRegion action?
How can I configure SSL/TLS for a custom S3 region?
Is it possible to specify connection ports for an S3 region?
How do I specify the region code when adding a custom region?

Associated Scenarios

Use Case
Standard Case: Integrating an On-Premise MinIO S3-Compatible Storage

A retail company is setting up a hybrid cloud environment. They want to use their on-premise MinIO object storage for staging raw sales data before processing it in SAS Viya. Th...

Use Case
Complex Case: Replacing a Secure S3 Provider's Configuration

A financial services firm is migrating its sensitive data from one secure, S3-compatible cloud provider to another due to new compliance requirements. The test involves adding t...

Use Case
Edge Case: Conflicting SSL Parameters and Missing Host

A junior administrator is attempting to configure a new S3 region but is unsure about the security parameters. This scenario tests the action's robustness and error handling whe...