Skip to content

Commit

Permalink
Add atmos_cli_config_path and atmos_base_path variables to `remot…
Browse files Browse the repository at this point in the history
…e-state` module (#53)

* Add `atmos_cli_config_path` and `atmos_base_path` variables

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
aknysh and cloudpossebot authored Oct 4, 2022
1 parent 5b602d5 commit 18239bd
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ Available targets:
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 1.2.0 |
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 1.3.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 1.2.0 |
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 1.3.0 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 1.2.0 |
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 1.3.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 1.2.0 |
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 1.3.0 |

## Modules

Expand Down
10 changes: 6 additions & 4 deletions examples/backend/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module "backend" {
source = "../../modules/backend"

stack = var.stack
component = var.component
ignore_errors = var.ignore_errors
env = var.env
stack = var.stack
component = var.component
ignore_errors = var.ignore_errors
env = var.env
atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path

context = module.this.context
}
12 changes: 12 additions & 0 deletions examples/backend/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ variable "env" {
description = "Map of ENV vars in the format `key=value`. These ENV vars will be set in the `utils` provider before executing the data source"
default = null
}

variable "atmos_cli_config_path" {
type = string
description = "atmos CLI config path"
default = null
}

variable "atmos_base_path" {
type = string
description = "atmos base path to components and stacks"
default = null
}
2 changes: 1 addition & 1 deletion examples/backend/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
9 changes: 9 additions & 0 deletions examples/remote-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module "remote_state_using_stack" {
ATMOS_CLI_CONFIG_PATH = path.module
}

atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path

context = module.this.context
}

Expand All @@ -30,6 +33,9 @@ module "remote_state_using_context" {
ATMOS_CLI_CONFIG_PATH = path.module
}

atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path

context = module.this.context
}

Expand All @@ -54,5 +60,8 @@ module "remote_state_using_context_ignore_errors" {
ATMOS_CLI_CONFIG_PATH = path.module
}

atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path

context = module.this.context
}
11 changes: 11 additions & 0 deletions examples/remote-state/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "atmos_cli_config_path" {
type = string
description = "atmos CLI config path"
default = null
}

variable "atmos_base_path" {
type = string
description = "atmos base path to components and stacks"
default = null
}
2 changes: 1 addition & 1 deletion examples/remote-state/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/spacelift/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/stack/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/stacks/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
18 changes: 10 additions & 8 deletions modules/backend/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
data "utils_component_config" "config" {
component = var.component
stack = var.stack
namespace = module.always.namespace
tenant = module.always.tenant
environment = module.always.environment
stage = module.always.stage
ignore_errors = var.ignore_errors
env = var.env
component = var.component
stack = var.stack
namespace = module.always.namespace
tenant = module.always.tenant
environment = module.always.environment
stage = module.always.stage
ignore_errors = var.ignore_errors
env = var.env
atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path
}

locals {
Expand Down
12 changes: 12 additions & 0 deletions modules/backend/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ variable "env" {
description = "Map of ENV vars in the format `key=value`. These ENV vars will be set in the `utils` provider before executing the data source"
default = null
}

variable "atmos_cli_config_path" {
type = string
description = "atmos CLI config path"
default = null
}

variable "atmos_base_path" {
type = string
description = "atmos base path to components and stacks"
default = null
}
2 changes: 1 addition & 1 deletion modules/backend/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion modules/env/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
18 changes: 10 additions & 8 deletions modules/remote-state/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
data "utils_component_config" "config" {
component = var.component
stack = var.stack
namespace = module.always.namespace
tenant = module.always.tenant
environment = module.always.environment
stage = module.always.stage
ignore_errors = var.ignore_errors
env = var.env
component = var.component
stack = var.stack
namespace = module.always.namespace
tenant = module.always.tenant
environment = module.always.environment
stage = module.always.stage
ignore_errors = var.ignore_errors
env = var.env
atmos_cli_config_path = var.atmos_cli_config_path
atmos_base_path = var.atmos_base_path
}

locals {
Expand Down
12 changes: 12 additions & 0 deletions modules/remote-state/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ variable "env" {
description = "Map of ENV vars in the format `key=value`. These ENV vars will be set in the `utils` provider before executing the data source"
default = null
}

variable "atmos_cli_config_path" {
type = string
description = "atmos CLI config path"
default = null
}

variable "atmos_base_path" {
type = string
description = "atmos base path to components and stacks"
default = null
}
2 changes: 1 addition & 1 deletion modules/remote-state/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion modules/settings/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion modules/spacelift/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion modules/vars/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
utils = {
source = "cloudposse/utils"
version = ">= 1.2.0"
version = ">= 1.3.0"
}
}
}

0 comments on commit 18239bd

Please sign in to comment.