-
Couldn't load subscription status.
- Fork 1
feat: add support to create resource key #90
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
Changes from 51 commits
35ba0cb
bd4ccf0
78ad177
4df2403
07816b3
0bdb1dc
4647240
83a9a20
96c820d
7e13bc9
b15ad6a
d264ed8
441c212
986997c
08479eb
0807d34
a633588
71f7606
f8d23ba
f17f2df
c72858f
f5b9794
83e4cd0
bd9fcb0
5d7b07f
f68d9e6
dbc1eee
96489c8
68ab9c3
12183b3
736a645
ab6cca0
275d050
5da9bf6
9f829cd
1b32a05
132f678
f885ed0
33b9d98
6a02896
1b8e005
92b82c5
31339a2
8e2d1fa
bdf1388
df2e732
4e461cb
bf5e586
a4d04c4
58577bc
17dde29
ea61469
5280ede
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 |
|---|---|---|
|
|
@@ -31,11 +31,31 @@ resource "ibm_resource_tag" "cloud_monitoring_tag" { | |
| tag_type = "access" | ||
| } | ||
|
|
||
| ############################################################################### | ||
| # Resource Key (Default Manager Key) | ||
| ############################################################################### | ||
|
|
||
| resource "ibm_resource_key" "resource_key" { | ||
| name = var.manager_key_name | ||
| count = var.disable_access_key_creation ? 0 : 1 | ||
|
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. wont this be a breaking change without a moved block? Why did upgrade test not fail? 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. No, when I ran locally terraform is understanding that we've added a count around the resource block. I will attach the screenshot here 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. Are you sure? Usually a moved block is required when we add a count |
||
| name = var.access_key_name | ||
| resource_instance_id = ibm_resource_instance.cloud_monitoring.id | ||
| role = "Manager" | ||
| tags = var.manager_key_tags | ||
| tags = var.access_key_tags | ||
| } | ||
|
|
||
| ############################################################################### | ||
| # Resource Keys | ||
| ############################################################################### | ||
|
|
||
| resource "ibm_resource_key" "resource_keys" { | ||
| for_each = { for key in var.resource_keys : key.name => key } | ||
| name = each.value.key_name == null ? each.key : each.value.key_name | ||
| resource_instance_id = ibm_resource_instance.cloud_monitoring.id | ||
| role = each.value.role | ||
| parameters = { | ||
| "serviceid_crn" = each.value.service_id_crn | ||
| "HMAC" = each.value.generate_hmac_credentials | ||
| } | ||
| } | ||
|
|
||
| ######################################################################## | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,15 +23,17 @@ output "resource_group_id" { | |
| description = "The resource group where cloud monitoring monitor instance resides" | ||
| } | ||
|
|
||
| output "access_key" { | ||
| value = ibm_resource_key.resource_key.credentials["Sysdig Access Key"] | ||
| description = "The cloud monitoring access key for agents to use" | ||
| output "resource_keys" { | ||
| description = "A list of maps representing resource keys created for the IBM Cloud Monitoring instance." | ||
| value = ibm_resource_key.resource_keys | ||
| sensitive = true | ||
| } | ||
|
|
||
| output "manager_key_name" { | ||
|
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. We should keep this output, but it should be renamed to 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. I remember that I have renamed this and added it back, somehow it is not in the final push :( |
||
| value = ibm_resource_key.resource_key.name | ||
| description = "The cloud monitoring manager key name" | ||
| # https://cloud.ibm.com/docs/monitoring?topic=monitoring-access_key | ||
| output "access_key" { | ||
| value = !var.disable_access_key_creation ? ibm_resource_key.resource_key[0].credentials["Sysdig Access Key"] : null | ||
| description = "The Cloud Monitoring access key for agents to use" | ||
| sensitive = true | ||
| } | ||
|
|
||
| # https://cloud.ibm.com/docs/monitoring?topic=monitoring-endpoints#endpoints_ingestion | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.