Last active
April 7, 2022 20:19
-
-
Save builtroller/52f2f48c777923527586de0a83c53c78 to your computer and use it in GitHub Desktop.
Revisions
-
builtroller revised this gist
Apr 7, 2022 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # ECR Login with Makefile * allow an alias for the aws account id * default to the default region for aws @@ -7,4 +9,8 @@ make ecr_login # login to dev account (111111111111), region = us-west-2 make ecr_login aws_account=dev region=us-west-2 ``` ## References * [Dictionaries/Maps/Lookup Tables in Makefiles](https://stackoverflow.com/a/40919906) -
builtroller created this gist
Apr 7, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # map bp/dev to aws account id aws_account ?= bp aws_account_dev := 111111111111 aws_account_bp := 222222222222 aws_account_id := $(aws_account_$(aws_account)) region ?= $(AWS_DEFAULT_REGION) ecr_login: aws ecr get-login-password --region $(region) | \ docker login --username AWS --password-stdin $(aws_account_id).dkr.ecr.$(region).amazonaws.com This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ * allow an alias for the aws account id * default to the default region for aws ```bash # login to bp account (222222222222), region = AWS_DEFAULT_REGION make ecr_login # login to dev account (111111111111), region = us-west-2 make ecr_login aws_account=dev region=us-west-2 ```