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
5bdf722e
Unverified
Commit
5bdf722e
authored
Sep 08, 2020
by
Ilia Lazebnik
Committed by
GitHub
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Allow running on custom AWS partition (incl. govcloud) (#94)
parent
dec17783
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
policies.tf
modules/iam-group-with-policies/policies.tf
+8
-6
No files found.
modules/iam-group-with-policies/policies.tf
View file @
5bdf722e
...
@@ -2,6 +2,8 @@ data "aws_caller_identity" "current" {
...
@@ -2,6 +2,8 @@ data "aws_caller_identity" "current" {
count
=
var
.
aws_account_id
==
""
?
1
:
0
count
=
var
.
aws_account_id
==
""
?
1
:
0
}
}
data
"aws_partition"
"current"
{}
locals
{
locals
{
aws_account_id
=
element
(
aws_account_id
=
element
(
concat
(
concat
(
...
@@ -41,9 +43,9 @@ data "aws_iam_policy_document" "iam_self_management" {
...
@@ -41,9 +43,9 @@ data "aws_iam_policy_document" "iam_self_management" {
# Allow for both users with "path" and without it
# Allow for both users with "path" and without it
resources
=
[
resources
=
[
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:user/*/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:user/*/
$
${
aws
:
username
}
"
,
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:user/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:user/
$
${
aws
:
username
}
"
,
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:mfa/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:mfa/
$
${
aws
:
username
}
"
,
]
]
}
}
...
@@ -71,9 +73,9 @@ data "aws_iam_policy_document" "iam_self_management" {
...
@@ -71,9 +73,9 @@ data "aws_iam_policy_document" "iam_self_management" {
# Allow for both users with "path" and without it
# Allow for both users with "path" and without it
resources
=
[
resources
=
[
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:user/*/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:user/*/
$
${
aws
:
username
}
"
,
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:user/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:user/
$
${
aws
:
username
}
"
,
"arn:
aws
:iam::
${
local
.
aws_account_id
}
:mfa/
$
${
aws
:
username
}
"
,
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:mfa/
$
${
aws
:
username
}
"
,
]
]
condition
{
condition
{
...
...
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