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
05fec507
Unverified
Commit
05fec507
authored
Aug 17, 2020
by
Chance Zibolski
Committed by
GitHub
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Strip https:// from OIDC provider URL if present (#50)
parent
2af9e387
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
main.tf
modules/iam-assumable-role-with-oidc/main.tf
+4
-3
No files found.
modules/iam-assumable-role-with-oidc/main.tf
View file @
05fec507
locals
{
aws_account_id
=
var
.
aws_account_id
!
=
""
?
var
.
aws_account_id
:
data
.
aws_caller_identity
.
current
.
account_id
provider_url
=
replace
(
var
.
provider_url
,
"https://"
,
""
)
}
data
"aws_caller_identity"
"current"
{}
...
...
@@ -18,7 +19,7 @@ data "aws_iam_policy_document" "assume_role_with_oidc" {
type
=
"Federated"
identifiers
=
[
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:oidc-provider/
${
var
.
provider_url
}
"
"arn:
${data
.
aws_partition
.
current
.
partition
}
:iam::
${
local
.
aws_account_id
}
:oidc-provider/
${
local
.
provider_url
}
"
]
}
...
...
@@ -26,7 +27,7 @@ data "aws_iam_policy_document" "assume_role_with_oidc" {
for_each
=
length
(
var
.
oidc_fully_qualified_subjects
)
>
0
?
[
1
]
:
[]
content
{
test
=
"StringEquals"
variable
=
"
${
var
.
provider_url
}
:sub"
variable
=
"
${
local
.
provider_url
}
:sub"
values
=
var
.
oidc_fully_qualified_subjects
}
}
...
...
@@ -36,7 +37,7 @@ data "aws_iam_policy_document" "assume_role_with_oidc" {
for_each
=
length
(
var
.
oidc_subjects_with_wildcards
)
>
0
?
[
1
]
:
[]
content
{
test
=
"StringLike"
variable
=
"
${
var
.
provider_url
}
:sub"
variable
=
"
${
local
.
provider_url
}
:sub"
values
=
var
.
oidc_subjects_with_wildcards
}
}
...
...
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