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
90066106
Unverified
Commit
90066106
authored
Feb 22, 2020
by
alemairebe
Committed by
GitHub
Feb 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add instance profile to role sub-module (#46)
parent
6c2919fd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
2 deletions
+31
-2
CHANGELOG.md
CHANGELOG.md
+1
-1
README.md
examples/iam-group-with-assumable-roles-policy/README.md
+1
-1
README.md
modules/iam-assumable-role/README.md
+3
-0
main.tf
modules/iam-assumable-role/main.tf
+6
-0
outputs.tf
modules/iam-assumable-role/outputs.tf
+14
-0
variables.tf
modules/iam-assumable-role/variables.tf
+6
-0
No files found.
CHANGELOG.md
View file @
90066106
<a
name=
"unreleased"
></a>
<a
name=
"unreleased"
></a>
## [Unreleased]
## [Unreleased]
-
iam-assumable-role: add possibility to create an IAM instance profile
<a
name=
"v2.6.0"
></a>
<a
name=
"v2.6.0"
></a>
## [v2.6.0] - 2020-01-27
## [v2.6.0] - 2020-01-27
...
...
examples/iam-group-with-assumable-roles-policy/README.md
View file @
90066106
...
@@ -30,7 +30,7 @@ No input.
...
@@ -30,7 +30,7 @@ No input.
| Name | Description |
| Name | Description |
|------|-------------|
|------|-------------|
| iam
\_
account
\_
id | IAM AWS account id
(this code is managing resources in this account
) |
| iam
\_
account
\_
id | IAM AWS account id
\(
this code is managing resources in this account
\
)
|
| production
\_
account
\_
id | Production AWS account id |
| production
\_
account
\_
id | Production AWS account id |
| this
\_
assumable
\_
roles | List of ARNs of IAM roles which members of IAM group can assume |
| this
\_
assumable
\_
roles | List of ARNs of IAM roles which members of IAM group can assume |
| this
\_
group
\_
users | List of IAM users in IAM group |
| this
\_
group
\_
users | List of IAM users in IAM group |
...
...
modules/iam-assumable-role/README.md
View file @
90066106
...
@@ -39,6 +39,9 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
...
@@ -39,6 +39,9 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| Name | Description |
| Name | Description |
|------|-------------|
|------|-------------|
| role
\_
requires
\_
mfa | Whether IAM role requires MFA |
| role
\_
requires
\_
mfa | Whether IAM role requires MFA |
| 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 |
| this
\_
iam
\_
role
\_
arn | ARN of IAM role |
| this
\_
iam
\_
role
\_
arn | ARN of IAM role |
| this
\_
iam
\_
role
\_
name | Name of IAM role |
| this
\_
iam
\_
role
\_
name | Name of IAM role |
| this
\_
iam
\_
role
\_
path | Path of IAM role |
| this
\_
iam
\_
role
\_
path | Path of IAM role |
...
...
modules/iam-assumable-role/main.tf
View file @
90066106
...
@@ -89,3 +89,9 @@ resource "aws_iam_role_policy_attachment" "readonly" {
...
@@ -89,3 +89,9 @@ resource "aws_iam_role_policy_attachment" "readonly" {
policy_arn
=
var
.
readonly_role_policy_arn
policy_arn
=
var
.
readonly_role_policy_arn
}
}
resource
"aws_iam_instance_profile"
"this"
{
count
=
var
.
create_role
&&
var
.
create_instance_profile
?
1
:
0
name
=
var
.
role_name
path
=
var
.
role_path
role
=
aws_iam_role
.
this
[
0
]
.
name
}
modules/iam-assumable-role/outputs.tf
View file @
90066106
...
@@ -18,3 +18,17 @@ output "role_requires_mfa" {
...
@@ -18,3 +18,17 @@ output "role_requires_mfa" {
value
=
var
.
role_requires_mfa
value
=
var
.
role_requires_mfa
}
}
output
"this_iam_instance_profile_arn"
{
description
=
"ARN of IAM instance profile"
value
=
element
(
concat
(
aws_iam_instance_profile
.
this
.*.
arn
,
[
""
]
),
0
)
}
output
"this_iam_instance_profile_name"
{
description
=
"Name of IAM instance profile"
value
=
element
(
concat
(
aws_iam_instance_profile
.
this
.*.
name
,
[
""
]
),
0
)
}
output
"this_iam_instance_profile_path"
{
description
=
"Path of IAM instance profile"
value
=
element
(
concat
(
aws_iam_instance_profile
.
this
.*.
path
,
[
""
]
),
0
)
}
modules/iam-assumable-role/variables.tf
View file @
90066106
...
@@ -28,6 +28,12 @@ variable "create_role" {
...
@@ -28,6 +28,12 @@ variable "create_role" {
default
=
false
default
=
false
}
}
variable
"create_instance_profile"
{
description
=
"Whether to create an instance profile"
type
=
bool
default
=
false
}
variable
"role_name"
{
variable
"role_name"
{
description
=
"IAM role name"
description
=
"IAM role name"
type
=
string
type
=
string
...
...
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