Skip to content

toyamagu-cicd/terraform-argocd-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-github

Prerequiments

  1. GitHub organization
  2. AWS Account
    • May spend some money...
    • DONOT FORGOT TO DESTROY
  3. S3 Bucket for tfstate
  4. Route53 public hostedzone (example.com)
    • ArgoCD will use argocd.example.com (create by terraform)
    • Sample application will use sample-app.example.com (create by terraform)

Prepare GitHub repositories

  1. cd resources/github
  2. Change backend-config.hcl for one's environment.
  3. cp example.tfvars example.auto.tfvars, and edit (Comment out input values appropriately).
  4. Setup backend: terraform init -backend-config=backend-config.hcl
  5. Export GitHub Token: export GITHUB_TOKEN=hogehoge
  6. terraform plan
  7. terraform apply

Create GitHub Application (Cannot create by terraform)

Following are abstract procedures. See document repo for complete description.

  1. Create application in one's organization.
  2. Install application to one's organiztion.
  3. Save pem file github-app.pem to resources/github.
  4. (optional) After installation, one can manage installation of GitHub App to a repository by terraform.
    • Terraform requires installation_id shown after the first installation.
    • For installation, you need at least one repository.

Complete GitHub Setting

Configure GitHub App and GitHub Secrets.

  1. cd resources/github
  2. Edit example.auto.tfvars
  3. terraform plan
  4. terraform apply

ArgoCD

Create GitHub OAuth App for ArgoCD Dex

  1. https://github.com/organizations/{your_org}/settings/applications
  2. Create OAuth application
    • image
  3. Generate Client secret

Terraform

  1. cd resources/argocd
  2. Edit backend-config.hcl
  3. cp example.tfvars example.auto.tfvars, and edit
  4. cp example-vaults.tfvars example-vaults.auto.tfvars, and edit
  5. Setup backend: terraform init -backend-config=backend-config.hcl
  6. terraform plan
  7. terraform apply: May take 20 minites or more.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published