Skip to content

Commit 4edafd1

Browse files
Update utils provider. Add ignore_errors variable to remote-state (#45)
* Update `utils` provider. Add `ignore_errors` variable to `remote-state` * Auto Format * Update `utils` provider. Add `ignore_errors` variable to `remote-state` Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
1 parent b07efab commit 4edafd1

42 files changed

Lines changed: 278 additions & 49 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/auto-readme.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
name: "auto-readme"
22
on:
33
schedule:
4-
# Update README.md nightly
4+
# Example of job definition:
5+
# .---------------- minute (0 - 59)
6+
# | .------------- hour (0 - 23)
7+
# | | .---------- day of month (1 - 31)
8+
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
9+
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
10+
# | | | | |
11+
# * * * * * user-name command to be executed
12+
13+
# Update README.md nightly at 4am UTC
514
- cron: '0 4 * * *'
615

716
jobs:
@@ -20,7 +29,7 @@ jobs:
2029
make init
2130
make readme/build
2231
# Ignore changes if they are only whitespace
23-
git diff --ignore-all-space --ignore-blank-lines --quiet README.md && git restore README.md
32+
git diff --ignore-all-space --ignore-blank-lines --quiet README.md && { git restore README.md; echo Ignoring whitespace-only changes in README; }
2433
2534
- name: Create Pull Request
2635
# This action will not create or change a pull request if there are no changes to make.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2021 Cloud Posse, LLC
189+
Copyright 2021-2022 Cloud Posse, LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,13 @@ Available targets:
346346
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
347347
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
348348
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
349-
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.7 |
349+
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.15 |
350350

351351
## Providers
352352

353353
| Name | Version |
354354
|------|---------|
355-
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.7 |
355+
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.15 |
356356

357357
## Modules
358358

@@ -504,7 +504,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
504504

505505
## Copyrights
506506

507-
Copyright © 2021-2021 [Cloud Posse, LLC](https://cloudposse.com)
507+
Copyright © 2021-2022 [Cloud Posse, LLC](https://cloudposse.com)
508508

509509

510510

docs/terraform.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
77
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
88
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
9-
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.7 |
9+
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.15 |
1010

1111
## Providers
1212

1313
| Name | Version |
1414
|------|---------|
15-
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.7 |
15+
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.15 |
1616

1717
## Modules
1818

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ terraform {
1212
}
1313
utils = {
1414
source = "cloudposse/utils"
15-
version = ">= 0.17.7"
15+
version = ">= 0.17.15"
1616
}
1717
}
1818
}

examples/remote-state/atmos.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
# It supports POSIX-style Globs for file names/paths (double-star `**` is supported)
99
# https://en.wikipedia.org/wiki/Glob_(programming)
1010

11+
# Base path for components and stacks configurations.
12+
# Can also be set using `ATMOS_BASE_PATH` ENV var, or `--base-path` command-line argument.
13+
# Supports both absolute and relative paths.
14+
# If not provided or is an empty string, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
15+
# are independent settings (supporting both absolute and relative paths).
16+
# If `base_path` is provided, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
17+
# are considered paths relative to `base_path`.
18+
base_path: "."
19+
1120
components:
1221
terraform:
1322
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_BASE_PATH` ENV var, or `--terraform-dir` command-line argument
1423
# Supports both absolute and relative paths
15-
base_path: "./components/terraform"
24+
base_path: "components/terraform"
1625
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE` ENV var
1726
apply_auto_approve: false
1827
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT` ENV var, or `--deploy-run-init` command-line argument
@@ -22,7 +31,7 @@ components:
2231
helmfile:
2332
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_BASE_PATH` ENV var, or `--helmfile-dir` command-line argument
2433
# Supports both absolute and relative paths
25-
base_path: "./components/helmfile"
34+
base_path: "components/helmfile"
2635
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH` ENV var
2736
kubeconfig_path: "/dev/shm"
2837
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN` ENV var
@@ -33,7 +42,7 @@ components:
3342
stacks:
3443
# Can also be set using `ATMOS_STACKS_BASE_PATH` ENV var, or `--config-dir` and `--stacks-dir` command-line arguments
3544
# Supports both absolute and relative paths
36-
base_path: "./stacks"
45+
base_path: "stacks"
3746
# Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
3847
included_paths:
3948
- "**/*"

examples/remote-state/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ module "remote_state_using_context" {
1717

1818
context = module.this.context
1919
}
20+
21+
module "remote_state_using_context_ignore_errors" {
22+
source = "../../modules/remote-state"
23+
24+
# Use a wrong component for testing
25+
# If `ignore_errors = false`, the `utils` provider will throw the error: Could not find config for the component 'test/test-component-override-wrong' in the stack 'tenant1-ue2-dev'
26+
# Note that terraform `try()` does not catch errors from providers, so `try(module.remote_state_using_context_ignore_errors.outputs, {})` will not work
27+
ignore_errors = true
28+
component = "test/test-component-override-wrong"
29+
tenant = "tenant1"
30+
environment = "ue2"
31+
stage = "dev"
32+
33+
context = module.this.context
34+
}

examples/remote-state/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ output "remote_state_using_context" {
77
value = module.remote_state_using_context.outputs
88
description = "Component remote state using the provided context"
99
}
10+
11+
output "remote_state_using_context_ignore_errors" {
12+
value = module.remote_state_using_context_ignore_errors.outputs
13+
description = "Component remote state using wrong component. Errors are ignored in the 'utils' provider"
14+
}

examples/remote-state/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ terraform {
1212
}
1313
utils = {
1414
source = "cloudposse/utils"
15-
version = ">= 0.17.7"
15+
version = ">= 0.17.15"
1616
}
1717
}
1818
}

examples/spacelift/atmos.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
# It supports POSIX-style Globs for file names/paths (double-star `**` is supported)
99
# https://en.wikipedia.org/wiki/Glob_(programming)
1010

11+
# Base path for components and stacks configurations.
12+
# Can also be set using `ATMOS_BASE_PATH` ENV var, or `--base-path` command-line argument.
13+
# Supports both absolute and relative paths.
14+
# If not provided or is an empty string, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
15+
# are independent settings (supporting both absolute and relative paths).
16+
# If `base_path` is provided, `components.terraform.base_path`, `components.helmfile.base_path` and `stacks.base_path`
17+
# are considered paths relative to `base_path`.
18+
base_path: "."
19+
1120
components:
1221
terraform:
1322
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_BASE_PATH` ENV var, or `--terraform-dir` command-line argument
1423
# Supports both absolute and relative paths
15-
base_path: "./components/terraform"
24+
base_path: "components/terraform"
1625
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE` ENV var
1726
apply_auto_approve: false
1827
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT` ENV var, or `--deploy-run-init` command-line argument
@@ -22,7 +31,7 @@ components:
2231
helmfile:
2332
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_BASE_PATH` ENV var, or `--helmfile-dir` command-line argument
2433
# Supports both absolute and relative paths
25-
base_path: "./components/helmfile"
34+
base_path: "components/helmfile"
2635
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH` ENV var
2736
kubeconfig_path: "/dev/shm"
2837
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN` ENV var
@@ -33,7 +42,7 @@ components:
3342
stacks:
3443
# Can also be set using `ATMOS_STACKS_BASE_PATH` ENV var, or `--config-dir` and `--stacks-dir` command-line arguments
3544
# Supports both absolute and relative paths
36-
base_path: "./stacks"
45+
base_path: "stacks"
3746
# Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
3847
included_paths:
3948
- "**/*"

0 commit comments

Comments
 (0)