AWS specific components for managing endpoints in Smithy
The AwsRuleSetExtension is the main integration point for AWS-specific functionality in the Smithy rules engine. It provides AWS built-in parameters, library functions, and authentication validators.
The primary extension class that implements EndpointRuleSetExtension to integrate AWS-specific functionality into the Smithy rules engine.
/**
* AWS-specific extensions to smithy-rules-engine.
*/
public final class AwsRuleSetExtension implements EndpointRuleSetExtension {
/**
* Returns the AWS-specific built-in parameters available to endpoint rules
* @return List of AWS built-in parameters including region, dual-stack, FIPS, etc.
*/
public List<Parameter> getBuiltIns();
/**
* Returns the AWS-specific library functions available to endpoint rules
* @return List of AWS library functions for partition resolution, ARN parsing, etc.
*/
public List<FunctionDefinition> getLibraryFunctions();
/**
* Returns the AWS-specific authentication scheme validators
* @return List of authentication validators for SigV4, SigV4a, etc.
*/
public List<AuthSchemeValidator> getAuthSchemeValidators();
}The extension is automatically registered through the Java Service Provider Interface:
META-INF/services/software.amazon.smithy.rulesengine.language.EndpointRuleSetExtensionUsage Examples:
import software.amazon.smithy.rulesengine.aws.language.functions.AwsRuleSetExtension;
import software.amazon.smithy.rulesengine.language.EndpointRuleSetExtension;
// Extension is automatically loaded by the rules engine
// You typically don't instantiate this directly
EndpointRuleSetExtension extension = new AwsRuleSetExtension();
// Get AWS built-in parameters
List<Parameter> awsBuiltIns = extension.getBuiltIns();
// Includes: REGION, DUALSTACK, FIPS, ACCOUNT_ID, S3_ACCELERATE, etc.
// Get AWS library functions
List<FunctionDefinition> awsFunctions = extension.getLibraryFunctions();
// Includes: aws.partition, aws.parseArn, aws.isVirtualHostableS3Bucket
// Get authentication validators
List<AuthSchemeValidator> authValidators = extension.getAuthSchemeValidators();
// Includes validators for SigV4, SigV4a, SigV4 sub-schemes, and beta schemesThe extension integrates seamlessly with Smithy's rules engine to provide AWS-specific capabilities:
// The rules engine automatically discovers and loads this extension
// Built-ins become available as parameters in endpoint rules
// Functions become available for use in rule expressions
// Validators ensure proper AWS authentication configurationThe extension provides the following AWS-specific built-in parameters:
DUALSTACK - UseDualStack boolean parameterFIPS - UseFIPS boolean parameterREGION - Region string parameterACCOUNT_ID - AccountId string parameterACCOUNT_ID_ENDPOINT_MODE - AccountIdEndpointMode string parameterCREDENTIAL_SCOPE - CredentialScope string parameterS3_ACCELERATE - S3 Accelerate boolean parameterS3_DISABLE_MRAP - S3 DisableMultiRegionAccessPoints boolean parameterS3_FORCE_PATH_STYLE - S3 ForcePathStyle boolean parameterS3_USE_ARN_REGION - S3 UseArnRegion boolean parameterS3_USE_GLOBAL_ENDPOINT - S3 UseGlobalEndpoint boolean parameterS3_CONTROL_USE_ARN_REGION - S3Control UseArnRegion boolean parameterSTS_USE_GLOBAL_ENDPOINT - STS UseGlobalEndpoint boolean parameterThe extension provides these AWS-specific functions:
aws.partition - Maps region to partition informationaws.parseArn - Parses AWS ARN into component partsaws.isVirtualHostableS3Bucket - Validates S3 bucket for virtual hostingThe extension provides validators for AWS authentication schemes:
SigV4SchemeValidator - Validates SigV4 authentication configurationSigV4aSchemeValidator - Validates SigV4a authentication configurationSigV4SubSchemeValidator - Validates SigV4 sub-scheme authenticationBetaSchemeValidator - Validates beta authentication schemesInstall with Tessl CLI
npx tessl i tessl/maven-software-amazon-smithy--smithy-aws-endpoints