@@ -26,6 +26,7 @@ def __init__(
2626 vpc_id : str ,
2727 private_subnet_ids : List [str ],
2828 number_instances : int ,
29+ parameter_group_family : str = "1.4" ,
2930 ** kwargs : Any ,
3031 ) -> None :
3132 super ().__init__ (scope , id , description = "This stack deploys Amazon Neptune Cluster resources" , ** kwargs )
@@ -42,6 +43,18 @@ def __init__(
4243 # Tagging all resources
4344 Tags .of (scope = cast (IConstruct , self )).add (key = "Deployment" , value = full_dep_mod )
4445
46+ # Map parameter group family string to enum
47+ family_map = {
48+ "1.2" : neptune .ParameterGroupFamily .NEPTUNE_1_2 ,
49+ "1.3" : neptune .ParameterGroupFamily .NEPTUNE_1_3 ,
50+ "1.4" : neptune .ParameterGroupFamily .NEPTUNE_1_4 ,
51+ }
52+ pg_family = family_map .get (parameter_group_family )
53+ if pg_family is None :
54+ raise ValueError (
55+ f"Unsupported parameter-group-family: { parameter_group_family } . Supported values: 1.2, 1.3, 1.4"
56+ )
57+
4558 # Importing the VPC
4659 self .vpc = ec2 .Vpc .from_lookup (
4760 self ,
@@ -74,15 +87,15 @@ def __init__(
7487 self ,
7588 f"{ dep_mod } ClusterParams" ,
7689 description = "Cluster parameter group" ,
77- family = neptune . ParameterGroupFamily . NEPTUNE_1_3 ,
90+ family = pg_family ,
7891 parameters = {"neptune_enable_audit_log" : "1" },
7992 )
8093
8194 db_params = neptune .ParameterGroup (
8295 self ,
8396 "DbParams" ,
8497 description = "Db parameter group" ,
85- family = neptune . ParameterGroupFamily . NEPTUNE_1_3 ,
98+ family = pg_family ,
8699 parameters = {"neptune_query_timeout" : "120000" },
87100 )
88101
0 commit comments