Skip to content

Commit bf224bb

Browse files
committed
fix!: stop declaring providers in module
See https://developer.hashicorp.com/terraform/language/modules/develop/providers for rationale. Also updating module reference and generating references for submodules.
1 parent e89e909 commit bf224bb

File tree

19 files changed

+273
-113
lines changed

19 files changed

+273
-113
lines changed

.terraform-docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
recursive:
2+
enabled: true
13
formatter: "markdown table"
24
content: |-
35
{{ .Providers }}

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ Each example generates a valid _jx-requirements.yml_ file that can be used to bo
407407
| Name | Version |
408408
|------|---------|
409409
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.60.0 |
410-
| <a name="provider_random"></a> [random](#provider\_random) | 3.6.2 |
411410
#### Modules
412411

413412
| Name | Source | Version |
@@ -422,13 +421,11 @@ Each example generates a valid _jx-requirements.yml_ file that can be used to bo
422421

423422
| Name | Version |
424423
|------|---------|
425-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.17, < 2.0.0 |
424+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0, < 2.0.0 |
426425
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | > 4.0 |
427426
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | ~> 2.0 |
428427
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | ~> 2.0 |
429-
| <a name="requirement_local"></a> [local](#requirement\_local) | ~> 2.0 |
430428
| <a name="requirement_null"></a> [null](#requirement\_null) | ~> 3.0 |
431-
| <a name="requirement_random"></a> [random](#requirement\_random) | ~> 3.0 |
432429
#### Inputs
433430

434431
| Name | Description | Type | Default | Required |
@@ -437,8 +434,9 @@ Each example generates a valid _jx-requirements.yml_ file that can be used to bo
437434
| <a name="input_apex_domain"></a> [apex\_domain](#input\_apex\_domain) | The main domain to either use directly or to configure a subdomain from | `string` | `""` | no |
438435
| <a name="input_asm_role"></a> [asm\_role](#input\_asm\_role) | DEPRECATED: Use the new bot\_iam\_role input with he same semantics instead. | `string` | `""` | no |
439436
| <a name="input_boot_iam_role"></a> [boot\_iam\_role](#input\_boot\_iam\_role) | Specify arn of the role to apply to the boot job service account | `string` | `""` | no |
440-
| <a name="input_boot_secrets"></a> [boot\_secrets](#input\_boot\_secrets) | n/a | <pre>list(object({<br> name = string<br> value = string<br> type = string<br> }))</pre> | `[]` | no |
437+
| <a name="input_boot_secrets"></a> [boot\_secrets](#input\_boot\_secrets) | n/a | <pre>list(object({<br/> name = string<br/> value = string<br/> type = string<br/> }))</pre> | `[]` | no |
441438
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Variable to provide your desired name for the cluster | `string` | n/a | yes |
439+
| <a name="input_cluster_oidc_issuer_url"></a> [cluster\_oidc\_issuer\_url](#input\_cluster\_oidc\_issuer\_url) | The oidc provider url for the clustrer | `string` | n/a | yes |
442440
| <a name="input_create_and_configure_subdomain"></a> [create\_and\_configure\_subdomain](#input\_create\_and\_configure\_subdomain) | Flag to create an NS record set for the subdomain in the apex domain's Hosted Zone | `bool` | `false` | no |
443441
| <a name="input_create_asm_role"></a> [create\_asm\_role](#input\_create\_asm\_role) | Flag to control AWS Secrets Manager iam roles creation | `bool` | `false` | no |
444442
| <a name="input_create_autoscaler_role"></a> [create\_autoscaler\_role](#input\_create\_autoscaler\_role) | Flag to control cluster autoscaler iam role creation | `bool` | `true` | no |
@@ -472,15 +470,14 @@ Each example generates a valid _jx-requirements.yml_ file that can be used to bo
472470
| <a name="input_jx_bot_username"></a> [jx\_bot\_username](#input\_jx\_bot\_username) | Bot username used to interact with the Jenkins X cluster git repository | `string` | `""` | no |
473471
| <a name="input_jx_git_operator_values"></a> [jx\_git\_operator\_values](#input\_jx\_git\_operator\_values) | Extra values for jx-git-operator chart as a list of yaml formated strings | `list(string)` | `[]` | no |
474472
| <a name="input_jx_git_url"></a> [jx\_git\_url](#input\_jx\_git\_url) | URL for the Jenkins X cluster git repository | `string` | `""` | no |
475-
| <a name="input_local-exec-interpreter"></a> [local-exec-interpreter](#input\_local-exec-interpreter) | If provided, this is a list of interpreter arguments used to execute the command | `list(string)` | <pre>[<br> "/bin/bash",<br> "-c"<br>]</pre> | no |
473+
| <a name="input_local-exec-interpreter"></a> [local-exec-interpreter](#input\_local-exec-interpreter) | If provided, this is a list of interpreter arguments used to execute the command | `list(string)` | <pre>[<br/> "/bin/bash",<br/> "-c"<br/>]</pre> | no |
476474
| <a name="input_manage_apex_domain"></a> [manage\_apex\_domain](#input\_manage\_apex\_domain) | Flag to control if apex domain should be managed/updated by this module. Set this to false,if your apex domain is managed in a different AWS account or different provider | `bool` | `true` | no |
477475
| <a name="input_manage_subdomain"></a> [manage\_subdomain](#input\_manage\_subdomain) | Flag to control subdomain creation/management | `bool` | `true` | no |
478476
| <a name="input_nginx_chart_version"></a> [nginx\_chart\_version](#input\_nginx\_chart\_version) | nginx chart version | `string` | n/a | yes |
479477
| <a name="input_nginx_namespace"></a> [nginx\_namespace](#input\_nginx\_namespace) | Name of the nginx namespace | `string` | `"nginx"` | no |
480478
| <a name="input_nginx_release_name"></a> [nginx\_release\_name](#input\_nginx\_release\_name) | Name of the nginx release name | `string` | `"nginx-ingress"` | no |
481479
| <a name="input_nginx_values_file"></a> [nginx\_values\_file](#input\_nginx\_values\_file) | Name of the values file which holds the helm chart values | `string` | `"nginx_values.yaml"` | no |
482480
| <a name="input_production_letsencrypt"></a> [production\_letsencrypt](#input\_production\_letsencrypt) | Flag to use the production environment of letsencrypt in the `jx-requirements.yml` file | `bool` | `false` | no |
483-
| <a name="input_profile"></a> [profile](#input\_profile) | The AWS Profile used to provision the EKS Cluster | `string` | `null` | no |
484481
| <a name="input_region"></a> [region](#input\_region) | The region to create the resources into | `string` | `"us-east-1"` | no |
485482
| <a name="input_registry"></a> [registry](#input\_registry) | Registry used to store images | `string` | `""` | no |
486483
| <a name="input_s3_extra_tags"></a> [s3\_extra\_tags](#input\_s3\_extra\_tags) | Add new tags for s3 buckets | `map(any)` | `{}` | no |
@@ -508,10 +505,9 @@ Each example generates a valid _jx-requirements.yml_ file that can be used to bo
508505
| <a name="output_cluster_asm_iam_role"></a> [cluster\_asm\_iam\_role](#output\_cluster\_asm\_iam\_role) | The IAM Role that the External Secrets pod will assume to authenticate (Secrets Manager) |
509506
| <a name="output_cluster_autoscaler_iam_role"></a> [cluster\_autoscaler\_iam\_role](#output\_cluster\_autoscaler\_iam\_role) | The IAM Role that the Jenkins X UI pod will assume to authenticate |
510507
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | The name of the created cluster |
511-
| <a name="output_cluster_oidc_issuer_url"></a> [cluster\_oidc\_issuer\_url](#output\_cluster\_oidc\_issuer\_url) | The Cluster OIDC Issuer URL |
512508
| <a name="output_cluster_ssm_iam_role"></a> [cluster\_ssm\_iam\_role](#output\_cluster\_ssm\_iam\_role) | The IAM Role that the External Secrets pod will assume to authenticate (Parameter Store) |
513509
| <a name="output_cm_cainjector_iam_role"></a> [cm\_cainjector\_iam\_role](#output\_cm\_cainjector\_iam\_role) | The IAM Role that the CM CA Injector pod will assume to authenticate |
514-
| <a name="output_connect"></a> [connect](#output\_connect) | "The cluster connection string to use once Terraform apply finishes,<br>this command is already executed as part of the apply, you may have to provide the region and<br>profile as environment variables " |
510+
| <a name="output_connect"></a> [connect](#output\_connect) | "The cluster connection string to use once Terraform apply finishes,<br/>this command is already executed as part of the apply, you may have to provide the region and<br/>profile as environment variables " |
515511
| <a name="output_controllerbuild_iam_role"></a> [controllerbuild\_iam\_role](#output\_controllerbuild\_iam\_role) | The IAM Role that the ControllerBuild pod will assume to authenticate |
516512
| <a name="output_external_dns_iam_role"></a> [external\_dns\_iam\_role](#output\_external\_dns\_iam\_role) | The IAM Role that the External DNS pod will assume to authenticate |
517513
| <a name="output_jx_requirements"></a> [jx\_requirements](#output\_jx\_requirements) | The jx-requirements rendered output |

local.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
locals {
2-
generated_seed = random_string.suffix.result
3-
oidc_provider_url = module.cluster.cluster_oidc_issuer_url
4-
external_vault = var.vault_url != "" ? true : false
5-
registry = var.registry != "" ? var.registry : "${data.aws_caller_identity.current.account_id}.dkr.ecr.${var.region}.amazonaws.com"
6-
project = data.aws_caller_identity.current.account_id
7-
tls_secret_name = var.tls_key == "" || var.tls_cert == "" ? "" : "tls-ingress-certificates-ca"
2+
external_vault = var.vault_url != "" ? true : false
3+
registry = var.registry != "" ? var.registry : "${data.aws_caller_identity.current.account_id}.dkr.ecr.${var.region}.amazonaws.com"
4+
project = data.aws_caller_identity.current.account_id
5+
tls_secret_name = var.tls_key == "" || var.tls_cert == "" ? "" : "tls-ingress-certificates-ca"
86

97
// ----------------------------------------------------------------------------
108
// Let's generate jx-requirements.yml

main.tf

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
// ----------------------------------------------------------------------------
2-
// Configure providers
3-
// ----------------------------------------------------------------------------
4-
provider "helm" {
5-
kubernetes {
6-
host = module.cluster.cluster_host
7-
cluster_ca_certificate = module.cluster.cluster_ca_certificate
8-
token = module.cluster.cluster_token
9-
}
10-
}
11-
12-
resource "random_string" "suffix" {
13-
length = 8
14-
special = false
15-
}
16-
17-
18-
191
data "aws_caller_identity" "current" {}
202

213
// ----------------------------------------------------------------------------
@@ -52,7 +34,6 @@ module "cluster" {
5234
tls_cert = var.tls_cert
5335
tls_key = var.tls_key
5436
local-exec-interpreter = var.local-exec-interpreter
55-
profile = var.profile
5637
enable_logs_storage = var.enable_logs_storage
5738
expire_logs_after_days = var.expire_logs_after_days
5839
enable_reports_storage = var.enable_reports_storage
@@ -61,6 +42,7 @@ module "cluster" {
6142
use_asm = var.use_asm
6243
boot_iam_role = "${var.asm_role}${var.boot_iam_role}"
6344
enable_acl = var.enable_acl
45+
cluster_oidc_issuer_url = var.cluster_oidc_issuer_url
6446
}
6547

6648
// ----------------------------------------------------------------------------

modules/backup/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- BEGIN_TF_DOCS # Autogenerated do not edit! -->
2+
#### Providers
3+
4+
| Name | Version |
5+
|------|---------|
6+
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
7+
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | n/a |
8+
#### Modules
9+
10+
No modules.
11+
#### Requirements
12+
13+
No requirements.
14+
#### Inputs
15+
16+
| Name | Description | Type | Default | Required |
17+
|------|-------------|------|---------|:--------:|
18+
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the Kubernetes cluster | `string` | n/a | yes |
19+
| <a name="input_create_velero_role"></a> [create\_velero\_role](#input\_create\_velero\_role) | Flag to control velero iam role creation | `bool` | `true` | no |
20+
| <a name="input_enable_acl"></a> [enable\_acl](#input\_enable\_acl) | Flag to enable ACL instead of bucket ownership for S3 storage | `bool` | n/a | yes |
21+
| <a name="input_enable_backup"></a> [enable\_backup](#input\_enable\_backup) | Whether or not Velero backups should be enabled | `bool` | `false` | no |
22+
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | Flag to determine whether storage buckets get forcefully destroyed | `bool` | `false` | no |
23+
| <a name="input_s3_default_tags"></a> [s3\_default\_tags](#input\_s3\_default\_tags) | Default tags for s3 buckets | `map(any)` | <pre>{<br/> "Owner": "Jenkins-x"<br/>}</pre> | no |
24+
| <a name="input_s3_extra_tags"></a> [s3\_extra\_tags](#input\_s3\_extra\_tags) | Add new tags for s3 buckets | `map(any)` | `{}` | no |
25+
| <a name="input_s3_kms_arn"></a> [s3\_kms\_arn](#input\_s3\_kms\_arn) | ARN of the kms key used for encrypting s3 buckets | `string` | `""` | no |
26+
| <a name="input_use_kms_s3"></a> [use\_kms\_s3](#input\_use\_kms\_s3) | Flag to determine whether kms should be used for encrypting s3 buckets | `bool` | `false` | no |
27+
| <a name="input_velero_namespace"></a> [velero\_namespace](#input\_velero\_namespace) | Kubernetes namespace for Velero | `string` | `"velero"` | no |
28+
| <a name="input_velero_username"></a> [velero\_username](#input\_velero\_username) | The username to be assigned to the Velero IAM user | `string` | `"velero"` | no |
29+
#### Outputs
30+
31+
| Name | Description |
32+
|------|-------------|
33+
| <a name="output_backup_bucket_url"></a> [backup\_bucket\_url](#output\_backup\_bucket\_url) | n/a |
34+
<!-- BEGIN_TF_DOCS -->

0 commit comments

Comments
 (0)