ã«ã¬ã³ããã£ã¬ã¯ãé
ä¸ã«ããå
¨ãã£ã¬ã¯ããªã§åãæä½ãããæã£ã¦å¤ãã®ã§ã¯ãªãã§ããããã
ä¾ãã°ä½ã£ã¦ãã terraform 群ãè¦æ±ãã Provider ã®ãã¼ã¸ã§ã³ãããã¦ãå
¨é¨ terraform init
ãã¦åããªãã¨ãããªããªã£ããã¨ãã
find
㨠xargs
ãçµã¿åãããã¨ãããªæãã§ã§ãã¾ãã -mindepth 1
ããã¦ããã®ã¯ã«ã¬ã³ããã£ã¬ã¯ããªãé¤å¤ããããã§ããã! -name .
ã§ãåé¡ãªãã§ãããã以å¤ã«ã解æ³ã¯ãã£ã¨ããããããã
$ find . -maxdepth 1 -mindepth 1 -type d | xargs -I% sh -c 'echo ==== % ====; cd %; terraform init'
ãã¡ãããfind
ã ãã§ãã§ãã¾ããã
$ find . -maxdepth 1 -mindepth 1 -type d ! -name vars ! -name test -exec sh -c "echo === {} ===; cd {}; terraform init" \;