Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure_1 #11

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version = 1

[[analyzers]]
name = "terraform"
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 3
assignees:
- "clouddrove-ci"
reviewers:
- "approvers"

- package-ecosystem: "terraform" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
assignees:
- "clouddrove-ci"
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "/_example/" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
assignees:
- "clouddrove-ci"
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3
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/[email protected]
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/[email protected]
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'example / Check code format'
...
6 changes: 3 additions & 3 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@master
changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.10
secrets: inherit
with:
branch: 'master'
branch: 'master'
17 changes: 8 additions & 9 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,33 @@ jobs:
uses: actions/checkout@master

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

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

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

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

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

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand Down
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:
example:
uses: clouddrove/github-shared-workflows/.github/workflows/[email protected]
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/[email protected]
secrets:
GITHUB: ${{ secrets.GITHUB }}
4 changes: 2 additions & 2 deletions .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@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.10
secrets: inherit
with:
working_directory: '.'
working_directory: '.'
11 changes: 7 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ github_repo: clouddrove/terraform-azure-labels

# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v1.0.0-green"
url: "https://www.terraform.io"
- name: "Latest Release"
image: "https://img.shields.io/github/release/clouddrove/terraform-azure-labels.svg"
url: "https://github.com/clouddrove/terraform-azure-labels/releases/latest"
- name: "tfsec"
image: "https://github.com/clouddrove/terraform-azure-labels/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-azure-labels/actions/workflows/tfsec.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
Expand Down Expand Up @@ -49,4 +52,4 @@ usage: |-
Application = "CloudDrove"
}
}
```
```
6 changes: 4 additions & 2 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ provider "azurerm" {
features {}
}

##-----------------------------------------------------------------------------
## Labels module call.
##-----------------------------------------------------------------------------
module "labels" {
source = "./../"

source = "./../"
name = "labels"
environment = "test"
label_order = ["name", "environment"]
Expand Down
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.6.6"
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.85.0"
}
}
}
17 changes: 5 additions & 12 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
## Managed By : CloudDrove
## Copyright @ CloudDrove. All Right Reserved.

#Module : locals
#Description : This terraform module is designed to generate consistent label names and tags for resources. You can use terraform-labels to implement a strict naming convention.

##-----------------------------------------------------------------------------
## This terraform module is designed to generate consistent label names and tags for resources. You can use terraform-labels to implement a strict naming convention.
##-----------------------------------------------------------------------------
locals {
label_order_defaults = {
label_order = ["environment", "name"]
label_order = ["name", "environment"]
}

id_context = {
Expand All @@ -20,14 +17,11 @@ locals {
id_labels = [for l in local.label_order : local.id_context[l] if length(local.id_context[l]) > 0]
id = lower(join(var.delimiter, local.id_labels, var.attributes))

enabled = var.enabled

name = var.enabled == true ? lower(format("%v", var.name)) : ""
environment = var.enabled == true ? lower(format("%v", var.environment)) : ""
managedby = var.enabled == true ? lower(format("%v", var.managedby)) : ""
repository = var.enabled == true ? lower(format("%v", var.repository)) : ""
business_unit = var.enabled == true ? lower(format("%v", var.business_unit)) : ""
delimiter = var.enabled == true ? lower(format("%v", var.delimiter)) : ""
attributes = var.enabled == true ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : ""

tags_context = {
Expand All @@ -41,6 +35,5 @@ locals {
}

generated_tags = { for l in keys(local.tags_context) : title(l) => local.tags_context[l] if length(local.tags_context[l]) > 0 }

tags = merge(local.generated_tags, var.extra_tags)
tags = merge(local.generated_tags, var.extra_tags)
}
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Terraform version
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.6.6"
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=2.90.0"
version = ">=3.85.0"
}
}
}