Skip to content

Commit

Permalink
Add module
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jagyugya <jagyugyaerik@gmail.com>
  • Loading branch information
jagyugyaerik committed Nov 25, 2021
1 parent cee871a commit 49a3977
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 48 deletions.
101 changes: 53 additions & 48 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: Terraform
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
workflow_dispatch:
inputs:
username:
description: 'A username passed from the caller workflow'
default: 'john-doe'
required: false
tfvars_file_name:
description: 'A tfvars file passed from the caller workflow'
default: 'terraform.tfvars'
required: true
type: string
defaults:
run:
working-directory: modules/terraform-azure-caf
working-directory: ./modules/terraform-azure-psp/examples/complete
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains the following jobs
Expand All @@ -29,45 +29,50 @@ jobs:
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform fmt
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate
- name: Terraform Plan
id: plan
run: terraform plan
terraform-apply:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: ["terraform-plan"]
env:
TF_CLI_ARGS: '-no-color'
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform fmt
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate
- name: Terraform Plan
id: plan
run: terraform apply
- name: Print the input name to STDOUT
run: cat ${{ env.TFVARS_FILE_PATH }}/${{ inputs.tfvars_file_name }}"
env:
TFVARS_FILE_PATH: ../../../../project_spaces

# - name: Install Terraform
# uses: hashicorp/setup-terraform@v1
# - name: Terraform fmt
# id: fmt
# run: terraform fmt -check
# - name: Terraform Init
# id: init
# run: terraform init
# - name: Terraform Validate
# id: validate
# run: terraform validate
# - name: Terraform Plan
# id: plan
# run: terraform plan
# terraform-apply:
# # The type of runner that the job will run on
# runs-on: ubuntu-latest
# needs: ["terraform-plan"]
# env:
# TF_CLI_ARGS: '-no-color'
# ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
# ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
# ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
# ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# - name: Checkout Source Code
# uses: actions/checkout@v2
# - name: Install Terraform
# uses: hashicorp/setup-terraform@v1
# - name: Terraform fmt
# id: fmt
# run: terraform fmt -check
# - name: Terraform Init
# id: init
# run: terraform init
# - name: Terraform Validate
# id: validate
# run: terraform validate
# - name: Terraform Plan
# id: plan
# run: terraform apply
Empty file.
37 changes: 37 additions & 0 deletions project_spaces/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2021 Nordcloud Oy or its affiliates. All Rights Reserved.

project_space_name = "complete-app"

environment = "test"

location = "westeurope"

location_short = "weu"

network_type = "default"

peering_type = "hub"

resource_group_names = ["auxilaryapp"]

subscription_id = "361c4a51-f554-4e57-8c0f-95d5fcf219c1"

subscription_name = "sub-lz-example-app-test-001"

management_group_id = "TestExternal"

virtual_networks = [
{
overwrite_peering_name : "",
use_remote_gateways : false,
network_name : "vnet-dev-spoke-001",
network_prefix : "10.250.250.0/24",
network_private_dns_name : "nord.cloud.com",
subnets = [
{
name : "snet-dev-001",
address_prefix : "10.250.250.0/26"
}
]
}
]

0 comments on commit 49a3977

Please sign in to comment.