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
5825fb4f
Unverified
Commit
5825fb4f
authored
Sep 08, 2020
by
Ilia Lazebnik
Committed by
GitHub
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: simplify count statements (#93)
parent
591bef48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
main.tf
modules/iam-assumable-role-with-oidc/main.tf
+1
-1
main.tf
modules/iam-assumable-role/main.tf
+1
-1
main.tf
modules/iam-group-with-policies/main.tf
+3
-3
No files found.
modules/iam-assumable-role-with-oidc/main.tf
View file @
5825fb4f
...
@@ -66,7 +66,7 @@ resource "aws_iam_role" "this" {
...
@@ -66,7 +66,7 @@ resource "aws_iam_role" "this" {
}
}
resource
"aws_iam_role_policy_attachment"
"custom"
{
resource
"aws_iam_role_policy_attachment"
"custom"
{
count
=
var
.
create_role
&&
length
(
var
.
role_policy_arns
)
>
0
?
length
(
var
.
role_policy_arns
)
:
0
count
=
var
.
create_role
?
length
(
var
.
role_policy_arns
)
:
0
role
=
join
(
""
,
aws_iam_role
.
this
.*.
name
)
role
=
join
(
""
,
aws_iam_role
.
this
.*.
name
)
policy_arn
=
var
.
role_policy_arns
[
count
.
index
]
policy_arn
=
var
.
role_policy_arns
[
count
.
index
]
...
...
modules/iam-assumable-role/main.tf
View file @
5825fb4f
...
@@ -72,7 +72,7 @@ resource "aws_iam_role" "this" {
...
@@ -72,7 +72,7 @@ resource "aws_iam_role" "this" {
}
}
resource
"aws_iam_role_policy_attachment"
"custom"
{
resource
"aws_iam_role_policy_attachment"
"custom"
{
count
=
var
.
create_role
&&
length
(
var
.
custom_role_policy_arns
)
>
0
?
length
(
var
.
custom_role_policy_arns
)
:
0
count
=
var
.
create_role
?
length
(
var
.
custom_role_policy_arns
)
:
0
role
=
aws_iam_role
.
this
[
0
]
.
name
role
=
aws_iam_role
.
this
[
0
]
.
name
policy_arn
=
element
(
var
.
custom_role_policy_arns
,
count
.
index
)
policy_arn
=
element
(
var
.
custom_role_policy_arns
,
count
.
index
)
...
...
modules/iam-group-with-policies/main.tf
View file @
5825fb4f
...
@@ -27,14 +27,14 @@ resource "aws_iam_group_policy_attachment" "iam_self_management" {
...
@@ -27,14 +27,14 @@ resource "aws_iam_group_policy_attachment" "iam_self_management" {
}
}
resource
"aws_iam_group_policy_attachment"
"custom_arns"
{
resource
"aws_iam_group_policy_attachment"
"custom_arns"
{
count
=
length
(
var
.
custom_group_policy_arns
)
>
0
?
length
(
var
.
custom_group_policy_arns
)
:
0
count
=
length
(
var
.
custom_group_policy_arns
)
group
=
local
.
group_name
group
=
local
.
group_name
policy_arn
=
element
(
var
.
custom_group_policy_arns
,
count
.
index
)
policy_arn
=
element
(
var
.
custom_group_policy_arns
,
count
.
index
)
}
}
resource
"aws_iam_group_policy_attachment"
"custom"
{
resource
"aws_iam_group_policy_attachment"
"custom"
{
count
=
length
(
var
.
custom_group_policies
)
>
0
?
length
(
var
.
custom_group_policies
)
:
0
count
=
length
(
var
.
custom_group_policies
)
group
=
local
.
group_name
group
=
local
.
group_name
policy_arn
=
element
(
aws_iam_policy
.
custom
.*.
arn
,
count
.
index
)
policy_arn
=
element
(
aws_iam_policy
.
custom
.*.
arn
,
count
.
index
)
...
@@ -51,7 +51,7 @@ resource "aws_iam_policy" "iam_self_management" {
...
@@ -51,7 +51,7 @@ resource "aws_iam_policy" "iam_self_management" {
}
}
resource
"aws_iam_policy"
"custom"
{
resource
"aws_iam_policy"
"custom"
{
count
=
length
(
var
.
custom_group_policies
)
>
0
?
length
(
var
.
custom_group_policies
)
:
0
count
=
length
(
var
.
custom_group_policies
)
name
=
var
.
custom_group_policies
[
count
.
index
][
"name"
]
name
=
var
.
custom_group_policies
[
count
.
index
][
"name"
]
policy
=
var
.
custom_group_policies
[
count
.
index
][
"policy"
]
policy
=
var
.
custom_group_policies
[
count
.
index
][
"policy"
]
...
...
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