- Save your AWS access key in a .tfvars file (never share a .tfvars file)
AWS_ACCESS_KEY="XXXXXYY"
AWS_SECRET_KEY="YYYYXXXXXXXX"
- Initialize your working directory
$ terraform init
- Apply
$ terraform apply
- Authenticating Amazon ECR Repositories for Docker CLI
Use the commande above to retrieves the password
$ aws ecr get-login-password
copy the password, in run the following commande
$ docker login –p password –e none https://aws_account_id.dkr.ecr.your_region.amazonaws.com