π‘οΈ AWS SageMaker Endpoint has less than 2 instancesπ’
- Contextual name: π‘οΈ Endpoint has less than 2 instancesπ’
- ID:
/ce/ca/aws/sagemaker/endpoint-instance-count - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
RELIABILITY
Logicβ
- π§ prod.logic.yamlπ’
Similar Policiesβ
- AWS Security Hub: [SageMaker.4] SageMaker endpoint production variants should have an initial instance count greater than 1
Descriptionβ
Descriptionβ
This policy identifies AWS SageMaker Endpoint that are not configured with at least two instances for each production variant.
Rationaleβ
AWS SageMaker endpoints are designed to support high availability and fault tolerance. However, these capabilities are only realized when multiple instances are provisioned for each production variant. If an instance fails or an Availability Zone becomes unavailable, SageMaker can automatically route traffic to the remaining healthy instances.
Additionally, during endpoint updates, SageMaker performs rolling or blue/green deployments. Configuring multiple instances ensures that sufficient capacity remains available to serve requests throughout the update process, minimizing service disruption.
Auditβ
This policy marks an AWS SageMaker Endpoint as
INCOMPLIANTwhen the associated AWS SageMaker Endpoint Configuration specifies an initialInstanceCount of1for any production variant.Endpoints that are not in the InService state are marked as
INAPPLICABLE.
Remediationβ
Remediationβ
Update SageMaker Endpoint Instance Countβ
To remediate this finding, ensure that each production variant associated with an AWS SageMaker endpoint has at least two instances. There are two approaches to achieve this:
Option 1: Scale the Variant's Capacityβ
You can increase the number of instances for the endpoint without creating a new endpoint configuration.
From Command Lineβ
aws sagemaker update-endpoint-weights-and-capacities \
--endpoint-name {{endpoint-name}} \
--desired-weight-and-capacities '[
{
"VariantName": "{{variant-name}}",
"DesiredInstanceCount": 2
}
]'Notes:
- Set
DesiredInstanceCountto 2 or more to meet high-availability requirements.- SageMaker dynamically adjusts capacity and routes traffic automatically.
- Monitor endpoint status and CloudWatch metrics to confirm the scaling operation completes successfully.
Option 2: Update the Endpoint with a New Configurationβ
You can create a new endpoint configuration specifying multiple instances per variant and update the endpoint to use this configuration. This method leverages SageMakerβs rolling update or blue/green deployment for minimal disruption.
... see more