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

fix: removed one storage resource and added required arguments in the module #45

Merged
merged 12 commits into from
Jan 26, 2024
20 changes: 3 additions & 17 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# 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"
Expand All @@ -29,20 +28,7 @@ updates:
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/basic" # 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/complete" # Location of package manifests
directory: "/_example/complete" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
Expand All @@ -55,7 +41,7 @@ updates:
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/storage_with_cmk" # Location of package manifests
directory: "/_example/basic" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
Expand All @@ -65,4 +51,4 @@ updates:
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3
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/auto_assignee.yml@1.2.1
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@1.2.1
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'example-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@master
changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.2.1
secrets: inherit
with:
branch: 'master'
3 changes: 1 addition & 2 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@master

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

Expand All @@ -25,7 +25,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: 'pre-commit check errors'
uses: pre-commit/action@v3.0.0
continue-on-error: true
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.

16 changes: 16 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
example-basic:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.1
with:
working_directory: './_example/basic'
example-complete:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.1
with:
working_directory: './_example/complete'

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@1.2.1
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@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.2.1
secrets: inherit
with:
working_directory: '.'
101 changes: 50 additions & 51 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ github_repo: clouddrove/terraform-azure-storage

# 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-storage.svg"
url: "https://github.com/clouddrove/terraform-azure-storage/releases/latest"
- name: "tfsec"
image: "https://github.com/clouddrove/terraform-azure-storage/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-azure-storage/actions/workflows/tfsec.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
Expand All @@ -37,76 +40,72 @@ include:
usage: |-
### Simple Example
Here is an example of how you can use this module in your inventory structure:
#### default storage
#### storage account without cmk encryption
```hcl
module "storage" {
depends_on = [module.resource_group]
source = "clouddrove/storage/azure"
name = "app"
environment = "test"
label_order = ["name", "environment"]
default_enabled = true
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
storage_account_name = "stordtyre236"

source = "../.."
name = local.name
environment = local.environment
label_order = local.label_order
resource_group_name = "test-rg"
location = "Central India"
storage_account_name = "storage7386"
public_network_access_enabled = true
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "GRS"

## Encryption is not enabled for this Storage account
cmk_encryption_enabled = false

## Storage Container
containers_list = [
{ name = "app-test", access_type = "private" },
{ name = "app2", access_type = "private" },
]

## Storage File Share
file_shares = [
{ name = "fileshare1", quota = 5 },
]

## Storage Tables
tables = ["table1"]

## Storage Queues
queues = ["queue1"]
file_shares = [
{ name = "fileshare", quota = "10" },
]

management_policy_enable = true

#enable private endpoint
virtual_network_id = module.vnet.vnet_id[0]
subnet_id = module.subnet.default_subnet_id[0]

log_analytics_workspace_id = module.log-analytics.workspace_id

virtual_network_id = "/subscriptions/--------------<vnet_id>---------------"
subnet_id = "/subscriptions/--------------<subnet_id>---------------"
log_analytics_workspace_id = "/subscriptions/--------------<log_analytics_workspace_id>---------------"
}
```
#### storage with cmk encryption
#### storage account with cmk encryption
```hcl
module "storage" {
depends_on = [module.resource_group]
source = "clouddrove/storage/azure"
name = "app"
environment = "test"
label_order = ["name", "environment", ]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
storage_account_name = "storagkqp0896"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
identity_type = "UserAssigned"
object_id = ["71d1a02f-3ae9-4ab9-8fec-d9b1166d7c97", ]
account_replication_type = "ZRS"
source = "../.."
name = local.name
environment = local.environment
label_order = local.label_order
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
storage_account_name = "storage874682"
public_network_access_enabled = true
account_kind = "StorageV2"
account_tier = "Standard"
identity_type = "UserAssigned"
object_id = [data.azurerm_client_config.current_client_config.object_id]
account_replication_type = "ZRS"
cmk_encryption_enabled = true
admin_objects_ids = [data.azurerm_client_config.current_client_config.object_id]

###customer_managed_key can only be set when the account_kind is set to StorageV2 or account_tier set to Premium, and the identity type is UserAssigned.
key_vault_id = module.vault.id

## Storage Container
containers_list = [
{ name = "app-test", access_type = "private" },
]
tables = ["table1"]
queues = ["queue1"]
file_shares = [
{ name = "fileshare", quota = "10" },
]

virtual_network_id = module.vnet.vnet_id[0]
subnet_id = module.subnet.default_subnet_id[0]

virtual_network_id = module.vnet.vnet_id[0]
subnet_id = module.subnet.default_subnet_id[0]
log_analytics_workspace_id = module.log-analytics.workspace_id

}
```
Loading
Loading