This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TraceableRegions is a list of AWS regions we want to crawl | |
var TraceableRegions = [...]string{"us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1"} | |
// SingleResource defines how we want to describe each AWS resource | |
type SingleResource struct { | |
Region *string | |
Service *string | |
Product *string | |
Details *string | |
ID *string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Name: ansible-aws-inventory-main.yml | |
# Description: this is the main file that calls the worker file (ansible-aws-inventory-worker.yml) to create an inventory of all the | |
# specific aws resources. | |
# Below are the resources that will be inventoried | |
# - vpc | |
# - subnet | |
# - igw | |
# - cgw | |
# - vgw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: ansible-aws-inventory-worker.yml | |
# Description: this is the worker file that called the main file (ansible-aws-inventory-main.yml) to to create an inventory of all the | |
# specific aws resources. This file, the worker file and the ansible inventory file must be placed in the same folder | |
# Prerequisites: | |
# - the worker file (ansible-aws-inventory-worker.yml) and the ansible hosts file must be present in the same folder as this file (ansible-aws-inventory-main.yml) | |
# - this script requires read access to all resources it will be querying. An AWS IAM user account must be created with the necessary permissions and with access keys enabled. | |
# At a minimum, to query all the resources mentioned above, the following permissions are required | |
# - AmazonVPCReadOnlyAccess | |
# - AmazonEC2ReadOnlyAccess | |
# - ElasticLoadBalancingReadOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks: | |
- name: initialise output files with headers | |
lineinfile: | |
state: present | |
create: yes | |
path: "{{ lookup('vars', item + outputfile_variablename_suffix) }}" | |
line: "{{ lookup('vars', item + outputfileheader_variablename_suffix) }}" | |
insertbefore: BOF | |
with_items: | |
- vpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
"log" | |
"math/rand" | |
"net/http" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import threading | |
import urllib.request | |
import logging | |
from time import sleep | |
__author__ = "Florian Dambrine <[email protected]>" | |
class DatabricksPushgatewayExporter: | |
""" |