]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/recipes/server.rb
cloudwatch: Add other billed accounts
[chef.git] / cookbooks / prometheus / recipes / server.rb
index 45550368cd5b669f1cb1b49ee9c1159fccbdb4d1..c1b7df2c6e3c7e94e6b7347ca3ffb4ff6a670135 100644 (file)
@@ -44,6 +44,27 @@ prometheus_exporter "statuscake" do
   environment "STATUSCAKE_APIKEY" => tokens["statuscake"]
 end
 
   environment "STATUSCAKE_APIKEY" => tokens["statuscake"]
 end
 
+template "/etc/prometheus/cloudwatch.yml" do
+  source "cloudwatch.yml.erb"
+  owner "root"
+  group "root"
+  mode "644"
+end
+
+prometheus_exporter "cloudwatch" do
+  address "127.0.0.1"
+  port 5000
+  listen_switch "listen-address"
+  options %w[
+    --config.file=/etc/prometheus/cloudwatch.yml
+    --enable-feature=aws-sdk-v2
+    --enable-feature=always-return-info-metrics
+  ]
+  environment "AWS_ACCESS_KEY_ID" => "AKIASQUXHPE7JHG37EA6",
+              "AWS_SECRET_ACCESS_KEY" => tokens["cloudwatch"]
+  subscribes :restart, "template[/etc/prometheus/cloudwatch.yml]"
+end
+
 cache_dir = Chef::Config[:file_cache_path]
 
 prometheus_version = "2.45.0"
 cache_dir = Chef::Config[:file_cache_path]
 
 prometheus_version = "2.45.0"