Skip to content

Commit

Permalink
Update atmos, rebuild provider docs (#102)
Browse files Browse the repository at this point in the history
* Update `atmos`, rebuild provider docs

* Update `atmos`, rebuild provider docs
  • Loading branch information
aknysh authored Jan 29, 2022
1 parent 85a1061 commit b0cc6f4
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 37 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ lint:
# Run acceptance tests
testacc: install
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 3m

tfplugindocs:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
tfplugindocs generate
59 changes: 59 additions & 0 deletions docs/data-sources/component_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "utils_component_config Data Source - terraform-provider-utils"
subcategory: ""
description: |-
The component_config data source accepts a component and a stack name and returns the component configuration in the stack
---

# utils_component_config (Data Source)

The `component_config` data source accepts a component and a stack name and returns the component configuration in the stack

## Example Usage

```terraform
locals {
component = "test/test-component-override"
stack = "tenant1-ue2-dev"
tenant = "tenant1"
environment = "ue2"
stage = "dev"
result1 = yamldecode(data.utils_component_config.example1.output)
result2 = yamldecode(data.utils_component_config.example2.output)
}
data "utils_component_config" "example1" {
component = local.component
stack = local.stack
}
data "utils_component_config" "example2" {
component = local.component
tenant = local.tenant
environment = local.environment
stage = local.stage
}
```

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

### Required

- **component** (String) Component name.

### Optional

- **environment** (String) Environment.
- **id** (String) The ID of this resource.
- **stack** (String) Stack name.
- **stage** (String) Stage.
- **tenant** (String) Tenant.

### Read-Only

- **output** (String) Component configuration.


20 changes: 5 additions & 15 deletions docs/data-sources/deep_merge_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ description: |-
The deep_merge_json data source accepts a list of JSON strings as input and deep merges into a single JSON string as output.
---

# Data Source `utils_deep_merge_json`
# utils_deep_merge_json (Data Source)

The `deep_merge_json` data source accepts a list of JSON strings as input and deep merges into a single JSON string as output.

## Example Usage

```terraform
terraform {
required_providers {
utils = {
source = "cloudposse/utils"
}
}
}
locals {
json_data_1 = file("${path.module}/json1.json")
json_data_2 = file("${path.module}/json2.json")
Expand All @@ -32,24 +24,22 @@ data "utils_deep_merge_json" "example" {
local.json_data_2
]
}
output "deep_merge_output" {
value = data.utils_deep_merge_json.example.output
}
```

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

### Required

- **inputs** (List of String) A list JSON strings that is deep merged into the `output` attribute.
- **input** (List of String) A list of JSON strings that is deep merged into the `output` attribute.

### Optional

- **append_list** (Boolean) A boolean flag to enable/disable appending lists instead of overwriting them.
- **deep_copy_list** (Boolean) A boolean flag to enable/disable merging of list elements one by one.
- **id** (String) The ID of this resource.

### Read-only
### Read-Only

- **output** (String) The deep-merged output.

Expand Down
20 changes: 5 additions & 15 deletions docs/data-sources/deep_merge_yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ description: |-
The deep_merge_yaml data source accepts a list of YAML strings as input and deep merges into a single YAML string as output.
---

# Data Source `utils_deep_merge_yaml`
# utils_deep_merge_yaml (Data Source)

The `deep_merge_yaml` data source accepts a list of YAML strings as input and deep merges into a single YAML string as output.

## Example Usage

```terraform
terraform {
required_providers {
utils = {
source = "cloudposse/utils"
}
}
}
locals {
yaml_data_1 = file("${path.module}/data1.yaml")
yaml_data_2 = file("${path.module}/data2.yaml")
Expand All @@ -32,24 +24,22 @@ data "utils_deep_merge_yaml" "example" {
local.yaml_data_2
]
}
output "deep_merge_output" {
value = data.utils_deep_merge_yaml.example.output
}
```

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

### Required

- **inputs** (List of String) A list YAML strings that is deep merged into the `output` attribute.
- **input** (List of String) A list of YAML strings that is deep merged into the `output` attribute.

### Optional

- **append_list** (Boolean) A boolean flag to enable/disable appending lists instead of overwriting them.
- **deep_copy_list** (Boolean) A boolean flag to enable/disable merging of list elements one by one.
- **id** (String) The ID of this resource.

### Read-only
### Read-Only

- **output** (String) The deep-merged output.

Expand Down
48 changes: 48 additions & 0 deletions docs/data-sources/spacelift_stack_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "utils_spacelift_stack_config Data Source - terraform-provider-utils"
subcategory: ""
description: |-
The spacelift_stack_config data source accepts a list of stack config file names and returns a map of Spacelift stack configurations.
---

# utils_spacelift_stack_config (Data Source)

The `spacelift_stack_config` data source accepts a list of stack config file names and returns a map of Spacelift stack configurations.

## Example Usage

```terraform
locals {
result = yamldecode(data.utils_spacelift_stack_config.example.output)
}
data "utils_spacelift_stack_config" "example" {
process_component_deps = true
process_stack_deps = true
process_imports = true
stack_config_path_template = "stacks/%s.yaml"
}
```

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

### Required

- **stack_config_path_template** (String) Stack config path template.

### Optional

- **base_path** (String) Stack config base path.
- **id** (String) The ID of this resource.
- **input** (List of String) A list of stack config file names.
- **process_component_deps** (Boolean) A boolean flag to enable/disable processing config dependencies for the components.
- **process_imports** (Boolean) A boolean flag to enable/disable processing stack imports.
- **process_stack_deps** (Boolean) A boolean flag to enable/disable processing all stack dependencies for the components.

### Read-Only

- **output** (String) A map of Spacelift stack configurations.


57 changes: 57 additions & 0 deletions docs/data-sources/stack_config_yaml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "utils_stack_config_yaml Data Source - terraform-provider-utils"
subcategory: ""
description: |-
The stack_config_yaml data source accepts a list of stack config file names and returns a list of stack configurations.
---

# utils_stack_config_yaml (Data Source)

The `stack_config_yaml` data source accepts a list of stack config file names and returns a list of stack configurations.

## Example Usage

```terraform
locals {
base_path = "../../config/stacks"
stack_config_files = [
"${local.base_path}/tenant1/ue2/dev.yaml",
"${local.base_path}/tenant1/ue2/prod.yaml",
"${local.base_path}/tenant1/ue2/staging.yaml",
"${local.base_path}/tenant2/ue2/dev.yaml",
"${local.base_path}/tenant2/ue2/prod.yaml",
"${local.base_path}/tenant2/ue2/staging.yaml",
]
result = [for i in data.utils_stack_config_yaml.example.output : yamldecode(i)]
}
data "utils_stack_config_yaml" "example" {
base_path = local.base_path
input = local.stack_config_files
process_component_deps = true
process_stack_deps = false
}
```

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

### Required

- **input** (List of String) A list of stack config file names.

### Optional

- **base_path** (String) Stack config base path.
- **id** (String) The ID of this resource.
- **process_component_deps** (Boolean) A boolean flag to enable/disable processing config dependencies for the components.
- **process_stack_deps** (Boolean) A boolean flag to enable/disable processing all stack dependencies for the components.

### Read-Only

- **output** (List of String) A list of stack configurations.


2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ provider "utils" {
```

<!-- schema generated by tfplugindocs -->
## Schema
## Schema
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/cloudposse/terraform-provider-utils
go 1.16

require (
github.com/cloudposse/atmos v1.3.25
github.com/gruntwork-io/terratest v0.38.9
github.com/cloudposse/atmos v1.3.26
github.com/gruntwork-io/terratest v0.39.0
github.com/hashicorp/terraform-plugin-docs v0.5.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
github.com/json-iterator/go v1.1.12
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudposse/atmos v1.3.25 h1:+zPEJtFXVVgVmmRhhIjWnBOZPUigzRhN5SvHVTgzwgU=
github.com/cloudposse/atmos v1.3.25/go.mod h1:QzJQBrCTMKjpqXPzm3qsXh4czWOsUj5Cy7uotYmC8+0=
github.com/cloudposse/atmos v1.3.26 h1:MsuL/ld1yJX+dprBzztyHq0MYm4xQ6C5S3BZy4Sd4/s=
github.com/cloudposse/atmos v1.3.26/go.mod h1:QzJQBrCTMKjpqXPzm3qsXh4czWOsUj5Cy7uotYmC8+0=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
Expand Down Expand Up @@ -515,8 +515,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78=
github.com/gruntwork-io/terratest v0.38.9 h1:OYEwDZnaqi8cS0ZyPd6MyxGxFlC/MsSguCjWgB1jirg=
github.com/gruntwork-io/terratest v0.38.9/go.mod h1:F4r5ay5mcPtmjFUmnAIvNQZ617/Co+lneTOfJKumPmE=
github.com/gruntwork-io/terratest v0.39.0 h1:Lq7aNCoFxhhmdQIyuBFBf8N87aCnypmNBFYgvsdIfCQ=
github.com/gruntwork-io/terratest v0.39.0/go.mod h1:CjHsEgP1Pe987X5N8K5qEqCuLtu1bqERGIAF8bTj1s0=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
Expand Down

0 comments on commit b0cc6f4

Please sign in to comment.