Environment variables applicable for Lambda functions

Understand the environment variables that are applicable for Lambda functions.

Following are the properties that are applicable for HeartBeat, APIs, and Metrics Lambda Functions.

Amazon API Gateway configurations let you specify the configurations required for AWS connectivity in Amazon API Gateway.

Properties Description
AWS_STAGE Mandatory. Stage (Runtime) name in Amazon API Gateway.

Agent configurations let you specify the configurations such as heart beat interval, assets sync interval, metrics sync interval, and so on in AWS agent.

Properties Description Possible Values
APICP_HEARTBEAT_SEND_INTERVAL_SECONDS Optional. The duration in seconds in which the Agent must send the health check status to API Control Plane. Min: 15 seconds Max: 900 seconds (5 minutes). Default: 60 seconds. If you do not specify a value for this property, the default value is considered.

Runtime configurations lets you specify the metadata of Amazon API Gateway that you want to administer from the federated API management such as Runtime name, Description, Tags, and so on.

Properties Description
APICP_RUNTIME_NAME Mandatory. The runtime name. This property defines how you want to identify the runtime in federated API management.Name must not exceed 50 characters. When the runtime gets registered with federated API management for the first time, the current implementation generates the runtime ID in the format <AWS_account_ID><AWS_region><AWS_stage>. As a result, changing the runtime name does not alter the runtime ID. Even if the runtime name is changed between agent restarts, a new runtime does not get created in federated API management. Instead, the runtime name gets updated for the existing runtime.
APICP_RUNTIME_DESCRIPTION Optional. The runtime description. Description must not exceed 300 characters. Default value: AWS Runtime. If you do not specify a value for this property, the default value is considered.
APICP_RUNTIME_REGION Optional. The region name where the runtime is hosted. Example: EAST US. Region name must not exceed 50 characters.
APICP_RUNTIME_LOCATION Optional. Location where the runtime is deployed. Specify the location in the Country|State|City format.
Note: If both APICP_RUNTIME_LOCATION and the individual fields (APICP_RUNTIME_COUNTRY, APICP_RUNTIME_STATE, and APICP_RUNTIME_CITY) are provided, the value in APICP_RUNTIME_LOCATION takes precedence.
APICP_RUNTIME_COUNTRY Optional. Country where the runtime is deployed.
APICP_RUNTIME_STATE Optional. State where the runtime is deployed.
APICP_RUNTIME_CITY Optional. City where the runtime is deployed. If the city name is unique and the country and state fields are not specified, federated API management automatically populates the country and state values.
APICP_RUNTIME_TAGS Optional. The tag name of the runtime. Default: AWS If you do not specify a value for this property, the default value is considered. Tags are used to organize and categorize the runtimes. Multiple tags can be specified by adding comma. Example: test, local, devTags must not exceed 50 characters. It must not contain whitespaces and the number of tags must not exceed 100.
APICP_RUNTIME_CAPACITY_VALUE Optional. The number of transaction calls that a runtime can process for the specified duration. You can configure the capacity value with any non-negative integer Default value: 500000
APICP_RUNTIME_CAPACITY_UNIT Optional. You can configure the capacity value with any non-negative integer and for any duration which can be in the following units:
  • PER_SECOND
  • PER_MINUTE
  • PER_HOUR
  • PER_DAY
  • PER_WEEK
  • PER_MONTH
  • PER_YEAR (Default value)
If you do not specify a value for this property, the default value is considered.

federated API management configurations let you specify federated API management details to which Amazon API Gateway must establish the connectivity.

Properties Description
APICP_URL Mandatory. The valid URL that is used to access federated API management.
APICP_USERNAME Mandatory. User name that is used to log in to federated API management.
APICP_PASSWORD Mandatory. Password of the corresponding user name, which is used for logging into the federated API management through basic authentication.
APICP_SSL_ENABLED Optional. The SSL certification of federated API management.Possible values: true or false
APICP_TRUSTSTORE_PATH Optional. Location of the truststore file.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_TRUSTSTORE_PASSWORD Optional. Password to access the truststore file.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_TRUSTSTORE_TYPE Optional. Type of the truststore.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_KEYSTORE_PATH Optional. Location of the keystore file.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_KEYSTORE_PASSWORD Optional. Password to access the keystore file.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_KEYSTORE_TYPE Optional. Type of the keystore.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_KEY_ALIAS Optional. Alias of key in the keystore.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_KEY_PASSWORD Optional. Password of key in the keystore.If APICP_SSL_ENABLED is set to true, you must specify a value for this property.
APICP_HTTP_CONNECTION_TIMEOUT Optional. The duration in seconds in which the agent must establish the initial connection with federated API management. Default: 10 seconds.
APICP_HTTP_READ_TIMEOUT Optional. The duration in seconds in which the agent fails to receive data over an established HTTP connection. Default: 10 seconds.
APICP_HTTP_MAX_CONNECTION Optional. Defines the maximum number of simultaneous connections the agent can establish with federated API management. Default: 5.
APICP_HTTP_MAX_RETRIES_COUNT Optional. Defines the maximum number of times an operation will be automatically retried after an initial connection failure. Default: 0.
APICP_HTTP_RETRY_INTERVAL Optional. Specifies the number of seconds the agent waits before attempting to reconnect to the federated API management after a failed connection. Default: 5 seconds

Following are the properties that are specific to Metrics Lambda Function.

Properties Description
AWS_METRICS_BY_DATA_OR_STATISTICS Optional. Method in which the metrics are retrieved from CloudWatch.Values:
  • Data
  • Statistics
The default value is Statistics. If you do not specify a value for this property, the default value is considered.
AWS_METRICS_SYNC_BUFFER_INTERVAL_SECONDS Optional. By default, Amazon API Gateway metric data is automatically sent to Amazon CloudWatch in one-minute interval. That is, most Amazon API Gateway metrics will be available in Amazon CloudWatch within 1 minute of the original data point.But to ensure proper metrics sync, set CloudWatch buffer time interval as more than 600 seconds (10 minutes).The default value is 600 seconds. If you do not specify a value for this property, the default value is considered.
APICP_METRICS_SEND_INTERVAL_SECONDS Optional. The duration in seconds in which the Agent must retrieve the metrics from Amazon CloudWatch and send metrics to federated API management. Supported metric synchronization values:
  • 60 seconds (1 minute)(Default value)
  • 300 seconds (5 minutes)
  • 600 seconds (10 minutes)
  • 1800 seconds (30 minutes)
  • 3600 seconds (60 minutes)
  • 7200 seconds (120 minutes)
If you do not specify a value for this property, the default value is considered.

Following are the properties that are specific to Assets Lambda Function.

Properties Description
APICP_ASSETS_SYNC_INTERVAL_SECONDS Optional. The duration in seconds in which the Agent must synchronize the changes made to the assets from the Amazon CloudTrail to federated API management.

Min:60 seconds

Max: 21600 seconds (6 hours)

Default: 300 seconds

If you do not specify a value for this property, the default value is considered.
AWS_ASSETS_SYNC_BUFFER_INTERVAL_SECONDS Mandatory. CloudTrail typically delivers Amazon API Gateway management events within about 5 minutes of the API call being made. This is the standard delivery time for CloudTrail events.

Therefore, set CloudTrail event time interval as more than 300 seconds (5 minutes).The default value is 300 seconds. If you do not specify a value for this property, the default value is considered.