docker terraform 실행 환경을 만들어 동료의 terraform 실행 환경을 존중
3699 단어 docker-composeTerraformAWS
소개하는 내용
環境別HOMEパス/.aws/credentials
에서 aws profile을 얻는 설정을 이용합니다.결론
동일한 aws profile 이름을 설정하는 규칙 만 준수하면 MAC에서 terraform을 설치 한 사람과 docker로 terraform을 설치 한 사람은 서로의 환경에 신경 쓰지 않고 terraform을 실행할 수 있다고 생각합니다.
gitignore했기 때문에 aws profile 정보는 git push되지 않습니다
소개 시작
디렉토리 구성
전체 소스 코드는 htps : // 기주 b. 코 m / 치에 ky 코 r d / 쿠에타 에에 mp에서 확인할 수 있습니다.

docker 컨테이너 안에서 생성한 aws profile의 정보를 마운트하는 곳입니다.

aws profile 이름
my-demo

시험 순서입니다.
cd qitta-example/terraform/aws-account-management
DOCKER_UID=$(id -u $USER) DOCKER_GID=$(id -g $USER) docker-compose up -d
docker exec -it aws-account-management /bin/sh
aws profile 설정
my-demo
로 설정되었습니다. terraform에서 참조하십시오 aws configure --profile my-demo
실행 전 이미지
aws configure --profile my-demo
실행 중인 이미지
aws configure --profile my-demo
실행 후 이미지
terraform 디렉터리로 이동
cd ~/terraform/demo
terraform init합니다
terraform init
terraform을 실행합니다.
terraform apply
terraform의 profile 참조 이름을 변경하여 오류가 발생하는지 확인합니다.
terraform apply

Reference
이 문제에 관하여(docker terraform 실행 환경을 만들어 동료의 terraform 실행 환경을 존중), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/cheekykorkind/items/9e4ff91eadfedf36050a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)