Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-iam
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-iam
Commits
fc566358
Unverified
Commit
fc566358
authored
Jun 10, 2020
by
Tim Gatzemeier
Committed by
GitHub
Jun 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Allow to set force_detach_policies on roles (#68)
parent
d9ed328d
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
46 additions
and
10 deletions
+46
-10
.pre-commit-config.yaml
.pre-commit-config.yaml
+2
-2
README.md
modules/iam-assumable-role-with-oidc/README.md
+1
-0
main.tf
modules/iam-assumable-role-with-oidc/main.tf
+2
-1
variables.tf
modules/iam-assumable-role-with-oidc/variables.tf
+6
-0
README.md
modules/iam-assumable-role/README.md
+1
-0
main.tf
modules/iam-assumable-role/main.tf
+2
-1
variables.tf
modules/iam-assumable-role/variables.tf
+6
-0
README.md
modules/iam-assumable-roles-with-saml/README.md
+1
-0
main.tf
modules/iam-assumable-roles-with-saml/main.tf
+6
-3
variables.tf
modules/iam-assumable-roles-with-saml/variables.tf
+6
-0
README.md
modules/iam-assumable-roles/README.md
+1
-0
main.tf
modules/iam-assumable-roles/main.tf
+6
-3
variables.tf
modules/iam-assumable-roles/variables.tf
+6
-0
No files found.
.pre-commit-config.yaml
View file @
fc566358
repos
:
-
repo
:
git://github.com/antonbabenko/pre-commit-terraform
rev
:
v1.
27
.0
rev
:
v1.
31
.0
hooks
:
-
id
:
terraform_fmt
-
id
:
terraform_docs
-
repo
:
git://github.com/pre-commit/pre-commit-hooks
rev
:
v
2.5
.0
rev
:
v
3.1
.0
hooks
:
-
id
:
check-merge-conflict
modules/iam-assumable-role-with-oidc/README.md
View file @
fc566358
...
...
@@ -26,6 +26,7 @@ This module supports IAM Roles for kubernetes service accounts as described in t
|------|-------------|------|---------|:--------:|
| aws
\_
account
\_
id | The AWS account ID where the OIDC provider lives, leave empty to use the account fo the AWS provider |
`string`
|
`""`
| no |
| create
\_
role | Whether to create a role |
`bool`
|
`false`
| no |
| force
\_
detach
\_
policies | Whether policies should be detached from this role when destroying |
`bool`
|
`false`
| no |
| max
\_
session
\_
duration | Maximum CLI/API session duration in seconds between 3600 and 43200 |
`number`
|
`3600`
| no |
| oidc
\_
fully
\_
qualified
\_
subjects | The fully qualified OIDC subjects to be added to the role policy |
`list(string)`
|
`[]`
| no |
| oidc
\_
subjects
\_
with
\_
wildcards | The OIDC subject using wildcards to be added to the role policy |
`list(string)`
|
`[]`
| no |
...
...
modules/iam-assumable-role-with-oidc/main.tf
View file @
fc566358
...
...
@@ -47,6 +47,7 @@ resource "aws_iam_role" "this" {
path
=
var
.
role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
role_permissions_boundary_arn
assume_role_policy
=
join
(
""
,
data
.
aws_iam_policy_document
.
assume_role_with_oidc
.*.
json
)
...
...
modules/iam-assumable-role-with-oidc/variables.tf
View file @
fc566358
...
...
@@ -63,3 +63,9 @@ variable "oidc_subjects_with_wildcards" {
default
=
[]
}
variable
"force_detach_policies"
{
description
=
"Whether policies should be detached from this role when destroying"
type
=
bool
default
=
false
}
modules/iam-assumable-role/README.md
View file @
fc566358
...
...
@@ -29,6 +29,7 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| create
\_
instance
\_
profile | Whether to create an instance profile |
`bool`
|
`false`
| no |
| create
\_
role | Whether to create a role |
`bool`
|
`false`
| no |
| custom
\_
role
\_
policy
\_
arns | List of ARNs of IAM policies to attach to IAM role |
`list(string)`
|
`[]`
| no |
| force
\_
detach
\_
policies | Whether policies should be detached from this role when destroying |
`bool`
|
`false`
| no |
| max
\_
session
\_
duration | Maximum CLI/API session duration in seconds between 3600 and 43200 |
`number`
|
`3600`
| no |
| mfa
\_
age | Max age of valid MFA (in seconds) for roles which require MFA |
`number`
|
`86400`
| no |
| poweruser
\_
role
\_
policy
\_
arn | Policy ARN to use for poweruser role |
`string`
|
`"arn:aws:iam::aws:policy/PowerUserAccess"`
| no |
...
...
modules/iam-assumable-role/main.tf
View file @
fc566358
...
...
@@ -54,6 +54,7 @@ resource "aws_iam_role" "this" {
max_session_duration
=
var
.
max_session_duration
description
=
var
.
role_description
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
role_permissions_boundary_arn
assume_role_policy
=
var
.
role_requires_mfa
?
data
.
aws_iam_policy_document
.
assume_role_with_mfa
.
json
:
data
.
aws_iam_policy_document
.
assume_role
.
json
...
...
modules/iam-assumable-role/variables.tf
View file @
fc566358
...
...
@@ -113,6 +113,12 @@ variable "attach_readonly_policy" {
default
=
false
}
variable
"force_detach_policies"
{
description
=
"Whether policies should be detached from this role when destroying"
type
=
bool
default
=
false
}
variable
"role_description"
{
description
=
"IAM Role description"
type
=
string
...
...
modules/iam-assumable-roles-with-saml/README.md
View file @
fc566358
...
...
@@ -33,6 +33,7 @@ Creates predefined IAM roles (admin, poweruser and readonly) which can be assume
| create
\_
admin
\_
role | Whether to create admin role |
`bool`
|
`false`
| no |
| create
\_
poweruser
\_
role | Whether to create poweruser role |
`bool`
|
`false`
| no |
| create
\_
readonly
\_
role | Whether to create readonly role |
`bool`
|
`false`
| no |
| force
\_
detach
\_
policies | Whether policies should be detached from this role when destroying |
`bool`
|
`false`
| no |
| max
\_
session
\_
duration | Maximum CLI/API session duration in seconds between 3600 and 43200 |
`number`
|
`3600`
| no |
| poweruser
\_
role
\_
name | IAM role with poweruser access |
`string`
|
`"poweruser"`
| no |
| poweruser
\_
role
\_
path | Path of poweruser IAM role |
`string`
|
`"/"`
| no |
...
...
modules/iam-assumable-roles-with-saml/main.tf
View file @
fc566358
...
...
@@ -25,6 +25,7 @@ resource "aws_iam_role" "admin" {
path
=
var
.
admin_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
admin_role_permissions_boundary_arn
assume_role_policy
=
data
.
aws_iam_policy_document
.
assume_role_with_saml
.
json
...
...
@@ -47,6 +48,7 @@ resource "aws_iam_role" "poweruser" {
path
=
var
.
poweruser_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
poweruser_role_permissions_boundary_arn
assume_role_policy
=
data
.
aws_iam_policy_document
.
assume_role_with_saml
.
json
...
...
@@ -69,6 +71,7 @@ resource "aws_iam_role" "readonly" {
path
=
var
.
readonly_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
readonly_role_permissions_boundary_arn
assume_role_policy
=
data
.
aws_iam_policy_document
.
assume_role_with_saml
.
json
...
...
modules/iam-assumable-roles-with-saml/variables.tf
View file @
fc566358
...
...
@@ -130,3 +130,9 @@ variable "max_session_duration" {
type
=
number
default
=
3600
}
variable
"force_detach_policies"
{
description
=
"Whether policies should be detached from this role when destroying"
type
=
bool
default
=
false
}
modules/iam-assumable-roles/README.md
View file @
fc566358
...
...
@@ -31,6 +31,7 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| create
\_
admin
\_
role | Whether to create admin role |
`bool`
|
`false`
| no |
| create
\_
poweruser
\_
role | Whether to create poweruser role |
`bool`
|
`false`
| no |
| create
\_
readonly
\_
role | Whether to create readonly role |
`bool`
|
`false`
| no |
| force
\_
detach
\_
policies | Whether policies should be detached from this role when destroying |
`bool`
|
`false`
| no |
| max
\_
session
\_
duration | Maximum CLI/API session duration in seconds between 3600 and 43200 |
`number`
|
`3600`
| no |
| mfa
\_
age | Max age of valid MFA (in seconds) for roles which require MFA |
`number`
|
`86400`
| no |
| poweruser
\_
role
\_
name | IAM role with poweruser access |
`string`
|
`"poweruser"`
| no |
...
...
modules/iam-assumable-roles/main.tf
View file @
fc566358
...
...
@@ -54,6 +54,7 @@ resource "aws_iam_role" "admin" {
path
=
var
.
admin_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
admin_role_permissions_boundary_arn
assume_role_policy
=
var
.
admin_role_requires_mfa
?
data
.
aws_iam_policy_document
.
assume_role_with_mfa
.
json
:
data
.
aws_iam_policy_document
.
assume_role
.
json
...
...
@@ -76,6 +77,7 @@ resource "aws_iam_role" "poweruser" {
path
=
var
.
poweruser_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
poweruser_role_permissions_boundary_arn
assume_role_policy
=
var
.
poweruser_role_requires_mfa
?
data
.
aws_iam_policy_document
.
assume_role_with_mfa
.
json
:
data
.
aws_iam_policy_document
.
assume_role
.
json
...
...
@@ -98,6 +100,7 @@ resource "aws_iam_role" "readonly" {
path
=
var
.
readonly_role_path
max_session_duration
=
var
.
max_session_duration
force_detach_policies
=
var
.
force_detach_policies
permissions_boundary
=
var
.
readonly_role_permissions_boundary_arn
assume_role_policy
=
var
.
readonly_role_requires_mfa
?
data
.
aws_iam_policy_document
.
assume_role_with_mfa
.
json
:
data
.
aws_iam_policy_document
.
assume_role
.
json
...
...
modules/iam-assumable-roles/variables.tf
View file @
fc566358
...
...
@@ -151,3 +151,9 @@ variable "max_session_duration" {
default
=
3600
}
variable
"force_detach_policies"
{
description
=
"Whether policies should be detached from this role when destroying"
type
=
bool
default
=
false
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment