billions-flower-97878
08/30/2023, 8:00 AMadventurous-plastic-90730
08/30/2023, 2:57 PM@step
def start(self):
"""
Start-up: check everything works or fail fast!
Get all of the parameters from SSM.
"""
import boto3
ssm = boto3.client("ssm", region_name="us-west-2")
namespace = <SSM_NAMESPACE>
# list of env vars to pull from SSM, assign to self.<param>
parameters = [
<labels of your SSM vars>
]
for param in parameters:
try:
value = ssm.get_parameter(
Name=f"/{namespace}/{param}", WithDecryption=True
)["Parameter"]["Value"]
setattr(self, param, value)
except Exception as e:
print(f"Error getting parameter {param}: {e}")
self.next(self.handle_auth)adventurous-plastic-90730
08/30/2023, 3:00 PMbillions-flower-97878
08/31/2023, 7:19 AMbillions-flower-97878
08/31/2023, 7:19 AMadventurous-plastic-90730
09/01/2023, 7:17 PM