Modernisation Platform Github Web Identity Assumable Role Module

July 11, 2025 ยท View on GitHub

repo standards badge

Usage


module "github-webidentity-assumable-role" {

  source = "https://github.com/ministryofjustice/modernisation-platform-github-oidc-role"

  github_repositories         = ["ministryofjustice/modernisation-platform-environments:*","ministryofjustice/modernisation-platform:*"]
  role_name                   = "modernisation-platform-github-actions"
  policy_arns                 = ["arn:aws:iam::aws:policy/AdministratorAccess"]
  policy_jsons                = [data.aws_iam_policy_document.first-policy.json, data.aws_iam_policy_document.second-policy.json]
  tags                        = local.tags

}

Looking for issues?

If you're looking to raise an issue with this module, please create a new issue in the Modernisation Platform repository.

Requirements

NameVersion
terraform~> 1.0
aws~> 6.0

Providers

NameVersion
aws~> 6.0

Modules

No modules.

Resources

NameType
aws_iam_policy.additional-permissionsresource
aws_iam_role.thisresource
aws_iam_role_policy_attachment.additional-permissionsresource
aws_iam_role_policy_attachment.policy-arnsresource
aws_caller_identity.currentdata source
aws_iam_policy_document.combined-role-policydata source
aws_iam_policy_document.thisdata source

Inputs

NameDescriptionTypeDefaultRequired
github_repositoriesThe github repositories, for example ["ministryofjustice/modernisation-platform-environments:*"]list(string)n/ayes
max_session_durationThe maximum session duration (in seconds) that you want to set for the specified role. Defaults to 3600number3600no
policy_arnsList of policy ARNs for the assumable role. Defaults to ["arn:aws:iam::aws:policy/ReadOnlyAccess"]list(string)
[
"arn:aws:iam::aws:policy/ReadOnlyAccess"
]
no
policy_jsonsList of policy jsons for the assumable role. Defaults to []list(string)[]no
role_nameName of rolestringn/ayes
subject_claimGithub OIDC subject claim, defaults to *string"*"no
tagsCommon tags to be used by all resourcesmap(string)n/ayes

Outputs

NameDescription
roleIAM Role created for use by the OIDC provider
role_additional_permissions_policyAdditional role policy for the role
role_trust_policyAssume role policy for the role