Skip to content

Commit

Permalink
Update Atmos to version 1.45.0 (#323)
Browse files Browse the repository at this point in the history
* Update Atmos to 1.45.0

* Update Atmos to 1.45.0
  • Loading branch information
aknysh authored Sep 2, 2023
1 parent bc59937 commit 2c38846
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
installed: false
installed: true

server_name: echo-server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
locals {
# Throw an error if lookup fails
check_required_tags = module.this.enabled ? [
for k in var.required_tags :
lookup(module.this.tags, k)
for k in var.required_tags : lookup(module.this.tags, k)
] : []
}

Expand All @@ -24,9 +23,12 @@ module "introspection" {
source = "cloudposse/label/null"
version = "0.25.0"

tags = merge(var.tags, {
"Component" = basename(abspath(path.module))
})
tags = merge(
var.tags,
{
"Component" = basename(abspath(path.module))
}
)

context = module.this.context
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
components:
terraform:
service-iam-role/{{ .app_name }}/{{ .service_environment }}:
metadata:
component: infra/service-iam-role
settings:
spacelift:
workspace_enabled: false
vars:
enabled: {{ .enabled }}
tags:
Service: {{ .app_name }}
service_account_name: {{ .app_name }}
service_account_namespace: {{ .service_account_namespace }}
{{ if hasKey . "iam_managed_policy_arns" }}
iam_managed_policy_arns:
{{ range $i, $iam_managed_policy_arn := .iam_managed_policy_arns }}
- '{{ $iam_managed_policy_arn }}'
{{ end }}
{{ end }}
{{ if hasKey . "iam_source_policy_documents" }}
iam_source_policy_documents:
{{ range $i, $iam_source_policy_document := .iam_source_policy_documents }}
- '{{ $iam_source_policy_document }}'
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import:
- path: catalog/terraform/service-iam-role/defaults.tmpl
context:
enabled: true
app_name: webservices
iam_managed_policy_arns:
- arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess
- arn:aws:iam::aws:policy/AmazonKinesisFullAccess
iam_source_policy_documents:
- '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kafka-cluster:Connect",
"kafka-cluster:AlterCluster",
"kafka-cluster:DescribeCluster"
],
"Resource": [
"arn:aws:kafka:us-east-2:xxxxxxxxxx:cluster/MSK-00/xxxxxxxxxx-14/*"
]
},
{
"Effect": "Allow",
"Action": [
"kafka-cluster:*Topic*",
"kafka-cluster:WriteData",
"kafka-cluster:ReadData"
],
"Resource": [
"arn:aws:kafka:region:xxxxxxxxxx:topic/MSK-00/*"
]
},
{
"Effect": "Allow",
"Action": [
"kafka-cluster:AlterGroup",
"kafka-cluster:DescribeGroup"
],
"Resource": [
"arn:aws:kafka:region:xxxxxxxxxx:group/MSK-00/*"
]
}
]
}'
- '{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:us-east-2:xxxxxxxxxx:xxxxxxxxxx/v1/*/scheduledtask/*"
}
]
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import:
- path: catalog/terraform/service-iam-role/webservices/defaults.tmpl
context:
iam_managed_policy_arns:
- arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess
- arn:aws:iam::aws:policy/AmazonKinesisFullAccess
- arn:aws:iam::aws:policy/AmazonS3FullAccess
- arn:aws:iam::aws:policy/AmazonSNSFullAccess
- arn:aws:iam::aws:policy/AmazonSQSFullAccess
- arn:aws:iam::aws:policy/AmazonECS_FullAccess
- arn:aws:iam::aws:policy/CloudWatchFullAccess
- arn:aws:iam::aws:policy/AWSDataPipeline_FullAccess
- arn:aws:iam::aws:policy/CloudFrontFullAccess
iam_source_policy_documents:
- '{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": "execute-api:Invoke",
"Resource": [
"arn:aws:execute-api:us-east-2:xxxxxxxxxx:xxxxxxxxx/v1/*/scheduledtask/*",
]
}
]
}'
- '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": "arn:aws:iam::xxxxxxxxxx:role/xxxxxxxxxx"
}
]
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import:
- path: catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl
context:
service_account_namespace: prod
service_environment: prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import:
- catalog/terraform/services/top-level-service-?.*

