Open bryanhorstmann opened 5 days ago
@bryanhorstmann The External ID can remain static for a while when fetching the data source. However, please note that a single External ID can only be used for one AWS monitor when creating monitors in Site24x7.
If you need to create multiple AWS monitors in bulk, please ensure that you fetch a unique External ID for each respective monitor.
Thanks, Vinoth K.
Hi @VinothDarwin-ZC ,
It does not appear to remain static though. Running two plans directly after each other generates a new external id which means the external id associated with the monitor updates on each plan/apply.
I am retrieving one per account using the for_each
here:
data "site24x7_aws_external_id" "this" {
for_each = { for monitor in var.amazon_monitors : monitor.name => monitor }
}
@bryanhorstmann
I received an update from the AWS product team that the External ID is no longer static. Here’s what we can suggest for your use case:
You can create multiple External IDs using the data sources, create the Role ARN separately, and then proceed to apply or create the AWS monitor in Site24x7.
Please note that the External ID cannot be static across multiple AWS monitors. The purpose of the External ID is to enhance security for the Role ARN in AWS. Each Role ARN should have a unique External ID associated with it to maintain security integrity.
Thanks,
Vinoth K.
Hi @VinothDarwin-ZC ,
I appreciate that feedback and while in theory that works, it goes against the basic idea of Terraform. If I ever run another plan / apply in the module where the monitor is created, then it will create a new External ID and update my monitor and stop the IAM role from working.
Once the value is retrieved and set it needs to remain static.
I have an existing Site24x7 estate I'm trying to import into Terraform. I've hit a blocker on my first resource type.
When trying to import existing AWS Monitors (using the monitor id as guess) I get the following error:
This is unfortunate, but I decide to create new
site24x7_amazon_monitor
resources instead and I'll remove my existing ones. I follow the example on https://registry.terraform.io/providers/site24x7/site24x7/latest/docs/resources/amazon_monitor but have another issue. The output forsite24x7_aws_external_id
data source updates on each plan. Its not static.This is blocker for me, as all our AWS IAM roles are created separately. I need to retrieve the external ID here and then update my IAM role in another repo.
Here is my terraform code to reproduce this:
Is it possible to retrieve a static value for the external id?