Skip to content

Commit

Permalink
Update Go module versions. Refactor stacks to the latest pattern. U…
Browse files Browse the repository at this point in the history
…pdate `atmos.yaml`. Refactor tests (#182)

* Update Go module versions

* Update stacks

* Update `atmos.yaml`

* Update tests
  • Loading branch information
aknysh authored Jul 11, 2022
1 parent 336b1a6 commit c116d7f
Show file tree
Hide file tree
Showing 49 changed files with 283 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ terraform:
s3:
encrypt: true
key: terraform.tfstate
bucket: eg-ue2-root-tfstate
dynamodb_table: eg-ue2-root-tfstate-lock
profile: eg-gb2-root-tfstate
bucket: cp-ue2-root-tfstate
dynamodb_table: cp-ue2-root-tfstate-lock
profile: cp-gb2-root-tfstate
acl: bucket-owner-full-control
region: us-east-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
components:
terraform:
"test/test-component-override":
vars:
service_1_name: "service-2-override-2"
2 changes: 1 addition & 1 deletion examples/complete/stacks/catalog/terraform/vpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ components:
vars:
enabled: true
name: "common"
subnet_type_tag_key: eg.io/subnet/type
subnet_type_tag_key: cp.io/subnet/type
nat_gateway_enabled: true
nat_instance_enabled: false
max_subnet_count: 3
2 changes: 0 additions & 2 deletions examples/complete/stacks/globals/tenant1-globals.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/complete/stacks/globals/tenant2-globals.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions examples/complete/stacks/globals/ue2-globals.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions examples/complete/stacks/mixins/region/global-region.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vars:
region: us-east-2
environment: gbl
12 changes: 12 additions & 0 deletions examples/complete/stacks/mixins/region/us-east-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
vars:
region: us-east-1
environment: ue1

components:
terraform:
vpc:
vars:
availability_zones:
- us-east-1a
- us-east-1b
- us-east-1c
12 changes: 12 additions & 0 deletions examples/complete/stacks/mixins/region/us-east-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
vars:
region: us-east-2
environment: ue2

components:
terraform:
vpc:
vars:
availability_zones:
- us-east-2a
- us-east-2b
- us-east-2c
2 changes: 2 additions & 0 deletions examples/complete/stacks/mixins/stage/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vars:
stage: dev
2 changes: 2 additions & 0 deletions examples/complete/stacks/mixins/stage/prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vars:
stage: prod
2 changes: 2 additions & 0 deletions examples/complete/stacks/mixins/stage/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vars:
stage: staging
2 changes: 2 additions & 0 deletions examples/complete/stacks/mixins/stage/test1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vars:
stage: test-1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vars:
namespace: eg
namespace: cp

terraform:
vars: {}
Expand All @@ -8,9 +8,9 @@ terraform:
backend:
s3:
encrypt: true
bucket: "eg-ue2-root-tfstate"
bucket: "cp-ue2-root-tfstate"
key: "terraform.tfstate"
dynamodb_table: "eg-ue2-root-tfstate-lock"
dynamodb_table: "cp-ue2-root-tfstate-lock"
acl: "bucket-owner-full-control"
region: "us-east-2"
role_arn: null
Expand All @@ -25,7 +25,7 @@ terraform:

remote_state_backend:
s3:
role_arn: "arn:aws:iam::123456789012:role/eg-gbl-root-terraform"
role_arn: "arn:aws:iam::123456789012:role/cp-gbl-root-terraform"

helmfile:
vars: {}
Expand Down
5 changes: 5 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant1/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import:
- orgs/cp/_defaults

vars:
tenant: tenant1
3 changes: 3 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant1/dev/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/dev
- orgs/cp/tenant1/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant1/dev/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant1-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant1/dev/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -12,15 +12,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: dev

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
3 changes: 3 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant1/prod/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/prod
- orgs/cp/tenant1/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant1/prod/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant2-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant1/prod/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -11,15 +11,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: prod

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/staging
- orgs/cp/tenant1/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant1/staging/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant2-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant1/staging/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -11,15 +11,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: staging

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
3 changes: 3 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant1/test1/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/test1
- orgs/cp/tenant1/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant1/test1/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant1-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant1/test1/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -11,15 +11,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: test-1

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
5 changes: 5 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant2/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import:
- orgs/cp/_defaults

vars:
tenant: tenant2
3 changes: 3 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant2/dev/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/dev
- orgs/cp/tenant2/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant2/dev/_defaults
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import:
- globals/tenant2-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant2/dev/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
- catalog/terraform/test-component-override-2
- catalog/terraform/test-component-override-3
- catalog/terraform/vpc
- catalog/terraform/tenant2-ue2-dev
- catalog/helmfile/echo-server
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: dev

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
3 changes: 3 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant2/prod/_defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/prod
- orgs/cp/tenant2/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant2/prod/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant1-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant2/prod/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -11,15 +11,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: prod

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/stage/staging
- orgs/cp/tenant2/_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import:
- mixins/region/global-region
- orgs/cp/tenant2/staging/_defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import:
- globals/tenant1-globals
- globals/ue2-globals
- mixins/region/us-east-2
- orgs/cp/tenant2/staging/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/test-component
- catalog/terraform/test-component-override
Expand All @@ -11,15 +11,6 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override

vars:
stage: staging

terraform:
vars: {}

helmfile:
vars: {}

components:
terraform:
"infra/vpc":
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ stacks:
base_path: "stacks"
# Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
included_paths:
- "**/*"
- "orgs/**/*"
# Can also be set using `ATMOS_STACKS_EXCLUDED_PATHS` ENV var (comma-separated values string)
excluded_paths:
- "globals/**/*"
- "catalog/**/*"
- "**/*globals*"
- "**/_defaults.yaml"
# Can also be set using `ATMOS_STACKS_NAME_PATTERN` ENV var
name_pattern: "{tenant}-{environment}-{stage}"

Expand Down
6 changes: 2 additions & 4 deletions examples/data-sources/utils_component_config/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ stacks:
base_path: "stacks"
# Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
included_paths:
- "**/*"
- "orgs/**/*"
# Can also be set using `ATMOS_STACKS_EXCLUDED_PATHS` ENV var (comma-separated values string)
excluded_paths:
- "globals/**/*"
- "catalog/**/*"
- "**/*globals*"
- "**/_defaults.yaml"
# Can also be set using `ATMOS_STACKS_NAME_PATTERN` ENV var
name_pattern: "{tenant}-{environment}-{stage}"

Expand Down
Loading

0 comments on commit c116d7f

Please sign in to comment.