components:
terraform:
top-level-component3:
metadata:
component: "top-level-component1"
settings:
spacelift:
workspace_enabled: false
depends_on:
1:
file: "examples/complete/components/terraform/mixins/introspection.mixin.tf"
2:
folder: "examples/complete/components/helmfile/infra/infra-server"
vars:
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import:
- orgs/cp/tenant1/test1/_defaults
- catalog/terraform/top-level-component1
- catalog/terraform/top-level-component2
- catalog/terraform/top-level-component3
- catalog/terraform/test-component
- catalog/terraform/test-component-override
- catalog/terraform/test-component-override-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import:
- catalog/helmfile/infra-server
- catalog/helmfile/infra-server-override
- catalog/terraform/spacelift/infrastructure-tenant2
- catalog/terraform/service-iam-role/webservices/prod

components:
terraform:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func TestSpaceliftStackProcessorWithTerraform(t *testing.T) {
// Test `settings.depends_on`
tenant1Ue2ProdTopLevelComponent1 := spaceliftStacks["tenant1-ue2-prod-top-level-component1"].(map[string]any)
tenant1Ue2ProdTopLevelComponent1Labels := tenant1Ue2ProdTopLevelComponent1["labels"].([]any)
assert.Equal(t, "depends-on:tenant1-ue2-prod-test-test-component-override", tenant1Ue2ProdTopLevelComponent1Labels[35])
assert.Equal(t, "depends-on:tenant1-ue2-dev-test-test-component", tenant1Ue2ProdTopLevelComponent1Labels[36])
assert.Equal(t, "depends-on:tenant1-ue2-dev-test-test-component", tenant1Ue2ProdTopLevelComponent1Labels[35])
assert.Equal(t, "depends-on:tenant1-ue2-prod-test-test-component-override", tenant1Ue2ProdTopLevelComponent1Labels[36])

yamlSpaceliftStacks, err := yaml.Marshal(spaceliftStacks)
assert.Nil(t, err)
Expand Down
43 changes: 22 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/cloudposse/terraform-provider-utils
go 1.20

require (
github.com/cloudposse/atmos v1.44.0
github.com/gruntwork-io/terratest v0.43.12
github.com/cloudposse/atmos v1.45.0
github.com/gruntwork-io/terratest v0.43.13
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0
github.com/json-iterator/go v1.1.12
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -19,7 +19,7 @@ require (
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
Expand All @@ -29,7 +29,7 @@ require (
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -39,13 +39,11 @@ require (
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/containerd v1.7.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/containerd/containerd v1.7.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.8.1 // indirect
Expand Down Expand Up @@ -74,12 +72,12 @@ require (
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
github.com/hashicorp/hcl/v2 v2.18.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-config-inspect v0.0.0-20230808231734-f15f31bf62b3 // indirect
github.com/hashicorp/terraform-config-inspect v0.0.0-20230825013512-b800820f61b8 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-go v0.16.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.18.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
Expand Down Expand Up @@ -108,7 +106,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/open-policy-agent/opa v0.55.0 // indirect
github.com/open-policy-agent/opa v0.56.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/otiai10/copy v1.12.0 // indirect
Expand Down Expand Up @@ -146,32 +144,35 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/yashtewari/glob-intersection v0.2.0 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
github.com/zclconf/go-cty v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.2 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mvdan.cc/sh/v3 v3.7.0 // indirect
oras.land/oras-go/v2 v2.2.1 // indirect
oras.land/oras-go/v2 v2.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 2c38846

Please sign in to comment.