Skip to content

Commit

Permalink
solved
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaLafinskiy committed Dec 24, 2024
1 parent e54115d commit cdd0539
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions .github/workflows/terraform-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,3 @@ jobs:

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3

- name: Check count function
run: |
if ! grep -Eq 'count\s+=' ./*.tf; then
echo "Count function not found in network.tf!"
exit 1
fi
echo "Count function is present."
- name: Check for_each meta-argument for network interfaces
run: |
if ! grep -Eq 'for_each\s+=' *.tf || ! grep -q 'azurerm_network_interface' *.tf; then
echo "For_each meta-argument for network interfaces not found!"
exit 1
fi
echo "For_each meta-argument for network interfaces is present."
- name: Check local value for network interface names
run: |
if ! grep -q 'locals {' *.tf || ! grep -Eq '(nic_names|network_interface_names)' *.tf; then
echo "Local value for network interface names not found!"
exit 1
fi
echo "Local value for network interface names is present."
- name: Check lifecycle block
run: |
if ! grep -q 'lifecycle {' *.tf || ! grep -q 'prevent_destroy = true' *.tf; then
echo "Lifecycle block to prevent accidental deletion not found!"
exit 1
fi
echo "Lifecycle block is present."
- name: Check dynamic blocks for security rules
run: |
if ! grep -q 'dynamic "security_rule"' *.tf; then
echo "Dynamic blocks for network security rules not found!"
exit 1
fi
echo "Dynamic blocks for security rules are present."
- name: Check local value for security rules
run: |
if ! grep -q 'locals {' *.tf || ! grep -Eq '(security_rules|nsg_rules)' *.tf; then
echo "Local value for security rules not found!"
exit 1
fi
echo "Local value for security rules is present."
- name: Check built-in functions usage
run: |
if ! grep -q 'upper(' *.tf || ! grep -q 'join(' *.tf || ! grep -Eq '\[for.*:' *.tf; then
echo "Required built-in functions not used correctly!"
exit 1
fi
echo "Required built-in functions are present."
- name: Terraform Fmt
run: terraform fmt -check -recursive -diff

- name: Terraform Init
run: terraform init -backend=false

- name: Terraform Validate
run: terraform validate

0 comments on commit cdd0539

Please sign in to comment.