-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: s2s auth iam engine #237
Changes from 6 commits
cca6637
d6a67f5
283cc7a
b9734e2
e980753
05a9ef0
4c73db5
c2ef6bd
44de3d3
b7e3cba
539d351
b4a1475
26152e6
058d2a4
4760ec3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,27 @@ resource "ibm_resource_instance" "secrets_manager_instance" { | |
} | ||
} | ||
|
||
# Create IAM credentials engine using s2s auth | ||
resource "ibm_iam_authorization_policy" "iam_identity_policy" { | ||
count = var.create_iam_engine ? 1 : 0 | ||
source_service_name = "secrets-manager" | ||
source_resource_instance_id = local.secrets_manager_guid | ||
target_service_name = "iam-identity" | ||
roles = ["Operator"] | ||
description = "Authorization Policy" | ||
transaction_id = "terraformAuthorizationPolicy" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is |
||
} | ||
|
||
resource "ibm_iam_authorization_policy" "iam_groups_policy" { | ||
count = var.create_iam_engine ? 1 : 0 | ||
source_service_name = "secrets-manager" | ||
source_resource_instance_id = local.secrets_manager_guid | ||
target_service_name = "iam-groups" | ||
roles = ["Groups Service Member Manage"] | ||
description = "Authorization Policy" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, description needs to be updated |
||
transaction_id = "terraformAuthorizationPolicy" | ||
} | ||
|
||
locals { | ||
# determine which service name to use for the policy | ||
kms_service_name = var.kms_encryption_enabled && var.kms_key_crn != null ? ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,12 @@ variable "sm_service_plan" { | |
} | ||
} | ||
|
||
variable "create_iam_engine" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only thing getting "created" here is s2s auth policies between SM and IAM. So maybe we need to rename this to The variable description needs to be more specific as to what exact type of auth policies are created (as its possible a consumer may already have them set in their account) |
||
type = bool | ||
description = "Whether to create an IAM credential engine using sserice to service (s2s) authentication." | ||
default = true | ||
} | ||
|
||
variable "sm_tags" { | ||
type = list(string) | ||
description = "The list of resource tags that you want to associate with your Secrets Manager instance." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description needs more info as to the type of auth policy here. Check out other auth policy descrptions we have used in other modules for an idea