I encountered a problem today where my Gmail password wasn't working for my SMTP configuration, which is stored in the SSM parameter store. The email configuration is pulled from the SSM parameter store in my Fargate task. After updating the password, it didn't reflect the change until I forced a new deployment. Meanwhile, it works fine when I run it locally in my Docker container. Is there some caching in the Fargate task that I'm not aware of, or am I doing something wrong? Here's a snippet of my code:
```python
session = (
boto3.Session(profile_name=os.getenv("AWS_PROFILE"))
if os.getenv("AWS_PROFILE")
else boto3.Session()
)
param_path = f"/abc/ffaasf"
ssm = session.client("ssm", region_name=AWS_REGION_NAME)
response = ssm.get_parameter(Name=param_path, WithDecryption=True)
```
3 Answers
You might want to make sure you're fetching the SSM parameters using the API correctly. It sounds like if you're relying on your task definition, it only pulls the parameters when the task starts, which is why you need to redeploy to get the new password. Try fetching them in your code as you are and see if that helps!
It really does depend on your fetching method. If it's defined within the task definition, it will only grab it when the task starts up. So if you’re changing that parameter in SSM, make sure you trigger a redeployment to pull the latest values correctly.
Yeah, whether parameters are fetched or cached can depend on how you've set things up. It would be helpful if you could share more about your task definition or how you're managing your configurations. Sometimes redeployments are necessary for updates to reflect correctly in Fargate.
I can share that I'm fetching the parameters in Python code as mentioned. I'll check further into the task definition details!

I'm actually using that API call as shown in the example above, so it should work. Just curious if there’s more to it?