This open source project provides hands-on materials on different aspects of working in the clouds like AWS and GCP.
CloudFormation. How to access CodeCommit repo from EC2 instance
It is a very common task to pull your application code to EC2 instances from the Git repository. If you’re using CodeCommit as your main Git repository and CloudFormation for infrastructure management, it is very easy to launch an instance and allow it to access to that repository without storing any credentials or keys inside of it.