File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ locals {
2323}
2424
2525resource "aws_iam_role" "this" {
26- name = " github-actions-${ md5 (data. aws_iam_policy_document . this . json )} "
26+ name = coalesce (var . iam_role_name , " github-actions-${ md5 (data. aws_iam_policy_document . this . json )} " )
2727
2828 assume_role_policy = data. aws_iam_policy_document . this . json
2929 max_session_duration = var. max_session_duration
Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/i
6464EOS
6565}
6666
67+ variable "iam_role_name" {
68+ type = string
69+ default = null
70+
71+ description = << EOS
72+ Custom name for the IAM role. If not provided, the name will be automatically
73+ generated as `github-actions-<md5>` based on the assume role policy document.
74+ EOS
75+ }
76+
6777variable "iam_role_tags" {
6878 type = map (string )
6979 default = {}
You can’t perform that action at this time.
0 commit comments