atlas-init 0.4.5__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. atlas_init/__init__.py +1 -1
  2. atlas_init/cli.py +2 -0
  3. atlas_init/cli_args.py +19 -1
  4. atlas_init/cli_cfn/cfn_parameter_finder.py +59 -51
  5. atlas_init/cli_cfn/example.py +8 -16
  6. atlas_init/cli_helper/go.py +6 -10
  7. atlas_init/cli_root/mms_released.py +46 -0
  8. atlas_init/cli_tf/app.py +3 -84
  9. atlas_init/cli_tf/ci_tests.py +585 -0
  10. atlas_init/cli_tf/codegen/__init__.py +0 -0
  11. atlas_init/cli_tf/codegen/models.py +97 -0
  12. atlas_init/cli_tf/codegen/openapi_minimal.py +74 -0
  13. atlas_init/cli_tf/github_logs.py +7 -94
  14. atlas_init/cli_tf/go_test_run.py +395 -130
  15. atlas_init/cli_tf/go_test_summary.py +589 -10
  16. atlas_init/cli_tf/go_test_tf_error.py +388 -0
  17. atlas_init/cli_tf/hcl/modifier.py +14 -12
  18. atlas_init/cli_tf/hcl/modifier2.py +207 -0
  19. atlas_init/cli_tf/mock_tf_log.py +1 -1
  20. atlas_init/cli_tf/{schema_v2_api_parsing.py → openapi.py} +101 -19
  21. atlas_init/cli_tf/schema_v2.py +43 -1
  22. atlas_init/crud/__init__.py +0 -0
  23. atlas_init/crud/mongo_client.py +115 -0
  24. atlas_init/crud/mongo_dao.py +296 -0
  25. atlas_init/crud/mongo_utils.py +239 -0
  26. atlas_init/html_out/__init__.py +0 -0
  27. atlas_init/html_out/md_export.py +143 -0
  28. atlas_init/repos/go_sdk.py +12 -3
  29. atlas_init/repos/path.py +110 -7
  30. atlas_init/sdk_ext/__init__.py +0 -0
  31. atlas_init/sdk_ext/go.py +102 -0
  32. atlas_init/sdk_ext/typer_app.py +18 -0
  33. atlas_init/settings/config.py +3 -6
  34. atlas_init/settings/env_vars.py +18 -2
  35. atlas_init/settings/env_vars_generated.py +2 -0
  36. atlas_init/settings/interactive2.py +134 -0
  37. atlas_init/tf/.terraform.lock.hcl +59 -59
  38. atlas_init/tf/always.tf +5 -5
  39. atlas_init/tf/main.tf +3 -3
  40. atlas_init/tf/modules/aws_kms/aws_kms.tf +1 -1
  41. atlas_init/tf/modules/aws_s3/provider.tf +2 -1
  42. atlas_init/tf/modules/aws_vpc/provider.tf +2 -1
  43. atlas_init/tf/modules/cfn/cfn.tf +0 -8
  44. atlas_init/tf/modules/cfn/kms.tf +5 -5
  45. atlas_init/tf/modules/cfn/provider.tf +7 -0
  46. atlas_init/tf/modules/cfn/variables.tf +1 -1
  47. atlas_init/tf/modules/cloud_provider/cloud_provider.tf +1 -1
  48. atlas_init/tf/modules/cloud_provider/provider.tf +2 -1
  49. atlas_init/tf/modules/cluster/cluster.tf +31 -31
  50. atlas_init/tf/modules/cluster/provider.tf +2 -1
  51. atlas_init/tf/modules/encryption_at_rest/provider.tf +2 -1
  52. atlas_init/tf/modules/federated_vars/federated_vars.tf +2 -3
  53. atlas_init/tf/modules/federated_vars/provider.tf +2 -1
  54. atlas_init/tf/modules/project_extra/project_extra.tf +1 -10
  55. atlas_init/tf/modules/project_extra/provider.tf +8 -0
  56. atlas_init/tf/modules/stream_instance/provider.tf +8 -0
  57. atlas_init/tf/modules/stream_instance/stream_instance.tf +0 -9
  58. atlas_init/tf/modules/vpc_peering/provider.tf +10 -0
  59. atlas_init/tf/modules/vpc_peering/vpc_peering.tf +0 -10
  60. atlas_init/tf/modules/vpc_privatelink/versions.tf +2 -1
  61. atlas_init/tf/outputs.tf +1 -0
  62. atlas_init/tf/providers.tf +1 -1
  63. atlas_init/tf/variables.tf +7 -7
  64. atlas_init/tf_ext/__init__.py +0 -0
  65. atlas_init/tf_ext/__main__.py +3 -0
  66. atlas_init/tf_ext/api_call.py +325 -0
  67. atlas_init/tf_ext/args.py +17 -0
  68. atlas_init/tf_ext/constants.py +3 -0
  69. atlas_init/tf_ext/models.py +106 -0
  70. atlas_init/tf_ext/paths.py +126 -0
  71. atlas_init/tf_ext/settings.py +39 -0
  72. atlas_init/tf_ext/tf_dep.py +324 -0
  73. atlas_init/tf_ext/tf_modules.py +394 -0
  74. atlas_init/tf_ext/tf_vars.py +173 -0
  75. atlas_init/tf_ext/typer_app.py +24 -0
  76. atlas_init/typer_app.py +4 -8
  77. {atlas_init-0.4.5.dist-info → atlas_init-0.7.0.dist-info}/METADATA +8 -4
  78. atlas_init-0.7.0.dist-info/RECORD +138 -0
  79. atlas_init-0.7.0.dist-info/entry_points.txt +5 -0
  80. atlas_init-0.4.5.dist-info/RECORD +0 -105
  81. atlas_init-0.4.5.dist-info/entry_points.txt +0 -2
  82. {atlas_init-0.4.5.dist-info → atlas_init-0.7.0.dist-info}/WHEEL +0 -0
  83. {atlas_init-0.4.5.dist-info → atlas_init-0.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,25 +2,25 @@
2
2
  # Manual edits may be lost in future updates.
3
3
 
4
4
  provider "registry.terraform.io/hashicorp/aws" {
5
- version = "5.87.0"
5
+ version = "5.100.0"
6
6
  constraints = "~> 5.0"
7
7
  hashes = [
8
- "h1:IYq3by7O/eJuXzJwOF920z2nZEkw08PkDFdw2xkyhrs=",
9
- "zh:017f237466875c919330b9e214fb33af14fffbff830d3755e8976d8fa3c963c2",
10
- "zh:0776d1e60aa93c85ecbb01144aed2789c8e180bb0f1c811a0aba17ca7247b26c",
11
- "zh:0dfa5c6cfb3724494fdc73f7d042515e88a20da8968959f48b3ec0b937bd8c8f",
12
- "zh:1707a5ead36a7980cb3f83e8b69a67a14ae725bfc990ddfcc209b59400b57b04",
13
- "zh:1c71f54fdd6adcbe547d6577dbb843d72a30fef0ab882d0afbeb8a7b348bc442",
14
- "zh:3563c850a29790957ec3f4d3ba203bfa2e084ac7319035b3f43b91f818a2c9b4",
15
- "zh:520bf6cef53785a92226651d5bebacbbf9314bdbc3211d0bf0903bce4e45149d",
16
- "zh:56f9778575830f6e5c23462c2eccbf2c9afaddb00a69275fcfb33cd1a6d17f4d",
17
- "zh:73e381cb0b1e76d471d7b0952f3d2a80350b507d15bda9b7041ea69077e3b5b5",
18
- "zh:7da74b48f8fa088be758a92407980400cb4b039a8d9ba3c108907e4055e9ad6f",
19
- "zh:8dacfa9623ba2e0197fe7db6faaaa0820a3b91fe00ba9e5d8a646340522bc8dd",
8
+ "h1:Ijt7pOlB7Tr7maGQIqtsLFbl7pSMIj06TVdkoSBcYOw=",
9
+ "zh:054b8dd49f0549c9a7cc27d159e45327b7b65cf404da5e5a20da154b90b8a644",
10
+ "zh:0b97bf8d5e03d15d83cc40b0530a1f84b459354939ba6f135a0086c20ebbe6b2",
11
+ "zh:1589a2266af699cbd5d80737a0fe02e54ec9cf2ca54e7e00ac51c7359056f274",
12
+ "zh:6330766f1d85f01ae6ea90d1b214b8b74cc8c1badc4696b165b36ddd4cc15f7b",
13
+ "zh:7c8c2e30d8e55291b86fcb64bdf6c25489d538688545eb48fd74ad622e5d3862",
14
+ "zh:99b1003bd9bd32ee323544da897148f46a527f622dc3971af63ea3e251596342",
20
15
  "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
21
- "zh:9c2ebd21d697e1a611fe201788dc9e1678949a088afc85d4589563bca484d835",
22
- "zh:ac5d0bbf36f9a6cedbfb63993f6baf0aabdaf21c8d7fc3b1e69ba8cbf344b5f3",
23
- "zh:c2329644179f78a0458b6cf2dd5eaadca4c610fc3577a1b50620544d92df13e8",
16
+ "zh:9f8b909d3ec50ade83c8062290378b1ec553edef6a447c56dadc01a99f4eaa93",
17
+ "zh:aaef921ff9aabaf8b1869a86d692ebd24fbd4e12c21205034bb679b9caf883a2",
18
+ "zh:ac882313207aba00dd5a76dbd572a0ddc818bb9cbf5c9d61b28fe30efaec951e",
19
+ "zh:bb64e8aff37becab373a1a0cc1080990785304141af42ed6aa3dd4913b000421",
20
+ "zh:dfe495f6621df5540d9c92ad40b8067376350b005c637ea6efac5dc15028add4",
21
+ "zh:f0ddf0eaf052766cfe09dea8200a946519f653c384ab4336e2a4a64fdd6310e9",
22
+ "zh:f1b7e684f4c7ae1eed272b6de7d2049bb87a0275cb04dbb7cda6636f600699c9",
23
+ "zh:ff461571e3f233699bf690db319dfe46aec75e58726636a0d97dd9ac6e32fb70",
24
24
  ]
25
25
  }
26
26
 
@@ -65,61 +65,61 @@ provider "registry.terraform.io/hashicorp/local" {
65
65
  }
66
66
 
67
67
  provider "registry.terraform.io/hashicorp/null" {
68
- version = "3.2.3"
68
+ version = "3.2.4"
69
69
  hashes = [
70
- "h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=",
71
- "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2",
72
- "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d",
73
- "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3",
74
- "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f",
75
- "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1",
70
+ "h1:L5V05xwp/Gto1leRryuesxjMfgZwjb7oool4WS1UEFQ=",
71
+ "zh:59f6b52ab4ff35739647f9509ee6d93d7c032985d9f8c6237d1f8a59471bbbe2",
76
72
  "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
77
- "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301",
78
- "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670",
79
- "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed",
80
- "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65",
81
- "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd",
82
- "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5",
73
+ "zh:795c897119ff082133150121d39ff26cb5f89a730a2c8c26f3a9c1abf81a9c43",
74
+ "zh:7b9c7b16f118fbc2b05a983817b8ce2f86df125857966ad356353baf4bff5c0a",
75
+ "zh:85e33ab43e0e1726e5f97a874b8e24820b6565ff8076523cc2922ba671492991",
76
+ "zh:9d32ac3619cfc93eb3c4f423492a8e0f79db05fec58e449dee9b2d5873d5f69f",
77
+ "zh:9e15c3c9dd8e0d1e3731841d44c34571b6c97f5b95e8296a45318b94e5287a6e",
78
+ "zh:b4c2ab35d1b7696c30b64bf2c0f3a62329107bd1a9121ce70683dec58af19615",
79
+ "zh:c43723e8cc65bcdf5e0c92581dcbbdcbdcf18b8d2037406a5f2033b1e22de442",
80
+ "zh:ceb5495d9c31bfb299d246ab333f08c7fb0d67a4f82681fbf47f2a21c3e11ab5",
81
+ "zh:e171026b3659305c558d9804062762d168f50ba02b88b231d20ec99578a6233f",
82
+ "zh:ed0fe2acdb61330b01841fa790be00ec6beaac91d41f311fb8254f74eb6a711f",
83
83
  ]
84
84
  }
85
85
 
86
86
  provider "registry.terraform.io/hashicorp/random" {
87
- version = "3.6.3"
87
+ version = "3.7.2"
88
88
  hashes = [
89
- "h1:zG9uFP8l9u+yGZZvi5Te7PV62j50azpgwPunq2vTm1E=",
90
- "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451",
91
- "zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8",
92
- "zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe",
93
- "zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1",
94
- "zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36",
95
- "zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e",
89
+ "h1:KG4NuIBl1mRWU0KD/BGfCi1YN/j3F7H4YgeeM7iSdNs=",
90
+ "zh:14829603a32e4bc4d05062f059e545a91e27ff033756b48afbae6b3c835f508f",
91
+ "zh:1527fb07d9fea400d70e9e6eb4a2b918d5060d604749b6f1c361518e7da546dc",
92
+ "zh:1e86bcd7ebec85ba336b423ba1db046aeaa3c0e5f921039b3f1a6fc2f978feab",
93
+ "zh:24536dec8bde66753f4b4030b8f3ef43c196d69cccbea1c382d01b222478c7a3",
94
+ "zh:29f1786486759fad9b0ce4fdfbbfece9343ad47cd50119045075e05afe49d212",
95
+ "zh:4d701e978c2dd8604ba1ce962b047607701e65c078cb22e97171513e9e57491f",
96
96
  "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
97
- "zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30",
98
- "zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615",
99
- "zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad",
100
- "zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556",
101
- "zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0",
97
+ "zh:7b8434212eef0f8c83f5a90c6d76feaf850f6502b61b53c329e85b3b281cba34",
98
+ "zh:ac8a23c212258b7976e1621275e3af7099e7e4a3d4478cf8d5d2a27f3bc3e967",
99
+ "zh:b516ca74431f3df4c6cf90ddcdb4042c626e026317a33c53f0b445a3d93b720d",
100
+ "zh:dc76e4326aec2490c1600d6871a95e78f9050f9ce427c71707ea412a2f2f1a62",
101
+ "zh:eac7b63e86c749c7d48f527671c7aee5b4e26c10be6ad7232d6860167f99dbb0",
102
102
  ]
103
103
  }
104
104
 
105
105
  provider "registry.terraform.io/mongodb/mongodbatlas" {
106
- version = "1.19.0"
107
- constraints = "1.19.0"
106
+ version = "1.37.0"
107
+ constraints = ">= 1.33.0"
108
108
  hashes = [
109
- "h1:zzKWs4GzWXo+ImMQud/b0ECObJmbtB2wCrK3b98z1ms=",
110
- "zh:3a8198e83b9b2dd1c461049f19464e82ce3f24d9fa7508e0e6dd642e2be70f73",
111
- "zh:3a89a8395624a8e8516c6147b1612798f05e59ed3f13c1f6d8878099c9ca5f6e",
112
- "zh:41ff89b10d5f1069d4bfa093e2d9297f1670863716f60d7b874f076bc37bc2ac",
113
- "zh:5baf75906ccfc658be79b4c02c86032943af18c159f9c80a067ed696f23db527",
114
- "zh:697aa8aebc5f4f8b6c42ba33bd1fec5ab8244555905bf6c6482ebf4733fe7976",
115
- "zh:6d7fe4c2bca1e34e0c881266a463bbe16dd9a2934b7fa6d116c711a56b895f6f",
116
- "zh:6dca00e357d04fbaeab6d2fa336c6704e289c076beef250a3cfe948a901bc4d4",
117
- "zh:877a40cabcc49ee9fb40143dcbd6253d0c08ac1603a71e2cf2dde2d1fbfde574",
118
- "zh:8a43a657196f4917f32f07ea91f056a2be6e7adb8a1fb7df4517ad9b71362c30",
119
- "zh:91ef30b6020da3d5c5781ea6718b5f785c1eb3c7f4677343b31af2297d9f3558",
120
- "zh:9bbc42509526c942db3979eaacd15b96ad454777993a0b002f908f9e9fcef51c",
121
- "zh:b11fd160fcdd9cf7423283af7e0c3f0970b391b5a62ec30fe699ffdd54351896",
122
- "zh:c297a0a188141741f14578cd8db41c309361e37b1b0904e635a7ebd0993e86f7",
123
- "zh:c8af40986dbc42e77d0e34af7ea2d730cb87aa0471236392dbea0926ab95159a",
109
+ "h1:Bn3O8yBFQ25GeP7bqvBEdyLFp/ZZGtxAZI9c1KU/Wek=",
110
+ "zh:0bb3d85fa4680d804b25341838ae4a5740f59c95b677e818aaeb74957093477c",
111
+ "zh:14ec370dcdf9c8a92311179089d972a2476c8d17d15ea3cd06c1e772782dcdf6",
112
+ "zh:16f42470f48c6bf727968cf0ed0fe64dfbdaf49dee626707367073c92006c354",
113
+ "zh:363bd381dbfed2f3c9a8da2aece2242d8bf2e0a94586422624352c000bcd59d7",
114
+ "zh:6762334cebaf7a72afdf72dde4edaf3263339e271cbb3946bbaae27f67551b6b",
115
+ "zh:730006225c2bb49f717610b3f8e1a7413d137b2721de541a254af7856869a203",
116
+ "zh:9aa5e9bd25788918e6ab7764f37f63d8afe6717c259e17475eed4660b8bed409",
117
+ "zh:ae0b2ad8660bed54eb1e91da863548bb368701181874d44a989b387a90bc7022",
118
+ "zh:b2fccfc349dc720239cd348b615790ce44ca7e3ff9f3f89fb30d4a1c7fe58793",
119
+ "zh:b879a1e1e2cf6585d596da131b150dcf66dd1e937576a161b3afac8bd3ab8e8a",
120
+ "zh:d23223ac3808f05023d531748e1c718ee0c2277fce8baa0268576220f6cb83a2",
121
+ "zh:dc6e6776807113723329d730b3cbc4c9d29d0c1c985414d290a63698d8ec06f8",
122
+ "zh:dff2961bf4b8f8a9d187bfd7d03839a2c2e7c1def13e83bddf82f0cbd794425f",
123
+ "zh:f5f3fc3b0b80f76c3b535ef33c76064347e96e086b7574f73e1f3931e1ab0b4d",
124
124
  ]
125
125
  }
atlas_init/tf/always.tf CHANGED
@@ -10,7 +10,7 @@ resource "random_password" "username" {
10
10
 
11
11
  data "http" "myip" {
12
12
  count = var.use_project_myip ? 1 : 0
13
- url = "https://ipv4.icanhazip.com"
13
+ url = "https://ipv4.icanhazip.com"
14
14
  }
15
15
 
16
16
  data "http" "last_provider_version" {
@@ -35,18 +35,18 @@ resource "mongodbatlas_project" "project" {
35
35
  name = var.project_name
36
36
  org_id = var.org_id
37
37
 
38
- tags = local.tags
38
+ tags = local.tags
39
39
  region_usage_restrictions = var.is_mongodbgov_cloud ? "GOV_REGIONS_ONLY" : null
40
- project_owner_id = length(var.user_id) > 0 ? var.user_id : null
40
+ project_owner_id = length(var.user_id) > 0 ? var.user_id : null
41
41
  }
42
42
 
43
43
  resource "mongodbatlas_project_ip_access_list" "mongo-access" {
44
- count = var.use_project_myip ? 1 : 0
44
+ count = var.use_project_myip ? 1 : 0
45
45
  project_id = mongodbatlas_project.project.id
46
46
  cidr_block = "${chomp(data.http.myip[0].response_body)}/32"
47
47
  }
48
48
 
49
49
  data "mongodbatlas_atlas_user" "this" {
50
- count = length(var.user_id) > 0 ? 1 : 0
50
+ count = length(var.user_id) > 0 ? 1 : 0
51
51
  user_id = var.user_id
52
52
  }
atlas_init/tf/main.tf CHANGED
@@ -141,9 +141,9 @@ module "aws_kms" {
141
141
  access_iam_role_arns = {
142
142
  atlas = module.cloud_provider[0].iam_role_arn
143
143
  }
144
- aws_account_id = local.aws_account_id
145
- aws_region = var.aws_region
146
- key_suffix = var.project_name
144
+ aws_account_id = local.aws_account_id
145
+ aws_region = var.aws_region
146
+ key_suffix = var.project_name
147
147
  }
148
148
 
149
149
  module "federated_vars" {
@@ -5,7 +5,7 @@ variable "aws_region" {
5
5
  type = string
6
6
  }
7
7
  variable "access_iam_role_arns" {
8
- type = map(string)
8
+ type = map(string)
9
9
  description = "static name to arn"
10
10
  }
11
11
 
@@ -2,8 +2,9 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  }
8
+
8
9
  required_version = ">= 1.0"
9
10
  }
@@ -2,11 +2,12 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  aws = {
8
8
  source = "hashicorp/aws"
9
9
  }
10
10
  }
11
+
11
12
  required_version = ">= 1.0"
12
13
  }
