Skip to content

Commit 9df4395

Browse files
author
Eduardo Lopez
authored
[feature] Allow specifying aws-iam-role max_session_duration (#299)
1 parent 06c61e5 commit 9df4395

File tree

54 files changed

+272
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+272
-252
lines changed

aws-aurora-mysql/variables.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ variable "publicly_accessible" {
9292
}
9393

9494
variable "rds_cluster_parameters" {
95-
type = list
95+
type = list(any)
9696
description = "Cluster params you can set. [Doc](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html#AuroraMySQL.Reference.Parameters.Cluster)"
9797

9898
default = [
@@ -110,7 +110,7 @@ variable "rds_cluster_parameters" {
110110
}
111111

112112
variable "db_parameters" {
113-
type = list
113+
type = list(any)
114114
description = "Instance params you can set. [Doc](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html#AuroraMySQL.Reference.Parameters.Instance)"
115115

116116
default = [
@@ -175,13 +175,13 @@ variable "params_engine_version" {
175175
default = "5.7"
176176
}
177177

178-
variable ca_cert_identifier {
178+
variable "ca_cert_identifier" {
179179
type = string
180180
description = "Identifier for the certificate authority. rds-ca-2019 is the latest available version."
181181
default = "rds-ca-2019"
182182
}
183183

184-
variable auto_minor_version_upgrade {
184+
variable "auto_minor_version_upgrade" {
185185
type = bool
186186
description = "Set the databases to automatically upgrade minor versions."
187187
default = true

aws-aurora-postgres/variables.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ variable "apply_immediately" {
8686
}
8787

8888
variable "rds_cluster_parameters" {
89-
type = list
89+
type = list(any)
9090
description = "Cluster params you can set. [Doc](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Reference.html#AuroraPostgreSQL.Reference.Parameters.Cluster)"
9191
default = []
9292
}
9393

9494
variable "db_parameters" {
95-
type = list
95+
type = list(any)
9696
description = "Instance params you can set. [Doc](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Reference.html#AuroraPostgreSQL.Reference.Parameters.Instance)"
9797
default = []
9898
}
@@ -119,13 +119,13 @@ variable "iam_database_authentication_enabled" {
119119
default = false
120120
}
121121

122-
variable ca_cert_identifier {
122+
variable "ca_cert_identifier" {
123123
type = string
124124
description = "Identifier for the certificate authority."
125125
default = "rds-ca-2019"
126126
}
127127

128-
variable auto_minor_version_upgrade {
128+
variable "auto_minor_version_upgrade" {
129129
type = bool
130130
description = "Set the databases to automatically upgrade minor versions."
131131
default = true

aws-aurora/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ resource "aws_security_group" "rds" {
1717

1818
vpc_id = var.vpc_id
1919

20-
dynamic ingress {
20+
dynamic "ingress" {
2121
for_each = var.ingress_cidr_blocks
2222
content {
2323
from_port = var.port
@@ -27,7 +27,7 @@ resource "aws_security_group" "rds" {
2727
}
2828
}
2929

30-
dynamic ingress {
30+
dynamic "ingress" {
3131
for_each = var.ingress_security_groups
3232
content {
3333
from_port = var.port

aws-aurora/variables.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ variable "publicly_accessible" {
7777
}
7878

7979
variable "rds_cluster_parameters" {
80-
type = list
80+
type = list(any)
8181

8282
default = []
8383
}
8484

8585
variable "db_parameters" {
86-
type = list
86+
type = list(any)
8787

8888
default = []
8989
}
@@ -116,7 +116,7 @@ variable "iam_database_authentication_enabled" {
116116
}
117117

118118
variable "enabled_cloudwatch_logs_exports" {
119-
type = list
119+
type = list(any)
120120
default = []
121121
}
122122

@@ -130,13 +130,13 @@ variable "db_deletion_protection" {
130130
default = false
131131
}
132132

133-
variable ca_cert_identifier {
133+
variable "ca_cert_identifier" {
134134
type = string
135135
description = "Identifier for the certificate authority. Use rds-ca-2019 for anything new."
136136
default = "rds-ca-2019"
137137
}
138138

139-
variable auto_minor_version_upgrade {
139+
variable "auto_minor_version_upgrade" {
140140
type = bool
141141
description = "Set the databases to automatically upgrade minor versions."
142142
default = true

aws-cloudfront-domain-redirect/main.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ locals {
77
}
88
}
99

10-
resource aws_s3_bucket redirect_bucket {
10+
resource "aws_s3_bucket" "redirect_bucket" {
1111
bucket = "redirect-${var.source_domain}-to-${var.target_domain}"
1212
website {
1313
redirect_all_requests_to = "https://${var.target_domain}"
@@ -36,7 +36,7 @@ module "cert" {
3636
service = var.service
3737
}
3838

39-
resource aws_cloudfront_distribution cf {
39+
resource "aws_cloudfront_distribution" "cf" {
4040
enabled = true
4141
comment = "Redirect requests from ${var.source_domain} to ${var.target_domain}."
4242

@@ -93,7 +93,7 @@ resource aws_cloudfront_distribution cf {
9393
tags = local.tags
9494
}
9595

96-
resource aws_route53_record alias_ipv4 {
96+
resource "aws_route53_record" "alias_ipv4" {
9797
zone_id = var.source_domain_zone_id
9898
name = var.source_domain
9999
type = "A"
@@ -105,7 +105,7 @@ resource aws_route53_record alias_ipv4 {
105105
}
106106
}
107107

108-
resource aws_route53_record alias_ipv6 {
108+
resource "aws_route53_record" "alias_ipv6" {
109109
zone_id = var.source_domain_zone_id
110110
name = var.source_domain
111111
type = "AAAA"
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
variable project {
1+
variable "project" {
22
type = string
33
description = "Project for tagging and naming. See [doc](../README.md#consistent-tagging)"
44
}
55

6-
variable env {
6+
variable "env" {
77
type = string
88
description = "Env for tagging and naming. See [doc](../README.md#consistent-tagging)"
99
}
1010

11-
variable service {
11+
variable "service" {
1212
type = string
1313
description = "Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
1414
}
1515

16-
variable owner {
16+
variable "owner" {
1717
type = string
1818
description = "Owner for tagging and naming. See [doc](../README.md#consistent-tagging)"
1919
}
2020

21-
variable source_domain {
21+
variable "source_domain" {
2222
type = string
2323
description = "The domain that will be redirected from."
2424
}
2525

26-
variable source_domain_zone_id {
26+
variable "source_domain_zone_id" {
2727
type = string
2828
description = "Route53 zone id for the source domain."
2929
}
3030

31-
variable target_domain {
31+
variable "target_domain" {
3232
type = string
3333
description = "The domain that will be redirected to."
3434
}

aws-cloudfront-logs-bucket/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ variable "lifecycle_rules" {
5858
]
5959
}
6060

61-
variable public_access_block {
61+
variable "public_access_block" {
6262
type = bool
6363
default = true
6464
}

aws-cloudwatch-log-retention-manager/main.tf

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010
lambda_name = "${var.project}-${var.env}-${var.service}-cloudwatch-retention"
1111
}
1212

13-
data archive_file lambda {
13+
data "archive_file" "lambda" {
1414
type = "zip"
1515
output_path = "${path.module}/build/lambda.zip"
1616
source {
@@ -60,7 +60,7 @@ data archive_file lambda {
6060
}
6161
}
6262

63-
module lambda {
63+
module "lambda" {
6464
source = "../aws-lambda-function"
6565

6666
function_name = local.lambda_name
@@ -78,26 +78,26 @@ module lambda {
7878
service = var.service
7979
}
8080

81-
resource aws_cloudwatch_event_rule trigger {
81+
resource "aws_cloudwatch_event_rule" "trigger" {
8282
name = "${var.project}-${var.env}-${var.service}-retention-trigger"
8383
schedule_expression = "rate(12 hours)"
8484
tags = local.tags
8585
}
8686

87-
resource aws_cloudwatch_event_target trigger {
87+
resource "aws_cloudwatch_event_target" "trigger" {
8888
rule = aws_cloudwatch_event_rule.trigger.id
8989
arn = module.lambda.arn
9090
}
9191

92-
resource aws_lambda_permission permission {
92+
resource "aws_lambda_permission" "permission" {
9393
statement_id = "AllowScheduledLambdaExecution"
9494
action = "lambda:InvokeFunction"
9595
function_name = local.lambda_name
9696
principal = "events.amazonaws.com"
9797
source_arn = aws_cloudwatch_event_rule.trigger.arn
9898
}
9999

100-
data aws_iam_policy_document policy {
100+
data "aws_iam_policy_document" "policy" {
101101
statement {
102102
effect = "Allow"
103103
actions = [
@@ -110,7 +110,7 @@ data aws_iam_policy_document policy {
110110
}
111111
}
112112

113-
resource aws_iam_role_policy policy {
113+
resource "aws_iam_role_policy" "policy" {
114114
name = "allow-managing-log-groups"
115115
role = module.lambda.role_id
116116
policy = data.aws_iam_policy_document.policy.json
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
variable project {
1+
variable "project" {
22
type = string
33
description = "Project for tagging and naming. See [doc](../README.md#consistent-tagging)"
44
}
55

6-
variable env {
6+
variable "env" {
77
type = string
88
description = "Env for tagging and naming. See [doc](../README.md#consistent-tagging)"
99
}
1010

11-
variable service {
11+
variable "service" {
1212
type = string
1313
description = "Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
1414
}
1515

16-
variable owner {
16+
variable "owner" {
1717
type = string
1818
description = "Owner for tagging and naming. See [doc](../README.md#consistent-tagging)"
1919
}
2020

21-
variable maximum_retention {
21+
variable "maximum_retention" {
2222
type = number
2323
description = "The default days of retention to apply to untagged Cloudwatch Log Groups."
2424
}

aws-iam-group-assume-role/variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "target_accounts" {
2-
type = list
2+
type = list(any)
33
description = "List of accounts in which this role should be assume-able."
44
}
55

@@ -15,7 +15,7 @@ variable "group_name" {
1515
}
1616

1717
variable "users" {
18-
type = list
18+
type = list(any)
1919
default = []
2020
description = "List of user's names who should be added to this group."
2121
}
@@ -29,5 +29,5 @@ variable "target_role" {
2929
# Pseudo depends_on because Terraform modules do not support depends_on
3030
variable "dependencies" {
3131
default = []
32-
type = list
32+
type = list(any)
3333
}

aws-iam-role-bless/variables.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ variable "source_account_ids" {
1515
}
1616

1717
variable "bless_lambda_arns" {
18-
type = list
18+
type = list(any)
1919
description = "List of bless lambda arns"
2020
}
2121

@@ -25,22 +25,22 @@ variable "iam_path" {
2525
description = "IAM path"
2626
}
2727

28-
variable project {
28+
variable "project" {
2929
type = string
3030
description = "Project for tagging and naming. See [doc](../README.md#consistent-tagging)"
3131
}
3232

33-
variable env {
33+
variable "env" {
3434
type = string
3535
description = "Env for tagging and naming. See [doc](../README.md#consistent-tagging)"
3636
}
3737

38-
variable service {
38+
variable "service" {
3939
type = string
4040
description = "Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
4141
}
4242

43-
variable owner {
43+
variable "owner" {
4444
type = string
4545
description = "Owner for tagging and naming. See [doc](../README.md#consistent-tagging)"
4646
}

aws-iam-role-cloudfront-poweruser/variables.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ variable "role_name" {
44
}
55

66
variable "s3_bucket_prefixes" {
7-
type = list
7+
type = list(any)
88
description = "Limits role permissions to buckets with specific prefixes. Empty for all buckets."
99

1010
default = [
@@ -35,22 +35,22 @@ variable "saml_idp_arn" {
3535
description = "The AWS SAML IDP arn to establish a trust relationship. Ignored if empty or not provided."
3636
}
3737

38-
variable project {
38+
variable "project" {
3939
type = string
4040
description = "Project for tagging and naming. See [doc](../README.md#consistent-tagging)"
4141
}
4242

43-
variable env {
43+
variable "env" {
4444
type = string
4545
description = "Env for tagging and naming. See [doc](../README.md#consistent-tagging)"
4646
}
4747

48-
variable service {
48+
variable "service" {
4949
type = string
5050
description = "Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
5151
}
5252

53-
variable owner {
53+
variable "owner" {
5454
type = string
5555
description = "Owner for tagging and naming. See [doc](../README.md#consistent-tagging)"
5656
}

0 commit comments

Comments
 (0)