I want to execute django command ($python manage.py foo) on ecs task (ec2). I do not want to use ssh because production server. I wanted to use AWS Systems Manager Run Command or Session manager.
I added the install command to Dockerfile taking the following page as an example.(https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html)
My docker image is debian because it is python 3.6 image
However, when I checked the ssm configuration method with cfn because there was a need for an activation code, there was no item for activation. (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_SSM.html)
I thought that I would manually create a manager and generate an activation code, but in 30 minutes I found the default setting for the code to expire. In this case, you have to generate an activation code each time you do docker build.
I'm trying to design an operation in this way.
Can I execute shell command on ecs task (your docker image) other than SSM and ssh?
Generate ssm with cfn, can you get an activation code with Ref etc?
Is there a way to make the activation code period indefinitely or unnecessary?
Can I get the ec2 instance of ecs created by my docker image to be displayed on the manager? Thank you