Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 29, 2025
1 parent 1a332f5 commit 1fc08fb
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
formatter: markdown table

header-from: main.tf
footer-from: ""

sections:
## hide: []
show:
- data-sources
- header
- footer
- inputs
- modules
- outputs
- providers
- requirements
- resources

output:
file: README.md
mode: replace
# mode: inject
# template: |-
# <!-- BEGIN_TF_DOCS -->
# {{ .Content }}
# <!-- END_TF_DOCS -->

## output-values:
## enabled: false
## from: ""
##
## sort:
## enabled: true
## by: name
##
## settings:
## anchor: true
## color: true
## default: true
## description: false
## escape: true
## indent: 2
## required: true
## sensitive: true
## type: true
1 change: 1 addition & 0 deletions rolesanywhere/.terraform-docs.yml
2 changes: 2 additions & 0 deletions rolesanywhere/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -63,3 +64,4 @@
|------|-------------|
| <a name="output_role_arn"></a> [role\_arn](#output\_role\_arn) | Created role ARN |
| <a name="output_role_name"></a> [role\_name](#output\_role\_name) | Created role name |
<!-- END_TF_DOCS -->
54 changes: 54 additions & 0 deletions rolesanywhere/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,57 @@ locals {
role_name = format("%v%v", lookup(local._prefixes, "role", ""), var.role_name)
role_description = var.role_description == "" ? format("%vRole for %v", local.saml_string, var.role_name) : var.role_description
}


/*
* # About aws-iam-role/rolesanywhere
*
* This module will create an IAM RolesAnywhere role, profile, and certificate from ACM-PCA.
*
* ## Policies
*
* When using `attached_policies`, it is important those policy ARNs exist before attempting to use the module
* with `plan` or `apply`. The module is called with an unknown value and it fails if not. You'll need to target your
* first apply with that of the policy like:
*
* ```shell
* tf-apply -target=aws_iam_policy.mypolicy
* ```
*
* # Usage
*
* Creating a role.
* ```hcl
* module "myrole2" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-iam-role.git"
* role_name = "my-role2"
* attached_policies = [ data.aws_iam_policy.aws-managed-readonlyaccess.arn ]
* contact_group_email = "group-email-address@census.gov"
* }
* ```
*
* Creating a with inline policies and a different OU for the certificate
* ```hcl
* data "aws_iam_document_policy" "my-policy-1" {
* statement {
* sid = "NameOfPermissiosn"
* # rest of stuff
* }
* }
*
* module "myrole3" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-iam-role.git"
*
* role_name = "my-role3"
* attached_policies = [ data.aws_iam_policy.aws-managed-readonlyaccess.arn ]
* contact_group_email = "group-email-address@census.gov"
* certificate_conditions = { "x509Subject/OU" = "MyRolesAnywhere" }
* inline_policies = [
* {
* name = "my-policy-1"
* policy = data.aws_iam_policy_document.my-policy-1.json
* }
* ]
* }
* ```
*/

0 comments on commit 1fc08fb

Please sign in to comment.