{"id":19621506,"url":"https://github.com/mnstrlara/aws-terraflow","last_synced_at":"2026-02-27T13:10:25.415Z","repository":{"id":244084657,"uuid":"814218884","full_name":"mnstrlara/aws-terraflow","owner":"mnstrlara","description":"Automated Terraform IaC Deployment on AWS with CI/CD Integration","archived":false,"fork":false,"pushed_at":"2024-07-01T10:58:45.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T18:42:27.002Z","etag":null,"topics":["aws","codebuild","codecommit","codepipeline","pipeline","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnstrlara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-12T15:07:39.000Z","updated_at":"2024-09-02T18:05:33.000Z","dependencies_parsed_at":"2024-09-20T18:38:58.972Z","dependency_job_id":"a56bc12e-19b8-4502-aacc-b4855f67603d","html_url":"https://github.com/mnstrlara/aws-terraflow","commit_stats":null,"previous_names":["manestarlara/aws-terraflow","mnstrlara/aws-terraflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mnstrlara/aws-terraflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Faws-terraflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Faws-terraflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Faws-terraflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Faws-terraflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnstrlara","download_url":"https://codeload.github.com/mnstrlara/aws-terraflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Faws-terraflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29896315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T12:09:13.686Z","status":"ssl_error","status_checked_at":"2026-02-27T12:09:13.282Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","codebuild","codecommit","codepipeline","pipeline","terraform"],"created_at":"2024-11-11T11:23:21.957Z","updated_at":"2026-02-27T13:10:25.393Z","avatar_url":"https://github.com/mnstrlara.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Terraform IaC Deployment on AWS with CI/CD Integration\n## Objective:\nThe objective of AWS Terraflow is to automate and streamline the deployment of infrastructure as code using Terraform on AWS, utilizing AWS CodePipeline and CodeBuild for continuous integration and deployment (CI/CD).\n## Components:\n### 1. IAM Role\nUsed to grant permissions for CodePipeline, CodeBuild, and other AWS services to interact securely with resources.\n### 2. KMS Key\nEnsures encryption of sensitive data used within the pipeline, such as credentials or configuration files.\n### 3. S3 Bucket\nActs as a storage repository for artifacts generated during the CI/CD process, including Terraform configuration files and deployment packages.\n### 4. CodeCommit\n Hosts the source code repository containing Terraform configuration files, enabling version control and collaboration.\n### 5. CodeBuild\nExecutes build tasks defined in the buildspec.yml file, such as compiling code, running tests, and packaging artifacts.\n### 6. CodePipeline \nOrchestrates the CI/CD workflow, automating the integration, testing, and deployment of changes to infrastructure as code.\n### 7. Terraform\nProvides the framework for defining and provisioning AWS infrastructure as code, ensuring consistent and repeatable deployments.\n\n## Pre-requisites:\n- AWS Root account created and available\n- AWS CLI installed on local machine\n- Terraform installed on local machine\n\n## .tfvars Configuration:\n`.tfvars` files in Terraform are used to supply input variables to your Terraform configurations. They allow you to parameterize your infrastructure code, making it flexible and reusable across different environments or configurations.\n\nExample:\n```\nproject_name               = \"your-project-name\"\nsource_repository_name     = \"your-repository-name\"\nrepo_default_branch        = \"your-default-branch\"\n```\n\n\u003e **NOTE: See the end of the README.md file for the documentation on how to correctly configure a .tfvars file**\n\n## Steps:\n### 1. Assume Proper Role\nBefore deploying the Terraform files to AWS, ensure you have assumed the appropriate IAM role with the necessary permissions. Follow these steps:\n\n- Open the AWS Management Console and navigate to the IAM Service\n- In the IAM dashboard, select \"Roles\" from the left-hand menu\n- Search for and select the IAM role that has the required permissions for deploying Terraform infrastructure.\n- After finding the role you will be using, return to the AWS CLI and apply the assume role command, it should look something like this:\n\n```\naws sts assume-role --role-arn \"arn:aws:iam::123456789012:role role-name\" --role-session-name your-session\n```\n\n- The AWS CLI will give you credentials which you will apply using these commands:\n\n```\nexport AWS_ACCESS_KEY_ID=\nexport AWS_SECRET_ACCESS_KEY=\nexport AWS_SESSION_TOKEN=\n```\n - Your role should now be assumed but in case you want to double check, use this command that will give you the credentials of the role you are currently using:\n\n```\naws sts get-caller-identity\n```\n\n### 2. Deployment\nTo deploy your infrastructure using Terraform, follow these steps:\n\n- **Initialize Terraform** using `terraform init`. It initializes a Terraform working directory by downloading and installing any required plugins defined in your configuration files (.tf files).\n\n- **Validate Terraform Configuration** using `terraform validate`. This validates the syntax and configuration of your Terraform files. (This is an optional step)\n\n- **Plan Terraform Changes** using `terraform plan`. It generates an execution plan for Terraform, showing the actions it will take to achieve the desired state defined in your configuration.\n\n- **Apply Terraform Changes** using `terraform apply`. This executes the planned changes to create, modify, or delete infrastructure resources as defined in your Terraform configuration.\n\n\u003e **NOTE: If you are using a .tfvars file, make sure to add it to your `terraform apply` command using -var-file=\"./path/to/.tfvars**\n\n### 3. Branch creation\nAfter running the `terraform apply` command, you should be receiving a confirmation regarding the deployment. If you go check out the pipeline in the AWS Console you will receive an error from CodeCommit telling you that the branch you gave it does not exist. This is because new repositories are not created with their default branch. This is where you have to create a branch using the following steps:\n\n- There are three ways to create a branch in the CodeCommit repository - through the **AWS Console**, through the **AWS CLI** and creating a branch **locally**. I will be giving an example on how you can do it locally.\n- Firstly, go to the AWS Console and copy the CodeCommit pipeline URL, you will use this URL to clone the repository using `git clone`.\n- Next, you will use the `cd` command to go inside the directory, where you will do the following line execution:\n\n```bash\n$\u003eecho 'hello world' \u003e touch.txt\n$\u003egit add touch.txt\n$\u003egit commit -a -m \"init master\"\n$\u003egit push -u origin master\n```\n\n- This will initialize the repository and officially start running your pipeline.\n\n## Documentation\n#### [AWS CLI install and update instructions](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) - This topic describes how to install or update the latest release of the AWS Command Line Interface (AWS CLI) on supported operating systems\n#### [Terraform installation](https://developer.hashicorp.com/terraform/install) - This link leads to a Terraform installation\n#### [Protect sensitive input variables](https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables) - Topic describing the importance of .tfvars files and how to configue them\n#### [Create a branch in AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-branch.html) - Topics on the three different ways to create a branch in AWS CodeCommit\n\n## License\nThis library is licensed under the MIT-0 License. See the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnstrlara%2Faws-terraflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnstrlara%2Faws-terraflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnstrlara%2Faws-terraflow/lists"}