Skip to content

Commit

Permalink
Add providers section to Atmos manifests. Update docs (#555)
Browse files Browse the repository at this point in the history
* updates

* Check and configure `prefix` for Terraform backend of type `gcs`

* Check and configure `prefix` for Terraform backend of type `gcs`

* Check and configure `prefix` for Terraform backend of type `gcs`

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates
  • Loading branch information
aknysh authored Mar 4, 2024
1 parent f0a622b commit e4136fa
Show file tree
Hide file tree
Showing 37 changed files with 442 additions and 42 deletions.
4 changes: 2 additions & 2 deletions examples/quick-start/components/terraform/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ locals {

module "utils" {
source = "cloudposse/utils/aws"
version = "1.3.0"
version = "1.4.0"
}

module "vpc" {
source = "cloudposse/vpc/aws"
version = "2.1.0"
version = "2.1.1"

ipv4_primary_cidr_block = var.ipv4_primary_cidr_block
internet_gateway_enabled = var.public_subnets_enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
},
"overrides": {
"$ref": "#/definitions/overrides"
},
"providers": {
"$ref": "#/definitions/providers"
}
},
"required": [],
Expand Down Expand Up @@ -225,6 +228,9 @@
},
"remote_state_backend": {
"$ref": "#/definitions/remote_state_backend"
},
"providers": {
"$ref": "#/definitions/providers"
}
},
"required": [],
Expand Down Expand Up @@ -432,7 +438,8 @@
"remote",
"vault",
"static",
"azurerm"
"azurerm",
"gcs"
],
"description": "Backend type",
"title": "backend_type"
Expand Down Expand Up @@ -537,6 +544,9 @@
},
"settings": {
"$ref": "#/definitions/settings"
},
"providers": {
"$ref": "#/definitions/providers"
}
},
"required": [],
Expand Down Expand Up @@ -716,6 +726,12 @@
"steps"
],
"title": "workflow_manifest"
},
"providers": {
"type": "object",
"description": "Providers section",
"additionalProperties": true,
"title": "providers"
}
}
}
5 changes: 3 additions & 2 deletions examples/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Atmos Tests

These configurations are used by the Atmos tests and CI to test/validate configurations and behaviors of Atmos. Thus, they contain many deliberately
broken examples and should not be used. Instead, please see our [Quick Start](../quick-start) example.
These configurations are used by the Atmos tests and CI to test/validate configurations and behaviors of Atmos.
Thus, they contain many deliberately broken examples and should not be used.
Instead, please see our [Quick Start](../quick-start) example.
4 changes: 2 additions & 2 deletions examples/tests/components/terraform/infra/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ locals {

module "utils" {
source = "cloudposse/utils/aws"
version = "1.1.0"
version = "1.4.0"
}

module "vpc" {
source = "cloudposse/vpc/aws"
version = "2.1.0"
version = "2.1.1"

ipv4_primary_cidr_block = var.ipv4_primary_cidr_block
internet_gateway_enabled = var.public_subnets_enabled
Expand Down
4 changes: 4 additions & 0 deletions examples/tests/components/terraform/infra/vpc/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "hashicorp/aws"
version = ">= 4.9.0"
}
utils = {
source = "cloudposse/utils"
version = ">= 1.18.0"
}
}
}
9 changes: 8 additions & 1 deletion examples/tests/stacks/catalog/terraform/vpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ components:
nat_instance_enabled: false
max_subnet_count: 3
map_public_ip_on_launch: true
dns_hostnames_enabled: true
subnet_type_tag_key: "type"
providers:
context:
values:
component: vpc
atmos_component: infra/vpc
aws:
assume_role: "test_role"
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/region/global-region.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vars:
region: us-east-2
environment: gbl

terraform:
providers:
context:
values:
environment: gbl
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/region/us-east-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ components:
- us-east-1a
- us-east-1b
- us-east-1c

terraform:
providers:
context:
values:
environment: ue1
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/region/us-east-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ components:
- us-east-2a
- us-east-2b
- us-east-2c

terraform:
providers:
context:
values:
environment: ue2
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/region/us-west-1.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vars:
region: us-west-1
environment: uw1

terraform:
providers:
context:
values:
environment: uw1
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/region/us-west-2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vars:
region: us-west-2
environment: uw2

terraform:
providers:
context:
values:
environment: uw2
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/stage/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ vars:
settings:
config:
is_prod: false

terraform:
providers:
context:
values:
stage: dev
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/stage/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ vars:
settings:
config:
is_prod: true

terraform:
providers:
context:
values:
stage: prod
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/stage/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ vars:
settings:
config:
is_prod: false

