This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aztfmod/vnext
July 2020
- Loading branch information
Showing
10 changed files
with
147 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation | ||
# Licensed under the MIT License. | ||
# | ||
|
||
name: caf_landing_zones_github_actions | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- vnext | ||
pull_request: | ||
branches: | ||
- master | ||
- vnext | ||
|
||
jobs: | ||
tfsec: | ||
name: Run TFsec | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Terraform security scan | ||
uses: triat/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
docs: | ||
name: Run Terraform-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Run Terraform-docs | ||
uses: Dirrk/[email protected] | ||
with: | ||
tf_docs_working_dir: . | ||
tf_docs_output_file: README.md | ||
tf_docs_output_method: inject | ||
tf_docs_git_push: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See http://pre-commit.com for more information | ||
# See http://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.31.0 | ||
hooks: | ||
- id: terraform_fmt | ||
# - id: terraform_docs | ||
- id: terraform_tflint | ||
# - id: terraform_tfsec | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.1.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
# - repo: git://github.com/markdownlint/markdownlint | ||
# rev: v0.9.0 | ||
# hooks: | ||
# - id: markdownlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,10 @@ | ||
# When Terraform will have condition module support, link it back to https://github.com/aztfmod/terraform-azurerm-caf-diagnostics | ||
|
||
resource "azurerm_monitor_diagnostic_setting" "diagnostics" { | ||
count = var.enable_bastion ? 1 : 0 | ||
|
||
name = "${azurerm_bastion_host.azurebastion.0.name}-diag" | ||
target_resource_id = azurerm_bastion_host.azurebastion.0.id | ||
|
||
eventhub_name = lookup(var.diagnostics_map, "eh_name", null) | ||
eventhub_authorization_rule_id = lookup(var.diagnostics_map, "eh_id", null) != null ? "${var.diagnostics_map.eh_id}/authorizationrules/RootManageSharedAccessKey" : null | ||
|
||
log_analytics_workspace_id = var.log_analytics_workspace.id | ||
log_analytics_destination_type = lookup(var.bastion_config.diagnostics, "log_analytics_destination_type", null) | ||
|
||
storage_account_id = var.diagnostics_map.diags_sa | ||
|
||
dynamic "log" { | ||
for_each = var.bastion_config.diagnostics.log | ||
content { | ||
category = log.value[0] | ||
enabled = log.value[1] | ||
retention_policy { | ||
enabled = log.value[2] | ||
days = log.value[3] | ||
} | ||
} | ||
} | ||
|
||
dynamic "metric" { | ||
for_each = var.bastion_config.diagnostics.metric | ||
content { | ||
category = metric.value[0] | ||
enabled = metric.value[1] | ||
retention_policy { | ||
enabled = metric.value[2] | ||
days = metric.value[3] | ||
} | ||
} | ||
} | ||
} | ||
module "diagnostics_pip" { | ||
source = "aztfmod/caf-diagnostics/azurerm" | ||
version = "1.0.0" | ||
|
||
name = azurerm_bastion_host.azurebastion.name | ||
resource_id = azurerm_bastion_host.azurebastion.id | ||
log_analytics_workspace_id = var.log_analytics_workspace.id | ||
diagnostics_map = var.diagnostics_map | ||
diag_object = var.diagnostics_settings | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output bastion { | ||
value = module.bastion | ||
sensitive = true | ||
description = "Full Bastion object" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
locals { | ||
module_tag = { | ||
"module" = basename(abspath(path.module)) | ||
} | ||
tags = merge(var.tags, local.module_tag) | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
azurecaf = { | ||
source = "aztfmod/azurecaf" | ||
} | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters