@@ -179,6 +179,33 @@ func TestAccSageMakerEndpointConfiguration_ProductionVariants_acceleratorType(t
179
179
})
180
180
}
181
181
182
+ func TestAccSageMakerEndpointConfiguration_ProductionVariants_variantNameGenerated (t * testing.T ) {
183
+ ctx := acctest .Context (t )
184
+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
185
+ resourceName := "aws_sagemaker_endpoint_configuration.test"
186
+
187
+ resource .ParallelTest (t , resource.TestCase {
188
+ PreCheck : func () { acctest .PreCheck (t ) },
189
+ ErrorCheck : acctest .ErrorCheck (t , sagemaker .EndpointsID ),
190
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
191
+ CheckDestroy : testAccCheckEndpointConfigurationDestroy (ctx ),
192
+ Steps : []resource.TestStep {
193
+ {
194
+ Config : testAccEndpointConfigurationConfig_productionVariantVariantNameGenerated (rName ),
195
+ Check : resource .ComposeTestCheckFunc (
196
+ testAccCheckEndpointConfigurationExists (ctx , resourceName ),
197
+ resource .TestCheckResourceAttrSet (resourceName , "production_variants.0.variant_name" ),
198
+ ),
199
+ },
200
+ {
201
+ ResourceName : resourceName ,
202
+ ImportState : true ,
203
+ ImportStateVerify : true ,
204
+ },
205
+ },
206
+ })
207
+ }
208
+
182
209
func TestAccSageMakerEndpointConfiguration_kmsKeyID (t * testing.T ) {
183
210
ctx := acctest .Context (t )
184
211
rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
@@ -599,6 +626,21 @@ resource "aws_sagemaker_endpoint_configuration" "test" {
599
626
` , rName ))
600
627
}
601
628
629
+ func testAccEndpointConfigurationConfig_productionVariantVariantNameGenerated (rName string ) string {
630
+ return acctest .ConfigCompose (testAccEndpointConfigurationConfig_base (rName ), fmt .Sprintf (`
631
+ resource "aws_sagemaker_endpoint_configuration" "test" {
632
+ name = %[1]q
633
+
634
+ production_variants {
635
+ model_name = aws_sagemaker_model.test.name
636
+ initial_instance_count = 2
637
+ instance_type = "ml.t2.medium"
638
+ initial_variant_weight = 1
639
+ }
640
+ }
641
+ ` , rName ))
642
+ }
643
+
602
644
func testAccEndpointConfigurationConfig_kmsKeyID (rName string ) string {
603
645
return acctest .ConfigCompose (testAccEndpointConfigurationConfig_base (rName ), fmt .Sprintf (`
604
646
resource "aws_sagemaker_endpoint_configuration" "test" {
0 commit comments