Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying aws_iam_role#max_session_duration #12

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.2.0

- [Allow specifying `aws_iam_role#max_session_duration`](https://github.com/babbel/terraform-aws-iam-role-for-github-repository/pull/12)

## v1.1.0

- [Relax version constraints for modules](https://github.com/babbel/terraform-aws-iam-role-for-github-repository/pull/7)
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ locals {
resource "aws_iam_role" "this" {
name = "github-actions-${md5(data.aws_iam_policy_document.this.json)}"

assume_role_policy = data.aws_iam_policy_document.this.json
assume_role_policy = data.aws_iam_policy_document.this.json
max_session_duration = var.max_session_duration

tags = var.tags
}
Expand Down
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/i
EOS
}

variable "max_session_duration" {
type = number
default = null

description = <<EOS
Maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role#max_session_duration
EOS
}

variable "openid_audience" {
type = string
default = "sts.amazonaws.com"
Expand Down