Skip to content

Commit

Permalink
update module validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli-Meitner committed Nov 14, 2022
1 parent 01dbdf5 commit dc1c4ae
Show file tree
Hide file tree
Showing 14 changed files with 150 additions and 452 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,40 @@ the arguments should include the -a|--action flag which calls the function (acti
#The following example validates there are no duplicate environments under two different data layers:
required_providers {
toluna = {
source = "toluna-terraform/toluna"
source = "toluna-terraform/toluna-v2"
}
}
}
data "toluna_validate_configuration" "app_json" {
dynamic "rule_set" {
for_each = local.app_config
content {
key_name = rule_set.value["key_name"]
rule = rule_set.value["rule"]
value = rule_set.value["value"]
}
}
json_config = data.consul_keys.appjson.var
}
data "toluna_environment_config" "app_json" {
address = "consul-cluster-test.consul.1234546-abcd-efgh-ijkl-12345678.aws.hashicorp.cloud"
scheme = "https"
path = "terraform/app-name/app-env.json"
validation_rules = "terraform/validations/app-config.json"
}
```

## Toggles
#### Validate arguments:
```yaml
arguments = command line arguments to pass to the validation script I.E. -a funcation name to run -f some file to validate
```

## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |


## Providers

| Name | Version |
|------|---------|
| <a name="assert"></a> [assert](https://github.com/bwoznicki/terraform-provider-assert) | >= 0.0.1 |
| <a name="toluna"></a> [assert](https://github.com/toluna-terraform/terraform-provider-toluna-v2) | >= 1.0.2 |


## Modules

## Resources

## DataSource
| Name | Source | Version |
|------|--------|---------|
| <a name="validate"></a> [validate](#module\validate) | ../../ | |

## Resources
| <a name="toluna_environment_config"></a> [toluna_environment_config](#data\toluna_environment_config) | ../../ | |

No Resources.

Expand Down
30 changes: 30 additions & 0 deletions docs/data-sources/toluna_environment_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "toluna_environment_config Data Source - terraform-provider-toluna-v2"
subcategory: ""
description: |-
---

# toluna_environment_config (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `address` (String)
- `path` (String)
- `scheme` (String)
- `validation_rules` (String)

### Read-Only

- `configuration` (String)
- `id` (Number) The ID of this resource.


84 changes: 6 additions & 78 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,20 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "toluna Provider"
page_title: "toluna-v2 Provider"
subcategory: ""
description: |-
---

# toluna Provider
The Toluna provider provides resources to allow custom action on terraform resources
# toluna-v2 Provider

## Example Usage

```terraform

terraform {
required_providers {
toluna = {
source = "toluna-terraform/toluna"
version = ">=0.0.9"
}
}
}

provider "aws" {
region = "us-east-1"
profile = "my-profile"
}

provider "toluna" {
}
resource "toluna_invoke_lambda" "example" {
region = "us-east-1"
aws_profile = "my-profile"
function_name = "my_lambda"
payload = jsonencode({"name": "example pay load"})
}
resource "toluna_start_codebuild" "example" {
region = "us-east-1"
aws_profile = "my-profile"
project_name = "my_project"
environment_variables {
name = "my-variable"
value = "FOO"
type = "PLAINTEXT"
}
environment_variables {
name = "my-secret-variable"
value = "BAR"
type = "PARAMETER_STORE"
}
environment_variables {
name = "my-other-secret-variable"
value = "BAR"
type = "SECRETS_MANAGER"
}
}
<!-- schema generated by tfplugindocs -->
## Schema

data "toluna_validate_configuration" "example" {
rule_set {
key_name = "key"
rule ="unique"
value = "nil"
}
rule_set {
key_name = "$..env_index"
rule ="odd"
value = "nil"
}
rule_set {
key_name = "$..env_index"
rule =">"
value = "6"
}
rule_set {
key_name = "$..env_index"
rule ="<"
value = "21"
}
rule_set {
key_name = "key"
rule ="~="
value = "example"
}
json_config = data.consul_keys.appjson.var
}
```
### Optional

- `strict_module_validation` (Boolean) Defaults to `false`.
58 changes: 0 additions & 58 deletions docs/resources/invoke_lambda.md

This file was deleted.

72 changes: 0 additions & 72 deletions docs/resources/start_codebuild.md

This file was deleted.

29 changes: 29 additions & 0 deletions docs/resources/toluna_invoke_lambda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "toluna_invoke_lambda Resource - terraform-provider-toluna-v2"
subcategory: ""
description: |-
---

# toluna_invoke_lambda (Resource)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `function_name` (String)
- `payload` (String)
- `region` (String)

### Optional

- `aws_profile` (String)
- `id` (String) The ID of this resource.


38 changes: 38 additions & 0 deletions docs/resources/toluna_start_codebuild.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "toluna_start_codebuild Resource - terraform-provider-toluna-v2"
subcategory: ""
description: |-
---

# toluna_start_codebuild (Resource)





<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_name` (String)
- `region` (String)

### Optional

- `aws_profile` (String)
- `environment_variables` (Block Set) (see [below for nested schema](#nestedblock--environment_variables))
- `id` (String) The ID of this resource.

<a id="nestedblock--environment_variables"></a>
### Nested Schema for `environment_variables`

Required:

- `name` (String)
- `type` (String)
- `value` (String)


Loading

0 comments on commit dc1c4ae

Please sign in to comment.