---
# System prepended metadata

title: Terraform in the pipeline
tags: [IaC, Pipeline, Infra, Research, Plando, Terraform]

---

# Terraform in the pipeline

###### tags: `Research` `Infra` `Pipeline` `IaC` `Terraform` `Plando`

:::info
More about terraform [here](/s/S1m0jRrOU)
:::

## :tv: Videos
- [Github actions and terraform](https://www.youtube.com/watch?v=zt0uvTG0Lz4)
- [Version-Controlled Infrastructure with GitHub & Terraform](https://www.youtube.com/watch?v=2TWqi7dLSro)


## :link: Links
- [Crud-api pipeline original module](https://github.com/badico-cloud-hub/terraform-aws-ecs-codepipeline)
- [Frontend pipeline reference](https://github.com/msfidelis/terraform-static-site-pipeline)
- [Github Token generation](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
- [terraform-cdci-aws-codepipeline](https://medium.com/faun/the-journey-goes-on-terraform-cdci-aws-codepipeline-codebuild-20349c0ff6c8)
- [deploying-spa-on-aws-with-terraform-codepipeline](https://medium.com/@geekrodion/deploying-spa-on-aws-with-terraform-codepipeline-6290529c24df)


## Codepipeline from Terraform config

- [connecting to github](https://stackoverflow.com/questions/32397338/aws-codepipeline-not-able-to-access-organizations-repositories)
- [error in s3](https://medium.com/@shanikae/insufficient-permissions-unable-to-access-the-artifact-with-amazon-s3-247f27e6cdc3)
## Codebuild from buildspec
[Document with example used](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html), we just have to make the following changes:
- `AWS_DEFAULT_REGION` to `AWS_REGION`.
- add `--target production` on build command
- add `artifacts` directive as in this [example](https://github.com/cloudposse/terraform-aws-ecs-codepipeline/pull/17)
- [replace helper](https://stackoverflow.com/questions/52096787/terraform-replace-regex-not-working-correctly) 
- [notes about terraform](https://itnext.io/things-i-wish-i-knew-about-terraform-before-jumping-into-it-43ee92a9dd65)