@@ -1,11 +1,3 @@
1
- terraform {
2
- required_providers {
3
- aws = {
4
- source = "hashicorp/aws"
5
- }
6
- }
7
- }
8
-
9
1
  locals {
10
2
  services_yaml = file("${path.module}/assume_role_services.yaml")
11
3
  resource_actions_yaml = file("${path.module}/resource_actions.yaml")
@@ -19,13 +19,13 @@ locals {
19
19
  Resource = "*"
20
20
  },
21
21
  {
22
- Sid = "Enable IAM User Permissions for Role",
23
- Effect = "Allow",
22
+ Sid = "Enable IAM User Permissions for Role",
23
+ Effect = "Allow",
24
24
  Principal = {
25
25
  AWS = "*"
26
26
  }
27
- Action = "kms:Decrypt",
28
- Resource = "*"
27
+ Action = "kms:Decrypt",
28
+ Resource = "*"
29
29
  Condition = {
30
30
  StringEquals = {
31
31
  "aws:PrincipalArn" = "arn:aws:iam::${var.aws_account_id}:role/${local.role_name}"
@@ -50,5 +50,5 @@ resource "aws_kms_key" "this" {
50
50
  count = var.use_kms_key ? 1 : 0
51
51
  description = "KMS key for ${var.cfn_profile}"
52
52
  deletion_window_in_days = 7
53
- policy = local.kms_key_policy_json
53
+ policy = local.kms_key_policy_json
54
54
  }
@@ -0,0 +1,7 @@
1
+ terraform {
2
+ required_providers {
3
+ aws = {
4
+ source = "hashicorp/aws"
5
+ }
6
+ }
7
+ }
@@ -18,7 +18,7 @@ variable "tags" {
18
18
  }
19
19
 
20
20
  variable "use_kms_key" {
21
- type = bool
21
+ type = bool
22
22
  default = false
23
23
  }
24
24
 
@@ -48,7 +48,7 @@ EOF
48
48
 
49
49
  output "env_vars" {
50
50
  value = {
51
- IAM_ROLE_ID = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id
51
+ IAM_ROLE_ID = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id
52
52
  AWS_IAM_ROLE_ARN = aws_iam_role.aws_role.arn
53
53
  }
54
54
  }
@@ -2,12 +2,13 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  aws = {
8
8
  source = "hashicorp/aws"
9
9
  version = "~> 5.0"
10
10
  }
11
11
  }
12
+
12
13
  required_version = ">= 1.0"
13
14
  }
@@ -30,49 +30,49 @@ locals {
30
30
  use_free_cluster = var.instance_size == "M0"
31
31
  cluster = try(mongodbatlas_advanced_cluster.project_cluster_free[0], mongodbatlas_advanced_cluster.project_cluster[0])
32
32
  container_id = one(values(local.cluster.replication_specs[0].container_id))
33
- mongodb_url = "mongodb+srv://${var.mongo_user}:${var.mongo_password}@${replace(local.cluster.connection_strings[0].standard_srv, "mongodb+srv://", "")}/?retryWrites=true"
33
+ mongodb_url = "mongodb+srv://${var.mongo_user}:${var.mongo_password}@${replace(local.cluster.connection_strings.standard_srv, "mongodb+srv://", "")}/?retryWrites=true"
34
34
  }
35
35
  resource "mongodbatlas_advanced_cluster" "project_cluster_free" {
36
- count = local.use_free_cluster ? 1 : 0
37
- project_id = var.project_id
38
- name = var.cluster_name
36
+ count = local.use_free_cluster ? 1 : 0
37
+ project_id = var.project_id
38
+ name = var.cluster_name
39
39
  cluster_type = "REPLICASET"
40
40
 
41
- replication_specs {
42
- region_configs {
43
- auto_scaling {
41
+ replication_specs = [{
42
+ region_configs = [{
43
+ auto_scaling = {
44
44
  disk_gb_enabled = false
45
45
  }
46
- priority = 7
47
- provider_name = "TENANT"
48
- backing_provider_name = "AWS"
49
- region_name = var.region
50
- electable_specs {
46
+ priority = 7
47
+ provider_name = "TENANT"
48
+ backing_provider_name = "AWS"
49
+ region_name = var.region
50
+ electable_specs = {
51
51
  instance_size = var.instance_size
52
52
  }
53
- }
54
- }
53
+ }]
54
+ }]
55
55
  }
56
56
 
57
57
  resource "mongodbatlas_advanced_cluster" "project_cluster" {
58
- count = local.use_free_cluster ? 0 : 1
59
- project_id = var.project_id
60
- name = var.cluster_name
58
+ count = local.use_free_cluster ? 0 : 1
59
+ project_id = var.project_id
60
+ name = var.cluster_name
61
61
  backup_enabled = var.cloud_backup
62
- cluster_type = "REPLICASET"
63
-
64
- replication_specs {
65
- region_configs {
66
- priority = 7
62
+ cluster_type = "REPLICASET"
63
+
64
+ replication_specs = [{
65
+ region_configs = [{
66
+ priority = 7
67
67
  provider_name = "AWS"
68
- region_name = var.region
69
- electable_specs {
70
- node_count = 3
68
+ region_name = var.region
69
+ electable_specs = {
70
+ node_count = 3
71
71
  instance_size = var.instance_size
72
- disk_size_gb = 10
72
+ disk_size_gb = 10
73
73
  }
74
- }
75
- }
74
+ }]
75
+ }]
76
76
  }
77
77
 
78
78
  resource "mongodbatlas_database_user" "mongo-user" {
@@ -98,11 +98,11 @@ resource "mongodbatlas_database_user" "mongo-user" {
98
98
  output "info" {
99
99
  sensitive = true
100
100
  value = {
101
- standard_srv = local.cluster.connection_strings[0].standard_srv
101
+ standard_srv = local.cluster.connection_strings.standard_srv
102
102
  mongo_url = local.mongodb_url
103
103
  mongo_username = var.mongo_user
104
104
  mongo_password = var.mongo_password
105
- mongo_url_with_db = "mongodb+srv://${var.mongo_user}:${var.mongo_password}@${replace(local.cluster.connection_strings[0].standard_srv, "mongodb+srv://", "")}/${var.db_in_url}?retryWrites=true"
105
+ mongo_url_with_db = "mongodb+srv://${var.mongo_user}:${var.mongo_password}@${replace(local.cluster.connection_strings.standard_srv, "mongodb+srv://", "")}/${var.db_in_url}?retryWrites=true"
106
106
  cluster_container_id = local.container_id
107
107
  }
108
108
  }
@@ -111,6 +111,6 @@ output "env_vars" {
111
111
  value = {
112
112
  MONGODB_ATLAS_CLUSTER_NAME = var.cluster_name
113
113
  MONGODB_ATLAS_CONTAINER_ID = local.container_id
114
- MONGODB_URL = local.mongodb_url
114
+ MONGODB_URL = local.mongodb_url
115
115
  }
116
116
  }
@@ -2,8 +2,9 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  }
8
+
8
9
  required_version = ">= 1.0"
9
10
  }
@@ -2,8 +2,9 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  }
8
+
8
9
  required_version = ">= 1.0"
9
10
  }
@@ -35,9 +35,8 @@ output "env_vars" {
35
35
  MONGODB_ATLAS_FEDERATION_SETTINGS_ID = var.federated_settings_id
36
36
  MONGODB_ATLAS_FEDERATED_ORG_ID = var.org_id
37
37
  MONGODB_ATLAS_FEDERATED_GROUP_ID = var.project_id
38
- MONGODB_ATLAS_FEDERATED_IDP_ID = data.mongodbatlas_federated_settings_org_config.current.identity_provider_id # 20 character legacy needed for PATCH on org
38
+ MONGODB_ATLAS_FEDERATED_IDP_ID = data.mongodbatlas_federated_settings_org_config.current.identity_provider_id # 20 character legacy needed for PATCH on org
39
39
  # MONGODB_ATLAS_FEDERATED_IDP_ID = data.mongodbatlas_federated_settings_org_config.current.okta_idp_id # used for org PATCH
40
- MONGODB_ATLAS_FEDERATED_SETTINGS_ASSOCIATED_DOMAIN = data.mongodbatlas_federated_settings_org_config.current.domain_allow_list[0]
40
+ MONGODB_ATLAS_FEDERATED_SETTINGS_ASSOCIATED_DOMAIN = try(data.mongodbatlas_federated_settings_org_config.current.domain_allow_list[0], "no-domain-set-by-atlas-init.com")
41
41
  }
42
-
43
42
  }
@@ -2,8 +2,9 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  }
8
+
8
9
  required_version = ">= 1.0"
9
10
  }
