- policyRef:
name: native-aws-signature-flex
config:
serviceName: <string> // REQUIRED
region: <string> // REQUIRED
useUnsignedPayload: <boolean> // OPTIONAL
signingAlgorithm: <string> // REQUIRED
matchExcludedHeaders:
- <string> // OPTIONAL
authenticationMode: <string> // REQUIRED
credentialsFileProvider: <object> // OPTIONAL
inlineCredentialProvider: <object> // OPTIONAL
AWS Request Signature Policy
Policy Name |
AWS Request Signature |
Summary |
Signs outgoing requests with AWS Signature Version 4 (SigV4) or Signature Version 4A (SigV4A) |
Category |
Security |
First Flex Gateway version available |
v1.11.0 |
Returned Status Codes |
No return codes exist for this policy. Error codes are returned from the upstream service. |
Summary
The AWS Request Signature policy signs outgoing requests with AWS Signature Version 4 (SigV4) or Signature Version 4A (SigV4A) authentication. This policy injects the required AWS signature headers into requests to authenticate with AWS services, such as Amazon S3, Amazon API Gateway, or other AWS HTTP endpoints.
The AWS Request Signature policy is an extension of the AWS Request Signing filter native to Envoy. To learn more about the AWS Request Signing filter, see AWS Request Signing Filter. Not all AWS Request Signing filter parameters are available to the AWS Request Signature policy. To find what parameters are configurable, see Configuring Policy Parameters.
Configuring Policy Parameters
Flex Gateway Local Mode
In Local Mode, you apply the policy to your API via declarative configuration files. Refer to the following policy definition and table of parameters:
| If you don’t configure required parameters, the policy the default value. If the policy doesn’t have a default value, there is a configuration error. |
| Parameter | Required or Optional | Default Value | Description |
|---|---|---|---|
|
Required |
N/A |
The service namespace of the HTTP endpoint. For example: |
|
Required |
N/A |
The AWS region of the service hosting the HTTP endpoint. |
|
Optional |
|
Use the literal string |
|
Optional |
N/A |
A list of request header to exclude from signing. Match by any Envoy StringMatcher pattern. For example: +
+
In the example, the policy does not sign headers that start with +
By default, Envoy excludes the |
|
Required |
|
The signing algorithm to use, either |
|
Required |
|
Determines the mode of authentication for AWS credentials. Options are: |
|
Optional |
N/A |
Configuration for using credentials from an AWS credential file. Required when |
|
Optional |
N/A |
Configuration for statically configured credentials. Required when |
Credential Provider Configuration
The credential provider configuration depends on the authenticationMode setting:
-
default: No additional configuration needed. The policy uses the AWS credential chain (environment variables, AWS credential file, or AWS roles). -
profile: UsecredentialsFileProviderto specify the AWS credential file and profile. -
static: UseinlineCredentialProviderto provide credentials directly in the configuration.
Credentials File Provider
Use credentialsFileProvider when authenticationMode is set to profile:
credentialsFileProvider:
credentialsDataSource:
filename: <string> // REQUIRED
profile: <string> // OPTIONAL
| Parameter | Required or Optional | Default Value | Description |
|---|---|---|---|
|
Required |
N/A |
Path to the AWS credential file. For example: |
|
Optional |
|
The AWS profile name to use from the credential file. |
Inline Credential Provider
Use inlineCredentialProvider when authenticationMode is set to static:
inlineCredentialProvider:
accessKeyId: <string> // REQUIRED
secretAccessKey: <string> // REQUIRED
sessionToken: <string> // OPTIONAL
| Parameter | Required or Optional | Default Value | Description |
|---|---|---|---|
|
Required |
N/A |
AWS access key ID. |
|
Required |
N/A |
AWS secret access key. |
|
Optional |
N/A |
AWS session token (required for temporary credentials). |
Resource Configuration Examples
-
Basic configuration with default authentication:
- policyRef: name: native-aws-signature-flex config: serviceName: s3 region: us-west-2 signingAlgorithm: AWS_SIGV4 authenticationMode: default -
Configuration with static credentials:
- policyRef: name: native-aws-signature-flex config: serviceName: execute-api region: us-east-1 signingAlgorithm: AWS_SIGV4 authenticationMode: static inlineCredentialProvider: accessKeyId: AKIAIOSFODNN7EXAMPLE secretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -
Configuration with profile authentication:
- policyRef: name: native-aws-signature-flex config: serviceName: s3 region: us-west-2 signingAlgorithm: AWS_SIGV4 authenticationMode: profile credentialsFileProvider: credentialsDataSource: filename: ~/.aws/credentials profile: my-profile -
Configuration with SigV4A and unsigned payload:
- policyRef: name: native-aws-signature-flex config: serviceName: s3 region: "*" signingAlgorithm: AWS_SIGV4A authenticationMode: default useUnsignedPayload: true -
Configuration with excluded headers:
- policyRef: name: native-aws-signature-flex config: serviceName: s3 region: us-west-2 signingAlgorithm: AWS_SIGV4 authenticationMode: default matchExcludedHeaders: - prefix: x-envoy - exact: x-custom-header - exact: x-trace-id
Managed Flex Gateway and Flex Gateway Connected Mode
When you apply the policy to your API instance from the UI, the following parameters are displayed:
| Parameter | Description | Required or Optional |
|---|---|---|
Service name |
The service namespace of the HTTP endpoint. For example: |
Required |
Region |
The AWS region string for the service. For SigV4, use a standard region. For example: |
Required |
Use unsigned payload |
Instead of buffering the request to calculate the payload hash, use the literal string |
Optional |
Signing algorithm |
The signing algorithm to use: |
Required |
Match excluded headers |
A list of request headers to exclude from signing. Match by any Envoy StringMatcher pattern. For example: |
Optional |
Authentication mode |
Determines the mode of authentication for AWS credentials. Options: |
Required |
Credentials file provider |
Configuration for using credentials from an AWS credential file (required when authentication mode is |
Optional |
Credentials file |
Path to the AWS credential file. For example: |
Required when using credentials file provider |
Profile |
The AWS profile name to use from the credential file. |
Optional |
Inline credential provider |
Configuration for statically configured credentials (required when authentication mode is |
Optional |
Access key ID |
AWS access key ID when using inline credential provider. |
Required when using inline credential provider |
Secret access key |
AWS secret access key when using inline credential provider. |
Required when using inline credential provider |
Session token |
AWS session token when using inline credential provider with temporary credentials. |
Optional |



