Skip to content

Commit 0bce0ca

Browse files
committed
fetch ami id from ssm via cdk, with .string_value fix
1 parent 57fe48b commit 0bce0ca

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cdk_app/hyp3_stack.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import aws_cdk as cdk
44
from aws_cdk import cloudformation_include as cfn_inc
5+
from aws_cdk import aws_ssm as ssm
56
from constructs import Construct
67

78

@@ -23,11 +24,7 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
2324
'ExpandedMaxvCpus': os.environ['EXPANDED_MAX_VCPUS'],
2425
'MonthlyBudget': os.environ['MONTHLY_BUDGET'],
2526
'RequiredSurplus': os.environ['REQUIRED_SURPLUS'],
26-
27-
# FIXME: retrieve AmiId from ssm parameter store
28-
#'AmiId': os.environ['AMI_ID'],
29-
'AmiId': 'ami-02a9aa9c17c6204ae',
30-
27+
'AmiId': ssm.StringParameter.from_string_parameter_name(self, 'AmiId', os.environ['AMI_ID']).string_value,
3128
'InstanceTypes': os.environ['INSTANCE_TYPES'].split(','),
3229
}
3330
if os.environ['SECURITY_ENVIRONMENT'] != 'EDC':

0 commit comments

Comments
 (0)