Closed ivan-kovnatskyi-c54f97a closed 2 months ago
Please can you provide more output? it looks like it is truncated
Thanks for the quick reply. Don't want to overwhelm with the console output. Updated it in my initial message.
From my observation it's just:
? [quicksight-datasource-id] Please choose DataSource (Select the first one if not sure): CID-CMD-Athena
This probably also meant new resource.
Yes, sorry for not mentionning that I have deployed some prerequisites with this code:
locals {
aws_account_id = data.aws_caller_identity.current.id
}
# Provider alias for us-east-1 must be passed explicitly (required for CUR setup)
provider "aws" {
region = "us-east-1"
alias = "useast1"
}
# Configure one or more source (payer) accounts
module "cur_source" {
source = "github.com/aws-samples/aws-cudos-framework-deployment//terraform-modules/cur-setup-source?ref=0.3.9"
destination_bucket_arn = module.cur_destination.cur_bucket_arn
enable_split_cost_allocation_data = true
# Provider alias for us-east-1 must be passed explicitly (required for CUR setup)
providers = {
aws.useast1 = aws.useast1
}
}
module "cur_destination" {
source = "github.com/aws-samples/aws-cudos-framework-deployment//terraform-modules/cur-setup-destination?ref=0.3.9"
source_account_ids = ["${local.aws_account_id}"]
create_cur = false # Set to true to create an additional CUR in the aggregation account
# Provider alias for us-east-1 must be passed explicitly (required for CUR setup)
providers = {
aws.useast1 = aws.useast1
}
}
module "cid_dashboards" {
source = "github.com/aws-samples/aws-cudos-framework-deployment//terraform-modules/cid-dashboards?ref=0.3.9"
stack_name = "Cloud-Intelligence-Dashboards"
template_bucket = local.s3_bucket
stack_parameters = {
"PrerequisitesQuickSight" = "yes"
"PrerequisitesQuickSightPermissions" = "yes"
"QuickSightUser" = "[redacted]"
# This is required to deploy SCAD dashboard with cid-cmd tool.
"DeployCUDOSDashboard" = "yes"
"DeployCostIntelligenceDashboard" = "yes"
"DeployKPIDashboard" = "yes"
}
}
My thinking is that potentially we could add SCAD to dashboards module with changes of course, only I don't grasp them all yet.
--
Hm, let me try to do it, actually.
In my draft PR I've added dashboard deployment, using CFN already in place, when I clean up dashboard with cid-cmd tool using delete
command it also deletes datasets, that is expected (now I know this 😄).
Hit deploy changed (with SCAD) terraform dashboard module, it does deploy the dashboard, but expectedly so does not configure datasets.
I tried to capture how dataset configured in dashboard would look like in terraform code and it's horrible, considering that dashboard's dataset config is the first source of truth, I presume. Add to that the fact that it will be updated from time to time, it does not make sense to codify/mimic that in another tool. Unless you guys do it in some other way.
I'm I spelling it correctly? Do I miss anything?
Basically currently dashboards module can only deploy dashboards that does not have datasets configuration.
Thankful for your input on this one.
Closing this, all in all CLI is the best choice to deploy the dashboard that has datasets defined, since terraform can't automagically parse it and configure it for us, we could of course parse yaml and form new dataset resource, but that would be a nightmare.
This options is the least distant:
resource "terraform_data" "cid_cmd_deploy" {
provisioner "local-exec" {
command = <<-EOT
pip3 install --upgrade cid-cmd
cid-cmd deploy
cid-cmd deploy --dashboard-id scad-containers-cost-allocation
EOT
}
provisioner "local-exec" {
when = destroy
command = "cid-cmd delete --dashboard-id scad-containers-cost-allocation"
}
}
Yet, many dislike arbitrary provider resources for their unpredictability.
Forgive my laziness at this stage, I would dive deep trying to understand how would one do it, but until I'm there I would very happy to hear feedback on how easy it would be implement in in terraform.
From the console output it looks like beside dashboard itself, I would need to make sure I have datasets all available.