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
893f08a1
Unverified
Commit
893f08a1
authored
Aug 17, 2020
by
LAKostis
Committed by
GitHub
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Added support for sts:ExternalId in modules/iam-assumable-role (#90)
parent
4b2a189e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
0 deletions
+25
-0
main.tf
examples/iam-assumable-role/main.tf
+2
-0
README.md
modules/iam-assumable-role/README.md
+2
-0
main.tf
modules/iam-assumable-role/main.tf
+9
-0
outputs.tf
modules/iam-assumable-role/outputs.tf
+6
-0
variables.tf
modules/iam-assumable-role/variables.tf
+6
-0
No files found.
examples/iam-assumable-role/main.tf
View file @
893f08a1
...
...
@@ -48,6 +48,8 @@ module "iam_assumable_role_custom" {
role_name
=
"custom"
role_requires_mfa
=
false
role_sts_externalid
=
"some-id-goes-here"
custom_role_policy_arns
=
[
"arn:aws:iam::aws:policy/AmazonCognitoReadOnly"
,
"arn:aws:iam::aws:policy/AlexaForBusinessFullAccess"
,
...
...
modules/iam-assumable-role/README.md
View file @
893f08a1
...
...
@@ -39,6 +39,7 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| role
\_
path | Path of IAM role |
`string`
|
`"/"`
| no |
| role
\_
permissions
\_
boundary
\_
arn | Permissions boundary ARN to use for IAM role |
`string`
|
`""`
| no |
| role
\_
requires
\_
mfa | Whether role requires MFA |
`bool`
|
`true`
| no |
| role
\_
sts
\_
externalid | STS ExternalId condition value to use with a role (when MFA is not required) |
`string`
|
`null`
| no |
| tags | A map of tags to add to IAM role resources |
`map(string)`
|
`{}`
| no |
| trusted
\_
role
\_
actions | Actions of STS |
`list(string)`
|
<pre>
[
<br> "sts:AssumeRole"<br>
]
</pre>
| no |
| trusted
\_
role
\_
arns | ARNs of AWS entities who can assume these roles |
`list(string)`
|
`[]`
| no |
...
...
@@ -49,6 +50,7 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| Name | Description |
|------|-------------|
| role
\_
requires
\_
mfa | Whether IAM role requires MFA |
| role
\_
sts
\_
externalid | STS ExternalId condition value to use with a role |
| this
\_
iam
\_
instance
\_
profile
\_
arn | ARN of IAM instance profile |
| this
\_
iam
\_
instance
\_
profile
\_
name | Name of IAM instance profile |
| this
\_
iam
\_
instance
\_
profile
\_
path | Path of IAM instance profile |
...
...
modules/iam-assumable-role/main.tf
View file @
893f08a1
...
...
@@ -13,6 +13,15 @@ data "aws_iam_policy_document" "assume_role" {
type
=
"Service"
identifiers
=
var
.
trusted_role_services
}
dynamic
"condition"
{
for_each
=
var
.
role_sts_externalid
!
=
null
?
[
true
]
:
[]
content
{
test
=
"StringEquals"
variable
=
"sts:ExternalId"
values
=
[
var
.
role_sts_externalid
]
}
}
}
}
...
...
modules/iam-assumable-role/outputs.tf
View file @
893f08a1
...
...
@@ -32,3 +32,9 @@ output "this_iam_instance_profile_path" {
description
=
"Path of IAM instance profile"
value
=
element
(
concat
(
aws_iam_instance_profile
.
this
.*.
path
,
[
""
]
),
0
)
}
output
"role_sts_externalid"
{
description
=
"STS ExternalId condition value to use with a role"
value
=
var
.
role_sts_externalid
}
modules/iam-assumable-role/variables.tf
View file @
893f08a1
...
...
@@ -125,3 +125,9 @@ variable "role_description" {
default
=
""
}
variable
"role_sts_externalid"
{
description
=
"STS ExternalId condition value to use with a role (when MFA is not required)"
type
=
string
default
=
null
}
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