Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavcloud committed Sep 19, 2024
1 parent 7a16f48 commit adffd08
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/" # Location of package manifests
directory: "example/" # Location of package manifests
schedule:
interval: "weekly"
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
12 changes: 12 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Auto merge
on:
pull_request:
jobs:
auto-merge:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'basic / Check code format'
...
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- "*"
workflow_dispatch:
jobs:
call-workflow-changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.2.1
changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
secrets: inherit
with:
branch: 'master'
59 changes: 10 additions & 49 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,15 @@
name: 'Create README.md file'
name: Readme Workflow
on:
push:
branches:
- master

paths-ignore:
- 'README.md'
- 'docs/**'
workflow_dispatch:
jobs:
readme-create:
name: 'readme-create'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Set up Python 3.7'
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: 'pre-commit check errors'
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: 'pre-commit fix erros'
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v9.0.2'
continue-on-error: true
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
README:
uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master
secrets:
TOKEN : ${{ secrets.GITHUB }}
SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}
30 changes: 0 additions & 30 deletions .github/workflows/semantic-releaser.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/static-checks.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-checks-aws-managed-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './example/'
11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
tfsec:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.2.1
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
secrets: inherit
with:
working_directory: '.'
1 change: 1 addition & 0 deletions _example/example.tf → example/example.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
provider "azurerm" {
subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX"
features {}
}

Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions example/s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# Function to update the versions.tf file
update_providers_file() {
local version=$1
cat > versions.tf << EOF
# Terraform version
terraform {
required_version = ">= 1.0.0"
}
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "$version"
}
}
}
EOF
echo "Updated versions.tf with AzureRM version $version"
}

# Main script
echo "Terraform AzureRM Provider Version Tester"
echo "----------------------------------------"

# Ask for the version number
read -p "Enter the AzureRM provider version to test (e.g., 4.0.1): " version

# Update the versions.tf file
update_providers_file $version

# Remove .terraform directory and .terraform.lock.hcl file
echo "Removing .terraform directory and .terraform.lock.hcl file..."
rm -rf .terraform .terraform.lock.hcl

# Run terraform init
echo "Running terraform init..."
terraform init

# Check if terraform init was successful
if [ $? -eq 0 ]; then
# Run terraform plan after init
echo "Terraform init completed successfully. Running terraform plan..."
terraform plan
else
echo "Terraform init failed. Please check the configuration."
fi

13 changes: 13 additions & 0 deletions example/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Terraform version
terraform {
required_version = ">= 1.0.0"
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.112.0"
}
}
}
14 changes: 8 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ resource "azurerm_lb" "load-balancer" {
sku = var.lb_sku

frontend_ip_configuration {
name = var.frontend_name
private_ip_address = var.frontend_private_ip_address
private_ip_address_allocation = var.frontend_private_ip_address_allocation
private_ip_address_version = var.frontend_private_ip_address_version
public_ip_address_id = try(azurerm_public_ip.default[0].id, null)
subnet_id = var.frontend_subnet_id
name = var.frontend_name
#when we are not using private ip
# private_ip_address = var.frontend_private_ip_address
# private_ip_address_allocation = var.frontend_private_ip_address_allocation
# private_ip_address_version = var.frontend_private_ip_address_version

public_ip_address_id = try(azurerm_public_ip.default[0].id, null)
subnet_id = var.frontend_subnet_id
}

timeouts {
Expand Down
10 changes: 0 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,7 @@ variable "frontend_name" {
default = "myip"
}

variable "frontend_private_ip_address" {
description = "(Optional) Private ip address to assign to frontend. Use it with type = private"
type = string
default = ""
}

variable "frontend_private_ip_address_allocation" {
description = "(Optional) Frontend ip allocation type (Static or Dynamic)"
type = string
default = "Dynamic"
}

variable "frontend_private_ip_address_version" {
description = "(Optional) The version of IP that the Private IP Address is. Possible values are `IPv4` or `IPv6`."
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.89.0"
version = ">=3.112.0"
}
}
}

0 comments on commit adffd08

Please sign in to comment.