Skip to content

Commit

Permalink
commit missed files
Browse files Browse the repository at this point in the history
  • Loading branch information
lucavallin committed Dec 5, 2023
1 parent 5996dcd commit a2c8072
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 51 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
"features": {
"ghcr.io/devcontainers/features/terraform:1": {}
}
"postCreateCommand": "../scripts/install.sh"
}
48 changes: 3 additions & 45 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
# This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file
# with an API token for Terraform Cloud (app.terraform.io). On pull request events, this workflow will run
# `terraform init`, `terraform fmt`, and `terraform plan` (speculative plan via Terraform Cloud). On push events
# to the "main" branch, `terraform apply` will be executed.
#
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform
#
# To use this workflow, you will need to complete the following setup steps.
#
# 1. Create a `main.tf` file in the root of this repository with the `remote` backend and one or more resources defined.
# Example `main.tf`:
# # The configuration for the `remote` backend.
# terraform {
# backend "remote" {
# # The name of your Terraform Cloud organization.
# organization = "example-organization"
#
# # The name of the Terraform Cloud workspace to store Terraform state files in.
# workspaces {
# name = "example-workspace"
# }
# }
# }
#
# # An example resource that does nothing.
# resource "null_resource" "example" {
# triggers = {
# value = "A example resource that does nothing!"
# }
# }
#
#
# 2. Generate a Terraform Cloud user API token and store it as a GitHub secret (e.g. TF_API_TOKEN) on this repository.
# Documentation:
# - https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html
# - https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
#
# 3. Reference the GitHub secret in step using the `hashicorp/setup-terraform` GitHub Action.
# Example:
# - name: Setup Terraform
# uses: hashicorp/setup-terraform@v1
# with:
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

name: 'Terraform'

Expand All @@ -62,6 +19,7 @@ jobs:
defaults:
run:
shell: bash
working-directory: src

steps:
# Checkout the repository to the GitHub Actions runner
Expand All @@ -80,10 +38,10 @@ jobs:
- name: Terraform Format
run: terraform fmt -check

# Setup, init and run TFLint linter
# Setup, init and run TFLint linter
- uses: terraform-linters/setup-tflint@v3
name: Setup TFLint

- name: Init TFLint
run: tflint --init

Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
# tf-ghes-oidc
Terraform configuration to setup cloud resources for OIDC on GHES.
Terraform configuration to setup cloud resources for OpenID Connect (OIDC) on GitHub Enterprise Server (GHES).
TODO: describe problem

## Development

install cli
terraform init
say about backend
CI/CD
tfvars
plan out / apply file

## Setup

### Azure

### Google Cloud

gcloud init
create project on gcp, make sure billing linked to project
must run gcloud init (select project you created)
source ~/.bashrc
run gcloud auth application-default login
update tf vars


### AWS

## Clean Up

destroy
Empty file removed main.tf
Empty file.
4 changes: 4 additions & 0 deletions scripts/aws-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Install the AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
2 changes: 2 additions & 0 deletions scripts/azure-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Install the Azure CLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
5 changes: 2 additions & 3 deletions scripts/install.sh → scripts/gcp-cli.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Install Google Cloud CLI

# Install the Google Cloud CLI
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-455.0.0-linux-x86_64.tar.gz
tar -xf google-cloud-cli-455.0.0-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh

./google-cloud-sdk/bin/gcloud init

0 comments on commit a2c8072

Please sign in to comment.