Storing Secrets in Amazon Parameter Store to use in ECS
One way to pass secrets and variables securely to containers in AWS is to use Parameter Store. Navigate to the AWS Systems Manager service to get started.
Parameter Store
Create Parameter
Enter a name or path for the parameter.
Optionally add a description.
Select the tier to use.
Select the type. (we will choose SecureString.)
Select the KMS key source which is what will encrypt the SecureString.
Enter the value for the parameter.
Creating a Role and policy for ECS in IAM
In order for the containers in our Task Definition to get parameters, we need to enable KMS decrypt and SSM get parameter permissions. Navigate to IAM to get started.
Create Policy
Create a policy with permissions for KMS and SSM:
Create Role
Choose the service
Elastic Container Service
Select the use case as
Elastic Container Service Task
Attach the policy created to read secrets from Parameter Store.
Enter a role name.
Enter a role description.
Last updated