Skip to content

Commit fbb60dc

Browse files
committed
Run project validations
1 parent da065b3 commit fbb60dc

File tree

8 files changed

+57
-37
lines changed

8 files changed

+57
-37
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.1.0
3+
rev: v3.4.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']
@@ -17,7 +17,7 @@ repos:
1717
- id: detect-aws-credentials
1818
args: ['--allow-missing-credentials']
1919
- repo: git://github.com/antonbabenko/pre-commit-terraform
20-
rev: v1.31.0
20+
rev: v1.50.0
2121
hooks:
2222
- id: terraform_fmt
2323
- id: terraform_docs

.tflint.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
config {
2-
deep_check = false
32
ignore_module = {}
43
varfile = []
54
}

README.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -117,52 +117,72 @@ Here's the gist of using it directly from github.
117117

118118
| Name | Version |
119119
|------|---------|
120-
| terraform | >= 0.12 |
121-
| helm | >= 1.2 |
122-
| kubernetes | >= 1.11.0 |
120+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12 |
121+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
122+
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 1.2 |
123+
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 1.11.0 |
123124

124125
## Providers
125126

126127
| Name | Version |
127128
|------|---------|
128-
| aws | n/a |
129-
| helm | >= 1.2 |
130-
| kubernetes | >= 1.11.0 |
129+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
130+
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 1.2 |
131+
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 1.11.0 |
132+
133+
## Modules
134+
135+
No modules.
136+
137+
## Resources
138+
139+
| Name | Type |
140+
|------|------|
141+
| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
142+
| [aws_iam_role_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
143+
| [helm_release.this](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
144+
| [kubernetes_namespace.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
145+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
146+
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
147+
| [aws_iam_policy_document.policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
148+
| [kubernetes_namespace.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/namespace) | data source |
131149

132150
## Inputs
133151

134152
| Name | Description | Type | Default | Required |
135153
|------|-------------|------|---------|:--------:|
136-
| app | A Release is an instance of a chart running in a Kubernetes cluster. | `map` | `{}` | no |
137-
| app\_deploy | Whether or not to deploy app | `bool` | `true` | no |
138-
| bucket | Backup and Restore bucket. | `string` | n/a | yes |
139-
| cluster\_name | Cluster name. | `string` | n/a | yes |
140-
| description | Namespace description | `string` | `"velero-back-up-and-restore"` | no |
141-
| iam\_deploy | Whether or not to deploy iam role | `bool` | `true` | no |
142-
| iam\_role\_name | Name of the Velero IAM role | `string` | `""` | no |
143-
| name | Namespace name | `string` | `"velero"` | no |
144-
| namespace\_deploy | Whether or not to deploy namespace | `bool` | `false` | no |
145-
| openid\_connect\_provider\_uri | OpenID Connect Provider for EKS to enable IRSA. | `string` | n/a | yes |
146-
| repository | VMware Tanzu repository for Helm repos. | `string` | `"https://vmware-tanzu.github.io/helm-charts"` | no |
147-
| tags | A mapping of tags to assign to the object. | `map` | `{}` | no |
148-
| values | List of values in raw yaml to pass to helm. Values will be merged. | `list(string)` | n/a | yes |
154+
| <a name="input_app"></a> [app](#input\_app) | A Release is an instance of a chart running in a Kubernetes cluster. | `map(any)` | `{}` | no |
155+
| <a name="input_app_deploy"></a> [app\_deploy](#input\_app\_deploy) | Whether or not to deploy app | `bool` | `true` | no |
156+
| <a name="input_bucket"></a> [bucket](#input\_bucket) | Backup and Restore bucket. | `string` | n/a | yes |
157+
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Cluster name. | `string` | n/a | yes |
158+
| <a name="input_description"></a> [description](#input\_description) | Namespace description | `string` | `"velero-back-up-and-restore"` | no |
159+
| <a name="input_iam_deploy"></a> [iam\_deploy](#input\_iam\_deploy) | whther or not to deploy iam role | `bool` | `true` | no |
160+
| <a name="input_iam_role_name"></a> [iam\_role\_name](#input\_iam\_role\_name) | Name of the Velero IAM role | `string` | `""` | no |
161+
| <a name="input_name"></a> [name](#input\_name) | Installation name | `string` | `"velero"` | no |
162+
| <a name="input_namespace_deploy"></a> [namespace\_deploy](#input\_namespace\_deploy) | Whether or not to deploy namespace | `bool` | `false` | no |
163+
| <a name="input_namespace_name"></a> [namespace\_name](#input\_namespace\_name) | Kubernetes namespace name | `string` | `null` | no |
164+
| <a name="input_openid_connect_provider_uri"></a> [openid\_connect\_provider\_uri](#input\_openid\_connect\_provider\_uri) | OpenID Connect Provider for EKS to enable IRSA. | `string` | n/a | yes |
165+
| <a name="input_repository"></a> [repository](#input\_repository) | VMware Tanzu repository for Helm repos. | `string` | `"https://vmware-tanzu.github.io/helm-charts"` | no |
166+
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to the object. | `map(any)` | `{}` | no |
167+
| <a name="input_values"></a> [values](#input\_values) | List of values in raw yaml to pass to helm. Values will be merged. | `list(string)` | n/a | yes |
149168

150169
## Outputs
151170

152171
| Name | Description |
153172
|------|-------------|
154-
| namespace\_name | Namespace name |
155-
173+
| <a name="output_namespace_name"></a> [namespace\_name](#output\_namespace\_name) | Namespace name |
156174
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
157175

158176
## Commands
159177

160178
<!-- START makefile-doc -->
161179
```
162-
$ make help
180+
$ make help
181+
make[1]: Entering directory '/home/jay/dev/altitude-sports/terraform-kubernetes-velero'
163182
hooks Commit hooks setup
164183
validate Validate with pre-commit hooks
165184
changelog Update changelog
185+
make[1]: Leaving directory '/home/jay/dev/altitude-sports/terraform-kubernetes-velero'
166186
```
167187
<!-- END makefile-doc -->
168188

iam.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
data aws_iam_policy_document assume_role {
1+
data "aws_iam_policy_document" "assume_role" {
22
statement {
33
sid = "serviceaccount"
44

@@ -22,7 +22,7 @@ data aws_iam_policy_document assume_role {
2222
}
2323
}
2424

25-
data aws_iam_policy_document policy {
25+
data "aws_iam_policy_document" "policy" {
2626
statement {
2727
sid = "ec2"
2828

@@ -61,9 +61,9 @@ data aws_iam_policy_document policy {
6161
}
6262
}
6363

64-
resource aws_iam_role this {
65-
count = var.iam_deploy ? 1 : 0
66-
name = var.iam_role_name == "" ? format("%s-%s", var.cluster_name, var.name) : var.iam_role_name
64+
resource "aws_iam_role" "this" {
65+
count = var.iam_deploy ? 1 : 0
66+
name = var.iam_role_name == "" ? format("%s-%s", var.cluster_name, var.name) : var.iam_role_name
6767

6868
assume_role_policy = data.aws_iam_policy_document.assume_role.json
6969
tags = merge(var.tags,
@@ -73,7 +73,7 @@ resource aws_iam_role this {
7373
)
7474
}
7575

76-
resource aws_iam_role_policy this {
76+
resource "aws_iam_role_policy" "this" {
7777
count = var.iam_deploy ? 1 : 0
7878
name = format("%s-%s", var.cluster_name, var.name)
7979
role = element(aws_iam_role.this.*.id, 0)

locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
22
namespace_name = coalesce(var.namespace_name, var.name)
3-
namespace = data.kubernetes_namespace.this.metadata.0.name
3+
namespace = data.kubernetes_namespace.this.metadata[0].name
44
account_id = data.aws_caller_identity.current.account_id
55
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ resource "kubernetes_namespace" "this" {
1111
}
1212
}
1313

14-
// Retrieving this data will ensure that the target Kubernetes namespace exists
15-
// before proceeding
14+
# Retrieving this data will ensure that the target Kubernetes namespace exists
15+
# before proceeding.
1616
data "kubernetes_namespace" "this" {
1717
metadata {
1818
name = local.namespace_name

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ variable "name" {
2828
}
2929

3030
variable "namespace_name" {
31-
description = "Kubernetes namespace name. If left unset, the `name` variable will be used instead."
31+
default = null
32+
description = "Kubernetes namespace name"
3233
type = string
33-
optional = true
3434
}
3535

3636
variable "description" {

versions.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ terraform {
22
required_version = ">= 0.12"
33

44
required_providers {
5-
kubernetes = ">= 1.11.0"
5+
aws = ">= 3.0"
66
helm = ">= 1.2"
7+
kubernetes = ">= 1.11.0"
78
}
89
}

0 commit comments

Comments
 (0)