From 93fd3fca7e31e1b997b9782d216b2a2966896c05 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Wed, 31 Jul 2024 19:06:25 -0400 Subject: [PATCH] more --- .pre-commit-config.yaml | 31 ++++++-------------------- .releaserc.json | 36 +++++++++++++++++++++++++++++++ cluster_admin_group.tf.disable | 1 - cluster_admin_policies.tf.disable | 1 - cluster_admin_roles.tf.disable | 1 - dns_zones.tf | 4 ++-- examples/testing/variables.tf | 2 +- main.tf | 2 +- node_ports.tf.disable | 2 +- security_groups.tf | 1 - sg_ports.tf | 2 +- 11 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 .releaserc.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6944a0a..7edd3aa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,30 +28,6 @@ repos: args: ['--allow-missing-credentials'] - id: detect-private-key - -- repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 3.0.0 - hooks: - - id: shfmt - args: ['-l', '-i', '2', '-ci', '-sr', '-w'] - - id: shellcheck - -# Dockerfile linter -- repo: https://github.com/hadolint/hadolint - rev: v2.12.1-beta - hooks: - - id: hadolint - args: [ - '--ignore', 'DL3007', # Using latest - '--ignore', 'DL3013', # Pin versions in pip - '--ignore', 'DL3027', # Do not use apt - '--ignore', 'DL3059', # Docker `RUN`s shouldn't be consolidated here - '--ignore', 'DL4006', # Not related to alpine - '--ignore', 'SC1091', # Useless check - '--ignore', 'SC2015', # Useless check - '--ignore', 'SC3037', # Not related to alpine - ] - # JSON5 Linter - repo: https://github.com/pre-commit/mirrors-prettier rev: v3.1.0 @@ -59,3 +35,10 @@ repos: - id: prettier # https://prettier.io/docs/en/options.html#parser files: '.json5$' + +# Terraform Hooks +- repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.92.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases + hooks: + - id: terraform_fmt + - id: terraform_docs diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..6e39031 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,36 @@ +{ + "branches": [ + "main", + "master" + ], + "ci": false, + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/github", + { + "successComment": + "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:", + "labels": false, + "releasedLabels": false + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md", + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file." + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ], + "message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/cluster_admin_group.tf.disable b/cluster_admin_group.tf.disable index 5ee158f..1312c25 100644 --- a/cluster_admin_group.tf.disable +++ b/cluster_admin_group.tf.disable @@ -9,4 +9,3 @@ module "group_cluster-admin" { var.tags, ) } - diff --git a/cluster_admin_policies.tf.disable b/cluster_admin_policies.tf.disable index ea3f658..9040354 100644 --- a/cluster_admin_policies.tf.disable +++ b/cluster_admin_policies.tf.disable @@ -126,4 +126,3 @@ data "aws_iam_policy_document" "cluster-admin_assume_policy" { resources = [module.role_cluster-admin.role_arn] } } - diff --git a/cluster_admin_roles.tf.disable b/cluster_admin_roles.tf.disable index 0c2a97c..4cdcf8e 100644 --- a/cluster_admin_roles.tf.disable +++ b/cluster_admin_roles.tf.disable @@ -23,4 +23,3 @@ output "role_cluster-admin-role_arn" { description = "Role ARN for EKS Cluster Admin Role" value = module.role_cluster-admin.role_arn } - diff --git a/dns_zones.tf b/dns_zones.tf index c54d080..34f087a 100644 --- a/dns_zones.tf +++ b/dns_zones.tf @@ -1,5 +1,5 @@ #------------------------------------------------- -# DNS Zone for EKS +# DNS Zone for EKS #------------------------------------------------- locals { cluster_domain_name = format("%v.%v", var.cluster_name, var.vpc_domain_name) @@ -9,7 +9,7 @@ locals { zone_ids = compact(var.zone_ids) } #------------------------------------------------- -# Providers for Cross Account DNS Action +# Providers for Cross Account DNS Action #------------------------------------------------- provider "aws" { alias = "route53_main_east" diff --git a/examples/testing/variables.tf b/examples/testing/variables.tf index 6369824..2e107e9 100644 --- a/examples/testing/variables.tf +++ b/examples/testing/variables.tf @@ -78,4 +78,4 @@ variable "tags" { description = "AWS Tags to apply to appropriate resources" type = map(string) default = {} -} \ No newline at end of file +} diff --git a/main.tf b/main.tf index 3a03cd2..7e80e18 100644 --- a/main.tf +++ b/main.tf @@ -53,7 +53,7 @@ locals { # This is done especially since access entries are fairly course grained, especially given the granularity we can achieve via EKS native # RBAC constructs in Roles and ClusterRoles and bindings. # This below is just an example, in practice we'd notionally be creating a role (or multiple) specific to the cluster and setting policy - # to allow the cluster users to assume said role; but we need to spend some time parsing what exactly are the permissions we plan to hand + # to allow the cluster users to assume said role; but we need to spend some time parsing what exactly are the permissions we plan to hand # out to these clusters. access_entries = { inf-admin-t2 = { diff --git a/node_ports.tf.disable b/node_ports.tf.disable index 403a3d6..1c2c550 100644 --- a/node_ports.tf.disable +++ b/node_ports.tf.disable @@ -42,4 +42,4 @@ locals { # type = "ingress" # self = true # } -# } \ No newline at end of file +# } diff --git a/security_groups.tf b/security_groups.tf index 2a46467..0dc3ded 100644 --- a/security_groups.tf +++ b/security_groups.tf @@ -69,4 +69,3 @@ resource "aws_security_group" "additional_eks_cluster_sg" { cidr_blocks = ["0.0.0.0/0"] } } - diff --git a/sg_ports.tf b/sg_ports.tf index b93db24..22ccfeb 100644 --- a/sg_ports.tf +++ b/sg_ports.tf @@ -54,4 +54,4 @@ locals { # ipv6_cidr_blocks = var.cluster_ip_family == "ipv6" ? ["::/0"] : null } } -} \ No newline at end of file +}