Skip to content

Commit 972fa3d

Browse files
updated references and examples
1 parent 187ef05 commit 972fa3d

File tree

12 files changed

+136
-135
lines changed

12 files changed

+136
-135
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ repos:
2626
files: ^examples/ # only scan `examples/*` which are the implementation
2727
args:
2828
- --args=--config-file=__GIT_WORKING_DIR__/tfsec.yaml
29-
- --args=--concise-output
29+
- --args=--concise-output

.tflint.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ rule "terraform_naming_convention" {
4141
locals {
4242
format = "none"
4343
}
44-
}
44+
}

IAM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ The Policy required to deploy this module:
2828
},
2929
]
3030
}
31-
```
31+
```

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ The required IAM permissions to create resources from this module can be found [
7272

7373
| Name | Version |
7474
|------|---------|
75-
| <a name="provider_archive"></a> [archive](#provider\_archive) | 2.4.0 |
75+
| <a name="provider_archive"></a> [archive](#provider\_archive) | n/a |
7676
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.13.1 |
77-
| <a name="provider_random"></a> [random](#provider\_random) | 3.5.1 |
77+
| <a name="provider_random"></a> [random](#provider\_random) | n/a |
7878

7979
## Modules
8080

@@ -152,6 +152,7 @@ The required IAM permissions to create resources from this module can be found [
152152
| <a name="input_replicate_source_db"></a> [replicate\_source\_db](#input\_replicate\_source\_db) | Specifies that this resource is a replicate database, and uses the specified value as the source database identifier | `string` | `null` | no |
153153
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted. If set to true, no DB snapshot is created. If set to false, a DB snapshot is created before the DB instance is deleted, using the value from final\_snapshot\_identifier | `bool` | `true` | no |
154154
| <a name="input_slack_channel"></a> [slack\_channel](#input\_slack\_channel) | The Slack channel where notifications will be posted. | `string` | `""` | no |
155+
| <a name="input_slack_notification_enabled"></a> [slack\_notification\_enabled](#input\_slack\_notification\_enabled) | Whether to enable/disable slack notification. | `bool` | `false` | no |
155156
| <a name="input_slack_username"></a> [slack\_username](#input\_slack\_username) | The username to use when sending notifications to Slack. | `string` | `""` | no |
156157
| <a name="input_slack_webhook_url"></a> [slack\_webhook\_url](#input\_slack\_webhook\_url) | The Slack Webhook URL where notifications will be sent. | `string` | `""` | no |
157158
| <a name="input_snapshot_identifier"></a> [snapshot\_identifier](#input\_snapshot\_identifier) | Specifies whether to create the database from a snapshot. Use the snapshot ID found in the RDS console, e.g., rds:production-2015-06-26-06-05 | `string` | `null` | no |
@@ -213,4 +214,4 @@ We believe that the key to success in the digital age is the ability to deliver
213214

214215
We provide [support](https://squareops.com/contact-us/) on all of our projects, no matter how small or large they may be.
215216

216-
To find more information about our company, visit [squareops.com](https://squareops.com/), follow us on [Linkedin](https://www.linkedin.com/company/squareops-technologies-pvt-ltd/), or fill out a [job application](https://squareops.com/careers/). If you have any questions or would like assistance with your cloud strategy and implementation, please don't hesitate to [contact us](https://squareops.com/contact-us/).
217+
To find more information about our company, visit [squareops.com](https://squareops.com/), follow us on [Linkedin](https://www.linkedin.com/company/squareops-technologies-pvt-ltd/), or fill out a [job application](https://squareops.com/careers/). If you have any questions or would like assistance with your cloud strategy and implementation, please don't hesitate to [contact us](https://squareops.com/contact-us/).

examples/complete-psql-replica/main.tf

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
locals {
2-
region = "us-east-2"
3-
name = "postgresql"
4-
family = "postgres15"
5-
vpc_cidr = "10.20.0.0/16"
6-
environment = "prod"
7-
storage_type = "gp3"
8-
engine_version = "15.2"
9-
instance_class = "db.m5d.large"
10-
replica_enable = true
11-
replica_count = 1
12-
current_identity = data.aws_caller_identity.current.arn
2+
region = "us-east-2"
3+
name = "postgresql"
4+
family = "postgres15"
5+
vpc_cidr = "10.20.0.0/16"
6+
environment = "prod"
7+
storage_type = "gp3"
8+
engine_version = "15.2"
9+
instance_class = "db.m5d.large"
10+
replica_enable = true
11+
replica_count = 1
12+
current_identity = data.aws_caller_identity.current.arn
1313
allowed_security_groups = ["sg-0a680afd35"]
1414
additional_tags = {
1515
Owner = "Organization_Name"
@@ -32,11 +32,11 @@ module "kms" {
3232
multi_region = true
3333

3434
# Policy
35-
enable_default_policy = true
36-
key_owners = [local.current_identity]
37-
key_administrators = [local.current_identity]
38-
key_users = [local.current_identity]
39-
key_service_users = [local.current_identity]
35+
enable_default_policy = true
36+
key_owners = [local.current_identity]
37+
key_administrators = [local.current_identity]
38+
key_users = [local.current_identity]
39+
key_service_users = [local.current_identity]
4040
key_statements = [
4141
{
4242
sid = "CloudWatchLogs"
@@ -66,17 +66,17 @@ module "kms" {
6666

6767

6868
module "vpc" {
69-
source = "squareops/vpc/aws"
70-
name = local.name
71-
vpc_cidr = local.vpc_cidr
72-
environment = local.environment
73-
availability_zones = ["us-east-2a", "us-east-2b"]
74-
public_subnet_enabled = true
75-
auto_assign_public_ip = true
76-
intra_subnet_enabled = false
77-
private_subnet_enabled = true
78-
one_nat_gateway_per_az = false
79-
database_subnet_enabled = true
69+
source = "squareops/vpc/aws"
70+
name = local.name
71+
vpc_cidr = local.vpc_cidr
72+
environment = local.environment
73+
availability_zones = ["us-east-2a", "us-east-2b"]
74+
public_subnet_enabled = true
75+
auto_assign_public_ip = true
76+
intra_subnet_enabled = false
77+
private_subnet_enabled = true
78+
one_nat_gateway_per_az = false
79+
database_subnet_enabled = true
8080
}
8181

8282
module "rds-pg" {

examples/complete-psql-replica/output.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ output "instance_username" {
2525
output "instance_password" {
2626
description = "Password for accessing the database (Note: Terraform does not track this password after initial creation)."
2727
value = module.rds-pg.db_instance_password
28-
sensitive = false
28+
sensitive = false
2929
}
3030

3131
output "security_group" {
@@ -45,4 +45,4 @@ output "subnet_group_id" {
4545

4646
output "master_user_secret_arn" {
4747
value = module.rds-pg.master_credential_secret_arn
48-
}
48+
}

examples/complete/main.tf

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
locals {
2-
region = "us-east-2"
3-
name = "postgresql"
4-
family = "postgres15"
5-
vpc_cidr = "10.20.0.0/16"
6-
environment = "prod"
7-
engine_version = "15.2"
8-
instance_class = "db.m5d.large"
9-
storage_type = "gp3"
10-
current_identity = data.aws_caller_identity.current.arn
2+
region = "us-east-2"
3+
name = "postgresql"
4+
family = "postgres15"
5+
vpc_cidr = "10.20.0.0/16"
6+
environment = "prod"
7+
engine_version = "15.2"
8+
instance_class = "db.m5d.large"
9+
storage_type = "gp3"
10+
current_identity = data.aws_caller_identity.current.arn
1111
allowed_security_groups = ["sg-0a680afd35"]
1212
additional_tags = {
1313
Owner = "Organization_Name"
@@ -30,11 +30,11 @@ module "kms" {
3030
multi_region = true
3131

3232
# Policy
33-
enable_default_policy = true
34-
key_owners = [local.current_identity]
35-
key_administrators = [local.current_identity]
36-
key_users = [local.current_identity]
37-
key_service_users = [local.current_identity]
33+
enable_default_policy = true
34+
key_owners = [local.current_identity]
35+
key_administrators = [local.current_identity]
36+
key_users = [local.current_identity]
37+
key_service_users = [local.current_identity]
3838
key_statements = [
3939
{
4040
sid = "Allow use of the key"
@@ -49,22 +49,22 @@ module "kms" {
4949

5050
principals = [
5151
{
52-
type = "Service"
52+
type = "Service"
5353
identifiers = [
5454
"monitoring.rds.amazonaws.com",
5555
"rds.amazonaws.com",
5656
]
5757
}
5858
]
5959
},
60-
{
61-
sid = "Enable IAM User Permissions"
62-
actions = ["kms:*"]
60+
{
61+
sid = "Enable IAM User Permissions"
62+
actions = ["kms:*"]
6363
resources = ["*"]
6464

6565
principals = [
6666
{
67-
type = "AWS"
67+
type = "AWS"
6868
identifiers = [
6969
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:root",
7070
data.aws_caller_identity.current.arn,
@@ -82,17 +82,17 @@ module "kms" {
8282

8383

8484
module "vpc" {
85-
source = "squareops/vpc/aws"
86-
name = local.name
87-
vpc_cidr = local.vpc_cidr
88-
environment = local.environment
89-
availability_zones = ["us-east-2a", "us-east-2b"]
90-
public_subnet_enabled = true
91-
auto_assign_public_ip = true
92-
intra_subnet_enabled = false
93-
private_subnet_enabled = true
94-
one_nat_gateway_per_az = false
95-
database_subnet_enabled = true
85+
source = "squareops/vpc/aws"
86+
name = local.name
87+
vpc_cidr = local.vpc_cidr
88+
environment = local.environment
89+
availability_zones = ["us-east-2a", "us-east-2b"]
90+
public_subnet_enabled = true
91+
auto_assign_public_ip = true
92+
intra_subnet_enabled = false
93+
private_subnet_enabled = true
94+
one_nat_gateway_per_az = false
95+
database_subnet_enabled = true
9696
}
9797

9898
module "rds-pg" {

examples/complete/output.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ output "instance_username" {
2525
output "instance_password" {
2626
description = "Password for accessing the database (Note: Terraform does not track this password after initial creation)."
2727
value = module.rds-pg.db_instance_password
28-
sensitive = false
28+
sensitive = false
2929
}
3030

3131
output "security_group" {
@@ -45,4 +45,4 @@ output "subnet_group_id" {
4545

4646
output "master_user_secret_arn" {
4747
value = module.rds-pg.master_credential_secret_arn
48-
}
48+
}

lambda/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ No requirements.
1616

1717
| Name | Version |
1818
|------|---------|
19-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.17.0 |
19+
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
2020

2121
## Modules
2222

@@ -56,4 +56,4 @@ No modules.
5656
| <a name="output_exec_role_id"></a> [exec\_role\_id](#output\_exec\_role\_id) | The ID of the Function's IAM Role. |
5757
| <a name="output_invoke_arn"></a> [invoke\_arn](#output\_invoke\_arn) | The ARN to be used for invoking Lambda Function from API Gateway. |
5858
| <a name="output_name"></a> [name](#output\_name) | The name of the Lambda Function. |
59-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
59+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

lambda/sns_slack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def format_cloudwatch_alarm_message(event):
3333
return message
3434

3535
def lambda_handler(event, context):
36-
url = slack_url
36+
url = slack_url
3737
msg = {
3838
"channel": slack_channel,
3939
"username": slack_user,
@@ -43,9 +43,9 @@ def lambda_handler(event, context):
4343

4444
encoded_msg = json.dumps(msg).encode('utf-8')
4545
resp = http.request('POST', url, body=encoded_msg)
46-
46+
4747
print({
4848
"message": msg,
4949
"status_code": resp.status,
5050
"response": resp.data
51-
})
51+
})

0 commit comments

Comments
 (0)