@@ -1,12 +1,3 @@
1
- terraform {
2
- required_providers {
3
- mongodbatlas = {
4
- source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
6
- }
7
- }
8
- }
9
-
10
1
  variable "org_id" {
11
2
  type = string
12
3
  }
@@ -51,7 +42,7 @@ resource "mongodbatlas_team" "project_team3" {
51
42
  output "env_vars" {
52
43
  value = {
53
44
  MONGODB_ATLAS_TEAM_ID = mongodbatlas_team.project_team.team_id
54
- MONGODB_ATLAS_TEAMS_IDS = join(",", [mongodbatlas_team.project_team.team_id, mongodbatlas_team.project_team2.team_id, mongodbatlas_team.project_team3.team_id])
45
+ MONGODB_ATLAS_TEAMS_IDS = join(",", [mongodbatlas_team.project_team.team_id, mongodbatlas_team.project_team2.team_id, mongodbatlas_team.project_team3.team_id])
55
46
  MONGODB_ATLAS_ORG_API_KEY_ID = mongodbatlas_api_key.project_key.api_key_id
56
47
  }
57
48
  }
@@ -0,0 +1,8 @@
1
+ terraform {
2
+ required_providers {
3
+ mongodbatlas = {
4
+ source = "mongodb/mongodbatlas"
5
+ version = ">=1.33"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ terraform {
2
+ required_providers {
3
+ mongodbatlas = {
4
+ source = "mongodb/mongodbatlas"
5
+ version = ">=1.33"
6
+ }
7
+ }
8
+ }
@@ -1,12 +1,3 @@
1
- terraform {
2
- required_providers {
3
- mongodbatlas = {
4
- source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
6
- }
7
- }
8
- }
9
-
10
1
  variable "project_id" {
11
2
  type = string
12
3
  }
@@ -0,0 +1,10 @@
1
+ terraform {
2
+ required_providers {
3
+ mongodbatlas = {
4
+ source = "mongodb/mongodbatlas"
5
+ version = ">=1.33"
6
+ }
7
+ }
8
+
9
+ required_version = ">= 1.0"
10
+ }
@@ -1,13 +1,3 @@
1
- terraform {
2
- required_providers {
3
- mongodbatlas = {
4
- source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
6
- }
7
- }
8
- required_version = ">= 1.0"
9
- }
10
-
11
1
  variable "atlas_vpc_cidr" {
12
2
  description = "Atlas CIDR"
13
3
  default = "192.168.232.0/21"
@@ -6,8 +6,9 @@ terraform {
6
6
  }
7
7
  mongodbatlas = {
8
8
  source = "mongodb/mongodbatlas"
9
- version = "1.19.0"
9
+ version = ">=1.33"
10
10
  }
11
11
  }
12
+
12
13
  required_version = ">= 1.0"
13
14
  }
atlas_init/tf/outputs.tf CHANGED
@@ -50,6 +50,7 @@ locals {
50
50
 
51
51
  PROJECT_NAME = var.project_name
52
52
  MONGODB_ATLAS_PROJECT_OWNER_ID = try(data.mongodbatlas_atlas_user.this[0].user_id, "")
53
+ MONGODB_ATLAS_USER_EMAIL = try(data.mongodbatlas_atlas_user.this[0].email_address, "")
53
54
 
54
55
  # tf
55
56
  TF_ACC = 1
@@ -2,7 +2,7 @@ terraform {
2
2
  required_providers {
3
3
  mongodbatlas = {
4
4
  source = "mongodb/mongodbatlas"
5
- version = "1.19.0"
5
+ version = ">=1.33"
6
6
  }
7
7
  aws = {
8
8
  source = "hashicorp/aws"
@@ -12,12 +12,12 @@ variable "atlas_base_url" {
12
12
  }
13
13
 
14
14
  variable "user_id" {
15
- type = string
15
+ type = string
16
16
  default = ""
17
17
  }
18
18
 
19
19
  variable "is_mongodbgov_cloud" {
20
- type = bool
20
+ type = bool
21
21
  default = false
22
22
  }
23
23
 
@@ -44,7 +44,7 @@ variable "project_name" {
44
44
  }
45
45
 
46
46
  variable "use_project_myip" {
47
- type = bool
47
+ type = bool
48
48
  default = false
49
49
  }
50
50
 
@@ -54,13 +54,13 @@ variable "out_dir" {
54
54
 
55
55
  variable "cfn_config" {
56
56
  type = object({
57
- profile = string
58
- region = string
57
+ profile = string
58
+ region = string
59
59
  use_kms_key = bool
60
60
  })
61
61
  default = {
62
- profile = ""
63
- region = "eu-west-1"
62
+ profile = ""
63
+ region = "eu-west-1"
64
64
  use_kms_key = false
65
65
  }
66
66
  }
File without changes
@@ -0,0 +1,3 @@
1
+ from atlas_init.tf_ext.typer_app import typer_main
2
+
3
+ typer_main()