├── .ci ├── pipeline.yml └── variables.yml ├── .github └── dependabot.yml ├── .gitignore ├── .golangci.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── assets ├── doc.go ├── icons │ ├── aws │ │ ├── AWS_Cost_Management │ │ │ └── AWS-Budgets.png │ │ ├── Analytics │ │ │ ├── AWS-Glue.png │ │ │ ├── AWS-Glue_Crawlers_light-bg.png │ │ │ ├── AWS-Glue_Data-catalog_light-bg.png │ │ │ ├── Amazon-Athena.png │ │ │ ├── Amazon-EMR.png │ │ │ ├── Amazon-Elasticsearch-Service.png │ │ │ ├── Amazon-Kinesis-Data-Firehose_light-bg.png │ │ │ └── Amazon-Kinesis-Data-Streams.png │ │ ├── Application_Integration │ │ │ ├── AWS-Step-Functions.png │ │ │ ├── Amazon-MQ.png │ │ │ ├── Amazon-Simple-Notification-Service-SNS.png │ │ │ ├── Amazon-Simple-Notification-Service-SNS_Topic_light-bg.png │ │ │ └── Amazon-Simple-Queue-Service-SQS.png │ │ ├── Compute │ │ │ ├── AWS-Batch.png │ │ │ ├── AWS-Elastic-Beanstalk.png │ │ │ ├── AWS-Lambda.png │ │ │ ├── AWS-Lambda_Lambda-Function_light-bg.png │ │ │ ├── Amazon-EC2-Auto-Scaling.png │ │ │ ├── Amazon-EC2-Container-Registry.png │ │ │ ├── Amazon-EC2.png │ │ │ ├── Amazon-EC2_AMI_light-bg.png │ │ │ ├── Amazon-EC2_Elastic-IP-Address_light-bg.png │ │ │ ├── Amazon-Elastic-Container-Service.png │ │ │ ├── Amazon-Elastic-Container-Service_Service_light-bg.png │ │ │ ├── Amazon-Elastic-Container-Service_Task_light-bg.png │ │ │ ├── Amazon-Elastic-Kubernetes-Service.png │ │ │ ├── Amazon-Lightsail.png │ │ │ └── _Instance │ │ │ │ └── Amazon-EC2_Spot-instance_light-bg.png │ │ ├── Customer_Engagement │ │ │ └── Amazon-Simple-Email-Service-SES.png │ │ ├── Database │ │ │ ├── AWS-Database-Migration-Service.png │ │ │ ├── Amazon-DynamoDB.png │ │ │ ├── Amazon-DynamoDB_Item_light-bg.png │ │ │ ├── Amazon-DynamoDB_Table_light-bg.png │ │ │ ├── Amazon-ElastiCache.png │ │ │ ├── Amazon-Neptune.png │ │ │ ├── Amazon-RDS.png │ │ │ └── Amazon-Redshift.png │ │ ├── Developer_Tools │ │ │ ├── AWS-Cloud9.png │ │ │ ├── AWS-CodeBuild.png │ │ │ ├── AWS-CodeCommit.png │ │ │ ├── AWS-CodeDeploy.png │ │ │ └── AWS-CodePipeline.png │ │ ├── Game_Tech │ │ │ └── Amazon-GameLift.png │ │ ├── Internet_of_Things │ │ │ └── Internet-of-Things.png │ │ ├── Management_and_Governance │ │ │ ├── AWS-Auto-Scaling.png │ │ │ ├── AWS-CloudFormation.png │ │ │ ├── AWS-CloudTrail.png │ │ │ ├── AWS-Config.png │ │ │ ├── AWS-OpsWorks.png │ │ │ ├── AWS-OpsWorks_Apps_light-bg.png │ │ │ ├── AWS-OpsWorks_Instances_light-bg.png │ │ │ ├── AWS-OpsWorks_Layers_light-bg.png │ │ │ ├── AWS-OpsWorks_Permissions_light-bg.png │ │ │ ├── AWS-Organizations.png │ │ │ ├── AWS-Organizations_Account_light-bg.png │ │ │ ├── AWS-Service-Catalog.png │ │ │ ├── AWS-Systems-Manager.png │ │ │ ├── AWS-Systems-Manager_Documents_light-bg.png │ │ │ ├── AWS-Systems-Manager_Maintenance-Windows_light-bg.png │ │ │ ├── AWS-Systems-Manager_Parameter-Store_light-bg.png │ │ │ ├── AWS-Systems-Manager_Patch-Manager_light-bg.png │ │ │ ├── Amazon-CloudWatch.png │ │ │ ├── Amazon-CloudWatch_Alarm_light-bg.png │ │ │ ├── Amazon-CloudWatch_Event-Event-Based_light-bg.png │ │ │ └── Amazon-CloudWatch_Rule_light-bg.png │ │ ├── Media_Services │ │ │ ├── AWS-Elemental-MediaStore.png │ │ │ └── Amazon-Elastic-Transcoder.png │ │ ├── Migration_and_Transfer │ │ │ └── AWS-Application-Discovery-Service.png │ │ ├── Mobile │ │ │ ├── AWS-AppSync.png │ │ │ └── AWS-Device-Farm.png │ │ ├── Networking_and_Content_Delivery │ │ │ ├── AWS-Direct-Connect.png │ │ │ ├── Amazon-API-Gateway.png │ │ │ ├── Amazon-CloudFront.png │ │ │ ├── Amazon-Route-53.png │ │ │ ├── Amazon-Route-53_Hosted-Zone_light-bg.png │ │ │ ├── Amazon-VPC.png │ │ │ ├── Amazon-VPC_Customer-Gateway_light-bg.png │ │ │ ├── Amazon-VPC_Elastic-Network-Interface_light-bg.png │ │ │ ├── Amazon-VPC_Endpoints_light-bg.png │ │ │ ├── Amazon-VPC_Flow-Logs_light-bg.png │ │ │ ├── Amazon-VPC_Internet-Gateway_light-bg.png │ │ │ ├── Amazon-VPC_NAT-Gateway_light-bg.png │ │ │ ├── Amazon-VPC_Network-Access-Control-List_light-bg.png │ │ │ ├── Amazon-VPC_Peering_light-bg.png │ │ │ ├── Amazon-VPC_Router_light-bg.png │ │ │ ├── Amazon-VPC_VPN-Connection_light-bg.png │ │ │ ├── Amazon-VPC_VPN-Gateway_light-bg.png │ │ │ └── Elastic-Load-Balancing.png │ │ ├── Security_Identity_and_Compliance │ │ │ ├── AWS-Certificate-Manager.png │ │ │ ├── AWS-Directory-Service.png │ │ │ ├── AWS-Identity-and-Access-Management-IAM_Data-Encryption-Key_light-bg.png │ │ │ ├── AWS-Identity-and-Access-Management-IAM_Permissions_light-bg.png │ │ │ ├── AWS-Identity-and-Access-Management-IAM_Role_light-bg.png │ │ │ ├── AWS-Identity-and-Access-Management_IAM.png │ │ │ ├── AWS-Key-Management-Service.png │ │ │ ├── AWS-Secrets-Manager.png │ │ │ ├── AWS-WAF.png │ │ │ ├── AWS-WAF_Filtering-rule_light-bg.png │ │ │ ├── Amazon-Cognito.png │ │ │ ├── Amazon-GuardDuty.png │ │ │ ├── Amazon-Inspector.png │ │ │ └── Amazon-Macie.png │ │ ├── Storage │ │ │ ├── AWS-Storage-Gateway.png │ │ │ ├── AWS-Storage-Gateway_Cached-Volume_light-bg.png │ │ │ ├── Amazon-Elastic-Block-Store-EBS_Snapshot_light-bg.png │ │ │ ├── Amazon-Elastic-Block-Store-EBS_Volume_light-bg.png │ │ │ ├── Amazon-Elastic-File-System_EFS.png │ │ │ ├── Amazon-S3-Glacier.png │ │ │ ├── Amazon-Simple-Storage-Service-S3.png │ │ │ └── Amazon-Simple-Storage-Service-S3_Object_light-bg.png │ │ └── _Group_Icons │ │ │ ├── Spot-fleet_light-bg.png │ │ │ └── VPC-subnet-public_light-bg.png │ ├── azurerm │ │ ├── Analytics │ │ │ ├── 00009-icon-service-Log-Analytics-Workspaces.png │ │ │ ├── 00037-icon-service-HD-Insight-Clusters.png │ │ │ └── 00039-icon-service-Event-Hubs.png │ │ ├── App_Services │ │ │ └── 10044-icon-service-Search-Services.png │ │ ├── Compute │ │ │ ├── 10025-icon-service-Availability-Sets.png │ │ │ ├── 10033-icon-service-Images.png │ │ │ ├── 10034-icon-service-VM-Scale-Sets.png │ │ │ ├── 10038-icon-service-Image-Versions.png │ │ │ ├── 10039-icon-service-Shared-Image-Galleries.png │ │ │ └── 10040-icon-service-VM-Images-(Classic).png │ │ ├── Containers │ │ │ ├── 10031-icon-service-Batch-Accounts.png │ │ │ ├── 10035-icon-service-App-Services.png │ │ │ ├── 10036-icon-service-Service-Fabric-Clusters.png │ │ │ └── 10105-icon-service-Container-Registries.png │ │ ├── Databases │ │ │ ├── 10122-icon-service-Azure-Database-MySQL-Server.png │ │ │ ├── 10123-icon-service-Azure-Database-MariaDB-Server.png │ │ │ ├── 10130-icon-service-SQL-Database.png │ │ │ ├── 10131-icon-service-Azure-Database-PostgreSQL-Server.png │ │ │ ├── 10132-icon-service-SQL-Server.png │ │ │ ├── 10134-icon-service-SQL-Elastic-Pools.png │ │ │ └── 10137-icon-service-Cache-Redis.png │ │ ├── DevOps │ │ │ └── 10264-icon-service-DevTest-Labs.png │ │ ├── General │ │ │ ├── 10839-icon-service-Storage-Container.png │ │ │ └── 10840-icon-service-Storage-Queue.png │ │ ├── Integration │ │ │ ├── 00041-icon-service-Data-Factory.png │ │ │ ├── 10206-icon-service-Event-Grid-Topics.png │ │ │ └── 10215-icon-service-Event-Grid-Domains.png │ │ ├── IoT │ │ │ ├── 00042-icon-service-Stream-Analytics-Jobs.png │ │ │ ├── 10029-icon-service-Function-Apps.png │ │ │ ├── 10045-icon-service-Notification-Hubs.png │ │ │ ├── 10183-icon-service-Event-Grid-Subscriptions.png │ │ │ └── 10184-icon-service-IoT-Central-Applications.png │ │ ├── Management_and_Governance │ │ │ ├── 00012-icon-service-Application-Insights.png │ │ │ └── 00022-icon-service-Automation-Accounts.png │ │ ├── Networking │ │ │ ├── 00023-icon-service-Network-Watcher.png │ │ │ ├── 00056-icon-service-CDN-Profiles.png │ │ │ ├── 01105-icon-service-Private-Link-Service.png │ │ │ ├── 10062-icon-service-Load-Balancers.png │ │ │ ├── 10063-icon-service-Virtual-Network-Gateways.png │ │ │ ├── 10064-icon-service-DNS-Zones.png │ │ │ ├── 10065-icon-service-Traffic-Manager-Profiles.png │ │ │ ├── 10067-icon-service-Network-Security-Groups.png │ │ │ ├── 10071-icon-service-Route-Filters.png │ │ │ ├── 10073-icon-service-Front-Doors.png │ │ │ ├── 10075-icon-service-Virtual-Networks-(Classic).png │ │ │ ├── 10079-icon-service-ExpressRoute-Circuits.png │ │ │ ├── 10080-icon-service-Network-Interfaces.png │ │ │ ├── 10083-icon-service-Application-Security-Groups.png │ │ │ ├── 10362-icon-service-Web-Application-Firewall-Policies(WAF).png │ │ │ ├── 10365-icon-service-Proximity-Placement-Groups.png │ │ │ └── 10372-icon-service-Public-IP-Prefixes.png │ │ ├── Other │ │ │ ├── 00398-icon-service-Disk-Encryption-Sets.png │ │ │ └── 10076-icon-service-Application-Gateways.png │ │ ├── Storage │ │ │ ├── 00017-icon-service-Recovery-Services-Vaults.png │ │ │ ├── 10087-icon-service-Storage-Accounts-(Classic).png │ │ │ ├── 10090-icon-service-Data-Lake-Storage-Gen1.png │ │ │ └── 10098-icon-service-Data-Shares.png │ │ └── Web │ │ │ └── 10053-icon-service-Notification-Hub-Namespaces.png │ ├── flexibleengine │ │ ├── Application-SMN.png │ │ ├── Computing-AS.png │ │ ├── Computing-CCE.png │ │ ├── Computing-ECS.png │ │ ├── Data Analysis&AI-DWS.png │ │ ├── Data Analysis&AI-MLS.png │ │ ├── Data Analysis&AI-MRS.png │ │ ├── Database-DCS.png │ │ ├── Database-RDS .png │ │ ├── Management&Deployment-CES.png │ │ ├── Management&Deployment-CTS.png │ │ ├── Management&Deployment-RTS.png │ │ ├── Network-DNS.png │ │ ├── Network-EIP.png │ │ ├── Network-ELB.png │ │ ├── Network-VPC.png │ │ ├── Network.png │ │ ├── Security-Anti-DDoS.png │ │ ├── Security-KMS.png │ │ ├── Storage-CSBS.png │ │ ├── Storage-SFS.png │ │ ├── Storage-VBS.png │ │ ├── Storage.png │ │ ├── bucket.png │ │ ├── cloud-server-group.png │ │ ├── drs.png │ │ ├── firewall.png │ │ ├── key-pair.png │ │ ├── nat-gateway.png │ │ ├── peer link.png │ │ ├── security-group.png │ │ ├── subnet.png │ │ └── zone.png │ ├── google │ │ ├── Compute │ │ │ ├── App_Engine.png │ │ │ ├── Cloud_Functions.png │ │ │ ├── Cloud_Run.png │ │ │ ├── Compute_Engine.png │ │ │ └── Kubernetes_Engine.png │ │ ├── Data_Analytics │ │ │ ├── Big_Query.png │ │ │ ├── Cloud_Dataflow.png │ │ │ ├── Cloud_Dataproc.png │ │ │ └── Cloud_PubSub.png │ │ ├── Databases │ │ │ ├── Cloud_Bigtable.png │ │ │ ├── Cloud_Firestore.png │ │ │ ├── Cloud_Memorystore.png │ │ │ ├── Cloud_SQL.png │ │ │ └── Cloud_Spanner.png │ │ ├── Developer_Tools │ │ │ └── Cloud_Build.png │ │ ├── Management_Tools │ │ │ ├── Cloud_Billing_API.png │ │ │ ├── Logging.png │ │ │ └── Monitoring.png │ │ ├── Networking │ │ │ ├── Cloud_DNS.png │ │ │ ├── Cloud_NAT.png │ │ │ ├── Cloud_Network.png │ │ │ ├── Cloud_Router.png │ │ │ ├── Cloud_Routes.png │ │ │ └── Cloud_VPN.png │ │ ├── Security │ │ │ ├── Cloud_IAM.png │ │ │ └── Key_Management_Service.png │ │ └── Storage │ │ │ ├── Cloud_Filestore.png │ │ │ ├── Cloud_Storage.png │ │ │ └── Persistent_Disk.png │ ├── im │ │ └── baseline_cloud_queue_black.png │ └── openstack │ │ ├── db-gray.png │ │ ├── firewall-gray.png │ │ ├── flavor-gray.png │ │ ├── floatingip-gray.png │ │ ├── image-gray.png │ │ ├── keypair-gray.png │ │ ├── lb-gray.png │ │ ├── network-gray.png │ │ ├── router-gray.png │ │ ├── securitygroup-gray.png │ │ ├── server-gray.png │ │ ├── stack-gray.png │ │ ├── volume-gray.png │ │ └── vpn-gray.png └── pkged.go ├── cmd ├── doc.go ├── generate.go ├── prune.go ├── root.go └── version.go ├── docs ├── Openstack-vertical-small.png ├── aws.png ├── azure.svg ├── flexibleengine.png ├── google-cloud.svg ├── inframap-logo_color-RGB.png ├── inframap.png ├── inframapconnections.png ├── inframapraw.png └── terraformgraph.svg ├── errcode ├── code.go └── doc.go ├── generate ├── connection.go ├── doc.go ├── hcl.go ├── hcl_test.go ├── helper_test.go ├── options.go ├── state.go ├── state_test.go └── testdata │ ├── aws_hcl_sg.tf │ ├── aws_state_cyclic.json │ ├── aws_state_multiple_hanging_edges.json │ ├── aws_state_sg.json │ ├── aws_state_sgr.json │ ├── aws_state_with_count.json │ ├── azure.tf │ ├── azure.tfstate │ ├── empty.json │ ├── error_missing_id.json │ ├── flexibleengine_hcl.tf │ ├── flexibleengine_state.json │ ├── flexibleengine_state_attach.json │ ├── flexibleengine_state_tf_011.json │ ├── google_hcl.tf │ ├── google_state.json │ ├── invalid_version_state.json │ ├── multi_module_state.json │ ├── openstack_state_lb.json │ ├── openstack_state_sg.json │ ├── repeated_modules.json │ ├── tf-module │ └── aws_hcl_sg.tf │ └── version_3_state.json ├── go.mod ├── go.sum ├── graph ├── doc.go ├── edge.go ├── edge_test.go ├── graph.go ├── graph_test.go └── node.go ├── main.go ├── printer ├── doc.go ├── dot │ └── printer.go ├── factory │ ├── factory.go │ └── factory_test.go ├── options.go ├── printer.go ├── type.go └── type_string.go ├── provider ├── aws │ ├── aws.go │ ├── aws_test.go │ └── graph.go ├── azurerm │ ├── azurerm.go │ ├── azurerm_test.go │ └── graph.go ├── doc.go ├── factory │ ├── factory.go │ └── factory_test.go ├── flexibleengine │ ├── flexibleengine.go │ ├── flexibleengine_test.go │ └── graph.go ├── google │ ├── google.go │ ├── google_test.go │ └── graph.go ├── im │ └── im.go ├── nop_provider.go ├── openstack │ ├── graph.go │ ├── openstack.go │ └── openstack_test.go ├── provider.go ├── raw_provider.go ├── type.go └── type_string.go ├── prune ├── doc.go └── prune.go ├── scripts ├── assets │ └── main.go └── deploy │ └── aur.sh └── tools ├── doc.go └── tools.go /.ci/variables.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Default variables that shouldn't be changed except if needed 3 | # 4 | project: inframap 5 | env: master 6 | customer: cycloid-owl 7 | 8 | base-context: cycloid-ci 9 | ci-context: inframap 10 | 11 | # Git repository 12 | github-repo-uri: git@github.com:cycloidio/inframap.git 13 | github-repo-owner: cycloidio 14 | github-repo-name: inframap 15 | github-access-token: ((github_access_token.data)) 16 | github-private-key: ((git_github.ssh_key)) 17 | 18 | # Docker image version 19 | docker-image: golang 20 | docker-image-tag: 1.15.6 21 | docker-hub-username: ((docker_hub.username)) 22 | docker-hub-password: ((docker_hub.password)) 23 | 24 | # Default branch 25 | branch: master 26 | 27 | # Cache path: used for dependencies 28 | cache-path: go/pkg/mod 29 | 30 | # Notifications 31 | slack-deployment-url: ((custom_slack-webhook-inframap.url)) 32 | event-key: ((custom_api-key-admin.key)) 33 | 34 | # aur publishing 35 | ssh-private-key: ((ssh_aur.ssh_key)) 36 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | 9 | - package-ecosystem: "gomod" 10 | directory: "/" 11 | schedule: 12 | interval: "weekly" 13 | 14 | - package-ecosystem: "docker" 15 | directory: "/" 16 | schedule: 17 | interval: "weekly" 18 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | # options for analysis running 2 | # full configuration example can be found at https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml 3 | run: 4 | # timeout for analysis, e.g. 30s, 5m, default is 1m 5 | timeout: 10m 6 | concurrency: 4 7 | go: "1.22" 8 | 9 | 10 | # all available settings of specific linters 11 | linters-settings: 12 | 13 | misspell: 14 | # Correct spellings using locale preferences for US or UK. 15 | # Default is to use a neutral variety of English. 16 | # Setting locale to US will correct the British spelling of 'colour' to 'color'. 17 | locale: US 18 | ignore-words: 19 | - licence 20 | - licences 21 | - utilisation 22 | - cancelled 23 | 24 | staticcheck: 25 | # https://staticcheck.io/docs/options#checks 26 | checks: ["all", "-SA1019", "-SA5012"] 27 | 28 | 29 | linters: 30 | disable-all: true 31 | enable: 32 | - staticcheck 33 | - goimports 34 | - ineffassign 35 | - unused 36 | - unconvert 37 | - misspell 38 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.22.4-alpine as builder 2 | WORKDIR /app 3 | 4 | COPY go.mod go.sum ./ 5 | 6 | RUN go mod download 7 | 8 | COPY . . 9 | 10 | RUN apk -q --no-progress add git make \ 11 | && make build 12 | 13 | FROM alpine 14 | 15 | RUN apk -q --no-progress add graphviz ttf-dejavu \ 16 | && addgroup -g 1000 inframap \ 17 | && adduser -u 1000 -G inframap -s /bin/ash -D inframap 18 | 19 | USER 1000 20 | 21 | WORKDIR /home/inframap 22 | 23 | COPY --from=builder /app/inframap /home/inframap 24 | 25 | ENTRYPOINT ["./inframap"] 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Cycloid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BIN := inframap 2 | TOOL_BIN := $(PWD)/bin 3 | 4 | GOIMPORTS := $(TOOL_BIN)/goimports 5 | ENUMER := $(TOOL_BIN)/enumer 6 | PKGER := $(TOOL_BIN)/go-bindata 7 | 8 | ARCHITECTURES=386 amd64 9 | PLATFORMS=darwin linux windows 10 | 11 | VERSION= $(shell git describe --tags --always) 12 | 13 | # Setup the -ldflags option for go build here, interpolate the variable values 14 | LDFLAGS=-ldflags "-X github.com/cycloidio/inframap/cmd.Version=${VERSION}" 15 | 16 | .PHONY: help 17 | help: Makefile ## This help dialog 18 | @IFS=$$'\n' ; \ 19 | help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \ 20 | for help_line in $${help_lines[@]}; do \ 21 | IFS=$$'#' ; \ 22 | help_split=($$help_line) ; \ 23 | help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ 24 | help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ 25 | printf "%-30s %s\n" $$help_command $$help_info ; \ 26 | done 27 | 28 | $(ENUMER): 29 | @GOBIN=$(TOOL_BIN) go install github.com/dmarkham/enumer 30 | 31 | $(GOIMPORTS): 32 | @GOBIN=$(TOOL_BIN) go install golang.org/x/tools/cmd/goimports 33 | 34 | $(PKGER): 35 | @GOBIN=$(TOOL_BIN) go install github.com/markbates/pkger/cmd/pkger 36 | 37 | .PHONY: test 38 | test: ## Tests all the project 39 | @go test ./... 40 | 41 | .PHONY: lint 42 | lint: ## Lint the source code 43 | @echo -e "# \e[33mRunning golangci-lint\e[0m" 44 | @golangci-lint run -v 45 | 46 | .PHONY: generate 47 | generate: $(ENUMER) ## Generates the needed code 48 | @go generate ./... 49 | 50 | .PHONY: generate-icons 51 | generate-icons: $(PKGER) ## Generates the needed code and Icons, it's separated as the icons generate always a new output 52 | @go generate -tags icons ./... 53 | 54 | .PHONY: build 55 | build: ## Builds the binary 56 | go build -o $(BIN) ${LDFLAGS} 57 | 58 | .PHONY: install 59 | install: ## Install the binary 60 | go install ${LDFLAGS} 61 | 62 | .PHONY: build-all build-compress 63 | build-all: ## Builds the binaries 64 | $(foreach GOOS, $(PLATFORMS),\ 65 | $(foreach GOARCH, $(ARCHITECTURES),\ 66 | $(shell export GO111MODULE=on; export CGO_ENABLED=0; export GOOS=$(GOOS); export GOARCH=$(GOARCH); go build -v -o $(BUILD_PATH)/$(BIN)-$(GOOS)-$(GOARCH) ${LDFLAGS}))) 67 | 68 | build-compress: build-all ## Builds and compress the binaries 69 | $(foreach GOOS, $(PLATFORMS),\ 70 | $(foreach GOARCH, $(ARCHITECTURES),\ 71 | $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); tar -C $(BUILD_PATH) -czf $(BUILD_PATH)/$(BIN)-$(GOOS)-$(GOARCH).tar.gz $(BIN)-$(GOOS)-$(GOARCH)))) 72 | 73 | .PHONY: dbuild 74 | dbuild: ## Builds the docker image with same name as the binary 75 | @docker build -t $(BIN) . 76 | 77 | .PHONY: format-go 78 | format-go: 79 | @gci write --skip-generated -s standard -s default -s "prefix(github.com/cycloidio)" . > /dev/null 80 | @goimports -w -local github.com/cycloidio . 81 | -------------------------------------------------------------------------------- /assets/doc.go: -------------------------------------------------------------------------------- 1 | package assets 2 | 3 | //go:generate ../bin/pkger -include /assets/icons -o /assets/ 4 | -------------------------------------------------------------------------------- /assets/icons/aws/AWS_Cost_Management/AWS-Budgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/AWS_Cost_Management/AWS-Budgets.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/AWS-Glue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/AWS-Glue.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/AWS-Glue_Crawlers_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/AWS-Glue_Crawlers_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/AWS-Glue_Data-catalog_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/AWS-Glue_Data-catalog_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/Amazon-Athena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/Amazon-Athena.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/Amazon-EMR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/Amazon-EMR.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/Amazon-Elasticsearch-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/Amazon-Elasticsearch-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/Amazon-Kinesis-Data-Firehose_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/Amazon-Kinesis-Data-Firehose_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Analytics/Amazon-Kinesis-Data-Streams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Analytics/Amazon-Kinesis-Data-Streams.png -------------------------------------------------------------------------------- /assets/icons/aws/Application_Integration/AWS-Step-Functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Application_Integration/AWS-Step-Functions.png -------------------------------------------------------------------------------- /assets/icons/aws/Application_Integration/Amazon-MQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Application_Integration/Amazon-MQ.png -------------------------------------------------------------------------------- /assets/icons/aws/Application_Integration/Amazon-Simple-Notification-Service-SNS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Application_Integration/Amazon-Simple-Notification-Service-SNS.png -------------------------------------------------------------------------------- /assets/icons/aws/Application_Integration/Amazon-Simple-Notification-Service-SNS_Topic_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Application_Integration/Amazon-Simple-Notification-Service-SNS_Topic_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Application_Integration/Amazon-Simple-Queue-Service-SQS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Application_Integration/Amazon-Simple-Queue-Service-SQS.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/AWS-Batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/AWS-Batch.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/AWS-Elastic-Beanstalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/AWS-Elastic-Beanstalk.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/AWS-Lambda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/AWS-Lambda.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/AWS-Lambda_Lambda-Function_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/AWS-Lambda_Lambda-Function_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-EC2-Auto-Scaling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-EC2-Auto-Scaling.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-EC2-Container-Registry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-EC2-Container-Registry.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-EC2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-EC2.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-EC2_AMI_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-EC2_AMI_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-EC2_Elastic-IP-Address_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-EC2_Elastic-IP-Address_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-Elastic-Container-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-Elastic-Container-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-Elastic-Container-Service_Service_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-Elastic-Container-Service_Service_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-Elastic-Container-Service_Task_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-Elastic-Container-Service_Task_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-Elastic-Kubernetes-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-Elastic-Kubernetes-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/Amazon-Lightsail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/Amazon-Lightsail.png -------------------------------------------------------------------------------- /assets/icons/aws/Compute/_Instance/Amazon-EC2_Spot-instance_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Compute/_Instance/Amazon-EC2_Spot-instance_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Customer_Engagement/Amazon-Simple-Email-Service-SES.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Customer_Engagement/Amazon-Simple-Email-Service-SES.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/AWS-Database-Migration-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/AWS-Database-Migration-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-DynamoDB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-DynamoDB.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-DynamoDB_Item_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-DynamoDB_Item_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-DynamoDB_Table_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-DynamoDB_Table_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-ElastiCache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-ElastiCache.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-Neptune.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-Neptune.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-RDS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-RDS.png -------------------------------------------------------------------------------- /assets/icons/aws/Database/Amazon-Redshift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Database/Amazon-Redshift.png -------------------------------------------------------------------------------- /assets/icons/aws/Developer_Tools/AWS-Cloud9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Developer_Tools/AWS-Cloud9.png -------------------------------------------------------------------------------- /assets/icons/aws/Developer_Tools/AWS-CodeBuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Developer_Tools/AWS-CodeBuild.png -------------------------------------------------------------------------------- /assets/icons/aws/Developer_Tools/AWS-CodeCommit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Developer_Tools/AWS-CodeCommit.png -------------------------------------------------------------------------------- /assets/icons/aws/Developer_Tools/AWS-CodeDeploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Developer_Tools/AWS-CodeDeploy.png -------------------------------------------------------------------------------- /assets/icons/aws/Developer_Tools/AWS-CodePipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Developer_Tools/AWS-CodePipeline.png -------------------------------------------------------------------------------- /assets/icons/aws/Game_Tech/Amazon-GameLift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Game_Tech/Amazon-GameLift.png -------------------------------------------------------------------------------- /assets/icons/aws/Internet_of_Things/Internet-of-Things.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Internet_of_Things/Internet-of-Things.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Auto-Scaling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Auto-Scaling.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-CloudFormation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-CloudFormation.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-CloudTrail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-CloudTrail.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Config.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-OpsWorks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-OpsWorks.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Apps_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Apps_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Instances_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Instances_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Layers_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Layers_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Permissions_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-OpsWorks_Permissions_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Organizations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Organizations.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Organizations_Account_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Organizations_Account_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Service-Catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Service-Catalog.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Systems-Manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Systems-Manager.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Documents_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Documents_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Maintenance-Windows_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Maintenance-Windows_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Parameter-Store_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Parameter-Store_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Patch-Manager_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/AWS-Systems-Manager_Patch-Manager_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/Amazon-CloudWatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/Amazon-CloudWatch.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Alarm_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Alarm_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Event-Event-Based_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Event-Event-Based_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Rule_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Management_and_Governance/Amazon-CloudWatch_Rule_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Media_Services/AWS-Elemental-MediaStore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Media_Services/AWS-Elemental-MediaStore.png -------------------------------------------------------------------------------- /assets/icons/aws/Media_Services/Amazon-Elastic-Transcoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Media_Services/Amazon-Elastic-Transcoder.png -------------------------------------------------------------------------------- /assets/icons/aws/Migration_and_Transfer/AWS-Application-Discovery-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Migration_and_Transfer/AWS-Application-Discovery-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Mobile/AWS-AppSync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Mobile/AWS-AppSync.png -------------------------------------------------------------------------------- /assets/icons/aws/Mobile/AWS-Device-Farm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Mobile/AWS-Device-Farm.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/AWS-Direct-Connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/AWS-Direct-Connect.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-API-Gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-API-Gateway.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-CloudFront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-CloudFront.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-Route-53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-Route-53.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-Route-53_Hosted-Zone_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-Route-53_Hosted-Zone_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Customer-Gateway_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Customer-Gateway_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Elastic-Network-Interface_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Elastic-Network-Interface_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Endpoints_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Endpoints_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Flow-Logs_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Flow-Logs_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Internet-Gateway_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Internet-Gateway_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_NAT-Gateway_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_NAT-Gateway_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Network-Access-Control-List_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Network-Access-Control-List_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Peering_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Peering_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Router_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_Router_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_VPN-Connection_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_VPN-Connection_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_VPN-Gateway_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Amazon-VPC_VPN-Gateway_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Networking_and_Content_Delivery/Elastic-Load-Balancing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Networking_and_Content_Delivery/Elastic-Load-Balancing.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Certificate-Manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Certificate-Manager.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Directory-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Directory-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Data-Encryption-Key_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Data-Encryption-Key_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Permissions_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Permissions_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Role_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management-IAM_Role_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management_IAM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Identity-and-Access-Management_IAM.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Key-Management-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Key-Management-Service.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-Secrets-Manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-Secrets-Manager.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-WAF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-WAF.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/AWS-WAF_Filtering-rule_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/AWS-WAF_Filtering-rule_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/Amazon-Cognito.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/Amazon-Cognito.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/Amazon-GuardDuty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/Amazon-GuardDuty.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/Amazon-Inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/Amazon-Inspector.png -------------------------------------------------------------------------------- /assets/icons/aws/Security_Identity_and_Compliance/Amazon-Macie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Security_Identity_and_Compliance/Amazon-Macie.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/AWS-Storage-Gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/AWS-Storage-Gateway.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/AWS-Storage-Gateway_Cached-Volume_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/AWS-Storage-Gateway_Cached-Volume_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-Elastic-Block-Store-EBS_Snapshot_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-Elastic-Block-Store-EBS_Snapshot_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-Elastic-Block-Store-EBS_Volume_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-Elastic-Block-Store-EBS_Volume_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-Elastic-File-System_EFS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-Elastic-File-System_EFS.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-S3-Glacier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-S3-Glacier.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-Simple-Storage-Service-S3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-Simple-Storage-Service-S3.png -------------------------------------------------------------------------------- /assets/icons/aws/Storage/Amazon-Simple-Storage-Service-S3_Object_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/Storage/Amazon-Simple-Storage-Service-S3_Object_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/_Group_Icons/Spot-fleet_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/_Group_Icons/Spot-fleet_light-bg.png -------------------------------------------------------------------------------- /assets/icons/aws/_Group_Icons/VPC-subnet-public_light-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/aws/_Group_Icons/VPC-subnet-public_light-bg.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Analytics/00009-icon-service-Log-Analytics-Workspaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Analytics/00009-icon-service-Log-Analytics-Workspaces.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Analytics/00037-icon-service-HD-Insight-Clusters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Analytics/00037-icon-service-HD-Insight-Clusters.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Analytics/00039-icon-service-Event-Hubs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Analytics/00039-icon-service-Event-Hubs.png -------------------------------------------------------------------------------- /assets/icons/azurerm/App_Services/10044-icon-service-Search-Services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/App_Services/10044-icon-service-Search-Services.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10025-icon-service-Availability-Sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10025-icon-service-Availability-Sets.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10033-icon-service-Images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10033-icon-service-Images.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10034-icon-service-VM-Scale-Sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10034-icon-service-VM-Scale-Sets.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10038-icon-service-Image-Versions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10038-icon-service-Image-Versions.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10039-icon-service-Shared-Image-Galleries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10039-icon-service-Shared-Image-Galleries.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Compute/10040-icon-service-VM-Images-(Classic).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Compute/10040-icon-service-VM-Images-(Classic).png -------------------------------------------------------------------------------- /assets/icons/azurerm/Containers/10031-icon-service-Batch-Accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Containers/10031-icon-service-Batch-Accounts.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Containers/10035-icon-service-App-Services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Containers/10035-icon-service-App-Services.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Containers/10036-icon-service-Service-Fabric-Clusters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Containers/10036-icon-service-Service-Fabric-Clusters.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Containers/10105-icon-service-Container-Registries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Containers/10105-icon-service-Container-Registries.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10122-icon-service-Azure-Database-MySQL-Server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10122-icon-service-Azure-Database-MySQL-Server.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10123-icon-service-Azure-Database-MariaDB-Server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10123-icon-service-Azure-Database-MariaDB-Server.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10130-icon-service-SQL-Database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10130-icon-service-SQL-Database.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10131-icon-service-Azure-Database-PostgreSQL-Server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10131-icon-service-Azure-Database-PostgreSQL-Server.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10132-icon-service-SQL-Server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10132-icon-service-SQL-Server.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10134-icon-service-SQL-Elastic-Pools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10134-icon-service-SQL-Elastic-Pools.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Databases/10137-icon-service-Cache-Redis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Databases/10137-icon-service-Cache-Redis.png -------------------------------------------------------------------------------- /assets/icons/azurerm/DevOps/10264-icon-service-DevTest-Labs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/DevOps/10264-icon-service-DevTest-Labs.png -------------------------------------------------------------------------------- /assets/icons/azurerm/General/10839-icon-service-Storage-Container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/General/10839-icon-service-Storage-Container.png -------------------------------------------------------------------------------- /assets/icons/azurerm/General/10840-icon-service-Storage-Queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/General/10840-icon-service-Storage-Queue.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Integration/00041-icon-service-Data-Factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Integration/00041-icon-service-Data-Factory.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Integration/10206-icon-service-Event-Grid-Topics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Integration/10206-icon-service-Event-Grid-Topics.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Integration/10215-icon-service-Event-Grid-Domains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Integration/10215-icon-service-Event-Grid-Domains.png -------------------------------------------------------------------------------- /assets/icons/azurerm/IoT/00042-icon-service-Stream-Analytics-Jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/IoT/00042-icon-service-Stream-Analytics-Jobs.png -------------------------------------------------------------------------------- /assets/icons/azurerm/IoT/10029-icon-service-Function-Apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/IoT/10029-icon-service-Function-Apps.png -------------------------------------------------------------------------------- /assets/icons/azurerm/IoT/10045-icon-service-Notification-Hubs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/IoT/10045-icon-service-Notification-Hubs.png -------------------------------------------------------------------------------- /assets/icons/azurerm/IoT/10183-icon-service-Event-Grid-Subscriptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/IoT/10183-icon-service-Event-Grid-Subscriptions.png -------------------------------------------------------------------------------- /assets/icons/azurerm/IoT/10184-icon-service-IoT-Central-Applications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/IoT/10184-icon-service-IoT-Central-Applications.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Management_and_Governance/00012-icon-service-Application-Insights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Management_and_Governance/00012-icon-service-Application-Insights.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Management_and_Governance/00022-icon-service-Automation-Accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Management_and_Governance/00022-icon-service-Automation-Accounts.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/00023-icon-service-Network-Watcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/00023-icon-service-Network-Watcher.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/00056-icon-service-CDN-Profiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/00056-icon-service-CDN-Profiles.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/01105-icon-service-Private-Link-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/01105-icon-service-Private-Link-Service.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10062-icon-service-Load-Balancers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10062-icon-service-Load-Balancers.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10063-icon-service-Virtual-Network-Gateways.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10063-icon-service-Virtual-Network-Gateways.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10064-icon-service-DNS-Zones.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10064-icon-service-DNS-Zones.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10065-icon-service-Traffic-Manager-Profiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10065-icon-service-Traffic-Manager-Profiles.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10067-icon-service-Network-Security-Groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10067-icon-service-Network-Security-Groups.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10071-icon-service-Route-Filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10071-icon-service-Route-Filters.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10073-icon-service-Front-Doors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10073-icon-service-Front-Doors.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10075-icon-service-Virtual-Networks-(Classic).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10075-icon-service-Virtual-Networks-(Classic).png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10079-icon-service-ExpressRoute-Circuits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10079-icon-service-ExpressRoute-Circuits.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10080-icon-service-Network-Interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10080-icon-service-Network-Interfaces.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10083-icon-service-Application-Security-Groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10083-icon-service-Application-Security-Groups.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10362-icon-service-Web-Application-Firewall-Policies(WAF).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10362-icon-service-Web-Application-Firewall-Policies(WAF).png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10365-icon-service-Proximity-Placement-Groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10365-icon-service-Proximity-Placement-Groups.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Networking/10372-icon-service-Public-IP-Prefixes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Networking/10372-icon-service-Public-IP-Prefixes.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Other/00398-icon-service-Disk-Encryption-Sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Other/00398-icon-service-Disk-Encryption-Sets.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Other/10076-icon-service-Application-Gateways.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Other/10076-icon-service-Application-Gateways.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Storage/00017-icon-service-Recovery-Services-Vaults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Storage/00017-icon-service-Recovery-Services-Vaults.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Storage/10087-icon-service-Storage-Accounts-(Classic).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Storage/10087-icon-service-Storage-Accounts-(Classic).png -------------------------------------------------------------------------------- /assets/icons/azurerm/Storage/10090-icon-service-Data-Lake-Storage-Gen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Storage/10090-icon-service-Data-Lake-Storage-Gen1.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Storage/10098-icon-service-Data-Shares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Storage/10098-icon-service-Data-Shares.png -------------------------------------------------------------------------------- /assets/icons/azurerm/Web/10053-icon-service-Notification-Hub-Namespaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/azurerm/Web/10053-icon-service-Notification-Hub-Namespaces.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Application-SMN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Application-SMN.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Computing-AS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Computing-AS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Computing-CCE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Computing-CCE.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Computing-ECS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Computing-ECS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Data Analysis&AI-DWS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Data Analysis&AI-DWS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Data Analysis&AI-MLS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Data Analysis&AI-MLS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Data Analysis&AI-MRS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Data Analysis&AI-MRS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Database-DCS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Database-DCS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Database-RDS .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Database-RDS .png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Management&Deployment-CES.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Management&Deployment-CES.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Management&Deployment-CTS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Management&Deployment-CTS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Management&Deployment-RTS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Management&Deployment-RTS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Network-DNS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Network-DNS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Network-EIP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Network-EIP.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Network-ELB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Network-ELB.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Network-VPC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Network-VPC.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Network.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Security-Anti-DDoS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Security-Anti-DDoS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Security-KMS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Security-KMS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Storage-CSBS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Storage-CSBS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Storage-SFS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Storage-SFS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Storage-VBS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Storage-VBS.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/Storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/Storage.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/bucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/bucket.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/cloud-server-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/cloud-server-group.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/drs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/drs.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/firewall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/firewall.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/key-pair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/key-pair.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/nat-gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/nat-gateway.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/peer link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/peer link.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/security-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/security-group.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/subnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/subnet.png -------------------------------------------------------------------------------- /assets/icons/flexibleengine/zone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/flexibleengine/zone.png -------------------------------------------------------------------------------- /assets/icons/google/Compute/App_Engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Compute/App_Engine.png -------------------------------------------------------------------------------- /assets/icons/google/Compute/Cloud_Functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Compute/Cloud_Functions.png -------------------------------------------------------------------------------- /assets/icons/google/Compute/Cloud_Run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Compute/Cloud_Run.png -------------------------------------------------------------------------------- /assets/icons/google/Compute/Compute_Engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Compute/Compute_Engine.png -------------------------------------------------------------------------------- /assets/icons/google/Compute/Kubernetes_Engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Compute/Kubernetes_Engine.png -------------------------------------------------------------------------------- /assets/icons/google/Data_Analytics/Big_Query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Data_Analytics/Big_Query.png -------------------------------------------------------------------------------- /assets/icons/google/Data_Analytics/Cloud_Dataflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Data_Analytics/Cloud_Dataflow.png -------------------------------------------------------------------------------- /assets/icons/google/Data_Analytics/Cloud_Dataproc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Data_Analytics/Cloud_Dataproc.png -------------------------------------------------------------------------------- /assets/icons/google/Data_Analytics/Cloud_PubSub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Data_Analytics/Cloud_PubSub.png -------------------------------------------------------------------------------- /assets/icons/google/Databases/Cloud_Bigtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Databases/Cloud_Bigtable.png -------------------------------------------------------------------------------- /assets/icons/google/Databases/Cloud_Firestore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Databases/Cloud_Firestore.png -------------------------------------------------------------------------------- /assets/icons/google/Databases/Cloud_Memorystore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Databases/Cloud_Memorystore.png -------------------------------------------------------------------------------- /assets/icons/google/Databases/Cloud_SQL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Databases/Cloud_SQL.png -------------------------------------------------------------------------------- /assets/icons/google/Databases/Cloud_Spanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Databases/Cloud_Spanner.png -------------------------------------------------------------------------------- /assets/icons/google/Developer_Tools/Cloud_Build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Developer_Tools/Cloud_Build.png -------------------------------------------------------------------------------- /assets/icons/google/Management_Tools/Cloud_Billing_API.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Management_Tools/Cloud_Billing_API.png -------------------------------------------------------------------------------- /assets/icons/google/Management_Tools/Logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Management_Tools/Logging.png -------------------------------------------------------------------------------- /assets/icons/google/Management_Tools/Monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Management_Tools/Monitoring.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_DNS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_DNS.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_NAT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_NAT.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_Network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_Network.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_Router.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_Router.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_Routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_Routes.png -------------------------------------------------------------------------------- /assets/icons/google/Networking/Cloud_VPN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Networking/Cloud_VPN.png -------------------------------------------------------------------------------- /assets/icons/google/Security/Cloud_IAM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Security/Cloud_IAM.png -------------------------------------------------------------------------------- /assets/icons/google/Security/Key_Management_Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Security/Key_Management_Service.png -------------------------------------------------------------------------------- /assets/icons/google/Storage/Cloud_Filestore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Storage/Cloud_Filestore.png -------------------------------------------------------------------------------- /assets/icons/google/Storage/Cloud_Storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Storage/Cloud_Storage.png -------------------------------------------------------------------------------- /assets/icons/google/Storage/Persistent_Disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/google/Storage/Persistent_Disk.png -------------------------------------------------------------------------------- /assets/icons/im/baseline_cloud_queue_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/im/baseline_cloud_queue_black.png -------------------------------------------------------------------------------- /assets/icons/openstack/db-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/db-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/firewall-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/firewall-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/flavor-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/flavor-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/floatingip-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/floatingip-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/image-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/image-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/keypair-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/keypair-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/lb-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/lb-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/network-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/network-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/router-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/router-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/securitygroup-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/securitygroup-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/server-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/server-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/stack-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/stack-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/volume-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/volume-gray.png -------------------------------------------------------------------------------- /assets/icons/openstack/vpn-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/assets/icons/openstack/vpn-gray.png -------------------------------------------------------------------------------- /cmd/doc.go: -------------------------------------------------------------------------------- 1 | // Package cmd holds all the commands 2 | // that InfraMap has 3 | package cmd 4 | -------------------------------------------------------------------------------- /cmd/generate.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "os" 7 | "strings" 8 | 9 | "github.com/spf13/afero" 10 | "github.com/spf13/cobra" 11 | 12 | "github.com/cycloidio/inframap/generate" 13 | "github.com/cycloidio/inframap/graph" 14 | "github.com/cycloidio/inframap/printer" 15 | "github.com/cycloidio/inframap/printer/factory" 16 | ) 17 | 18 | var ( 19 | printerType string 20 | raw bool 21 | clean bool 22 | connections bool 23 | showIcons bool 24 | externalNodes bool 25 | descriptionFile string 26 | alternativeNodeNames bool 27 | 28 | generateCmd = &cobra.Command{ 29 | Use: "generate [FILE]", 30 | Short: "Generates the Graph", 31 | Long: "Generates the Graph from TFState or HCL", 32 | Example: "inframap generate state.tfstate\ncat state.tfstate | inframap generate", 33 | Args: cobra.MaximumNArgs(1), 34 | PreRunE: preRunFile, 35 | RunE: func(cmd *cobra.Command, args []string) error { 36 | opt := generate.Options{ 37 | Raw: raw, 38 | Clean: clean, 39 | Connections: connections, 40 | ExternalNodes: externalNodes, 41 | } 42 | 43 | var ( 44 | g *graph.Graph 45 | gdesc map[string]interface{} 46 | err error 47 | ) 48 | 49 | if tfstate { 50 | g, gdesc, err = generate.FromState(file, opt) 51 | } else { 52 | if len(file) == 0 { 53 | g, gdesc, err = generate.FromHCL(afero.NewOsFs(), path, opt) 54 | } else { 55 | fs := afero.NewMemMapFs() 56 | path = "module.tf" 57 | 58 | var f afero.File 59 | f, err = fs.Create(path) 60 | if err != nil { 61 | return err 62 | } 63 | 64 | _, err = f.Write(file) 65 | if err != nil { 66 | return err 67 | } 68 | 69 | err = f.Sync() 70 | if err != nil { 71 | return err 72 | } 73 | 74 | g, gdesc, err = generate.FromHCL(fs, path, opt) 75 | } 76 | } 77 | 78 | if err != nil { 79 | return err 80 | } 81 | 82 | p, err := factory.Get(printerType) 83 | if err != nil { 84 | return err 85 | } 86 | 87 | if descriptionFile != "" && gdesc != nil { 88 | df, err := os.OpenFile(descriptionFile, os.O_APPEND|os.O_TRUNC|os.O_RDWR|os.O_CREATE, 0644) 89 | if err != nil { 90 | return err 91 | } 92 | defer df.Close() 93 | 94 | // The gdesc has the description of all the elements of the graph, including the 95 | // edges so we have to remove them from the output 96 | for can := range gdesc { 97 | if _, err := g.GetNodeByCanonical(can); err != nil { 98 | delete(gdesc, can) 99 | } 100 | } 101 | 102 | b, err := json.Marshal(gdesc) 103 | if err != nil { 104 | return err 105 | } 106 | 107 | df.Write(b) 108 | } 109 | 110 | popt := printer.Options{ 111 | ShowIcons: showIcons, 112 | AlternativeNodeNames: alternativeNodeNames, 113 | } 114 | err = p.Print(g, popt, os.Stdout) 115 | if err != nil { 116 | return err 117 | } 118 | 119 | return nil 120 | }, 121 | } 122 | ) 123 | 124 | func init() { 125 | generateCmd.Flags().StringVar(&printerType, "printer", "dot", fmt.Sprintf("Type of printer to use for the output. Supported ones are: %s", strings.Join(printer.TypeStrings(), ","))) 126 | generateCmd.Flags().BoolVar(&raw, "raw", false, "Raw will not use any specific logic from the provider, will just display the connections between elements. It's used by default if none of the Providers is known") 127 | generateCmd.Flags().BoolVar(&clean, "clean", true, "Clean will the generated graph will not have any Node that does not have a connection/edge") 128 | generateCmd.Flags().BoolVar(&connections, "connections", true, "Connections will apply the logic of the provider to remove resources that are not nodes") 129 | generateCmd.Flags().BoolVar(&showIcons, "show-icons", true, "Toggle the icons on the printed graph") 130 | generateCmd.Flags().BoolVar(&externalNodes, "external-nodes", true, "Toggle the addition of external nodes like 'im_out' (used to show ingress connections)") 131 | generateCmd.Flags().StringVar(&descriptionFile, "description-file", "", "On the given file (will be created or overwritten) we'll output the description of the returned graph, with the attributes of all the visible nodes") 132 | generateCmd.Flags().BoolVar(&alternativeNodeNames, "alternative-node-names", false, "Whether to try reading node names from tags, labels and other sources instead of using the canonical names") 133 | } 134 | -------------------------------------------------------------------------------- /cmd/prune.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | "github.com/spf13/cobra" 8 | 9 | "github.com/cycloidio/inframap/prune" 10 | ) 11 | 12 | var ( 13 | canonicals bool 14 | pruneCmd = &cobra.Command{ 15 | Use: "prune [FILE]", 16 | Short: "Prunes the file", 17 | Long: "Prunes the TFState or HCL file", 18 | Example: "inframap prune state.tfstate", 19 | Args: cobra.MaximumNArgs(1), 20 | PreRunE: preRunFile, 21 | RunE: func(cmd *cobra.Command, args []string) error { 22 | if tfstate { 23 | s, err := prune.Prune(file, canonicals) 24 | if err != nil { 25 | return err 26 | } 27 | 28 | fmt.Println(string(s)) 29 | } else { 30 | return errors.New("prune does not support HCL yet") 31 | } 32 | 33 | return nil 34 | }, 35 | } 36 | ) 37 | 38 | func init() { 39 | pruneCmd.Flags().BoolVar(&canonicals, "canonicals", false, "If the prune command will also assign random names to the resources, EX: aws_lb.front => aws_lb.123") 40 | } 41 | -------------------------------------------------------------------------------- /cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | "io/ioutil" 7 | "os" 8 | 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | var ( 13 | hcl bool 14 | tfstate bool 15 | file []byte 16 | path string 17 | 18 | rootCmd = &cobra.Command{ 19 | Use: "inframap", 20 | Short: "Reads the TFState or HCL to generate a Graphical view", 21 | Long: "Reads the TFState or HCL to generate a Graphical view with Nodes and Edges.", 22 | } 23 | ) 24 | 25 | // Execute executes the root command. 26 | func Execute() error { 27 | return rootCmd.Execute() 28 | } 29 | 30 | // preRunFile checks where the input is, ARGS or STDIN 31 | // also checks if --hcl or --tfstate are setted as one of 32 | // them is required 33 | func preRunFile(cmd *cobra.Command, args []string) error { 34 | var err error 35 | 36 | if len(args) == 1 { 37 | path = args[0] 38 | 39 | fi, err := os.Stat(path) 40 | if err != nil { 41 | return err 42 | } 43 | 44 | if !fi.IsDir() { 45 | file, err = ioutil.ReadFile(path) 46 | if err != nil { 47 | return err 48 | } 49 | } else { 50 | // Only HCL can used with dirs 51 | hcl = true 52 | tfstate = false 53 | } 54 | } else { 55 | fi, err := os.Stdin.Stat() 56 | if err != nil { 57 | return err 58 | } 59 | 60 | if fi.Mode()&os.ModeNamedPipe == 0 { 61 | return errors.New("STDIN is empty") 62 | } 63 | 64 | file, err = ioutil.ReadAll(os.Stdin) 65 | if err != nil { 66 | return err 67 | } 68 | 69 | } 70 | 71 | setGenerateType(file) 72 | 73 | return err 74 | } 75 | 76 | // setGenerateType will try to guess the file content by first parsing it in JSON 77 | // and if it fails fallback to HCL. 78 | // If any of the flags --hcl or --tfstate are set it'll do nothing and use those 79 | // directly as they are setted by the user 80 | func setGenerateType(b []byte) { 81 | if hcl || tfstate { 82 | return 83 | } 84 | 85 | var aux map[string]interface{} 86 | if err := json.Unmarshal(b, &aux); err != nil { 87 | hcl = true 88 | tfstate = false 89 | } else { 90 | hcl = false 91 | tfstate = true 92 | } 93 | } 94 | 95 | func init() { 96 | rootCmd.AddCommand( 97 | generateCmd, 98 | pruneCmd, 99 | versionCmd, 100 | ) 101 | 102 | rootCmd.PersistentFlags().BoolVar(&hcl, "hcl", false, "Forces to use HCL parser") 103 | rootCmd.PersistentFlags().BoolVar(&tfstate, "tfstate", false, "Forces to use TFState parser") 104 | } 105 | -------------------------------------------------------------------------------- /cmd/version.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | var ( 10 | // Version is the value of the current verion, this 11 | // is set via -ldflags 12 | Version string 13 | 14 | versionCmd = &cobra.Command{ 15 | Use: "version", 16 | Short: "Prints the current build version", 17 | Run: func(cmd *cobra.Command, args []string) { 18 | if Version != "" { 19 | fmt.Printf("The current version is: %s\n", Version) 20 | } else { 21 | fmt.Printf("No version defined\n") 22 | } 23 | }, 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /docs/Openstack-vertical-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/Openstack-vertical-small.png -------------------------------------------------------------------------------- /docs/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/aws.png -------------------------------------------------------------------------------- /docs/azure.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/flexibleengine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/flexibleengine.png -------------------------------------------------------------------------------- /docs/google-cloud.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/inframap-logo_color-RGB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/inframap-logo_color-RGB.png -------------------------------------------------------------------------------- /docs/inframap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/inframap.png -------------------------------------------------------------------------------- /docs/inframapconnections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/inframapconnections.png -------------------------------------------------------------------------------- /docs/inframapraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cycloidio/inframap/d59165c805de3d8212b5a1ffbd668925b8c8e0c0/docs/inframapraw.png -------------------------------------------------------------------------------- /errcode/code.go: -------------------------------------------------------------------------------- 1 | package errcode 2 | 3 | import "errors" 4 | 5 | // List of all the errors 6 | var ( 7 | ErrGraphEdgeReplace = errors.New("graph edge replace source not found") 8 | ErrGraphRequiredEdgeID = errors.New("graph edge ID is required") 9 | ErrGraphRequiredEdgeTarget = errors.New("graph edge target is required") 10 | ErrGraphRequiredEdgeSource = errors.New("graph edge source is required") 11 | ErrGraphNotFoundEdgeTarget = errors.New("graph edge target not found") 12 | ErrGraphNotFoundEdgeSource = errors.New("graph edge source not found") 13 | ErrGraphAlreadyExistsEdge = errors.New("graph edge already exists") 14 | ErrGraphAlreadyExistsEdgeID = errors.New("graph edge ID already exists") 15 | ErrGraphRequiredNodeCanonical = errors.New("graph node canonical is required") 16 | ErrGraphRequiredNodeID = errors.New("graph node ID is required") 17 | ErrGraphAlreadyExistsNode = errors.New("graph node already exists") 18 | ErrGraphAlreadyExistsNodeID = errors.New("graph node ID already exists") 19 | ErrGraphNotFoundNode = errors.New("graph node not found") 20 | ErrGraphRequiredEdgeBetweenNodes = errors.New("graph requires edge between nodes") 21 | 22 | ErrProviderNotFoundResource = errors.New("provider resource not found") 23 | ErrProviderNotFoundDataSource = errors.New("provider data source not found") 24 | ErrProviderNotFound = errors.New("provider not found") 25 | 26 | ErrInvalidTFStateFile = errors.New("invalid Terraform State file") 27 | ErrInvalidTFStateVersion = errors.New("invalid Terraform State version, we only support version 3 and 4") 28 | ErrInvalidTFStateFileMissingResourceID = errors.New("invalid Terraform State file, a resource is missing the attributes.id") 29 | 30 | ErrPrinterNotFound = errors.New("printer not found") 31 | 32 | ErrGenerateFromJSON = errors.New("we do not support JSON HCL") 33 | ) 34 | -------------------------------------------------------------------------------- /errcode/doc.go: -------------------------------------------------------------------------------- 1 | // Package errcode contains the list of all the errors we 2 | // can return. 3 | // This way we have a single package for the errors and can 4 | // be reused between multiple packages 5 | package errcode 6 | -------------------------------------------------------------------------------- /generate/connection.go: -------------------------------------------------------------------------------- 1 | package generate 2 | 3 | import ( 4 | "github.com/cycloidio/inframap/graph" 5 | "github.com/cycloidio/inframap/provider" 6 | ) 7 | 8 | type direction int 9 | 10 | const ( 11 | positive direction = 1 12 | negative direction = -1 13 | ) 14 | 15 | // connection represents the Node and Direction of the connection(edge) 16 | // It's always respective to the root Node in which it was created from 17 | // An example would be: RN [-> N1] The content of the [] is what the 18 | // connection represents. 19 | // The Direction is respective to the RN if it's in favor it is positive( RN -> ) 20 | // if not it is negative ( RN <- ) 21 | type connection struct { 22 | Node *graph.Node 23 | // Direction is related to the 24 | // first node of the chain. 25 | Direction direction 26 | } 27 | 28 | // findEdgeConnections for each edge on n returns the closests connections to a Node. 29 | // The last 'connection' on the []*connection will be a valid provider Node. 30 | // If there are more than one short path they will also be returend 31 | // The [][][]*connection is: 32 | // * First [] is for each edge of the n 33 | // * Second [] is for the shortest connections 34 | // * Third [] is for the connections building a shortest path to another Node 35 | func findEdgeConnections(g *graph.Graph, n *graph.Node, visited map[string]struct{}, opt Options) ([][][]*connection, error) { 36 | res := make([][][]*connection, 0) 37 | edges := g.GetEdgesForNode(n.ID) 38 | for _, e := range edges { 39 | // If we have already visited that Edge 40 | // we skip it 41 | if _, ok := visited[e.ID]; ok { 42 | continue 43 | } 44 | 45 | // Get the Node on the other 46 | // part of the Edge 47 | en, err := g.GetNodeByID(e.Source) 48 | direc := negative 49 | if e.Source == n.ID { 50 | en, err = g.GetNodeByID(e.Target) 51 | direc = positive 52 | } 53 | if err != nil { 54 | return nil, err 55 | } 56 | 57 | pv, rs, err := getProviderAndResource(en.Canonical, opt) 58 | if err != nil { 59 | return nil, err 60 | } 61 | 62 | // If it's IM we do not want to try to merge or anything 63 | // so we just continue to the next edge 64 | if pv.Type() == provider.IM { 65 | continue 66 | } 67 | 68 | visited[e.ID] = struct{}{} 69 | // If it's a Node we just add it 70 | if pv.IsNode(rs) { 71 | res = append(res, [][]*connection{ 72 | { 73 | &connection{ 74 | Node: en, 75 | Direction: direc, 76 | }, 77 | }, 78 | }) 79 | } else { 80 | 81 | // We make a copy of the visited so 82 | // each nested edge does not share the 83 | // same copy of it and produces a wrong 84 | // result 85 | aux := make(map[string]struct{}) 86 | for k, v := range visited { 87 | aux[k] = v 88 | } 89 | 90 | // We get all the shortest path to a Node and append it 91 | cons, err := getShortestNodePath(g, en, aux, opt) 92 | if err != nil { 93 | return nil, err 94 | } 95 | // If there are no connections means it's an end Node, 96 | // and as it is not a Node (it'll have entered the previous 97 | // condition) it means it has no Node at the end so we do not 98 | // return it 99 | if len(cons) != 0 { 100 | for i, cs := range cons { 101 | // Append the first edge node 102 | // to the first position of the 103 | // connections 104 | con := []*connection{ 105 | &connection{ 106 | Node: en, 107 | Direction: direc, 108 | }, 109 | } 110 | cons[i] = append(con, cs...) 111 | } 112 | 113 | res = append(res, cons) 114 | } 115 | } 116 | } 117 | return res, nil 118 | } 119 | 120 | // getShortestNodePath get the shortest path to a Node starting from n 121 | func getShortestNodePath(g *graph.Graph, n *graph.Node, visited map[string]struct{}, opt Options) ([][]*connection, error) { 122 | edges, err := findEdgeConnections(g, n, visited, opt) 123 | if err != nil { 124 | return nil, err 125 | } 126 | 127 | // From all the possible Edges we take the 128 | // shortest path 129 | shortestCons := make([][]*connection, 0, 0) 130 | if len(edges) > 0 { 131 | shortestCons = [][]*connection{ 132 | edges[0][0], 133 | } 134 | for _, cs := range edges { 135 | for _, cons := range cs { 136 | // Compare for the shortest path 137 | if len(shortestCons[0]) > len(cons) { 138 | shortestCons = [][]*connection{ 139 | cons, 140 | } 141 | } else if len(shortestCons[0]) == len(cons) { 142 | shortestCons = append(shortestCons, cons) 143 | } 144 | } 145 | } 146 | } 147 | return shortestCons, nil 148 | } 149 | -------------------------------------------------------------------------------- /generate/doc.go: -------------------------------------------------------------------------------- 1 | // Package generate has the logic to generate Graph from 2 | // HCL or State 3 | package generate 4 | -------------------------------------------------------------------------------- /generate/helper_test.go: -------------------------------------------------------------------------------- 1 | package generate_test 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/assert" 9 | "github.com/stretchr/testify/require" 10 | 11 | "github.com/cycloidio/inframap/graph" 12 | ) 13 | 14 | // assertEqualGraph will compare the expected graph to the actual one, the way it'll do that is by ignoring the IDs 15 | // and only using the canonicals of the Node, same with the Edges 16 | func assertEqualGraph(t *testing.T, expected, actual *graph.Graph, actualCfg map[string]interface{}) { 17 | 18 | assert.Len(t, actual.Nodes, len(expected.Nodes), "Nodes") 19 | assert.Len(t, actual.Edges, len(expected.Edges), "Edges") 20 | 21 | // nodeCans holds canonical -> graph.Node 22 | nodeCans := make(map[string]*graph.Node) 23 | 24 | // nodeIDs holds ID -> canonical 25 | nodeIDs := make(map[string]string) 26 | 27 | // edgeDirections it's a combination of "source+target" key 28 | edgeDirections := make(map[string]*graph.Edge) 29 | 30 | // edgeCans holds all the edge canonicals 31 | edgeCans := make(map[string]struct{}) 32 | 33 | for _, n := range actual.Nodes { 34 | nodeCans[n.Canonical] = n 35 | nodeIDs[n.ID] = n.Canonical 36 | } 37 | 38 | for _, e := range actual.Edges { 39 | so, ok := nodeIDs[e.Source] 40 | require.True(t, ok, "The ID %q is missing", e.Source) 41 | 42 | ta, ok := nodeIDs[e.Target] 43 | require.True(t, ok, "The ID %q is missing", e.Target) 44 | 45 | edgeDirections[formatEdgeKey(so, ta)] = e 46 | 47 | for _, c := range e.Canonicals { 48 | edgeCans[c] = struct{}{} 49 | } 50 | } 51 | 52 | for _, en := range expected.Nodes { 53 | if an, ok := nodeCans[en.Canonical]; ok { 54 | en.ID = an.ID 55 | en.TFID = an.TFID 56 | en.Resource = an.Resource 57 | en.Weight = an.Weight 58 | assert.Equal(t, en, an) 59 | } else { 60 | assert.Failf(t, "Fail", "The Node with Canonical %q is missing", en.Canonical) 61 | } 62 | } 63 | 64 | for _, ee := range expected.Edges { 65 | if e, ok := edgeDirections[formatEdgeKey(ee.Source, ee.Target)]; !ok { 66 | if _, ok = edgeDirections[formatEdgeKey(ee.Target, ee.Source)]; ok { 67 | assert.Failf(t, "Fail", "The Edge with Source %q and Target %q is present but in the other direction", ee.Source, ee.Target) 68 | } else { 69 | assert.Failf(t, "Fail", "The Edge with Source %q and Target %q is missing", ee.Source, ee.Target) 70 | } 71 | } else { 72 | sort.Strings(e.Canonicals) 73 | sort.Strings(ee.Canonicals) 74 | assert.Equal(t, ee.Canonicals, e.Canonicals, fmt.Sprintf("Source: %s Target: %s", ee.Source, ee.Target)) 75 | } 76 | } 77 | 78 | // As the FromHCL does not have config 79 | // the validation for nil has to be done before, here 80 | // it'll be ignored if nil 81 | if actualCfg != nil { 82 | actualCans := make([]string, 0, 0) 83 | for k, _ := range actualCfg { 84 | actualCans = append(actualCans, k) 85 | } 86 | 87 | expectedCans := make([]string, 0, 0) 88 | for k := range edgeCans { 89 | expectedCans = append(expectedCans, k) 90 | } 91 | for k := range nodeCans { 92 | expectedCans = append(expectedCans, k) 93 | } 94 | 95 | sort.Strings(actualCans) 96 | sort.Strings(expectedCans) 97 | 98 | assert.Equal(t, expectedCans, actualCans) 99 | } 100 | 101 | } 102 | 103 | // formatEdgeKey returns the "%s--%s" of s and t 104 | func formatEdgeKey(s, t string) string { 105 | return fmt.Sprintf("%s--%s", s, t) 106 | } 107 | -------------------------------------------------------------------------------- /generate/options.go: -------------------------------------------------------------------------------- 1 | package generate 2 | 3 | // Options are the possible options 4 | // that can be used to generate a Graph 5 | type Options struct { 6 | // Raw means the RawProvider instead of the 7 | // specific one 8 | Raw bool 9 | 10 | // Clean means that the Nodes that do not have 11 | // any connection will be "removed" 12 | Clean bool 13 | 14 | // Connections toggles the Provider logic for 15 | // merging Edges between Nodes into one 16 | Connections bool 17 | 18 | // ExternalNodes will try to add extra 19 | // Nodes detected to make the graph better, 20 | // like the 'im_out' 21 | ExternalNodes bool 22 | } 23 | -------------------------------------------------------------------------------- /generate/testdata/aws_hcl_sg.tf: -------------------------------------------------------------------------------- 1 | # ALB 2 | 3 | resource "aws_lb" "front" { 4 | name = "some name" 5 | security_groups = ["${aws_security_group.lb-front.id}"] 6 | 7 | tags = { 8 | Name = "name" 9 | role = "front" 10 | } 11 | } 12 | 13 | resource "aws_security_group" "lb-front" { 14 | name = "some name" 15 | description = "Front " 16 | 17 | ingress { 18 | from_port = 80 19 | to_port = 80 20 | protocol = "tcp" 21 | cidr_blocks = ["0.0.0.0/0"] 22 | } 23 | 24 | ingress { 25 | from_port = 443 26 | to_port = 443 27 | protocol = "tcp" 28 | cidr_blocks = ["0.0.0.0/0"] 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = { 39 | Name = "name" 40 | role = "front" 41 | } 42 | } 43 | 44 | # Launch Template 45 | 46 | resource "aws_launch_template" "front" { 47 | name_prefix = "name" 48 | 49 | network_interfaces { 50 | security_groups = [ 51 | "${aws_security_group.front.id}", 52 | ] 53 | } 54 | lifecycle { 55 | create_before_destroy = true 56 | } 57 | tags = { 58 | Name = "name" 59 | role = "fronttemplate" 60 | } 61 | } 62 | 63 | resource "aws_security_group" "front" { 64 | name = "anem" 65 | description = "Front" 66 | 67 | # Allow to get myeasyapi nginx, openapi nginx, mypages nginx 68 | ingress { 69 | from_port = 80 70 | to_port = 80 71 | protocol = "tcp" 72 | security_groups = ["${aws_security_group.lb-front.id}"] 73 | } 74 | 75 | egress { 76 | from_port = 0 77 | to_port = 0 78 | protocol = "-1" 79 | cidr_blocks = ["0.0.0.0/0"] 80 | } 81 | 82 | tags = { 83 | Name = "name" 84 | role = "front" 85 | } 86 | } 87 | 88 | # RDS 89 | 90 | resource "aws_security_group" "rds" { 91 | name = "anme" 92 | description = "rds" 93 | 94 | ingress { 95 | from_port = 3306 96 | to_port = 3306 97 | protocol = "tcp" 98 | 99 | security_groups = ["${aws_security_group.front.id}"] 100 | } 101 | 102 | tags = { 103 | Name = "name" 104 | role = "rds" 105 | } 106 | } 107 | 108 | resource "aws_db_instance" "application" { 109 | identifier = "rds" 110 | 111 | vpc_security_group_ids = ["${aws_security_group.rds.id}"] 112 | 113 | tags = { 114 | Name = "name" 115 | type = "master" 116 | role = "rds" 117 | } 118 | } 119 | 120 | # Redis 121 | 122 | resource "aws_security_group" "redis" { 123 | name = "name" 124 | description = "desc" 125 | 126 | ingress { 127 | from_port = 3306 128 | to_port = 3306 129 | protocol = "tcp" 130 | 131 | security_groups = [ 132 | "${aws_security_group.front.id}", 133 | ] 134 | } 135 | 136 | tags = { 137 | Name = "name" 138 | role = "redis" 139 | } 140 | } 141 | 142 | resource "aws_elasticache_cluster" "redis" { 143 | security_group_ids = ["${aws_security_group.redis.id}"] 144 | 145 | tags = { 146 | Name = "name" 147 | role = "redis" 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /generate/testdata/aws_state_with_count.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 304, 5 | "lineage": "cf6f7feb-36ef-0aca-cae9-6d36b96c86da", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "flexibleengine_blockstorage_volume_v2", 11 | "name": "PBbzj", 12 | "each": "list", 13 | "provider": "provider.flexibleengine", 14 | "instances": [ 15 | { 16 | "index_key": 0, 17 | "schema_version": 0, 18 | "attributes": { 19 | "id": "2ff83afc-ccfa-452c-8569-c7ab49870fd2" 20 | } 21 | }, 22 | { 23 | "index_key": 1, 24 | "schema_version": 0, 25 | "attributes": { 26 | "id": "41695a2e-4a13-43ed-b361-7f21856c2535" 27 | } 28 | } 29 | ] 30 | }, 31 | { 32 | "mode": "managed", 33 | "type": "flexibleengine_compute_instance_v2", 34 | "name": "fllXa", 35 | "provider": "provider.flexibleengine", 36 | "instances": [ 37 | { 38 | "schema_version": 0, 39 | "attributes": { 40 | "id": "141a1e75-11c2-4b3d-90cf-243f384b1fbb" 41 | }, 42 | "depends_on": [ 43 | "flexibleengine_blockstorage_volume_v2.PBbzj" 44 | ] 45 | } 46 | ] 47 | } 48 | ] 49 | } 50 | 51 | -------------------------------------------------------------------------------- /generate/testdata/azure.tfstate: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 17, 5 | "lineage": "65f8a469-c021-ee9d-a634-45cdf74dff6b", 6 | "outputs": { 7 | "tls_private_key": { 8 | "value": "", 9 | "type": "string" 10 | } 11 | }, 12 | "resources": [ 13 | { 14 | "mode": "managed", 15 | "type": "azurerm_linux_virtual_machine", 16 | "name": "myterraformvm", 17 | "provider": "provider.azurerm", 18 | "instances": [ 19 | { 20 | "schema_version": 0, 21 | "attributes": { 22 | "id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", 23 | "name": "myVM" 24 | }, 25 | "dependencies": [ 26 | "azurerm_network_interface.myterraformnic", 27 | "azurerm_resource_group.myterraformgroup", 28 | "azurerm_storage_account.mystorageaccount", 29 | "azurerm_subnet.myterraformsubnet", 30 | "azurerm_virtual_network.myterraformnetwork", 31 | "random_id.randomId", 32 | "tls_private_key.example_ssh" 33 | ] 34 | } 35 | ] 36 | }, 37 | { 38 | "mode": "managed", 39 | "type": "azurerm_linux_virtual_machine", 40 | "name": "myterraformvm2", 41 | "provider": "provider.azurerm", 42 | "instances": [ 43 | { 44 | "schema_version": 0, 45 | "attributes": { 46 | "id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2", 47 | "name": "myVM2" 48 | }, 49 | "dependencies": [ 50 | "azurerm_network_interface.myterraformnic2", 51 | "azurerm_resource_group.myterraformgroup", 52 | "azurerm_storage_account.mystorageaccount", 53 | "azurerm_subnet.myterraformsubnet2", 54 | "azurerm_virtual_network.myterraformnetwork2", 55 | "random_id.randomId", 56 | "tls_private_key.example_ssh" 57 | ] 58 | } 59 | ] 60 | }, 61 | { 62 | "mode": "managed", 63 | "type": "azurerm_virtual_network", 64 | "name": "myterraformnetwork", 65 | "provider": "provider.azurerm", 66 | "instances": [ 67 | { 68 | "schema_version": 0, 69 | "attributes": { 70 | "id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet", 71 | "name": "myVnet" 72 | }, 73 | "dependencies": [ 74 | "azurerm_resource_group.myterraformgroup" 75 | ] 76 | } 77 | ] 78 | }, 79 | { 80 | "mode": "managed", 81 | "type": "azurerm_virtual_network", 82 | "name": "myterraformnetwork2", 83 | "provider": "provider.azurerm", 84 | "instances": [ 85 | { 86 | "schema_version": 0, 87 | "attributes": { 88 | "id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet2", 89 | "name": "myVnet2" 90 | }, 91 | "dependencies": [ 92 | "azurerm_resource_group.myterraformgroup" 93 | ] 94 | } 95 | ] 96 | }, 97 | { 98 | "mode": "managed", 99 | "type": "azurerm_virtual_network_peering", 100 | "name": "example-1", 101 | "provider": "provider.azurerm", 102 | "instances": [ 103 | { 104 | "schema_version": 0, 105 | "attributes": { 106 | "id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/virtualNetworkPeerings/peer1to2", 107 | "name": "peer1to2", 108 | "remote_virtual_network_id": "/subscriptions/508f906f-b287-4882-b038-c653fe001aa0/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet2", 109 | "virtual_network_name": "myVnet" 110 | }, 111 | "dependencies": [ 112 | "azurerm_resource_group.myterraformgroup", 113 | "azurerm_virtual_network.myterraformnetwork", 114 | "azurerm_virtual_network.myterraformnetwork2" 115 | ] 116 | } 117 | ] 118 | } 119 | ] 120 | } 121 | -------------------------------------------------------------------------------- /generate/testdata/empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "terraform_version": "0.11.14", 4 | "serial": 83, 5 | "lineage": "3fd5eb87-d6b9-8b47-6c2d-7209f7f884ee", 6 | "resources": [] 7 | } 8 | -------------------------------------------------------------------------------- /generate/testdata/error_missing_id.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":4, 3 | "terraform_verison": "0.12.28", 4 | "resources": [ 5 | { 6 | "type":"aws_db_instance", 7 | "mode":"managed", 8 | "name": "mydb", 9 | "provider": "provider.aws", 10 | "instances": [ 11 | { 12 | "attributes":{} 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | 19 | -------------------------------------------------------------------------------- /generate/testdata/flexibleengine_hcl.tf: -------------------------------------------------------------------------------- 1 | data "flexibleengine_images_image_v2" "ubuntu" { 2 | name = "Ubuntu 18.04" 3 | most_recent = true 4 | } 5 | 6 | resource "flexibleengine_compute_instance_v2" "instance_one" { 7 | name = "instance-one" 8 | image_id = "${data.flexibleengine_images_image_v2.ubuntu.id}" 9 | flavor_id = "s3.small.1" 10 | 11 | network { 12 | port = "${flexibleengine_networking_port_v2.port_instance_one.id}" 13 | } 14 | } 15 | 16 | resource "flexibleengine_compute_instance_v2" "instance_two" { 17 | name = "instance-two" 18 | image_id = "${data.flexibleengine_images_image_v2.ubuntu.id}" 19 | flavor_id = "s3.small.1" 20 | 21 | network { 22 | port = "${flexibleengine_networking_port_v2.port_instance_two.id}" 23 | } 24 | } 25 | 26 | resource "flexibleengine_networking_port_v2" "port_instance_one" { 27 | name = "port_instance_one" 28 | security_group_ids = [ 29 | "${flexibleengine_networking_secgroup_v2.secgroup_instance_one.id}", 30 | ] 31 | } 32 | 33 | resource "flexibleengine_networking_port_v2" "port_instance_two" { 34 | name = "port_instance_two" 35 | security_group_ids = [ 36 | "${flexibleengine_networking_secgroup_v2.secgroup_instance_two.id}", 37 | ] 38 | } 39 | 40 | resource "flexibleengine_networking_secgroup_v2" "secgroup_instance_one" { 41 | name = "secgroup_instance_one" 42 | description = "security group for the instance one" 43 | } 44 | 45 | resource "flexibleengine_networking_secgroup_v2" "secgroup_instance_two" { 46 | name = "secgroup_instance_two" 47 | description = "security group for the instance two" 48 | } 49 | 50 | resource "flexibleengine_networking_secgroup_rule_v2" "ssh_two_to_one" { 51 | direction = "ingress" 52 | ethertype = "IPv4" 53 | protocol = "tcp" 54 | port_range_min = 22 55 | port_range_max = 22 56 | security_group_id = "${flexibleengine_networking_secgroup_v2.secgroup_instance_one.id}" 57 | remote_group_id = "${flexibleengine_networking_secgroup_v2.secgroup_instance_two.id}" 58 | } 59 | -------------------------------------------------------------------------------- /generate/testdata/flexibleengine_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 304, 5 | "lineage": "cf6f7feb-36ef-0aca-cae9-6d36b96c86da", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "flexibleengine_blockstorage_volume_v2", 11 | "name": "hOHQu", 12 | "each": "list", 13 | "provider": "provider.flexibleengine", 14 | "instances": [ 15 | { 16 | "index_key": 0, 17 | "schema_version": 0, 18 | "attributes": { 19 | "id": "2ff83afc-ccfa-452c-8569-c7ab49870fd2" 20 | } 21 | }, 22 | { 23 | "index_key": 1, 24 | "schema_version": 0, 25 | "attributes": { 26 | "id": "41695a2e-4a13-43ed-b361-7f21856c2535" 27 | } 28 | } 29 | ] 30 | }, 31 | { 32 | "mode": "managed", 33 | "type": "flexibleengine_compute_instance_v2", 34 | "name": "Aumwn", 35 | "provider": "provider.flexibleengine", 36 | "instances": [ 37 | { 38 | "schema_version": 0, 39 | "attributes": { 40 | "id": "141a1e75-11c2-4b3d-90cf-243f384b1fbb" 41 | }, 42 | "depends_on": [ 43 | "flexibleengine_blockstorage_volume_v2.hOHQu", 44 | "flexibleengine_networking_port_v2.nLwOe" 45 | ] 46 | } 47 | ] 48 | }, 49 | { 50 | "mode": "managed", 51 | "type": "flexibleengine_compute_instance_v2", 52 | "name": "bkbLl", 53 | "provider": "provider.flexibleengine", 54 | "instances": [ 55 | { 56 | "schema_version": 0, 57 | "attributes": { 58 | "id": "21bc79d5-7ff4-4c6e-81ba-eff95fd0daea" 59 | }, 60 | "depends_on": [ 61 | "flexibleengine_blockstorage_volume_v2.hOHQu", 62 | "flexibleengine_networking_port_v2.nLyuK" 63 | ] 64 | } 65 | ] 66 | }, 67 | { 68 | "mode": "managed", 69 | "type": "flexibleengine_networking_port_v2", 70 | "name": "nLwOe", 71 | "provider": "provider.flexibleengine", 72 | "instances": [ 73 | { 74 | "schema_version": 0, 75 | "attributes": { 76 | "id": "17800f09-3853-4562-84d5-f67081d7f5df", 77 | "security_group_ids": [ 78 | "465d4ac0-faf7-4975-91c2-b57ae8adc1c7" 79 | ] 80 | }, 81 | "depends_on": [ 82 | "flexibleengine_networking_secgroup_v2.uiWdG" 83 | ] 84 | } 85 | ] 86 | }, 87 | { 88 | "mode": "managed", 89 | "type": "flexibleengine_networking_port_v2", 90 | "name": "nLyuK", 91 | "provider": "provider.flexibleengine", 92 | "instances": [ 93 | { 94 | "schema_version": 0, 95 | "attributes": { 96 | "id": "5ae4b714-5642-4004-ba66-b24e3a94fc54", 97 | "security_group_ids": [ 98 | "f1473c82-1db7-4cf7-862d-70b91d0a61da" 99 | ] 100 | }, 101 | "depends_on": [ 102 | "flexibleengine_networking_secgroup_v2.mDAul" 103 | ] 104 | } 105 | ] 106 | }, 107 | { 108 | "mode": "managed", 109 | "type": "flexibleengine_networking_secgroup_rule_v2", 110 | "name": "ZPPPO", 111 | "provider": "provider.flexibleengine", 112 | "instances": [ 113 | { 114 | "schema_version": 0, 115 | "attributes": { 116 | "direction": "ingress", 117 | "id": "7246bfe1-88cf-4a65-970c-1121a2468bac", 118 | "remote_group_id": "f1473c82-1db7-4cf7-862d-70b91d0a61da" 119 | }, 120 | "depends_on": [ 121 | "flexibleengine_networking_secgroup_v2.uiWdG", 122 | "flexibleengine_networking_secgroup_v2.mDAul" 123 | ] 124 | } 125 | ] 126 | }, 127 | { 128 | "mode": "managed", 129 | "type": "flexibleengine_networking_secgroup_v2", 130 | "name": "mDAul", 131 | "provider": "provider.flexibleengine", 132 | "instances": [ 133 | { 134 | "schema_version": 0, 135 | "attributes": { 136 | "id": "f1473c82-1db7-4cf7-862d-70b91d0a61da" 137 | } 138 | } 139 | ] 140 | }, 141 | { 142 | "mode": "managed", 143 | "type": "flexibleengine_networking_secgroup_v2", 144 | "name": "uiWdG", 145 | "provider": "provider.flexibleengine", 146 | "instances": [ 147 | { 148 | "schema_version": 0, 149 | "attributes": { 150 | "id": "465d4ac0-faf7-4975-91c2-b57ae8adc1c7" 151 | } 152 | } 153 | ] 154 | } 155 | ] 156 | } 157 | 158 | -------------------------------------------------------------------------------- /generate/testdata/flexibleengine_state_tf_011.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 3, 5 | "lineage": "0bd7e20b-0609-bece-a74e-2f22a6a1037d", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "flexibleengine_compute_instance_v2", 11 | "name": "CpCKR", 12 | "provider": "provider.flexibleengine", 13 | "instances": [ 14 | { 15 | "schema_version": 0, 16 | "attributes_flat": { 17 | "id": "74e5d095-0da6-405a-b083-2eb186ecd814" 18 | }, 19 | "depends_on": [ 20 | "flexibleengine_networking_port_v2.Maycs" 21 | ] 22 | } 23 | ] 24 | }, 25 | { 26 | "mode": "managed", 27 | "type": "flexibleengine_compute_instance_v2", 28 | "name": "uwGDt", 29 | "provider": "provider.flexibleengine", 30 | "instances": [ 31 | { 32 | "schema_version": 0, 33 | "attributes_flat": { 34 | "id": "0f6dab7f-cd6e-4751-864d-173b344c3b20" 35 | }, 36 | "depends_on": [ 37 | "flexibleengine_networking_port_v2.QkWrX" 38 | ] 39 | } 40 | ] 41 | }, 42 | { 43 | "mode": "managed", 44 | "type": "flexibleengine_networking_port_v2", 45 | "name": "Maycs", 46 | "provider": "provider.flexibleengine", 47 | "instances": [ 48 | { 49 | "schema_version": 0, 50 | "attributes_flat": { 51 | "id": "70349ef1-b1c5-4fc6-8741-6ed4664e4473", 52 | "security_group_ids.#": "1", 53 | "security_group_ids.3535293312": "61e04be8-1fdf-47a9-82ea-421e90e606b6" 54 | }, 55 | "depends_on": [ 56 | "flexibleengine_networking_secgroup_v2.hlwMN" 57 | ] 58 | } 59 | ] 60 | }, 61 | { 62 | "mode": "managed", 63 | "type": "flexibleengine_networking_port_v2", 64 | "name": "QkWrX", 65 | "provider": "provider.flexibleengine", 66 | "instances": [ 67 | { 68 | "schema_version": 0, 69 | "attributes_flat": { 70 | "id": "444f871a-f662-4327-8578-a6da8011ebb0", 71 | "security_group_ids.#": "1", 72 | "security_group_ids.1216456113": "058995dd-0dc7-4e23-b753-cff6a27caea5" 73 | }, 74 | "depends_on": [ 75 | "flexibleengine_networking_secgroup_v2.wVneZ" 76 | ] 77 | } 78 | ] 79 | }, 80 | { 81 | "mode": "managed", 82 | "type": "flexibleengine_networking_secgroup_rule_v2", 83 | "name": "CbxAB", 84 | "provider": "provider.flexibleengine", 85 | "instances": [ 86 | { 87 | "schema_version": 0, 88 | "attributes_flat": { 89 | "direction": "ingress", 90 | "id": "29ebedf1-7b21-42f2-9569-70857fb12da8", 91 | "remote_group_id": "058995dd-0dc7-4e23-b753-cff6a27caea5" 92 | }, 93 | "depends_on": [ 94 | "flexibleengine_networking_secgroup_v2.hlwMN", 95 | "flexibleengine_networking_secgroup_v2.wVneZ" 96 | ] 97 | } 98 | ] 99 | }, 100 | { 101 | "mode": "managed", 102 | "type": "flexibleengine_networking_secgroup_v2", 103 | "name": "hlwMN", 104 | "provider": "provider.flexibleengine", 105 | "instances": [ 106 | { 107 | "schema_version": 0, 108 | "attributes_flat": { 109 | "id": "61e04be8-1fdf-47a9-82ea-421e90e606b6" 110 | } 111 | } 112 | ] 113 | }, 114 | { 115 | "mode": "managed", 116 | "type": "flexibleengine_networking_secgroup_v2", 117 | "name": "wVneZ", 118 | "provider": "provider.flexibleengine", 119 | "instances": [ 120 | { 121 | "schema_version": 0, 122 | "attributes_flat": { 123 | "id": "058995dd-0dc7-4e23-b753-cff6a27caea5" 124 | } 125 | } 126 | ] 127 | } 128 | ] 129 | } 130 | -------------------------------------------------------------------------------- /generate/testdata/google_hcl.tf: -------------------------------------------------------------------------------- 1 | resource "google_compute_instance" "inframap-tmp" { 2 | name = "inframap-tmp" 3 | machine_type = "f1-micro" 4 | zone = "us-east1-b" 5 | 6 | tags = ["front", "ssh"] 7 | 8 | boot_disk { 9 | initialize_params { 10 | image = "debian-cloud/debian-9" 11 | } 12 | } 13 | 14 | scheduling { 15 | preemptible = true 16 | automatic_restart = false 17 | } 18 | 19 | network_interface { 20 | network = google_compute_network.vpc_network.name 21 | 22 | access_config { 23 | // Ephemeral IP 24 | } 25 | } 26 | 27 | } 28 | 29 | resource "google_compute_instance" "inframap-tmp-two" { 30 | name = "inframap-tmp-two" 31 | machine_type = "f1-micro" 32 | zone = "us-east1-b" 33 | 34 | tags = ["ssh"] 35 | 36 | boot_disk { 37 | initialize_params { 38 | image = "debian-cloud/debian-9" 39 | } 40 | } 41 | 42 | scheduling { 43 | preemptible = true 44 | automatic_restart = false 45 | } 46 | 47 | network_interface { 48 | network = google_compute_network.vpc_network.name 49 | 50 | access_config { 51 | // Ephemeral IP 52 | } 53 | } 54 | 55 | } 56 | 57 | resource "google_compute_network" "vpc_network" { 58 | name = "inframap-network-tmp" 59 | auto_create_subnetworks = true 60 | } 61 | 62 | resource "google_compute_firewall" "allow-http" { 63 | network = google_compute_network.vpc_network.name 64 | description = "allow incoming http traffic" 65 | name = "allow-http" 66 | 67 | allow { 68 | protocol = "tcp" 69 | ports = ["80"] 70 | } 71 | direction = "INGRESS" 72 | source_ranges = ["0.0.0.0/0"] 73 | target_tags = ["front"] 74 | } 75 | 76 | resource "google_compute_firewall" "allow-ssh" { 77 | network = google_compute_network.vpc_network.name 78 | description = "allow SSH between instances" 79 | name = "allow-ssh" 80 | 81 | allow { 82 | protocol = "tcp" 83 | ports = ["22"] 84 | } 85 | direction = "INGRESS" 86 | source_tags = ["ssh"] 87 | target_tags = ["front"] 88 | } 89 | -------------------------------------------------------------------------------- /generate/testdata/google_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 10, 5 | "lineage": "e5dbb7fb-d6a4-7f76-666f-636d219b9b88", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "google_compute_firewall", 11 | "name": "PEZjy", 12 | "provider": "provider.google", 13 | "instances": [ 14 | { 15 | "schema_version": 1, 16 | "attributes": { 17 | "direction": "INGRESS", 18 | "id": "allow-ssh", 19 | "source_tags": [ 20 | "ssh" 21 | ], 22 | "target_tags": [ 23 | "front" 24 | ] 25 | } 26 | } 27 | ] 28 | }, 29 | { 30 | "mode": "managed", 31 | "type": "google_compute_firewall", 32 | "name": "vZmhG", 33 | "provider": "provider.google", 34 | "instances": [ 35 | { 36 | "schema_version": 1, 37 | "attributes": { 38 | "direction": "INGRESS", 39 | "id": "allow-http", 40 | "source_tags": [], 41 | "target_tags": [ 42 | "front" 43 | ] 44 | } 45 | } 46 | ] 47 | }, 48 | { 49 | "mode": "managed", 50 | "type": "google_compute_instance", 51 | "name": "ZthAT", 52 | "provider": "provider.google", 53 | "instances": [ 54 | { 55 | "schema_version": 6, 56 | "attributes": { 57 | "id": "infraview-tmp-two", 58 | "tags": [ 59 | "ssh" 60 | ] 61 | } 62 | } 63 | ] 64 | }, 65 | { 66 | "mode": "managed", 67 | "type": "google_compute_instance", 68 | "name": "lodiw", 69 | "provider": "provider.google", 70 | "instances": [ 71 | { 72 | "schema_version": 6, 73 | "attributes": { 74 | "id": "infraview-tmp", 75 | "tags": [ 76 | "front" 77 | ] 78 | } 79 | } 80 | ] 81 | } 82 | ] 83 | } 84 | 85 | -------------------------------------------------------------------------------- /generate/testdata/invalid_version_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "terraform_version": "0.11.14", 4 | "serial": 83, 5 | "lineage": "3fd5eb87-d6b9-8b47-6c2d-7209f7f884ee" 6 | } 7 | -------------------------------------------------------------------------------- /generate/testdata/multi_module_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.13.3", 4 | "serial": 13, 5 | "lineage": "d5c08c3d-3474-2dd8-8a36-7f9b776cc756", 6 | "resources": [ 7 | { 8 | "mode": "managed", 9 | "type": "scaleway_instance_placement_group", 10 | "name": "infra", 11 | "provider": "provider[\"registry.terraform.io/scaleway/scaleway\"]", 12 | "instances": [ 13 | { 14 | "schema_version": 0, 15 | "attributes": { 16 | "id": "1", 17 | "name": "kubernetes-infra" 18 | } 19 | } 20 | ] 21 | }, 22 | { 23 | "module": "module.kapsule", 24 | "mode": "managed", 25 | "type": "scaleway_k8s_cluster_beta", 26 | "name": "cluster", 27 | "provider": "provider[\"registry.terraform.io/scaleway/scaleway\"]", 28 | "instances": [ 29 | { 30 | "schema_version": 0, 31 | "attributes": { 32 | "id": "2", 33 | "name": "kubernetes" 34 | } 35 | } 36 | ] 37 | }, 38 | { 39 | "module": "module.node_pool", 40 | "mode": "managed", 41 | "type": "scaleway_k8s_pool_beta", 42 | "name": "nodes", 43 | "provider": "provider[\"registry.terraform.io/scaleway/scaleway\"]", 44 | "instances": [ 45 | { 46 | "schema_version": 0, 47 | "attributes": { 48 | "id": "3", 49 | "name": "kubernetes-infra" 50 | }, 51 | "dependencies": [ 52 | "module.kapsule.scaleway_k8s_cluster_beta.cluster", 53 | "scaleway_instance_placement_group.infra" 54 | ] 55 | } 56 | ] 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /generate/testdata/openstack_state_sg.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.12.28", 4 | "serial": 304, 5 | "lineage": "cf6f7feb-36ef-0aca-cae9-6d36b96c86da", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "openstack_compute_instance_v2", 11 | "name": "PiGtZ", 12 | "provider": "provider.openstack", 13 | "instances": [ 14 | { 15 | "schema_version": 0, 16 | "attributes": { 17 | "id": "21bc79d5-7ff4-4c6e-81ba-eff95fd0daea" 18 | }, 19 | "depends_on": [ 20 | "openstack_networking_port_v2.tZVzk" 21 | ] 22 | } 23 | ] 24 | }, 25 | { 26 | "mode": "managed", 27 | "type": "openstack_compute_instance_v2", 28 | "name": "sjSbA", 29 | "provider": "provider.openstack", 30 | "instances": [ 31 | { 32 | "schema_version": 0, 33 | "attributes": { 34 | "id": "141a1e75-11c2-4b3d-90cf-243f384b1fbb" 35 | }, 36 | "depends_on": [ 37 | "openstack_networking_port_v2.QWPcW" 38 | ] 39 | } 40 | ] 41 | }, 42 | { 43 | "mode": "managed", 44 | "type": "openstack_networking_port_v2", 45 | "name": "QWPcW", 46 | "provider": "provider.openstack", 47 | "instances": [ 48 | { 49 | "schema_version": 0, 50 | "attributes": { 51 | "id": "17800f09-3853-4562-84d5-f67081d7f5df", 52 | "security_group_ids": [ 53 | "465d4ac0-faf7-4975-91c2-b57ae8adc1c7" 54 | ] 55 | }, 56 | "depends_on": [ 57 | "openstack_networking_secgroup_v2.ievUc" 58 | ] 59 | } 60 | ] 61 | }, 62 | { 63 | "mode": "managed", 64 | "type": "openstack_networking_port_v2", 65 | "name": "tZVzk", 66 | "provider": "provider.openstack", 67 | "instances": [ 68 | { 69 | "schema_version": 0, 70 | "attributes": { 71 | "id": "5ae4b714-5642-4004-ba66-b24e3a94fc54", 72 | "security_group_ids": [ 73 | "f1473c82-1db7-4cf7-862d-70b91d0a61da" 74 | ] 75 | }, 76 | "depends_on": [ 77 | "openstack_networking_secgroup_v2.DKQQX" 78 | ] 79 | } 80 | ] 81 | }, 82 | { 83 | "mode": "managed", 84 | "type": "openstack_networking_secgroup_rule_v2", 85 | "name": "QdNte", 86 | "provider": "provider.openstack", 87 | "instances": [ 88 | { 89 | "schema_version": 0, 90 | "attributes": { 91 | "direction": "ingress", 92 | "id": "7246bfe1-88cf-4a65-970c-1121a2468bac", 93 | "remote_group_id": "f1473c82-1db7-4cf7-862d-70b91d0a61da" 94 | }, 95 | "depends_on": [ 96 | "openstack_networking_secgroup_v2.ievUc", 97 | "openstack_networking_secgroup_v2.DKQQX" 98 | ] 99 | } 100 | ] 101 | }, 102 | { 103 | "mode": "managed", 104 | "type": "openstack_networking_secgroup_v2", 105 | "name": "DKQQX", 106 | "provider": "provider.openstack", 107 | "instances": [ 108 | { 109 | "schema_version": 0, 110 | "attributes": { 111 | "id": "f1473c82-1db7-4cf7-862d-70b91d0a61da" 112 | } 113 | } 114 | ] 115 | }, 116 | { 117 | "mode": "managed", 118 | "type": "openstack_networking_secgroup_v2", 119 | "name": "ievUc", 120 | "provider": "provider.openstack", 121 | "instances": [ 122 | { 123 | "schema_version": 0, 124 | "attributes": { 125 | "id": "465d4ac0-faf7-4975-91c2-b57ae8adc1c7" 126 | } 127 | } 128 | ] 129 | } 130 | ] 131 | } 132 | 133 | -------------------------------------------------------------------------------- /generate/testdata/tf-module/aws_hcl_sg.tf: -------------------------------------------------------------------------------- 1 | # ALB 2 | 3 | resource "aws_lb" "front" { 4 | name = "some name" 5 | security_groups = ["${aws_security_group.lb-front.id}"] 6 | 7 | tags = { 8 | Name = "name" 9 | role = "front" 10 | } 11 | } 12 | 13 | resource "aws_security_group" "lb-front" { 14 | name = "some name" 15 | description = "Front " 16 | 17 | ingress { 18 | from_port = 80 19 | to_port = 80 20 | protocol = "tcp" 21 | cidr_blocks = ["0.0.0.0/0"] 22 | } 23 | 24 | ingress { 25 | from_port = 443 26 | to_port = 443 27 | protocol = "tcp" 28 | cidr_blocks = ["0.0.0.0/0"] 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = { 39 | Name = "name" 40 | role = "front" 41 | } 42 | } 43 | 44 | # Launch Template 45 | 46 | resource "aws_launch_template" "front" { 47 | name_prefix = "name" 48 | 49 | network_interfaces { 50 | security_groups = [ 51 | "${aws_security_group.front.id}", 52 | ] 53 | } 54 | lifecycle { 55 | create_before_destroy = true 56 | } 57 | tags = { 58 | Name = "name" 59 | role = "fronttemplate" 60 | } 61 | } 62 | 63 | resource "aws_security_group" "front" { 64 | name = "anem" 65 | description = "Front" 66 | 67 | # Allow to get myeasyapi nginx, openapi nginx, mypages nginx 68 | ingress { 69 | from_port = 80 70 | to_port = 80 71 | protocol = "tcp" 72 | security_groups = ["${aws_security_group.lb-front.id}"] 73 | } 74 | 75 | egress { 76 | from_port = 0 77 | to_port = 0 78 | protocol = "-1" 79 | cidr_blocks = ["0.0.0.0/0"] 80 | } 81 | 82 | tags = { 83 | Name = "name" 84 | role = "front" 85 | } 86 | } 87 | 88 | # RDS 89 | 90 | resource "aws_security_group" "rds" { 91 | name = "anme" 92 | description = "rds" 93 | 94 | ingress { 95 | from_port = 3306 96 | to_port = 3306 97 | protocol = "tcp" 98 | 99 | security_groups = ["${aws_security_group.front.id}"] 100 | } 101 | 102 | tags = { 103 | Name = "name" 104 | role = "rds" 105 | } 106 | } 107 | 108 | resource "aws_db_instance" "application" { 109 | identifier = "rds" 110 | 111 | vpc_security_group_ids = ["${aws_security_group.rds.id}"] 112 | 113 | tags = { 114 | Name = "name" 115 | type = "master" 116 | role = "rds" 117 | } 118 | } 119 | 120 | # Redis 121 | 122 | resource "aws_security_group" "redis" { 123 | name = "name" 124 | description = "desc" 125 | 126 | ingress { 127 | from_port = 3306 128 | to_port = 3306 129 | protocol = "tcp" 130 | 131 | security_groups = [ 132 | "${aws_security_group.front.id}", 133 | ] 134 | } 135 | 136 | tags = { 137 | Name = "name" 138 | role = "redis" 139 | } 140 | } 141 | 142 | resource "aws_elasticache_cluster" "redis" { 143 | security_group_ids = ["${aws_security_group.redis.id}"] 144 | 145 | tags = { 146 | Name = "name" 147 | role = "redis" 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/cycloidio/inframap 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/adrg/xdg v0.4.0 7 | github.com/awalterschulze/gographviz v2.0.3+incompatible 8 | github.com/chr4/pwgen v1.1.0 9 | github.com/cycloidio/flatmap v1.0.0 10 | github.com/cycloidio/tfdocs v0.0.0-20230516095646-1dc8f8412d50 11 | github.com/dmarkham/enumer v1.5.6 12 | github.com/hashicorp/hcl/v2 v2.13.0 13 | github.com/hashicorp/terraform v0.15.3 14 | github.com/markbates/pkger v0.17.1 15 | github.com/satori/go.uuid v1.2.0 16 | github.com/spf13/afero v1.8.2 17 | github.com/spf13/cobra v1.5.0 18 | github.com/stretchr/testify v1.8.0 19 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 20 | golang.org/x/tools v0.1.12 21 | ) 22 | 23 | require ( 24 | github.com/agext/levenshtein v1.2.3 // indirect 25 | github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect 26 | github.com/apparentlymart/go-versions v1.0.1 // indirect 27 | github.com/davecgh/go-spew v1.1.1 // indirect 28 | github.com/fatih/color v1.13.0 // indirect 29 | github.com/gobuffalo/here v0.6.2 // indirect 30 | github.com/golang/protobuf v1.5.2 // indirect 31 | github.com/google/go-cmp v0.5.6 // indirect 32 | github.com/hashicorp/errwrap v1.1.0 // indirect 33 | github.com/hashicorp/go-cleanhttp v0.5.2 // indirect 34 | github.com/hashicorp/go-hclog v1.0.0 // indirect 35 | github.com/hashicorp/go-multierror v1.1.1 // indirect 36 | github.com/hashicorp/go-retryablehttp v0.7.0 // indirect 37 | github.com/hashicorp/go-version v1.3.0 // indirect 38 | github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect 39 | github.com/inconshreveable/mousetrap v1.0.0 // indirect 40 | github.com/mattn/go-colorable v0.1.12 // indirect 41 | github.com/mattn/go-isatty v0.0.14 // indirect 42 | github.com/mitchellh/copystructure v1.2.0 // indirect 43 | github.com/mitchellh/go-wordwrap v1.0.1 // indirect 44 | github.com/mitchellh/panicwrap v1.0.0 // indirect 45 | github.com/mitchellh/reflectwalk v1.0.2 // indirect 46 | github.com/pascaldekloe/name v1.0.1 // indirect 47 | github.com/pmezard/go-difflib v1.0.0 // indirect 48 | github.com/spf13/pflag v1.0.5 // indirect 49 | github.com/zclconf/go-cty v1.8.3 // indirect 50 | golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect 51 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect 52 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect 53 | golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect 54 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect 55 | golang.org/x/text v0.3.7 // indirect 56 | google.golang.org/appengine v1.6.7 // indirect 57 | google.golang.org/protobuf v1.27.1 // indirect 58 | gopkg.in/yaml.v3 v3.0.1 // indirect 59 | ) 60 | -------------------------------------------------------------------------------- /graph/doc.go: -------------------------------------------------------------------------------- 1 | // Package graph has all the Graph logic that we 2 | // need to interact with Graph, Node and Edge. 3 | package graph 4 | -------------------------------------------------------------------------------- /graph/edge.go: -------------------------------------------------------------------------------- 1 | package graph 2 | 3 | import ( 4 | "github.com/cycloidio/inframap/errcode" 5 | ) 6 | 7 | // Edge defines the standard format of an Edge 8 | type Edge struct { 9 | ID string 10 | 11 | Canonicals []string 12 | // mCanonicals is used to know which Canonicals 13 | // are already on the Canonicals slice so we 14 | // do not repeat them 15 | mCanonicals map[string]struct{} 16 | 17 | Source string 18 | Target string 19 | } 20 | 21 | // Replace replaces the src (on Target or Source) for rep values 22 | func (e *Edge) Replace(src, rep string) error { 23 | if e.Source == src { 24 | e.Source = rep 25 | return nil 26 | } else if e.Target == src { 27 | e.Target = rep 28 | return nil 29 | } 30 | 31 | return errcode.ErrGraphEdgeReplace 32 | } 33 | 34 | // AddCanonicals adds the cans to the internal list, if 35 | // one is repeated it'll be ignored 36 | func (e *Edge) AddCanonicals(cans ...string) { 37 | if e.mCanonicals == nil { 38 | e.mCanonicals = make(map[string]struct{}) 39 | } 40 | 41 | for _, c := range cans { 42 | if _, ok := e.mCanonicals[c]; !ok { 43 | e.mCanonicals[c] = struct{}{} 44 | e.Canonicals = append(e.Canonicals, c) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /graph/edge_test.go: -------------------------------------------------------------------------------- 1 | package graph_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | "github.com/stretchr/testify/require" 8 | 9 | "github.com/cycloidio/inframap/errcode" 10 | "github.com/cycloidio/inframap/graph" 11 | ) 12 | 13 | func TestEdgeReplace(t *testing.T) { 14 | tests := []struct { 15 | Name string 16 | Edge graph.Edge 17 | Src string 18 | Rep string 19 | EEdge graph.Edge 20 | EError error 21 | }{ 22 | { 23 | Name: "SuccessInSource", 24 | Edge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 25 | Src: "2", Rep: "1", 26 | EEdge: graph.Edge{ID: "1", Source: "1", Target: "3"}, 27 | }, 28 | { 29 | Name: "SuccessInTarget", 30 | Edge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 31 | Src: "3", Rep: "1", 32 | EEdge: graph.Edge{ID: "1", Source: "2", Target: "1"}, 33 | }, 34 | { 35 | Name: "SuccessEqual", 36 | Edge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 37 | Src: "2", Rep: "2", 38 | EEdge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 39 | }, 40 | { 41 | Name: "SuccessCircular", 42 | Edge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 43 | Src: "3", Rep: "2", 44 | EEdge: graph.Edge{ID: "1", Source: "2", Target: "2"}, 45 | }, 46 | { 47 | Name: "ErrorInvalidFormatEdgeSourceNotFound", 48 | Edge: graph.Edge{ID: "1", Source: "2", Target: "3"}, 49 | Src: "1", Rep: "2", 50 | EError: errcode.ErrGraphNotFoundEdgeSource, 51 | }, 52 | } 53 | for _, tt := range tests { 54 | t.Run(tt.Name, func(t *testing.T) { 55 | err := tt.Edge.Replace(tt.Src, tt.Rep) 56 | if tt.EError == nil { 57 | require.NoError(t, err) 58 | assert.Equal(t, tt.EEdge.Source, tt.Edge.Source) 59 | assert.Equal(t, tt.EEdge.Target, tt.Edge.Target) 60 | } else { 61 | assert.Error(t, err, tt.EError.Error()) 62 | } 63 | }) 64 | } 65 | } 66 | 67 | func TestAddCanonicals(t *testing.T) { 68 | t.Run("Success", func(t *testing.T) { 69 | e := graph.Edge{} 70 | e.AddCanonicals("a") 71 | assert.Equal(t, []string{"a"}, e.Canonicals) 72 | e.AddCanonicals("b") 73 | assert.Equal(t, []string{"a", "b"}, e.Canonicals) 74 | e.AddCanonicals("b") 75 | assert.Equal(t, []string{"a", "b"}, e.Canonicals) 76 | e.AddCanonicals("a", "b", "c") 77 | assert.Equal(t, []string{"a", "b", "c"}, e.Canonicals) 78 | }) 79 | } 80 | -------------------------------------------------------------------------------- /graph/node.go: -------------------------------------------------------------------------------- 1 | package graph 2 | 3 | import "github.com/cycloidio/tfdocs/resource" 4 | 5 | // Node defines the standard format of an Edge 6 | type Node struct { 7 | // ID it'a a random UUID 8 | ID string 9 | 10 | // Canonical it's 'aws_lb.front' format 11 | Canonical string 12 | 13 | // Name it's the name of the resource 14 | Name string 15 | 16 | // Position holds the position of the node if any 17 | Position []int // x, y 18 | 19 | // TFID it's the internal ID it has on TF 20 | TFID string 21 | 22 | // Resource it's the information of the resource 23 | // it holds 24 | Resource resource.Resource 25 | 26 | // Weight is the addition of the Directions 27 | // of the Node 28 | Weight int 29 | } 30 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/cycloidio/inframap/cmd" 7 | ) 8 | 9 | func main() { 10 | if err := cmd.Execute(); err != nil { 11 | os.Exit(1) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /printer/doc.go: -------------------------------------------------------------------------------- 1 | // Package printer has the abstraction logic 2 | // to print Graph. It's an interface that could 3 | // have different implementations, one for each 4 | // type of different Printer 5 | package printer 6 | -------------------------------------------------------------------------------- /printer/dot/printer.go: -------------------------------------------------------------------------------- 1 | package dot 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | "os" 8 | "path" 9 | 10 | "github.com/adrg/xdg" 11 | "github.com/awalterschulze/gographviz" 12 | "github.com/markbates/pkger" 13 | 14 | // As we require to load the assets to be used 15 | // we import it as empty 16 | _ "github.com/cycloidio/inframap/assets" 17 | "github.com/cycloidio/inframap/graph" 18 | "github.com/cycloidio/inframap/printer" 19 | "github.com/cycloidio/inframap/provider" 20 | "github.com/cycloidio/inframap/provider/factory" 21 | ) 22 | 23 | // Dot is the struct that implements 24 | // the Printer of Dot format 25 | type Dot struct{} 26 | 27 | // Print prints into w the g in DOT format 28 | func (d Dot) Print(g *graph.Graph, opt printer.Options, w io.Writer) error { 29 | graph := gographviz.NewGraph() 30 | parentName := "G" 31 | graph.SetName(parentName) 32 | graph.SetDir(true) 33 | graph.SetStrict(true) 34 | 35 | for _, n := range g.Nodes { 36 | // If it's nil the pv, it means we do not know it so we'll use 37 | // the RawProvider. 38 | // We do not use the inframap.Options to see if it was 39 | // marked as Raw as we could then see the edges distinction 40 | // on the output if needed 41 | pv, rs, _ := factory.GetProviderAndResource(n.Canonical) 42 | if pv == nil { 43 | pv = provider.RawProvider{} 44 | } 45 | attr := map[string]string{ 46 | "shape": "ellipse", 47 | } 48 | if pv.IsEdge(rs) { 49 | attr["shape"] = "rectangle" 50 | } 51 | 52 | if opt.ShowIcons && n.Resource.Icon != "" { 53 | ext := path.Ext(n.Resource.Icon) 54 | pngIcon := fmt.Sprintf("%s.png", n.Resource.Icon[0:len(n.Resource.Icon)-len(ext)]) 55 | assetPath := path.Join("inframap", "assets", pv.Type().String(), pngIcon) 56 | pathIcon := path.Join(xdg.CacheHome, assetPath) 57 | 58 | attr["image"] = fmt.Sprintf("%q", pathIcon) 59 | attr["shape"] = "plaintext" 60 | attr["labelloc"] = "b" 61 | attr["height"] = "1.15" 62 | attr["imagepos"] = "tc" 63 | 64 | // If the file does not exists on the Cache path, we have to write it, 65 | // if not it means it's already correct so nothing to be done 66 | if _, err := os.Stat(pathIcon); os.IsNotExist(err) { 67 | p, err := xdg.CacheFile(assetPath) 68 | if err != nil { 69 | return err 70 | } 71 | 72 | f, err := os.Create(p) 73 | if err != nil { 74 | return err 75 | } 76 | 77 | iconFile, err := pkger.Open(path.Join("/assets", "icons", pv.Type().String(), pngIcon)) 78 | if err != nil { 79 | return err 80 | } 81 | 82 | if _, err = io.Copy(f, iconFile); err != nil { 83 | return err 84 | } 85 | 86 | f.Close() 87 | iconFile.Close() 88 | } 89 | } 90 | 91 | if opt.AlternativeNodeNames { 92 | graph.AddNode(parentName, fmt.Sprintf("%q", n.Name), attr) 93 | } else { 94 | graph.AddNode(parentName, fmt.Sprintf("%q", n.Canonical), attr) 95 | } 96 | } 97 | 98 | for _, e := range g.Edges { 99 | src, err := g.GetNodeByID(e.Source) 100 | if err != nil { 101 | return err 102 | } 103 | 104 | tr, err := g.GetNodeByID(e.Target) 105 | if err != nil { 106 | return err 107 | } 108 | 109 | if opt.AlternativeNodeNames { 110 | graph.AddEdge(fmt.Sprintf("%q", src.Name), fmt.Sprintf("%q", tr.Name), true, nil) 111 | } else { 112 | graph.AddEdge(fmt.Sprintf("%q", src.Canonical), fmt.Sprintf("%q", tr.Canonical), true, nil) 113 | } 114 | } 115 | 116 | buff := bytes.NewBufferString(graph.String()) 117 | io.Copy(w, buff) 118 | 119 | return nil 120 | } 121 | -------------------------------------------------------------------------------- /printer/factory/factory.go: -------------------------------------------------------------------------------- 1 | package factory 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/cycloidio/inframap/errcode" 7 | "github.com/cycloidio/inframap/printer" 8 | "github.com/cycloidio/inframap/printer/dot" 9 | ) 10 | 11 | var ( 12 | printers = map[printer.Type]printer.Printer{ 13 | printer.DOT: dot.Dot{}, 14 | } 15 | ) 16 | 17 | // Get returns the specific Printer for t 18 | func Get(t string) (printer.Printer, error) { 19 | ty, err := printer.TypeString(t) 20 | if err != nil { 21 | return nil, fmt.Errorf("no printer defined for %s: %w", ty, errcode.ErrPrinterNotFound) 22 | } 23 | 24 | p, ok := printers[ty] 25 | if !ok { 26 | return nil, fmt.Errorf("no printer defined for %s: %w", ty, errcode.ErrPrinterNotFound) 27 | } 28 | return p, nil 29 | } 30 | -------------------------------------------------------------------------------- /printer/factory/factory_test.go: -------------------------------------------------------------------------------- 1 | package factory_test 2 | 3 | import ( 4 | "errors" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | "github.com/stretchr/testify/require" 9 | 10 | "github.com/cycloidio/inframap/errcode" 11 | "github.com/cycloidio/inframap/printer/factory" 12 | ) 13 | 14 | func TestGet(t *testing.T) { 15 | t.Run("Success", func(t *testing.T) { 16 | p, err := factory.Get("dot") 17 | require.NoError(t, err) 18 | assert.NotNil(t, p) 19 | }) 20 | t.Run("Error", func(t *testing.T) { 21 | p, err := factory.Get("potato") 22 | assert.True(t, errors.Is(err, errcode.ErrPrinterNotFound)) 23 | assert.Nil(t, p) 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /printer/options.go: -------------------------------------------------------------------------------- 1 | package printer 2 | 3 | // Options is the possible options that the 4 | // Printer can have 5 | type Options struct { 6 | // ShowIcons toggles display of the 7 | // icons on the end Graph 8 | ShowIcons bool 9 | 10 | // AlternativeNodeNames will use Node names instead of canonical names 11 | AlternativeNodeNames bool 12 | } 13 | -------------------------------------------------------------------------------- /printer/printer.go: -------------------------------------------------------------------------------- 1 | package printer 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/cycloidio/inframap/graph" 7 | ) 8 | 9 | // Printer is an abstraction to Print the graph.Graph 10 | // in different formats 11 | type Printer interface { 12 | Print(g *graph.Graph, opt Options, w io.Writer) error 13 | } 14 | -------------------------------------------------------------------------------- /printer/type.go: -------------------------------------------------------------------------------- 1 | package printer 2 | 3 | // Type defines the type of the Printer iota 4 | type Type int 5 | 6 | //go:generate ./../bin/enumer -type=Type -transform=lower -output=type_string.go 7 | 8 | // List of all Types 9 | const ( 10 | DOT Type = iota 11 | ) 12 | -------------------------------------------------------------------------------- /printer/type_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "enumer -type=Type -transform=lower -output=type_string.go"; DO NOT EDIT. 2 | 3 | package printer 4 | 5 | import ( 6 | "fmt" 7 | "strings" 8 | ) 9 | 10 | const _TypeName = "dot" 11 | 12 | var _TypeIndex = [...]uint8{0, 3} 13 | 14 | const _TypeLowerName = "dot" 15 | 16 | func (i Type) String() string { 17 | if i < 0 || i >= Type(len(_TypeIndex)-1) { 18 | return fmt.Sprintf("Type(%d)", i) 19 | } 20 | return _TypeName[_TypeIndex[i]:_TypeIndex[i+1]] 21 | } 22 | 23 | // An "invalid array index" compiler error signifies that the constant values have changed. 24 | // Re-run the stringer command to generate them again. 25 | func _TypeNoOp() { 26 | var x [1]struct{} 27 | _ = x[DOT-(0)] 28 | } 29 | 30 | var _TypeValues = []Type{DOT} 31 | 32 | var _TypeNameToValueMap = map[string]Type{ 33 | _TypeName[0:3]: DOT, 34 | _TypeLowerName[0:3]: DOT, 35 | } 36 | 37 | var _TypeNames = []string{ 38 | _TypeName[0:3], 39 | } 40 | 41 | // TypeString retrieves an enum value from the enum constants string name. 42 | // Throws an error if the param is not part of the enum. 43 | func TypeString(s string) (Type, error) { 44 | if val, ok := _TypeNameToValueMap[s]; ok { 45 | return val, nil 46 | } 47 | s = strings.ToLower(s) 48 | if val, ok := _TypeNameToValueMap[s]; ok { 49 | return val, nil 50 | } 51 | return 0, fmt.Errorf("%s does not belong to Type values", s) 52 | } 53 | 54 | // TypeValues returns all values of the enum 55 | func TypeValues() []Type { 56 | return _TypeValues 57 | } 58 | 59 | // TypeStrings returns a slice of all String values of the enum 60 | func TypeStrings() []string { 61 | strs := make([]string, len(_TypeNames)) 62 | copy(strs, _TypeNames) 63 | return strs 64 | } 65 | 66 | // IsAType returns "true" if the value is listed in the enum definition. "false" otherwise 67 | func (i Type) IsAType() bool { 68 | for _, v := range _TypeValues { 69 | if i == v { 70 | return true 71 | } 72 | } 73 | return false 74 | } 75 | -------------------------------------------------------------------------------- /provider/aws/aws.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/cycloidio/inframap/errcode" 7 | "github.com/cycloidio/inframap/provider" 8 | tfdocAWS "github.com/cycloidio/tfdocs/providers/aws" 9 | "github.com/cycloidio/tfdocs/resource" 10 | ) 11 | 12 | // Provider is the Type that defines the interface 'provider.Interface' 13 | type Provider struct { 14 | provider.NopProvider 15 | } 16 | 17 | var ( 18 | usedAttributes = []string{ 19 | "id", 20 | "egress", 21 | "ingress", 22 | "source_security_group_id", 23 | "security_group_id", 24 | } 25 | ) 26 | 27 | // Type returns the type of the implementation 28 | func (a Provider) Type() provider.Type { return provider.AWS } 29 | 30 | // IsNode returns if the resources is a Node 31 | func (a Provider) IsNode(resource string) bool { 32 | _, ok := nodeTypes[resource] 33 | return ok 34 | } 35 | 36 | // IsEdge returns if the resource is an Edge 37 | func (a Provider) IsEdge(resource string) bool { 38 | _, ok := edgeTypes[resource] 39 | return ok 40 | } 41 | 42 | // Resource returns the resource information 43 | func (a Provider) Resource(resource string) (*resource.Resource, error) { 44 | r, err := tfdocAWS.GetResource(resource) 45 | if err != nil { 46 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundResource) 47 | } 48 | return r, nil 49 | } 50 | 51 | // DataSource returns the resource information 52 | func (a Provider) DataSource(resource string) (*resource.Resource, error) { 53 | r, err := tfdocAWS.GetDataSource(resource) 54 | if err != nil { 55 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundDataSource) 56 | } 57 | return r, nil 58 | } 59 | 60 | // ResourceInOutNodes returns the In, Out and Nodes of the rs based on the cfg 61 | func (a Provider) ResourceInOutNodes(id, rs string, cfgs map[string]map[string]interface{}) ([]string, []string, []string) { 62 | var ins, outs, nodes []string 63 | cfg := cfgs[id] 64 | if rs == "aws_security_group" { 65 | ingress, inok := cfg["ingress"] 66 | if inok { 67 | for _, in := range ingress.([]interface{}) { 68 | min := in.(map[string]interface{}) 69 | if sgs, ok := min["security_groups"].([]interface{}); ok { 70 | for _, sg := range sgs { 71 | ins = append(ins, sg.(string)) 72 | } 73 | } 74 | if cidrs, ok := min["cidr_blocks"].([]interface{}); ok { 75 | for _, ci := range cidrs { 76 | sci := ci.(string) 77 | if sci == "0.0.0.0/0" { 78 | nodes = append(nodes, fmt.Sprintf("im_out.%v/%v->%v", min["protocol"], min["from_port"], min["to_port"])) 79 | } 80 | } 81 | } 82 | } 83 | } 84 | 85 | egress, egok := cfg["egress"] 86 | if egok { 87 | for _, eg := range egress.([]interface{}) { 88 | if sgs, ok := eg.(map[string]interface{})["security_groups"].([]interface{}); ok { 89 | for _, sg := range sgs { 90 | outs = append(outs, sg.(string)) 91 | } 92 | } 93 | } 94 | } 95 | 96 | } else if rs == "aws_security_group_rule" { 97 | in, ok := cfg["source_security_group_id"] 98 | if ok && in != nil { 99 | ins = append(ins, in.(string)) 100 | } 101 | 102 | out, ok := cfg["security_group_id"] 103 | if ok && in != nil { 104 | outs = append(outs, out.(string)) 105 | } 106 | } 107 | 108 | return ins, outs, nodes 109 | } 110 | 111 | // UsedAttributes returns all the attributes that are 112 | // required/used/needed on the providers, so when we have to 113 | // prune we know what to keep 114 | func (a Provider) UsedAttributes() []string { 115 | return usedAttributes 116 | } 117 | -------------------------------------------------------------------------------- /provider/aws/aws_test.go: -------------------------------------------------------------------------------- 1 | package aws_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | 8 | "github.com/cycloidio/inframap/provider/aws" 9 | ) 10 | 11 | func TestResourceInOutNodes(t *testing.T) { 12 | t.Run("SuccessSG", func(t *testing.T) { 13 | aws := aws.Provider{} 14 | id := "id" 15 | rs := "aws_security_group" 16 | cfg := map[string]map[string]interface{}{ 17 | id: map[string]interface{}{ 18 | "ingress": []interface{}{ 19 | map[string]interface{}{ 20 | "security_groups": []interface{}{ 21 | "in-id", 22 | }, 23 | }, 24 | }, 25 | "egress": []interface{}{ 26 | map[string]interface{}{ 27 | "security_groups": []interface{}{ 28 | "out-id", 29 | }, 30 | }, 31 | }, 32 | }, 33 | } 34 | 35 | ins, outs, _ := aws.ResourceInOutNodes(id, rs, cfg) 36 | assert.Equal(t, []string{"in-id"}, ins) 37 | assert.Equal(t, []string{"out-id"}, outs) 38 | }) 39 | t.Run("SuccessSGR", func(t *testing.T) { 40 | aws := aws.Provider{} 41 | id := "id" 42 | rs := "aws_security_group_rule" 43 | cfg := map[string]map[string]interface{}{ 44 | id: map[string]interface{}{ 45 | "source_security_group_id": "in-id", 46 | "security_group_id": "out-id", 47 | }, 48 | } 49 | 50 | ins, outs, _ := aws.ResourceInOutNodes(id, rs, cfg) 51 | assert.Equal(t, []string{"in-id"}, ins) 52 | assert.Equal(t, []string{"out-id"}, outs) 53 | }) 54 | } 55 | -------------------------------------------------------------------------------- /provider/aws/graph.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | var ( 4 | // nodeTypes all the Nodes that we support right now 5 | nodeTypes = map[string]struct{}{ 6 | "aws_api_gateway_resource": struct{}{}, 7 | "aws_athena_database": struct{}{}, 8 | "aws_autoscaling_group": struct{}{}, 9 | "aws_dax_cluster": struct{}{}, 10 | "aws_db_instance": struct{}{}, 11 | "aws_directory_service_directory": struct{}{}, 12 | "aws_dms_replication_instance": struct{}{}, 13 | "aws_dx_gateway": struct{}{}, 14 | "aws_dynamodb_table": struct{}{}, 15 | "aws_ebs_volume": struct{}{}, 16 | "aws_ecs_cluster": struct{}{}, 17 | "aws_ecs_service": struct{}{}, 18 | "aws_efs_file_system": struct{}{}, 19 | "aws_eip": struct{}{}, 20 | "aws_eks_cluster": struct{}{}, 21 | "aws_elasticache_cluster": struct{}{}, 22 | "aws_elastic_beanstalk_application": struct{}{}, 23 | "aws_elasticsearch_domain": struct{}{}, 24 | "aws_elb": struct{}{}, 25 | "aws_emr_cluster": struct{}{}, 26 | "aws_iam_user": struct{}{}, 27 | "aws_instance": struct{}{}, 28 | "aws_internet_gateway": struct{}{}, 29 | "aws_kinesis_stream": struct{}{}, 30 | "aws_lambda_function": struct{}{}, 31 | "aws_lightsail_instance": struct{}{}, 32 | "aws_mq_broker": struct{}{}, 33 | "aws_media_store_container": struct{}{}, 34 | "aws_nat_gateway": struct{}{}, 35 | "aws_rds_cluster": struct{}{}, 36 | "aws_rds_cluster_instance": struct{}{}, 37 | "aws_redshift_cluster": struct{}{}, 38 | "aws_s3_bucket": struct{}{}, 39 | "aws_storagegateway_gateway": struct{}{}, 40 | "aws_sqs_queue": struct{}{}, 41 | "aws_vpn_gateway": struct{}{}, 42 | "aws_batch_job_definition": struct{}{}, 43 | "aws_neptune_cluster": struct{}{}, 44 | "aws_alb": struct{}{}, 45 | "aws_lb": struct{}{}, 46 | "aws_cloudfront_distribution": struct{}{}, 47 | "aws_elasticache_replication_group": struct{}{}, 48 | "aws_launch_template": struct{}{}, 49 | } 50 | 51 | // edgeTypes map of all the supported Edges 52 | edgeTypes = map[string]struct{}{ 53 | "aws_security_group": struct{}{}, 54 | "aws_security_group_rule": struct{}{}, 55 | } 56 | ) 57 | -------------------------------------------------------------------------------- /provider/azurerm/azurerm.go: -------------------------------------------------------------------------------- 1 | package azurerm 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/cycloidio/inframap/errcode" 7 | "github.com/cycloidio/inframap/provider" 8 | tfdocAzurerm "github.com/cycloidio/tfdocs/providers/azurerm" 9 | "github.com/cycloidio/tfdocs/resource" 10 | ) 11 | 12 | // Provider is the Type that defines the interface 'provider.Interface' 13 | type Provider struct { 14 | provider.NopProvider 15 | } 16 | 17 | // Type returns the type of the implementation 18 | func (a Provider) Type() provider.Type { return provider.Azurerm } 19 | 20 | // IsNode returns if the resources is a Node 21 | func (a Provider) IsNode(resource string) bool { 22 | _, ok := nodeTypes[resource] 23 | return ok 24 | } 25 | 26 | // IsEdge returns if the resource is an Edge 27 | func (a Provider) IsEdge(resource string) bool { 28 | _, ok := edgeTypes[resource] 29 | return ok 30 | } 31 | 32 | // Resource returns the resource information 33 | func (a Provider) Resource(resource string) (*resource.Resource, error) { 34 | r, err := tfdocAzurerm.GetResource(resource) 35 | if err != nil { 36 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundResource) 37 | } 38 | return r, nil 39 | } 40 | 41 | // DataSource returns the resource information 42 | func (a Provider) DataSource(resource string) (*resource.Resource, error) { 43 | r, err := tfdocAzurerm.GetDataSource(resource) 44 | if err != nil { 45 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundDataSource) 46 | } 47 | return r, nil 48 | } 49 | 50 | // ResourceInOutNodes returns the In, Out and Nodes of the rs based on the cfg 51 | func (a Provider) ResourceInOutNodes(id, rs string, cfgs map[string]map[string]interface{}) ([]string, []string, []string) { 52 | var ins, outs []string 53 | cfg := cfgs[id] 54 | switch rs { 55 | case "azurerm_virtual_network_peering": 56 | vnn := cfg["virtual_network_name"] 57 | vnID, ok := getRsIDByName(cfgs, vnn) 58 | if !ok { 59 | break 60 | } 61 | ins = append(ins, vnID) 62 | 63 | rvni := cfg["remote_virtual_network_id"] 64 | outs = append(outs, rvni.(string)) 65 | } 66 | return ins, outs, nil 67 | } 68 | 69 | // getRsIDByName ranges over all resources, looking for a same name as provided. 70 | // If found, the id of the resource will be returned. 71 | func getRsIDByName(cfgs map[string]map[string]interface{}, name interface{}) (string, bool) { 72 | for _, cfg := range cfgs { 73 | rsName := cfg["name"] 74 | if rsName == name { 75 | pvid, ok := cfg["id"].(string) 76 | return pvid, ok 77 | } 78 | } 79 | return "", false 80 | } 81 | 82 | var ( 83 | usedAttributes = []string{ 84 | "remote_virtual_network_id", 85 | "virtual_network_name", 86 | "id", 87 | "name", 88 | } 89 | ) 90 | 91 | // UsedAttributes returns all the attributes that are 92 | // required/used/needed on the providers, so when we have to 93 | // prune we know what to keep 94 | func (a Provider) UsedAttributes() []string { 95 | return usedAttributes 96 | } 97 | -------------------------------------------------------------------------------- /provider/azurerm/azurerm_test.go: -------------------------------------------------------------------------------- 1 | package azurerm_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | 8 | "github.com/cycloidio/inframap/provider/azurerm" 9 | ) 10 | 11 | func TestResourceInOut(t *testing.T) { 12 | t.Run("SuccessVNetwork", func(t *testing.T) { 13 | aws := azurerm.Provider{} 14 | id := "id" 15 | rs := "azurerm_virtual_network_peering" 16 | cfg := map[string]map[string]interface{}{ 17 | "virtual_network": { 18 | "name": "vnname", 19 | "id": "src_v_network", 20 | }, 21 | id: { 22 | "virtual_network_name": "vnname", 23 | "remote_virtual_network_id": "remote_v_network", 24 | }, 25 | } 26 | 27 | ins, outs, _ := aws.ResourceInOutNodes(id, rs, cfg) 28 | assert.Equal(t, []string{"src_v_network"}, ins) 29 | assert.Equal(t, []string{"remote_v_network"}, outs) 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /provider/azurerm/graph.go: -------------------------------------------------------------------------------- 1 | package azurerm 2 | 3 | var ( 4 | nodeTypes = map[string]struct{}{ 5 | "azurerm_app_service": struct{}{}, 6 | "azurerm_app_service_certificate": struct{}{}, 7 | "azurerm_app_service_environment": struct{}{}, 8 | "azurerm_app_service_plan": struct{}{}, 9 | "azurerm_application_gateway": struct{}{}, 10 | "azurerm_bastion_host": struct{}{}, 11 | "azurerm_batch_account": struct{}{}, 12 | "azurerm_batch_application": struct{}{}, 13 | "azurerm_batch_pool": struct{}{}, 14 | "azurerm_cdn_endpoint": struct{}{}, 15 | "azurerm_cdn_profile": struct{}{}, 16 | "azurerm_container_group": struct{}{}, 17 | "azurerm_container_registry": struct{}{}, 18 | "azurerm_cosmosdb_account": struct{}{}, 19 | "azurerm_data_factory": struct{}{}, 20 | "azurerm_dedicated_host": struct{}{}, 21 | "azurerm_dedicated_host_group": struct{}{}, 22 | "azurerm_dns_zone": struct{}{}, 23 | "azurerm_firewall": struct{}{}, 24 | "azurerm_frontdoor": struct{}{}, 25 | "azurerm_function_app": struct{}{}, 26 | "azurerm_image": struct{}{}, 27 | "azurerm_kubernetes_cluster": struct{}{}, 28 | "azurerm_kubernetes_cluster_node_pool": struct{}{}, 29 | "azurerm_lb": struct{}{}, 30 | "azurerm_linux_virtual_machine": struct{}{}, 31 | "azurerm_mariadb_database": struct{}{}, 32 | "azurerm_mariadb_server": struct{}{}, 33 | "azurerm_mssql_database": struct{}{}, 34 | "azurerm_mssql_elasticpool": struct{}{}, 35 | "azurerm_mssql_server": struct{}{}, 36 | "azurerm_mssql_virtual_machine": struct{}{}, 37 | "azurerm_mysql_database": struct{}{}, 38 | "azurerm_mysql_server": struct{}{}, 39 | "azurerm_nat_gateway": struct{}{}, 40 | "azurerm_nat_gateway_public_ip_association": struct{}{}, 41 | "azurerm_netapp_account": struct{}{}, 42 | "azurerm_netapp_pool": struct{}{}, 43 | "azurerm_netapp_volume": struct{}{}, 44 | "azurerm_postgresql_database": struct{}{}, 45 | "azurerm_postgresql_server": struct{}{}, 46 | "azurerm_private_dns_zone": struct{}{}, 47 | "azurerm_private_endpoint": struct{}{}, 48 | "azurerm_public_ip": struct{}{}, 49 | "azurerm_redis_cache": struct{}{}, 50 | "azurerm_sql_database": struct{}{}, 51 | "azurerm_sql_server": struct{}{}, 52 | "azurerm_storage_container": struct{}{}, 53 | "azurerm_virtual_machine": struct{}{}, 54 | "azurerm_virtual_network_gateway": struct{}{}, 55 | "azurerm_vpn_gateway": struct{}{}, 56 | "azurerm_windows_virtual_machine": struct{}{}, 57 | "azurerm_virtual_network": struct{}{}, 58 | } 59 | 60 | // edgeTypes map of all the supported Edges 61 | edgeTypes = map[string]struct{}{ 62 | "azurerm_virtual_network_peering": {}, 63 | } 64 | ) 65 | -------------------------------------------------------------------------------- /provider/doc.go: -------------------------------------------------------------------------------- 1 | // Package provider has the abstraction of a Provider 2 | // which holds the specific logic of that Provider 3 | // when trying to generate a Graph. The logic to 4 | // hide/show specific elements and how they should 5 | // be represented 6 | package provider 7 | -------------------------------------------------------------------------------- /provider/factory/factory.go: -------------------------------------------------------------------------------- 1 | package factory 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "strings" 7 | 8 | "github.com/cycloidio/inframap/errcode" 9 | "github.com/cycloidio/inframap/provider" 10 | "github.com/cycloidio/inframap/provider/aws" 11 | "github.com/cycloidio/inframap/provider/azurerm" 12 | "github.com/cycloidio/inframap/provider/flexibleengine" 13 | "github.com/cycloidio/inframap/provider/google" 14 | "github.com/cycloidio/inframap/provider/im" 15 | "github.com/cycloidio/inframap/provider/openstack" 16 | ) 17 | 18 | var ( 19 | providers = map[provider.Type]provider.Provider{ 20 | provider.IM: im.Provider{}, 21 | provider.AWS: aws.Provider{}, 22 | provider.FlexibleEngine: flexibleengine.Provider{}, 23 | provider.OpenStack: openstack.Provider{}, 24 | provider.Google: google.Provider{}, 25 | provider.Azurerm: azurerm.Provider{}, 26 | } 27 | 28 | // reProvider is a regexp to match 'aws' from 'aws' or 'aws_iam_user' 29 | reProvider = regexp.MustCompile(`(?P[^_][a-z0-9]+)(?:_+)?`) 30 | ) 31 | 32 | // GetProviderAndResource returns the Interface 33 | // and the resource name "aws_alb.front" -> "aws_alb" 34 | func GetProviderAndResource(can string) (provider.Provider, string, error) { 35 | // Due to modules, we'll check it from the back not from 36 | // the front as it may have modules prefix 37 | rss := strings.Split(can, ".") 38 | var rs string 39 | if len(rss) > 1 { 40 | rs = rss[len(rss)-2] 41 | } else { 42 | rs = can 43 | } 44 | match := reProvider.FindStringSubmatch(rs) 45 | 46 | if match == nil { 47 | return nil, "", fmt.Errorf("no match for %s: %w", can, errcode.ErrProviderNotFound) 48 | } 49 | 50 | t, err := provider.TypeString(match[1]) 51 | if err != nil { 52 | return nil, "", fmt.Errorf("no provider type with %s from %s: %w", match[1], can, errcode.ErrProviderNotFound) 53 | } 54 | 55 | pv, ok := providers[t] 56 | if !ok { 57 | return nil, "", fmt.Errorf("no provider implementation for type %s from %s: %w", match[1], can, errcode.ErrProviderNotFound) 58 | } 59 | return pv, rs, nil 60 | } 61 | -------------------------------------------------------------------------------- /provider/factory/factory_test.go: -------------------------------------------------------------------------------- 1 | package factory_test 2 | 3 | import ( 4 | "errors" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | "github.com/stretchr/testify/require" 9 | 10 | "github.com/cycloidio/inframap/errcode" 11 | "github.com/cycloidio/inframap/provider" 12 | "github.com/cycloidio/inframap/provider/factory" 13 | ) 14 | 15 | func TestGetProviderAndResource(t *testing.T) { 16 | tests := []struct { 17 | name string 18 | input string 19 | eProvider provider.Type 20 | eResource string 21 | eError error 22 | }{ 23 | { 24 | name: "Success", 25 | input: "aws_lb.front", 26 | eProvider: provider.AWS, 27 | eResource: "aws_lb", 28 | }, 29 | { 30 | name: "SuccessOnlyResource", 31 | input: "aws_lb", 32 | eProvider: provider.AWS, 33 | eResource: "aws_lb", 34 | }, 35 | { 36 | name: "ErrProviderNotFound-InvalidProvider", 37 | input: "pepe_a.front", 38 | eError: errcode.ErrProviderNotFound, 39 | }, 40 | } 41 | 42 | for _, tt := range tests { 43 | t.Run(tt.name, func(t *testing.T) { 44 | p, rs, err := factory.GetProviderAndResource(tt.input) 45 | 46 | if tt.eError == nil { 47 | require.NoError(t, err) 48 | assert.Equal(t, tt.eResource, rs) 49 | assert.Equal(t, tt.eProvider, p.Type()) 50 | } else { 51 | assert.True(t, errors.Is(err, tt.eError)) 52 | } 53 | }) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /provider/flexibleengine/flexibleengine.go: -------------------------------------------------------------------------------- 1 | package flexibleengine 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/cycloidio/inframap/errcode" 7 | "github.com/cycloidio/inframap/provider" 8 | tfdocFE "github.com/cycloidio/tfdocs/providers/flexibleengine" 9 | "github.com/cycloidio/tfdocs/resource" 10 | ) 11 | 12 | // Provider is the Type that defines the interface 'provider.Interface' 13 | type Provider struct { 14 | provider.NopProvider 15 | } 16 | 17 | var ( 18 | usedAttributes = []string{ 19 | "id", 20 | "instance_id", 21 | "direction", 22 | "remote_group_id", 23 | "security_group_ids", 24 | "loadbalancer_id", 25 | "listener_id", 26 | "pool_id", 27 | } 28 | ) 29 | 30 | // Type returns the type of the implementation 31 | func (a Provider) Type() provider.Type { return provider.FlexibleEngine } 32 | 33 | // IsNode returns if the resources is a Node 34 | func (a Provider) IsNode(resource string) bool { 35 | _, ok := nodeTypes[resource] 36 | return ok 37 | } 38 | 39 | // IsEdge returns if the resource is an Edge 40 | func (a Provider) IsEdge(resource string) bool { 41 | _, ok := edgeTypes[resource] 42 | return ok 43 | } 44 | 45 | // Resource returns the resource information 46 | func (a Provider) Resource(resource string) (*resource.Resource, error) { 47 | r, err := tfdocFE.GetResource(resource) 48 | if err != nil { 49 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundResource) 50 | } 51 | return r, nil 52 | } 53 | 54 | // DataSource returns the resource information 55 | func (a Provider) DataSource(resource string) (*resource.Resource, error) { 56 | r, err := tfdocFE.GetDataSource(resource) 57 | if err != nil { 58 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundDataSource) 59 | } 60 | return r, nil 61 | } 62 | 63 | // ResourceInOutNodes returns the In, Out and Nodes of the rs based on the cfg 64 | func (a Provider) ResourceInOutNodes(id, rs string, cfgs map[string]map[string]interface{}) ([]string, []string, []string) { 65 | var ins, outs []string 66 | cfg := cfgs[id] 67 | switch rs { 68 | case "flexibleengine_compute_interface_attach_v2": 69 | if instanceID, ok := cfg["instance_id"]; ok { 70 | ins = append(ins, instanceID.(string)) 71 | } 72 | case "flexibleengine_networking_secgroup_rule_v2": 73 | if direction, ok := cfg["direction"]; ok { 74 | if direction.(string) == "ingress" { 75 | if rg, ok := cfg["remote_group_id"]; ok { 76 | ins = append(ins, rg.(string)) 77 | } 78 | } else { 79 | if rg, ok := cfg["remote_group_id"]; ok { 80 | outs = append(outs, rg.(string)) 81 | } 82 | } 83 | } 84 | case "flexibleengine_networking_port_v2": 85 | if sgs, ok := cfg["security_group_ids"]; ok { 86 | for _, sg := range sgs.([]interface{}) { 87 | ins = append(ins, sg.(string)) 88 | } 89 | } 90 | case "flexibleengine_lb_listener_v2": 91 | if lbid, ok := cfg["loadbalancer_id"]; ok { 92 | ins = append(ins, lbid.(string)) 93 | } 94 | case "flexibleengine_lb_pool_v2": 95 | if lid, ok := cfg["listener_id"]; ok { 96 | ins = append(ins, lid.(string)) 97 | } 98 | case "flexibleengine_lb_member_v2": 99 | if pid, ok := cfg["pool_id"]; ok { 100 | ins = append(ins, pid.(string)) 101 | } 102 | } 103 | return ins, outs, nil 104 | } 105 | 106 | // UsedAttributes returns all the attributes that are 107 | // required/used/needed on the providers, so when we have to 108 | // prune we know what to keep 109 | func (a Provider) UsedAttributes() []string { 110 | return usedAttributes 111 | } 112 | -------------------------------------------------------------------------------- /provider/flexibleengine/flexibleengine_test.go: -------------------------------------------------------------------------------- 1 | package flexibleengine_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | 8 | "github.com/cycloidio/inframap/provider/flexibleengine" 9 | ) 10 | 11 | func TestResourceInOutNodes(t *testing.T) { 12 | t.Run("SuccessCIAV2", func(t *testing.T) { 13 | fe := flexibleengine.Provider{} 14 | id := "id" 15 | rs := "flexibleengine_compute_interface_attach_v2" 16 | cfg := map[string]map[string]interface{}{ 17 | id: map[string]interface{}{ 18 | "instance_id": "in-id", 19 | }, 20 | } 21 | 22 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 23 | assert.Equal(t, []string{"in-id"}, ins) 24 | assert.Equal(t, []string(nil), outs) 25 | }) 26 | t.Run("SuccessNSGRV2_ingress", func(t *testing.T) { 27 | fe := flexibleengine.Provider{} 28 | id := "id" 29 | rs := "flexibleengine_networking_secgroup_rule_v2" 30 | cfg := map[string]map[string]interface{}{ 31 | id: map[string]interface{}{ 32 | "direction": "ingress", 33 | "remote_group_id": "in-id", 34 | }, 35 | } 36 | 37 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 38 | assert.Equal(t, []string{"in-id"}, ins) 39 | assert.Equal(t, []string(nil), outs) 40 | }) 41 | t.Run("SuccessNSGRV2_egress", func(t *testing.T) { 42 | fe := flexibleengine.Provider{} 43 | id := "id" 44 | rs := "flexibleengine_networking_secgroup_rule_v2" 45 | cfg := map[string]map[string]interface{}{ 46 | id: map[string]interface{}{ 47 | "direction": "egress", 48 | "remote_group_id": "out-id", 49 | }, 50 | } 51 | 52 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 53 | assert.Equal(t, []string(nil), ins) 54 | assert.Equal(t, []string{"out-id"}, outs) 55 | }) 56 | t.Run("SuccessNPV2", func(t *testing.T) { 57 | fe := flexibleengine.Provider{} 58 | id := "id" 59 | rs := "flexibleengine_networking_port_v2" 60 | cfg := map[string]map[string]interface{}{ 61 | id: map[string]interface{}{ 62 | "security_group_ids": []interface{}{ 63 | "in-id", 64 | }, 65 | }, 66 | } 67 | 68 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 69 | assert.Equal(t, []string{"in-id"}, ins) 70 | assert.Equal(t, []string(nil), outs) 71 | }) 72 | t.Run("SuccessLBLV2", func(t *testing.T) { 73 | fe := flexibleengine.Provider{} 74 | id := "id" 75 | rs := "flexibleengine_lb_listener_v2" 76 | cfg := map[string]map[string]interface{}{ 77 | id: map[string]interface{}{ 78 | "loadbalancer_id": "in-id", 79 | }, 80 | } 81 | 82 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 83 | assert.Equal(t, []string{"in-id"}, ins) 84 | assert.Equal(t, []string(nil), outs) 85 | }) 86 | t.Run("SuccessLBPV2", func(t *testing.T) { 87 | fe := flexibleengine.Provider{} 88 | id := "id" 89 | rs := "flexibleengine_lb_pool_v2" 90 | cfg := map[string]map[string]interface{}{ 91 | id: map[string]interface{}{ 92 | "listener_id": "in-id", 93 | }, 94 | } 95 | 96 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 97 | assert.Equal(t, []string{"in-id"}, ins) 98 | assert.Equal(t, []string(nil), outs) 99 | }) 100 | t.Run("SuccessLBMV2", func(t *testing.T) { 101 | fe := flexibleengine.Provider{} 102 | id := "id" 103 | rs := "flexibleengine_lb_member_v2" 104 | cfg := map[string]map[string]interface{}{ 105 | id: map[string]interface{}{ 106 | "pool_id": "in-id", 107 | }, 108 | } 109 | 110 | ins, outs, _ := fe.ResourceInOutNodes(id, rs, cfg) 111 | assert.Equal(t, []string{"in-id"}, ins) 112 | assert.Equal(t, []string(nil), outs) 113 | }) 114 | } 115 | -------------------------------------------------------------------------------- /provider/google/google_test.go: -------------------------------------------------------------------------------- 1 | package google_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | 9 | "github.com/cycloidio/inframap/provider" 10 | "github.com/cycloidio/inframap/provider/google" 11 | ) 12 | 13 | func TestResourceInOutNodes(t *testing.T) { 14 | t.Run("SuccessGCF_INGRESS", func(t *testing.T) { 15 | google := google.Provider{} 16 | id := "id" 17 | inid := "id-in" 18 | outid := "out-id" 19 | tagIn := "tag-in" 20 | tagOut := "tag-out" 21 | rs := "google_compute_firewall" 22 | cfg := map[string]map[string]interface{}{ 23 | id: map[string]interface{}{ 24 | "direction": "INGRESS", 25 | "target_tags": []interface{}{ 26 | tagOut, 27 | }, 28 | "source_tags": []interface{}{ 29 | tagIn, 30 | }, 31 | }, 32 | "in-node-id": map[string]interface{}{ 33 | "id": inid, 34 | "tags": []interface{}{ 35 | tagIn, 36 | }, 37 | }, 38 | "out-node-id": map[string]interface{}{ 39 | "id": outid, 40 | "tags": []interface{}{ 41 | tagOut, 42 | }, 43 | }, 44 | } 45 | 46 | ins, outs, _ := google.ResourceInOutNodes(id, rs, cfg) 47 | assert.Equal(t, []string{inid}, ins) 48 | assert.Equal(t, []string{outid}, outs) 49 | }) 50 | t.Run("SuccessGCF_INGRESS_with_HCLCanonicalKey", func(t *testing.T) { 51 | google := google.Provider{} 52 | id := "id" 53 | incan := "id-can" 54 | outcan := "out-can" 55 | tagIn := "tag-in" 56 | tagOut := "tag-out" 57 | rs := "google_compute_firewall" 58 | cfg := map[string]map[string]interface{}{ 59 | id: map[string]interface{}{ 60 | "direction": "INGRESS", 61 | "target_tags": []interface{}{ 62 | tagOut, 63 | }, 64 | "source_tags": []interface{}{ 65 | tagIn, 66 | }, 67 | }, 68 | "in-node-id": map[string]interface{}{ 69 | provider.HCLCanonicalKey: incan, 70 | "tags": []interface{}{ 71 | tagIn, 72 | }, 73 | }, 74 | "out-node-id": map[string]interface{}{ 75 | provider.HCLCanonicalKey: outcan, 76 | "tags": []interface{}{ 77 | tagOut, 78 | }, 79 | }, 80 | } 81 | 82 | ins, outs, _ := google.ResourceInOutNodes(id, rs, cfg) 83 | assert.Equal(t, []string{fmt.Sprintf("${%s.something}", incan)}, ins) 84 | assert.Equal(t, []string{fmt.Sprintf("${%s.something}", outcan)}, outs) 85 | }) 86 | t.Run("SuccessGCF_EGRESS", func(t *testing.T) { 87 | google := google.Provider{} 88 | id := "id" 89 | inid := "id-in" 90 | tagIn := "tag-in" 91 | rs := "google_compute_firewall" 92 | cfg := map[string]map[string]interface{}{ 93 | id: map[string]interface{}{ 94 | "direction": "EGRESS", 95 | "target_tags": []interface{}{ 96 | tagIn, 97 | }, 98 | }, 99 | "in-node-id": map[string]interface{}{ 100 | "id": inid, 101 | "tags": []interface{}{ 102 | tagIn, 103 | }, 104 | }, 105 | } 106 | 107 | ins, outs, _ := google.ResourceInOutNodes(id, rs, cfg) 108 | assert.Equal(t, []string{inid}, ins) 109 | assert.Equal(t, []string(nil), outs) 110 | }) 111 | t.Run("SuccessGCF_EGRESS_with_HCLCanonicalKey", func(t *testing.T) { 112 | google := google.Provider{} 113 | id := "id" 114 | incan := "id-can" 115 | tagIn := "tag-in" 116 | rs := "google_compute_firewall" 117 | cfg := map[string]map[string]interface{}{ 118 | id: map[string]interface{}{ 119 | "direction": "EGRESS", 120 | "target_tags": []interface{}{ 121 | tagIn, 122 | }, 123 | }, 124 | "in-node-id": map[string]interface{}{ 125 | provider.HCLCanonicalKey: incan, 126 | "tags": []interface{}{ 127 | tagIn, 128 | }, 129 | }, 130 | } 131 | 132 | ins, outs, _ := google.ResourceInOutNodes(id, rs, cfg) 133 | assert.Equal(t, []string{fmt.Sprintf("${%s.something}", incan)}, ins) 134 | assert.Equal(t, []string(nil), outs) 135 | }) 136 | } 137 | -------------------------------------------------------------------------------- /provider/im/im.go: -------------------------------------------------------------------------------- 1 | package im 2 | 3 | import ( 4 | "github.com/cycloidio/inframap/provider" 5 | "github.com/cycloidio/tfdocs/resource" 6 | ) 7 | 8 | // Provider is the Type that defines the interface 'provider.Interface' 9 | type Provider struct { 10 | provider.NopProvider 11 | } 12 | 13 | // Type returns the type of the implementation 14 | func (a Provider) Type() provider.Type { return provider.IM } 15 | 16 | // Resource returns the resource information 17 | func (a Provider) Resource(rsc string) (*resource.Resource, error) { 18 | return &resource.Resource{ 19 | Name: rsc, 20 | Type: rsc, 21 | Icon: "baseline_cloud_queue_black.svg", 22 | }, nil 23 | } 24 | -------------------------------------------------------------------------------- /provider/nop_provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "github.com/cycloidio/tfdocs/resource" 5 | ) 6 | 7 | // NopProvider holds the default methods for 8 | // the provider.Interface so if one Provider 9 | // does not implement one method we do not have 10 | // to write the method 11 | type NopProvider struct{} 12 | 13 | // Type returns the name of the Provider 14 | func (n NopProvider) Type() Type { return Type(9999) } 15 | 16 | // IsNode checks if the resource should be considered 17 | // a Node or not 18 | func (n NopProvider) IsNode(rsc string) bool { return false } 19 | 20 | // IsEdge checks if the resource should be considered 21 | // an Edge or not 22 | func (n NopProvider) IsEdge(rsc string) bool { return false } 23 | 24 | // Resource returns the resource information 25 | func (n NopProvider) Resource(rsc string) (*resource.Resource, error) { return nil, nil } 26 | 27 | // DataSource returns the resource information 28 | func (n NopProvider) DataSource(rsc string) (*resource.Resource, error) { return nil, nil } 29 | 30 | // ResourceInOutNodes returns the resource In Out and Nodes from a 31 | // state config. As an example in AWS this would be 32 | // an "aws_security_group" "ingress" and "egress" 33 | // In are the incoming connections, Out are the exiting connections 34 | // and Nodes are fictional Nodes that need to be added, it's basically 35 | // to represent the internet access 36 | func (n NopProvider) ResourceInOutNodes(id, rs string, cfg map[string]map[string]interface{}) (in, out, nodes []string) { 37 | return nil, nil, nil 38 | } 39 | 40 | // UsedAttributes returns all the attributes that are 41 | // required/used/needed on the providers, so when we have to 42 | // prune we know what to keep 43 | func (n NopProvider) UsedAttributes() []string { return nil } 44 | 45 | // PreProcess defines new edges from the config. 46 | // each element is an edge and for each edge we have the source 47 | // and the target. 48 | // [_][0] is the source of the edge 49 | // [_][1] is the target of the edge 50 | func (n NopProvider) PreProcess(cfg map[string]map[string]interface{}) [][]string { 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /provider/openstack/openstack.go: -------------------------------------------------------------------------------- 1 | package openstack 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/cycloidio/inframap/errcode" 7 | "github.com/cycloidio/inframap/provider" 8 | tfdocOS "github.com/cycloidio/tfdocs/providers/openstack" 9 | "github.com/cycloidio/tfdocs/resource" 10 | ) 11 | 12 | // Provider is the Type that implements the interface 'provider.Interface' 13 | type Provider struct { 14 | provider.NopProvider 15 | } 16 | 17 | var ( 18 | usedAttributes = []string{ 19 | "id", 20 | "instance_id", 21 | "direction", 22 | "remote_group_id", 23 | "security_group_ids", 24 | "loadbalancer_id", 25 | "listener_id", 26 | "pool_id", 27 | } 28 | ) 29 | 30 | // Type returns the type of the implementation 31 | func (a Provider) Type() provider.Type { return provider.OpenStack } 32 | 33 | // IsNode returns if the resource is a Node 34 | func (a Provider) IsNode(resource string) bool { 35 | _, ok := nodeTypes[resource] 36 | return ok 37 | } 38 | 39 | // IsEdge returns if the resource is an Edge 40 | func (a Provider) IsEdge(resource string) bool { 41 | _, ok := edgeTypes[resource] 42 | return ok 43 | } 44 | 45 | // Resource returns the resource information 46 | func (a Provider) Resource(resource string) (*resource.Resource, error) { 47 | r, err := tfdocOS.GetResource(resource) 48 | if err != nil { 49 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundResource) 50 | } 51 | return r, nil 52 | } 53 | 54 | // DataSource returns the resource information 55 | func (a Provider) DataSource(resource string) (*resource.Resource, error) { 56 | r, err := tfdocOS.GetDataSource(resource) 57 | if err != nil { 58 | return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundDataSource) 59 | } 60 | return r, nil 61 | } 62 | 63 | // ResourceInOutNodes returns the In, Out and Nodes of the rs based on the cfg 64 | func (a Provider) ResourceInOutNodes(id, rs string, cfgs map[string]map[string]interface{}) ([]string, []string, []string) { 65 | var ins, outs []string 66 | cfg := cfgs[id] 67 | switch rs { 68 | case "openstack_compute_interface_attach_v2": 69 | if instanceID, ok := cfg["instance_id"]; ok { 70 | ins = append(ins, instanceID.(string)) 71 | } 72 | case "openstack_networking_secgroup_rule_v2": 73 | if direction, ok := cfg["direction"]; ok { 74 | if direction.(string) == "ingress" { 75 | if rg, ok := cfg["remote_group_id"]; ok { 76 | ins = append(ins, rg.(string)) 77 | } 78 | } else { 79 | if rg, ok := cfg["remote_group_id"]; ok { 80 | outs = append(outs, rg.(string)) 81 | } 82 | } 83 | } 84 | case "openstack_networking_port_v2": 85 | if sgs, ok := cfg["security_group_ids"]; ok { 86 | for _, sg := range sgs.([]interface{}) { 87 | ins = append(ins, sg.(string)) 88 | } 89 | } 90 | case "openstack_lb_listener_v2": 91 | if lbid, ok := cfg["loadbalancer_id"]; ok { 92 | ins = append(ins, lbid.(string)) 93 | } 94 | case "openstack_lb_pool_v2": 95 | if lid, ok := cfg["listener_id"]; ok { 96 | ins = append(ins, lid.(string)) 97 | } 98 | case "openstack_lb_member_v2": 99 | if pid, ok := cfg["pool_id"]; ok { 100 | ins = append(ins, pid.(string)) 101 | } 102 | } 103 | return ins, outs, nil 104 | } 105 | 106 | // UsedAttributes returns all the attributes that are 107 | // required/used/needed on the providers, so when we have to 108 | // prune we know what to keep 109 | func (a Provider) UsedAttributes() []string { 110 | return usedAttributes 111 | } 112 | -------------------------------------------------------------------------------- /provider/openstack/openstack_test.go: -------------------------------------------------------------------------------- 1 | package openstack_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | 8 | "github.com/cycloidio/inframap/provider/openstack" 9 | ) 10 | 11 | func TestResourceInOutNodes(t *testing.T) { 12 | t.Run("SuccessCIAV2", func(t *testing.T) { 13 | os := openstack.Provider{} 14 | id := "id" 15 | rs := "openstack_compute_interface_attach_v2" 16 | cfg := map[string]map[string]interface{}{ 17 | id: map[string]interface{}{ 18 | "instance_id": "in-id", 19 | }, 20 | } 21 | 22 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 23 | assert.Equal(t, []string{"in-id"}, ins) 24 | assert.Equal(t, []string(nil), outs) 25 | }) 26 | t.Run("SuccessNSGRV2_ingress", func(t *testing.T) { 27 | os := openstack.Provider{} 28 | id := "id" 29 | rs := "openstack_networking_secgroup_rule_v2" 30 | cfg := map[string]map[string]interface{}{ 31 | id: map[string]interface{}{ 32 | "direction": "ingress", 33 | "remote_group_id": "in-id", 34 | }, 35 | } 36 | 37 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 38 | assert.Equal(t, []string{"in-id"}, ins) 39 | assert.Equal(t, []string(nil), outs) 40 | }) 41 | t.Run("SuccessNSGRV2_egress", func(t *testing.T) { 42 | os := openstack.Provider{} 43 | id := "id" 44 | rs := "openstack_networking_secgroup_rule_v2" 45 | cfg := map[string]map[string]interface{}{ 46 | id: map[string]interface{}{ 47 | "direction": "egress", 48 | "remote_group_id": "out-id", 49 | }, 50 | } 51 | 52 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 53 | assert.Equal(t, []string(nil), ins) 54 | assert.Equal(t, []string{"out-id"}, outs) 55 | }) 56 | t.Run("SuccessNPV2", func(t *testing.T) { 57 | os := openstack.Provider{} 58 | id := "id" 59 | rs := "openstack_networking_port_v2" 60 | cfg := map[string]map[string]interface{}{ 61 | id: map[string]interface{}{ 62 | "security_group_ids": []interface{}{ 63 | "in-id", 64 | }, 65 | }, 66 | } 67 | 68 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 69 | assert.Equal(t, []string{"in-id"}, ins) 70 | assert.Equal(t, []string(nil), outs) 71 | }) 72 | t.Run("SuccessLBLV2", func(t *testing.T) { 73 | os := openstack.Provider{} 74 | id := "id" 75 | rs := "openstack_lb_listener_v2" 76 | cfg := map[string]map[string]interface{}{ 77 | id: map[string]interface{}{ 78 | "loadbalancer_id": "in-id", 79 | }, 80 | } 81 | 82 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 83 | assert.Equal(t, []string{"in-id"}, ins) 84 | assert.Equal(t, []string(nil), outs) 85 | }) 86 | t.Run("SuccessLBPV2", func(t *testing.T) { 87 | os := openstack.Provider{} 88 | id := "id" 89 | rs := "openstack_lb_pool_v2" 90 | cfg := map[string]map[string]interface{}{ 91 | id: map[string]interface{}{ 92 | "listener_id": "in-id", 93 | }, 94 | } 95 | 96 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 97 | assert.Equal(t, []string{"in-id"}, ins) 98 | assert.Equal(t, []string(nil), outs) 99 | }) 100 | t.Run("SuccessLBMV2", func(t *testing.T) { 101 | os := openstack.Provider{} 102 | id := "id" 103 | rs := "openstack_lb_member_v2" 104 | cfg := map[string]map[string]interface{}{ 105 | id: map[string]interface{}{ 106 | "pool_id": "in-id", 107 | }, 108 | } 109 | 110 | ins, outs, _ := os.ResourceInOutNodes(id, rs, cfg) 111 | assert.Equal(t, []string{"in-id"}, ins) 112 | assert.Equal(t, []string(nil), outs) 113 | }) 114 | } 115 | -------------------------------------------------------------------------------- /provider/provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "github.com/cycloidio/tfdocs/resource" 5 | ) 6 | 7 | // HCLCanonicalKey is used to define a specific key to the config, in this case 8 | // the HCL config, as it does not have an 'id' we'll add this key with the 9 | // Canonical of the Resource (ex: _im_canonical => aws_lb.front) 10 | const HCLCanonicalKey = "_im_canonical" 11 | 12 | // Provider is an interface to abstract common functions on all the 13 | // providers 14 | type Provider interface { 15 | // Type returns the name of the Provider 16 | Type() Type 17 | 18 | // IsNode checks if the resource should be considered 19 | // a Node or not 20 | IsNode(rsc string) bool 21 | 22 | // IsEdge checks if the resource should be considered 23 | // an Edge or not 24 | IsEdge(rsc string) bool 25 | 26 | // Resource returns the resource information 27 | Resource(rsc string) (*resource.Resource, error) 28 | 29 | // DataSource returns the resource information 30 | DataSource(rsc string) (*resource.Resource, error) 31 | 32 | // ResourceInOutNodes returns the resource In Out and Nodes from a 33 | // state config. As an example in AWS this would be 34 | // an "aws_security_group" "ingress" and "egress" 35 | // In are the incoming connections, Out are the exiting connections 36 | // and Nodes are fictional Nodes that need to be added, it's basically 37 | // to represent the internet access 38 | ResourceInOutNodes(id, rs string, cfg map[string]map[string]interface{}) (in, out, nodes []string) 39 | 40 | // UsedAttributes returns all the attributes that are 41 | // required/used/needed on the providers, so when we have to 42 | // prune we know what to keep 43 | UsedAttributes() []string 44 | 45 | // PreProcess defines new edges from the config. 46 | // each element is an edge and for each edge we have the source 47 | // and the target. 48 | // [_][0] is the source of the edge 49 | // [_][1] is the target of the edge 50 | PreProcess(cfg map[string]map[string]interface{}) [][]string 51 | } 52 | -------------------------------------------------------------------------------- /provider/raw_provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import "github.com/cycloidio/tfdocs/resource" 4 | 5 | // RawProvider is the provider that would be used 6 | // when we do not have an specific implementation 7 | // a Provider 8 | type RawProvider struct { 9 | NopProvider 10 | } 11 | 12 | // Type returns the name of the Provider 13 | func (n RawProvider) Type() Type { return Raw } 14 | 15 | // IsNode checks if the resource should be considered 16 | // a Node or not 17 | // For the default one we consider all of the Nodes 18 | func (n RawProvider) IsNode(rsc string) bool { return true } 19 | 20 | // Resource returns the resource information 21 | func (n RawProvider) Resource(rsc string) (*resource.Resource, error) { 22 | return &resource.Resource{ 23 | Name: rsc, 24 | Type: rsc, 25 | }, nil 26 | } 27 | -------------------------------------------------------------------------------- /provider/type.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | // Type defines the type of the Provider 4 | type Type int 5 | 6 | //go:generate ./../bin/enumer -type=Type -transform=lower -output=type_string.go 7 | 8 | // List of all the Providers supported 9 | const ( 10 | Raw Type = iota 11 | IM 12 | AWS 13 | FlexibleEngine 14 | OpenStack 15 | Google 16 | Azurerm 17 | ) 18 | -------------------------------------------------------------------------------- /provider/type_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "enumer -type=Type -transform=lower -output=type_string.go"; DO NOT EDIT. 2 | 3 | package provider 4 | 5 | import ( 6 | "fmt" 7 | "strings" 8 | ) 9 | 10 | const _TypeName = "rawimawsflexibleengineopenstackgoogleazurerm" 11 | 12 | var _TypeIndex = [...]uint8{0, 3, 5, 8, 22, 31, 37, 44} 13 | 14 | const _TypeLowerName = "rawimawsflexibleengineopenstackgoogleazurerm" 15 | 16 | func (i Type) String() string { 17 | if i < 0 || i >= Type(len(_TypeIndex)-1) { 18 | return fmt.Sprintf("Type(%d)", i) 19 | } 20 | return _TypeName[_TypeIndex[i]:_TypeIndex[i+1]] 21 | } 22 | 23 | // An "invalid array index" compiler error signifies that the constant values have changed. 24 | // Re-run the stringer command to generate them again. 25 | func _TypeNoOp() { 26 | var x [1]struct{} 27 | _ = x[Raw-(0)] 28 | _ = x[IM-(1)] 29 | _ = x[AWS-(2)] 30 | _ = x[FlexibleEngine-(3)] 31 | _ = x[OpenStack-(4)] 32 | _ = x[Google-(5)] 33 | _ = x[Azurerm-(6)] 34 | } 35 | 36 | var _TypeValues = []Type{Raw, IM, AWS, FlexibleEngine, OpenStack, Google, Azurerm} 37 | 38 | var _TypeNameToValueMap = map[string]Type{ 39 | _TypeName[0:3]: Raw, 40 | _TypeLowerName[0:3]: Raw, 41 | _TypeName[3:5]: IM, 42 | _TypeLowerName[3:5]: IM, 43 | _TypeName[5:8]: AWS, 44 | _TypeLowerName[5:8]: AWS, 45 | _TypeName[8:22]: FlexibleEngine, 46 | _TypeLowerName[8:22]: FlexibleEngine, 47 | _TypeName[22:31]: OpenStack, 48 | _TypeLowerName[22:31]: OpenStack, 49 | _TypeName[31:37]: Google, 50 | _TypeLowerName[31:37]: Google, 51 | _TypeName[37:44]: Azurerm, 52 | _TypeLowerName[37:44]: Azurerm, 53 | } 54 | 55 | var _TypeNames = []string{ 56 | _TypeName[0:3], 57 | _TypeName[3:5], 58 | _TypeName[5:8], 59 | _TypeName[8:22], 60 | _TypeName[22:31], 61 | _TypeName[31:37], 62 | _TypeName[37:44], 63 | } 64 | 65 | // TypeString retrieves an enum value from the enum constants string name. 66 | // Throws an error if the param is not part of the enum. 67 | func TypeString(s string) (Type, error) { 68 | if val, ok := _TypeNameToValueMap[s]; ok { 69 | return val, nil 70 | } 71 | s = strings.ToLower(s) 72 | if val, ok := _TypeNameToValueMap[s]; ok { 73 | return val, nil 74 | } 75 | return 0, fmt.Errorf("%s does not belong to Type values", s) 76 | } 77 | 78 | // TypeValues returns all values of the enum 79 | func TypeValues() []Type { 80 | return _TypeValues 81 | } 82 | 83 | // TypeStrings returns a slice of all String values of the enum 84 | func TypeStrings() []string { 85 | strs := make([]string, len(_TypeNames)) 86 | copy(strs, _TypeNames) 87 | return strs 88 | } 89 | 90 | // IsAType returns "true" if the value is listed in the enum definition. "false" otherwise 91 | func (i Type) IsAType() bool { 92 | for _, v := range _TypeValues { 93 | if i == v { 94 | return true 95 | } 96 | } 97 | return false 98 | } 99 | -------------------------------------------------------------------------------- /prune/doc.go: -------------------------------------------------------------------------------- 1 | // Package prune has the logic to Prune a configuration 2 | // to make it anonymous and only keep the information needed 3 | // to generate the Graph and discarding the extra 4 | package prune 5 | -------------------------------------------------------------------------------- /scripts/assets/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "flag" 6 | "fmt" 7 | "log" 8 | "net/http" 9 | "os" 10 | "path/filepath" 11 | "strings" 12 | 13 | "github.com/cycloidio/inframap/provider" 14 | ) 15 | 16 | var ( 17 | dry bool 18 | branch string 19 | ) 20 | 21 | func init() { 22 | flag.BoolVar(&dry, "dry", false, "Makes a dry run") 23 | flag.StringVar(&branch, "branch", "master", "Branch from tfdocs to use") 24 | } 25 | 26 | func main() { 27 | flag.Parse() 28 | for _, pr := range provider.TypeValues() { 29 | if pr == provider.Raw || pr == provider.IM { 30 | continue 31 | } 32 | url := fmt.Sprintf("https://raw.githubusercontent.com/cycloidio/tfdocs/%s/assets/%s/icons.json", branch, pr) 33 | 34 | res, err := http.Get(url) 35 | if err != nil { 36 | log.Fatal(err) 37 | } 38 | 39 | if res.StatusCode != 200 { 40 | log.Fatalf("expecting a 200 status code but got %d for provider %s", res.StatusCode, pr) 41 | } 42 | 43 | icons := make(map[string]string) 44 | err = json.NewDecoder(res.Body).Decode(&icons) 45 | if err != nil { 46 | log.Fatal(err) 47 | } 48 | res.Body.Close() 49 | 50 | paths := make(map[string]bool) 51 | for _, p := range icons { 52 | if p == "" { 53 | continue 54 | } 55 | paths[p] = false 56 | } 57 | 58 | rootDir := fmt.Sprintf("assets/icons/%s/", pr) 59 | _, err = os.Stat(rootDir) 60 | if os.IsNotExist(err) { 61 | fmt.Printf("missing icons for %s\n", pr) 62 | continue 63 | } 64 | err = filepath.Walk(rootDir, func(p string, fi os.FileInfo, err error) error { 65 | if err != nil { 66 | return err 67 | } 68 | if !fi.IsDir() { 69 | // We need to remove the rootDir as it's not on tfdocs 70 | // and also replace the .png for .svg 71 | np := strings.Replace( 72 | strings.TrimPrefix(p, rootDir), 73 | ".png", ".svg", -1, 74 | ) 75 | if _, ok := paths[np]; !ok { 76 | fmt.Printf("remove %s %s\n", pr, p) 77 | if !dry { 78 | os.Remove(p) 79 | } 80 | } else { 81 | paths[np] = true 82 | } 83 | } 84 | 85 | return nil 86 | }) 87 | if err != nil { 88 | log.Fatal(err) 89 | } 90 | 91 | for p, ok := range paths { 92 | if !ok { 93 | fmt.Printf("missing %s %s\n", pr, p) 94 | } 95 | } 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /scripts/deploy/aur.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/sh 2 | 3 | # this script can be used manually or in a CI context in order to push 4 | # inframap archlinux package to the AUR 5 | # usage: 6 | # ``` 7 | # export SSH_PRIVATE_KEY=$(cat /path/to/aur/ssh/key) 8 | # sh ./deploy.sh 9 | # ``` 10 | 11 | # script requirements: 12 | # * curl 13 | # * jq 14 | # * wget 15 | # * git 16 | 17 | function error { 18 | echo $1 19 | exit 1 20 | } 21 | 22 | set -xe 23 | 24 | # SSH_PRIVATE_KEY is the private key used to push / pull on the AUR package 25 | [[ -z "$SSH_PRIVATE_KEY" ]] && error "SSH_PRIVATE_KEY must be set" 26 | 27 | # fetch the latest tag name 28 | tag_name=$(curl --silent "https://api.github.com/repos/cycloidio/inframap/releases/latest" | 29 | jq -r .tag_name 30 | ) 31 | 32 | source_i386="https://github.com/cycloidio/inframap/releases/download/$tag_name/inframap-linux-386.tar.gz" 33 | source_amd64="https://github.com/cycloidio/inframap/releases/download/$tag_name/inframap-linux-amd64.tar.gz" 34 | 35 | # download the two assets for linux (amd64, i386) 36 | wget $source_i386 37 | wget $source_amd64 38 | 39 | # compute sha256 sums 40 | sha256sum_i386=$(sha256sum inframap-linux-386.tar.gz | awk '{ print $1 }') 41 | sha256sum_amd64=$(sha256sum inframap-linux-amd64.tar.gz | awk '{ print $1 }') 42 | 43 | # save the SSH_PRIVATE_KEY in a file, to be used as identity 44 | echo "$SSH_PRIVATE_KEY" > id_rsa.aur; chmod 600 ./id_rsa.aur 45 | 46 | # clone the actual AUR 47 | GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i ./id_rsa.aur" git clone ssh://aur@aur.archlinux.org/inframap.git && cd inframap 48 | 49 | # update the manifests (PKGBUILD and .SRCINFO) 50 | # update the package version, the URLs and the sha256sums 51 | # ${tag_name:1} to prevent adding the 'v' character of the version 52 | sed -i "s/pkgver=[^\"]*/pkgver=${tag_name:1}/" PKGBUILD 53 | sed -i "s/sha256sums_i386=[^\"]*/sha256sums_i386=('$sha256sum_i386')/" PKGBUILD 54 | sed -i "s/sha256sums_x86_64=[^\"]*/sha256sums_x86_64=('$sha256sum_amd64')/" PKGBUILD 55 | 56 | sed -i "s|source_i386 = [^\"]*|source_i386 = $source_i386|" .SRCINFO 57 | sed -i "s/sha256sums_i386 = [^\"]*/sha256sums_i386 = $sha256sum_i386/" .SRCINFO 58 | sed -i "s|source_x86_64 = [^\"]*|source_x86_64 = $source_amd64|" .SRCINFO 59 | sed -i "s/sha256sums_x86_64 = [^\"]*/sha256sums_x86_64 = $sha256sum_amd64/" .SRCINFO 60 | sed -i "s/pkgver = [^\"]*/pkgver = ${tag_name:1}/" .SRCINFO 61 | 62 | # show git diff 63 | git --no-pager diff 64 | 65 | # configure git 66 | git config --global user.name "cycloid" 67 | git config --global user.email "cycloid@build" 68 | 69 | # commit the files 70 | # TODO: sign the commit by the CI 71 | git commit -am "inframap: bump to version $tag_name" 72 | 73 | # push the files 74 | GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i ../id_rsa.aur" git push -u origin master 75 | 76 | cd ../; rm -rf inframap* id_rsa.aur 77 | -------------------------------------------------------------------------------- /tools/doc.go: -------------------------------------------------------------------------------- 1 | // Package tools has a list of all the tools we use 2 | // so we can vendor them in an specific version 3 | package tools 4 | -------------------------------------------------------------------------------- /tools/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | package tools 5 | 6 | import ( 7 | _ "github.com/dmarkham/enumer" 8 | _ "github.com/markbates/pkger/cmd/pkger" 9 | _ "golang.org/x/lint/golint" 10 | _ "golang.org/x/tools/cmd/goimports" 11 | ) 12 | --------------------------------------------------------------------------------