Skip to content

Commit

Permalink
Merge pull request #1 from quantum-sec/fix/missing-vars
Browse files Browse the repository at this point in the history
Updated tags, var types and missing attributes (patch)
  • Loading branch information
lukiffer authored Jun 3, 2020
2 parents 228cf60 + 0d0ee60 commit f5aee4a
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @lukiffer
* @lukiffer @deepanshumarwah
44 changes: 22 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Terraform
.terraform
terraform.tfvars
*.tfstate
*.tfstate.backup

# OS X
.history
.DS_Store

# IntelliJ
.idea_modules
*.iml
*.iws
*.ipr
.idea/
build/
*/build/
out/
node_modules
*.keystore
*.lic
# Terraform
.terraform
terraform.tfvars
*.tfstate
*.tfstate.backup

# OS X
.history
.DS_Store

# IntelliJ
.idea_modules
*.iml
*.iws
*.ipr
.idea/
build/
*/build/
out/
node_modules
*.keystore
*.lic
44 changes: 22 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=no]
- id: trailing-whitespace
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.21.0
hooks:
- id: terraform_fmt
- id: terraform_validate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=no]
- id: trailing-whitespace
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.21.0
hooks:
- id: terraform_fmt
- id: terraform_validate
6 changes: 3 additions & 3 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@quantum-sec/semantic-release-config/base"
}
{
"extends": "@quantum-sec/semantic-release-config/base"
}
2 changes: 1 addition & 1 deletion .terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
latest:^0.12
latest:^0.12
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
© 2020 Quantum Security Pte. Ltd. All Rights Reserved.
© 2020 Quantum Security Pte. Ltd. All Rights Reserved.
76 changes: 38 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# package- log-analytics

This repository contains modules for deploying and managing Azure Log Analytics Workspace that are shared across other modules or instances.

## Using a Terraform Module

To use a module in your Terraform templates, create a `module` resource and set its `source` field to the Git URL of
this repo. You should also set the `ref` parameter so you're fixed to a specific version of this repo, as the `master`
branch may have backwards incompatible changes (see [module sources](https://www.terraform.io/docs/modules/sources.html)).

For example, to use `1.0.0` of the `azure-function-app` module, you would add the following:

```hcl
module "function_app" {
source = "git::[email protected]:quantum-sec/package-azure-functions.git//modules/azure-function-app?ref=1.0.0"
// set the parameters for the azure-function-app module
}
```

_Note: the double slash (`//`) is intentional and required. It's part of Terraform's Git syntax (see [module sources](https://www.terraform.io/docs/modules/sources.html))._

See the module's documentation and `vars.tf` file for all the parameters you can set. Run `terraform get -update` to
pull the latest version of this module from this repo before running the standard `terraform plan` and
`terraform apply` commands.


## Using Scripts & Binaries

You can install the scripts and binaries in the `modules` folder of any repo using the [Gruntwork Installer](https://github.com/gruntwork-io/gruntwork-installer).
For example, if the scripts you want to install are in the `modules/ecs-scripts` folder of the
https://github.com/gruntwork-io/module-ecs repo, you could install them as follows:

```bash
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --tag "0.0.1"
```

See the docs for each script & binary for detailed instructions on how to use them.
# package- log-analytics

This repository contains modules for deploying and managing Azure Log Analytics Workspace that are shared across other modules or instances.

## Using a Terraform Module

To use a module in your Terraform templates, create a `module` resource and set its `source` field to the Git URL of
this repo. You should also set the `ref` parameter so you're fixed to a specific version of this repo, as the `master`
branch may have backwards incompatible changes (see [module sources](https://www.terraform.io/docs/modules/sources.html)).

For example, to use `1.0.0` of the `azure-function-app` module, you would add the following:

```hcl
module "function_app" {
source = "git::[email protected]:quantum-sec/package-azure-functions.git//modules/azure-function-app?ref=1.0.0"
// set the parameters for the azure-function-app module
}
```

_Note: the double slash (`//`) is intentional and required. It's part of Terraform's Git syntax (see [module sources](https://www.terraform.io/docs/modules/sources.html))._

See the module's documentation and `vars.tf` file for all the parameters you can set. Run `terraform get -update` to
pull the latest version of this module from this repo before running the standard `terraform plan` and
`terraform apply` commands.


## Using Scripts & Binaries

You can install the scripts and binaries in the `modules` folder of any repo using the [Gruntwork Installer](https://github.com/gruntwork-io/gruntwork-installer).
For example, if the scripts you want to install are in the `modules/ecs-scripts` folder of the
https://github.com/gruntwork-io/module-ecs repo, you could install them as follows:

```bash
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --tag "0.0.1"
```

See the docs for each script & binary for detailed instructions on how to use them.
36 changes: 18 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
trigger:
branches:
include:
- master
- feature/*
- fix/*

resources:
repositories:
- repository: pipeline-library
type: github
endpoint: quantum-sec-github
name: quantum-sec/pipeline-library

jobs:
- template: templates/jobs/default.yml@pipeline-library
parameters:
containerImage: quantumdev.azurecr.io/quantum-ci-terragrunt:latest
trigger:
branches:
include:
- master
- feature/*
- fix/*

resources:
repositories:
- repository: pipeline-library
type: github
endpoint: quantum-sec-github
name: quantum-sec/pipeline-library

jobs:
- template: templates/jobs/default.yml@pipeline-library
parameters:
containerImage: quantumci.azurecr.io/quantum-ci-terragrunt:latest
6 changes: 5 additions & 1 deletion modules/log-analytics-workspace/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ resource "azurerm_log_analytics_workspace" "la" {
location = var.location
sku = var.sku
retention_in_days = var.retention_in_days
tags = var.tags
tags = merge({
"terraform-managed" = "true"
},
var.tags
)
}
8 changes: 8 additions & 0 deletions modules/log-analytics-workspace/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ output "workspace_id" {
output "portal_url" {
value = azurerm_log_analytics_workspace.la.portal_url
}

output "primary_shared_key" {
value = azurerm_log_analytics_workspace.la.primary_shared_key
}

output "secondary_shared_key" {
value = azurerm_log_analytics_workspace.la.primary_shared_key
}
14 changes: 7 additions & 7 deletions modules/log-analytics-workspace/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ variable "location" {
}

variable "name" {
description = "The name to assign to the LA workspace."
description = "The name to assign to the Log Analytics workspace."
type = string
}

variable "resource_group_name" {
description = "The name of the resource group in which this LA workspace will be provisioned."
description = "The name of the resource group in which this Log Analytics workspace will be provisioned."
type = string
}

Expand All @@ -20,13 +20,13 @@ variable "sku" {
}

variable "retention_in_days" {
description = "(Optional) The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730."
type = string
description = "The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730."
type = number
default = 7
}

variable "tags" {
description = "(Optional) A mapping of tags to assign to the resource."
type = string
default = null
description = "A mapping of tags to assign to the resource."
type = map(string)
default = {}
}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5aee4a

Please sign in to comment.