terraform:
providers:
context:
values:
stage: staging
6 changes: 6 additions & 0 deletions examples/tests/stacks/mixins/stage/test1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ vars:
settings:
config:
is_prod: false

terraform:
providers:
context:
values:
stage: test1
24 changes: 24 additions & 0 deletions examples/tests/stacks/orgs/cp/_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@ terraform:
s3:
role_arn: "arn:aws:iam::123456789012:role/cp-gbl-root-terraform"

providers:
context:
enabled: true
delimiter: "-"
properties:
namespace:
required: true
min_length: 2
max_length: 4
tenant:
required: true
min_length: 2
max_length: 10
environment:
required: true
min_length: 2
max_length: 6
stage:
required: true
min_length: 2
max_length: 20
values:
namespace: cp

helmfile:
vars: {}

Expand Down
6 changes: 6 additions & 0 deletions examples/tests/stacks/orgs/cp/tenant1/_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ settings:
tenant: tenant1
environment: ue2
stage: prod

terraform:
providers:
context:
values:
tenant: tenant1
4 changes: 4 additions & 0 deletions examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ terraform:
vars:
enabled: false

overrides:
providers:
context: {}

components:
terraform:
"infra/vpc":
Expand Down
6 changes: 6 additions & 0 deletions examples/tests/stacks/orgs/cp/tenant2/_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ settings:
tenant: tenant2
environment: ue2
stage: prod

terraform:
providers:
context:
values:
tenant: tenant2
2 changes: 2 additions & 0 deletions examples/tests/stacks/orgs/cp/tenant2/prod/us-east-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ components:
"infra/vpc":
vars:
ipv4_primary_cidr_block: 10.8.0.0/18
map_public_ip_on_launch: false
vpc_flow_logs_enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"region": {
"type": "string"
},
"cidr_block": {
"ipv4_primary_cidr_block": {
"type": "string",
"pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
},
Expand All @@ -22,7 +22,7 @@
"additionalProperties": true,
"required": [
"region",
"cidr_block",
"ipv4_primary_cidr_block",
"map_public_ip_on_launch"
]
}
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/google/uuid v1.6.0
github.com/hashicorp/go-getter v1.7.3
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/hcl/v2 v2.19.1
github.com/hashicorp/hcl/v2 v2.20.0
github.com/hashicorp/terraform-config-inspect v0.0.0-20231204233900-a34142ec2a72
github.com/imdario/mergo v0.3.13
github.com/ivanpirog/coloredcobra v1.0.1
Expand All @@ -35,8 +35,8 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/zclconf/go-cty v1.14.2
github.com/stretchr/testify v1.9.0
github.com/zclconf/go-cty v1.14.3
gopkg.in/yaml.v2 v2.4.0
mvdan.cc/sh/v3 v3.8.0
)
Expand Down Expand Up @@ -77,7 +77,7 @@ require (
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/docker/cli v24.0.0+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v25.0.0+incompatible // indirect
github.com/docker/docker v25.0.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down
17 changes: 10 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,10 @@ github.com/docker/cli v24.0.0+incompatible h1:0+1VshNwBQzQAx9lOl+OYCTCEAD8fKs/qe
github.com/docker/cli v24.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v25.0.0+incompatible h1:g9b6wZTblhMgzOT2tspESstfw6ySZ9kdm94BLDKaZac=
github.com/docker/docker v25.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.0+incompatible h1:z4bf8HvONXX9Tde5lGBMQ7yCJgNahmJumdrStZAbeY4=
github.com/docker/docker v24.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ=
github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
Expand Down Expand Up @@ -508,8 +510,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI=
github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
github.com/hashicorp/hcl/v2 v2.20.0 h1:l++cRs/5jQOiKVvqXZm/P1ZEfVXJmvLS9WSVxkaeTb4=
github.com/hashicorp/hcl/v2 v2.20.0/go.mod h1:WmcD/Ym72MDOOx5F62Ly+leloeu6H7m0pG7VBiU6pQk=
github.com/hashicorp/terraform-config-inspect v0.0.0-20231204233900-a34142ec2a72 h1:nZ5gGjbe5o7XUu1d7j+Y5Ztcxlp+yaumTKH9i0D3wlg=
github.com/hashicorp/terraform-config-inspect v0.0.0-20231204233900-a34142ec2a72/go.mod h1:l8HcFPm9cQh6Q0KSWoYPiePqMvRFenybP1CH2MjKdlg=
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
Expand Down Expand Up @@ -692,8 +694,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes=
Expand All @@ -718,8 +721,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI=
github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho=
github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Expand Down
Loading

0 comments on commit e4136fa

Please sign in to comment.