CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-software-amazon-smithy--smithy-aws-endpoints

AWS specific components for managing endpoints in Smithy

Overview
Eval results
Files

aws-rule-set-extension.mddocs/

AWS Rule Set Extension

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.

Capabilities

AwsRuleSetExtension Class

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();
}

Service Registration

The extension is automatically registered through the Java Service Provider Interface:

META-INF/services/software.amazon.smithy.rulesengine.language.EndpointRuleSetExtension

Usage 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 schemes

Integration with Rules Engine

The 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 configuration

Built-in Parameters Provided

The extension provides the following AWS-specific built-in parameters:

  • DUALSTACK - UseDualStack boolean parameter
  • FIPS - UseFIPS boolean parameter
  • REGION - Region string parameter
  • ACCOUNT_ID - AccountId string parameter
  • ACCOUNT_ID_ENDPOINT_MODE - AccountIdEndpointMode string parameter
  • CREDENTIAL_SCOPE - CredentialScope string parameter
  • S3_ACCELERATE - S3 Accelerate boolean parameter
  • S3_DISABLE_MRAP - S3 DisableMultiRegionAccessPoints boolean parameter
  • S3_FORCE_PATH_STYLE - S3 ForcePathStyle boolean parameter
  • S3_USE_ARN_REGION - S3 UseArnRegion boolean parameter
  • S3_USE_GLOBAL_ENDPOINT - S3 UseGlobalEndpoint boolean parameter
  • S3_CONTROL_USE_ARN_REGION - S3Control UseArnRegion boolean parameter
  • STS_USE_GLOBAL_ENDPOINT - STS UseGlobalEndpoint boolean parameter

Library Functions Provided

The extension provides these AWS-specific functions:

  • aws.partition - Maps region to partition information
  • aws.parseArn - Parses AWS ARN into component parts
  • aws.isVirtualHostableS3Bucket - Validates S3 bucket for virtual hosting

Authentication Validators Provided

The extension provides validators for AWS authentication schemes:

  • SigV4SchemeValidator - Validates SigV4 authentication configuration
  • SigV4aSchemeValidator - Validates SigV4a authentication configuration
  • SigV4SubSchemeValidator - Validates SigV4 sub-scheme authentication
  • BetaSchemeValidator - Validates beta authentication schemes

Install with Tessl CLI

npx tessl i tessl/maven-software-amazon-smithy--smithy-aws-endpoints

docs

arn-parsing.md

authentication-utilities.md

aws-built-ins.md

aws-rule-set-extension.md

index.md

partition-resolution.md

s3-virtual-hosting.md

smithy-traits.md

validation-components.md

tile.json