AWS specific components for managing endpoints in Smithy
The AwsBuiltIns class provides AWS-specific built-in parameters for endpoint rules. These parameters enable AWS-aware endpoint resolution with configuration for regions, dual-stack, FIPS compliance, and service-specific settings.
/**
* Built-in parameter representing the AWS region used to dispatch requests
*/
public static final Parameter REGION = Parameter.builder()
.name("Region")
.type(ParameterType.STRING)
.builtIn("AWS::Region")
.documentation("The AWS region used to dispatch the request.")
.build();/**
* Built-in parameter representing the DualStack parameter for SDKs
*/
public static final Parameter DUALSTACK = Parameter.builder()
.name("UseDualStack")
.type(ParameterType.BOOLEAN)
.builtIn("AWS::UseDualStack")
.documentation("When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.")
.required(true)
.defaultValue(Value.booleanValue(false))
.build();/**
* Built-in parameter representing whether the endpoint must be FIPS-compliant
*/
public static final Parameter FIPS = Parameter.builder()
.name("UseFIPS")
.type(ParameterType.BOOLEAN)
.builtIn("AWS::UseFIPS")
.documentation("When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.")
.required(true)
.defaultValue(Value.booleanValue(false))
.build();/**
* Built-in parameter representing the AccountId
*/
public static final Parameter ACCOUNT_ID = Parameter.builder()
.name("AccountId")
.type(ParameterType.STRING)
.builtIn("AWS::Auth::AccountId")
.documentation("The AWS AccountId used for the request.")
.build();/**
* Built-in parameter representing the AccountId Endpoint Mode
*/
public static final Parameter ACCOUNT_ID_ENDPOINT_MODE = Parameter.builder()
.name("AccountIdEndpointMode")
.type(ParameterType.STRING)
.builtIn("AWS::Auth::AccountIdEndpointMode")
.documentation("The AccountId Endpoint Mode.")
.build();/**
* Built-in parameter representing the Credential Scope
*/
public static final Parameter CREDENTIAL_SCOPE = Parameter.builder()
.name("CredentialScope")
.type(ParameterType.STRING)
.builtIn("AWS::Auth::CredentialScope")
.documentation("The AWS Credential Scope used for the request.")
.build();/**
* S3-specific parameter for acceleration. MUST only be used by S3 rules.
*/
public static final Parameter S3_ACCELERATE = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("Accelerate")
.builtIn("AWS::S3::Accelerate")
.required(true)
.defaultValue(Value.booleanValue(false))
.documentation("When true, use S3 Accelerate. NOTE: Not all regions support S3 accelerate.")
.build();/**
* S3-specific parameter for disabling multi-region access points. MUST only be used by S3 rules.
*/
public static final Parameter S3_DISABLE_MRAP = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("DisableMultiRegionAccessPoints")
.builtIn("AWS::S3::DisableMultiRegionAccessPoints")
.required(true)
.defaultValue(Value.booleanValue(false))
.documentation("Whether multi-region access points (MRAP) should be disabled.")
.build();/**
* S3-specific parameter for path-style endpoints. MUST only be used by S3 rules.
*/
public static final Parameter S3_FORCE_PATH_STYLE = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("ForcePathStyle")
.builtIn("AWS::S3::ForcePathStyle")
.documentation("When true, force a path-style endpoint to be used where the bucket name is part of the path.")
.build();/**
* S3-specific parameter for ARN region usage. MUST only be used by S3 rules.
*/
public static final Parameter S3_USE_ARN_REGION = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("UseArnRegion")
.builtIn("AWS::S3::UseArnRegion")
.documentation("When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.")
.build();/**
* S3-specific parameter for global endpoint usage. MUST only be used by S3 rules.
*/
public static final Parameter S3_USE_GLOBAL_ENDPOINT = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("UseGlobalEndpoint")
.builtIn("AWS::S3::UseGlobalEndpoint")
.required(true)
.defaultValue(Value.booleanValue(false))
.documentation("Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.")
.build();/**
* S3Control-specific parameter for ARN region usage. MUST only be used by S3Control rules.
*/
public static final Parameter S3_CONTROL_USE_ARN_REGION = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("UseArnRegion")
.builtIn("AWS::S3Control::UseArnRegion")
.documentation("When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.")
.build();/**
* STS-specific parameter for global endpoint usage. MUST only be used by STS rules.
*/
public static final Parameter STS_USE_GLOBAL_ENDPOINT = Parameter.builder()
.type(ParameterType.BOOLEAN)
.name("UseGlobalEndpoint")
.builtIn("AWS::STS::UseGlobalEndpoint")
.required(true)
.defaultValue(Value.booleanValue(false))
.documentation("Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.")
.build();Usage Examples:
import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter;
import software.amazon.smithy.rulesengine.aws.language.functions.AwsBuiltIns;
// Access AWS built-in parameters
Parameter regionParam = AwsBuiltIns.REGION;
Parameter dualStackParam = AwsBuiltIns.DUALSTACK;
Parameter fipsParam = AwsBuiltIns.FIPS;
// These parameters are automatically available in endpoint rules
// when using the AwsRuleSetExtension
// Example parameter usage in rule expressions:
// - Built-in name: "AWS::Region"
// - Parameter name: "Region"
// - Type: STRING
// - Required: varies by parameterREGION - AWS region for request routingDUALSTACK - Enable IPv4/IPv6 dual-stack endpointsFIPS - Require FIPS-compliant endpointsACCOUNT_ID - AWS account identifierACCOUNT_ID_ENDPOINT_MODE - Account-specific endpoint modeCREDENTIAL_SCOPE - Credential scoping informationAll parameters include comprehensive documentation strings explaining their purpose and usage constraints.
Install with Tessl CLI
npx tessl i tessl/maven-software-amazon-smithy--smithy-aws-endpoints