Skip to content

Commit

Permalink
329-CD Add pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cristhiandasf committed Jul 30, 2022
1 parent 24ebb12 commit 0bbd0e9
Show file tree
Hide file tree
Showing 45 changed files with 87 additions and 76 deletions.
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.74.1
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_validate
# - id: terraform_tfsec
# - id: terraform_checkov
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ release: ## Release
@git push origin ${version}
@./batect generate_latest_changelog
@gh release create ${version} -F latest_release_changelog.md
@rm -rf latest_release_changelog.md
@rm -rf latest_release_changelog.md
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Provide the required inputs as described:
- `public_subnet_ids_list` - List of public subnets for the load balancer
- `private_subnet_ids_list` - List of private subnets for the ECS service
- `vpc_id` - VPC id
- `resource-name-prefix` - The prefix that will be given to all of these rAPId resources, it needs to be unique so to not conflict with any other instance e.g `rapid-<your-team/project/dept>`
- `resource-name-prefix` - The prefix that will be given to all of these rAPId resources, it needs to be unique so to not conflict with any other instance e.g `rapid-<your-team/project/dept>`
- `support_emails_for_cloudwatch_alerts` - List of engineer emails that should receive alert notifications

There are also these optional inputs:
Expand Down Expand Up @@ -432,9 +432,9 @@ module "app_cluster" {
...
support_emails_for_cloudwatch_alerts = ["someone@email.com", "support@email.com"]
...
}
```

> ⚠️ Make sure to **confirm** the notification subscription email in order to start receiving alert emails.
> ⚠️ Make sure to **confirm** the notification subscription email in order to start receiving alert emails.
2 changes: 1 addition & 1 deletion batect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ tasks:
description: Parse the changelog file for the release's changes
run:
container: utility
command: "python get_latest_release_changelog.py"
command: "python get_latest_release_changelog.py"
2 changes: 1 addition & 1 deletion blocks/app-cluster/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ output "log_error_alarm_notification_arn" {
output "rapid_metric_log_error_alarm_arn" {
value = module.app_cluster.rapid_metric_log_error_alarm_arn
description = "The arn of the log error alarm metric"
}
}
2 changes: 1 addition & 1 deletion blocks/auth/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ module "auth" {
domain_name = var.domain_name
resource-name-prefix = var.resource-name-prefix
scopes = var.scopes
}
}
4 changes: 2 additions & 2 deletions blocks/auth/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ variable "resource-name-prefix" {
variable "scopes" {
type = list(map(any))
default = [
{
{
scope_name = "CLIENT_APP"
scope_description = "Client app default access"
},
Expand Down Expand Up @@ -61,4 +61,4 @@ variable "scopes" {
scope_description = "Carry out admin actions with regards to the data products"
},
]
}
}
2 changes: 1 addition & 1 deletion blocks/data-workflow/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ output "athena_query_output_bucket_arn" {
output "glue_catalog_arn" {
value = module.data_workflow.glue_catalog_arn
description = "Catalog database arn"
}
}
2 changes: 1 addition & 1 deletion blocks/data-workflow/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ variable "resource-name-prefix" {
variable "aws_region" {
type = string
description = "The region of the AWS Account for the rAPId service"
}
}
2 changes: 1 addition & 1 deletion blocks/ecr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ resource "aws_ecrpublic_repository" "public" {
operating_systems = ["Linux"]
usage_text = "Please see https://github.com/no10ds/rapid-infrastructure/ for details on the use"
}
}
}
2 changes: 1 addition & 1 deletion blocks/ecr/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ output "ecr_private_repo_arn" {
output "ecr_public_repo_arn" {
value = aws_ecrpublic_repository.public.arn
description = "The arn of the public ecr repo"
}
}
2 changes: 1 addition & 1 deletion blocks/iam-config/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ variable "iam_users" {
variable "manual_users" {
type = map(map(list(string)))
description = "A list of users that were created manually into the account"
}
}
2 changes: 1 addition & 1 deletion blocks/pipeline/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "tags" {
value = var.tags
description = "The tags used in the project"
}
}
2 changes: 1 addition & 1 deletion blocks/s3/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ resource "aws_s3_bucket_public_access_block" "logs" {
block_public_acls = true
block_public_policy = true
restrict_public_buckets = true
}
}
2 changes: 1 addition & 1 deletion blocks/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ variable "tags" {
variable "resource-name-prefix" {
type = string
description = "The prefix to add to resources for easier identification"
}
}
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ See [v1.0.0] changes
- Build rapid infrastructure

[Unreleased changes]: https://github.com/no10ds/rapid-infrastructure/compare/v1.0.0...HEAD
[v1.0.0]: https://github.com/no10ds/rapid-infrastructure/compare/5298389...v1.0.0
[v1.0.0]: https://github.com/no10ds/rapid-infrastructure/compare/5298389...v1.0.0
2 changes: 1 addition & 1 deletion changelog_release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ See [vX.X.X] changes

### Security

[vX.X.X]: https://github.com/no10ds/rapid-infrastructure/compare/<previous_version>...HEAD
[vX.X.X]: https://github.com/no10ds/rapid-infrastructure/compare/<previous_version>...HEAD
2 changes: 1 addition & 1 deletion docs/adr/0001_remove_api_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ We have explored different options that could be considered in the future:
- Use OTHER API gateway: They seem to need a license to operate and there were not many at the time.
- [LB](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html) handle redirect to Cognito: The ALB have a way to redirect traffic with the listeners.
- Write custom API gateway in EC2/ECS: Might be an option if only required for proxying.
- Write custom API gateway in [Lambda](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) (Not recommended): The maximum limit is 6Mb, even worse than the API Gateway itself.
- Write custom API gateway in [Lambda](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) (Not recommended): The maximum limit is 6Mb, even worse than the API Gateway itself.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile host="app.diagrams.net" modified="2022-02-22T13:50:04.521Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36" etag="uBM-AIv46vimdkLaZca-" version="16.6.1" type="device"><diagram id="K40IkdBUgf9wXKWKcoKk" name="Page-1">7VvbcqM4EP0aP8ZlEOLyaGM72dlMTWZSO7N5cslGwUowcgn5lq9fCYQvSLljx/FmJqmgRhKi+3T3QQ0NEE6W5wxNx99phJOG3YqWDdBt2Lbt2pb4IyUrJWkBr5DEjESFzNoIrskDVsKWks5IhLOdjpzShJPprnBE0xSP+I4MMUYXu91uabJ71SmKsSa4HqFEl/4hER8XUt/2NvILTOJxeWXLDYozE1R2VneSjVFEF1si0GuAkFHKi6PJMsSJ1F6pl2Jc/5Gz64UxnPKXDAj/XJCH+MK7v6dtPv52A5bx8EzNMkfJTN2wWixflRpgdJZGWE5iNUBnMSYcX0/RSJ5dCKML2ZhPEnVaX1R5Bcw4Xm6J1CLPMZ1gzlaiizp75pe2V5g5CwIlWGws4HlKNt7SPiyFSFk9Xs++UYw4ULox66mXnff//oF+P/RRm8VdbLUvPYOermbDhIyE7Ho2TDHX1EZnPCEpDte4bAn1xAxFRKgmpAllQpbSFO8q0KTf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0wthL50TRtOJvOkqiMRd84qzmkxvKF5plqwafEKiKCc8pkrcLgmqxS6BtqEELM0wlsmRnX3VqvQKefuyc8I2gNpLCrZuApMF6qg3Gy2g15vDkhBkJ2wIx6k4g+sZNucPaYiXkJNMEILRWKlB8XlxAnbEjxgeFr9QdA2lJA+xmtAk83ShpXcTfyzTFapCk8zThZbeTbbKVe8KTTIP6iuujrYMo63KaPHzpc6a1fku8iX34YAjicTmXJcwMVHBoVK5KaCzs05oAehqUUmcuc3/HSNFM9IxhovNheJ9mo5omt6sGSV0Fi2QiAi1PbrZfiU/+eUm5DNF7jpqTuawqBP9LuIoj4uUyfd4TzdJWeIBqmTJpUGgaywjHzRT6Vw6XENRyBManzJ1sL1K1S1o6XXZwxpEp9Ff1OEz5TroeE7wulz3yE7EyeY6Gqck3+evJ7BW0pxnmaIqXJfpdr83qGNXy+zIelU1VDd+uvFUN4ZzyBRnfMfhQ4qhDVMVyKDd9xaG9DqO5drVgrTjVxhd4aVq5JNFIR82fcfzBX0H0AucSrYsS0TriYv6mDbx+2ui5S28oiZac/nKiK3gmLF1qLej9oxBUH2OgdWpjgl1ir/Vhbr2YtDvkdvspmPPvi/SwXgRIsO3bD9nmK1IGjfkJ4RuIrPJkImjOP+oArM5GekPV1808nhpZODAbv+VWyawDVod+L+hkYiPcYpqIy5axILld7/PVUZfT1xEc/PZcBEVNl9fg95/</diagram></mxfile>
<mxfile host="app.diagrams.net" modified="2022-02-22T13:50:04.521Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36" etag="uBM-AIv46vimdkLaZca-" version="16.6.1" type="device"><diagram id="K40IkdBUgf9wXKWKcoKk" name="Page-1">7VvbcqM4EP0aP8ZlEOLyaGM72dlMTWZSO7N5cslGwUowcgn5lq9fCYQvSLljx/FmJqmgRhKi+3T3QQ0NEE6W5wxNx99phJOG3YqWDdBt2Lbt2pb4IyUrJWkBr5DEjESFz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DVod+L+hkYiPcYpqIy5axILld7/PVUZfT1xEc/PZcBEVNl9fg95/</diagram></mxfile>
2 changes: 1 addition & 1 deletion docs/diagrams/infrastructure/ApplicationRuntimeDiagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0bbd0e9

Please sign in to comment.