diff --git a/.gitignore b/.gitignore index f1b0d54..f8434f4 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,7 @@ venv.bak/ # mypy .mypy_cache/ + +# node_modules +node_modules +package-lock.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2d35634..df4191b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,35 @@ -ARG TF_VERSION=0.12.12 +ARG TF_VERSION=0.12.20 ARG PYTHON_VERSION=3.7 +FROM python:$PYTHON_VERSION-alpine + + + FROM hashicorp/terraform:$TF_VERSION AS terraform +FROM ibmterraform/terraform-provider-ibm-docker AS provideribm +FROM nibhart1/hcl2json:hcl2json AS hcl2json FROM python:$PYTHON_VERSION-alpine RUN pip install -U pip ply \ && apk add --update --no-cache graphviz ttf-freefont - +RUN pip install graphviz COPY --from=terraform /bin/terraform /bin/terraform +COPY --from=provideribm /go/bin/terraform-provider-ibm_v* /root/.terraform.d/plugins/linux_amd64/terraform-provider-ibm +COPY --from=hcl2json /go/bin/hcl2json /bin/hcl2json COPY ./docker-entrypoint.sh /bin/docker-entrypoint.sh RUN chmod +x /bin/docker-entrypoint.sh +WORKDIR /bin +RUN ls + WORKDIR /src COPY . . RUN pip install -e . - WORKDIR /data ENTRYPOINT ["/bin/docker-entrypoint.sh"] CMD ["blast-radius", "--serve"] + + + + diff --git a/Makefile b/Makefile index b3a191a..1134969 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,25 @@ CATEGORIES_JSON = ./blastradius/server/static/js/categories.json CATEGORIES_JS = ./blastradius/server/static/js/categories.js +GOPATH = $(CURDIR)/blastradius +export GOPATH + .PHONY: clean clean: -find . -type d -name __pycache__ -exec rm -r {} \+ -rm $(CATEGORIES_JSON) -rm $(CATEGORIES_JS) + -rm -rf hcl2json + +# install +.PHONY: install +install: hcl2json + pipenv install + +# build hcl2json binary +.PHONY: hcl2json +hcl2json: + -go get github.com/tmccombs/hcl2json # build pypi package .PHONY: dist diff --git a/README.md b/README.md index d475fd7..5f9bfcb 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,89 @@ # Blast Radius -[![CircleCI](https://circleci.com/gh/28mm/blast-radius/tree/master.svg?style=svg)](https://circleci.com/gh/28mm/blast-radius/tree/master) [![PyPI version](https://badge.fury.io/py/BlastRadius.svg)](https://badge.fury.io/py/BlastRadius) [terraform]: https://www.terraform.io/ [examples]: https://28mm.github.io/blast-radius-docs/ +[overlayfs]: -_Blast Radius_ is a tool for reasoning about [Terraform][] dependency graphs -with interactive visualizations. +_Blast Radius_ is a tool for reasoning about [Terraform][] dependency graphs with interactive visualizations. Use _Blast Radius_ to: * __Learn__ about *Terraform* or one of its providers through real [examples][] * __Document__ your infrastructure * __Reason__ about relationships between resources and evaluate changes to them -* __Interact__ with the diagram below (and many others) [in the docs][examples] +* __Interact__ with the diagrams below (and many others) [in the docs][examples] -![screenshot](doc/blastradius-interactive.png) +--- + +## Blast Radius +![screenshot](doc/blastradiusext.png) + +--- ## Prerequisites * [Graphviz](https://www.graphviz.org/) + > __Note:__ For macOS you can `brew install graphviz` * [Python](https://www.python.org/) 3.7 or newer +* [Go](https://golang.org/) 1.12.16 or newer +* [Terraform][] 0.12.x or newer -> __Note:__ For macOS you can `brew install graphviz` +--- ## Quickstart -The fastest way to get up and running with *Blast Radius* is to install it with -`pip` to your pre-existing environment: - -```sh -pip install blastradius -``` - -Once installed just point *Blast Radius* at any initialized *Terraform* -directory: - -```sh -blast-radius --serve /path/to/terraform/directory -``` - -And you will shortly be rewarded with a browser link http://127.0.0.1:5000/. +For fastest way to get up and running with blast-radius is as follows: + +* Download and install the wheel files from the [release](https://github.com/nishubharti/blast-radius/releases) + + ``` + copy the blastradius/server/static folder to the terraform directory + ``` + ``` + easy_install blastradius-0.1.25.4-py3-none-any.whl + ``` + or + ``` + pip3 blastradius-0.1.25.4-py3-none-any.whl + ``` + +* Once installed just point Blast Radius at any initialized Terraform directory: + ```sh + blast-radius --serve /path/to/terraform/directory + ``` +* Go to the browser link http://127.0.0.1:5000/ to view the Blast Radius diagram for the terraform file. + + ![BlastRadius](doc/blastradiusext.png) + +* Enrich the Blast Radius diagrams with the outcome of Terraform plan & apply actions: + ``` + terraform plan --out tfplan.binary + terraform show -json tfplan.binary > tfplan.json + terraform apply + ``` + for including cost and policy information into blast-radius cost.json and policy.json file need to be stored into the working directory. + + ```sh + blast-radius --serve /path/to/terraform/directory + ``` +* Go to the browser link http://127.0.0.1:5000/ to view the Blast Radius extended diagram + + The enrichments include - information from the Plan file, State file , cost file and time file . + Click the columns adjacent to the Resource Names to view these enrichment in the side panel view. + + ![BlastRadiusExt](doc/blast-radius-ext.png) + +--- + +## Build your own wheel file + +* Create wheel file of this repo + ```sh + python3 setup.py sdist bdist_wheel + ``` +--- ## Docker @@ -50,34 +92,28 @@ And you will shortly be rewarded with a browser link http://127.0.0.1:5000/. To launch *Blast Radius* for a local directory by manually running: -```sh -docker run --rm -it -p 5000:5000 \ - -v $(pwd):/data:ro \ - --security-opt apparmor:unconfined \ - --cap-add=SYS_ADMIN \ - 28mm/blast-radius -``` +* create a dockerhub account + ```sh + docker build -t /blast-radius:v1 . + docker push /blast-radius:v1 + ``` -A slightly more customized variant of this is also available as an example -[docker-compose.yml](./examples/docker-compose.yml) usecase for Workspaces. + ```sh + docker run --cap-add=SYS_ADMIN -dit -p 5000:5000 -v :/data:ro /blast-radius:v1 + ``` ### Docker configurations *Terraform* module links are saved as _absolute_ paths in relative to the project root (note `.terraform/modules/`). Given these paths will vary -betwen Docker and the host, we mount the volume as read-only, assuring we don't -ever interfere with your real environment. +betwen Docker and the host, we mount the volume as read-only, assuring we don't ever interfere with your real environment. -However, in order for *Blast Radius* to actually work with *Terraform*, it needs -to be initialized. To accomplish this, the container creates an [overlayfs][] -that exists within the container, overlaying your own, so that it can operate +However, in order for *Blast Radius* to actually work with *Terraform*, it needs to be initialized as well as planned compulsory. To accomplish this, the container creates an [overlayfs][] that exists within the container, overlaying your own, so that it can operate independently. To do this, certain runtime privileges are required -- specifically `--cap-add=SYS_ADMIN`. -For more information on how this works and what it means for your host, check -out the [runtime privileges][privileges] documentation. -#### Docker & Subdirectories +### Docker & Subdirectories If you organized your *Terraform* project using stacks and modules, *Blast Radius* must be called from the project root and reference them as @@ -101,14 +137,12 @@ It consists of 3 modules `foo`, `bar` and `dead`, followed by one `beef` stack. To apply *Blast Radius* to the `beef` stack, you would want to run the container with the following: -```sh -$ cd project -$ docker run --rm -it -p 5000:5000 \ - -v $(pwd):/data:ro \ - --security-opt apparmor:unconfined \ - --cap-add=SYS_ADMIN \ - 28mm/blast-radius --serve stacks/beef -``` + ```sh + $ cd project + $ docker run --cap-add=SYS_ADMIN -dit -p 5000:5000 -v :/data:ro /blast-radius:v1 + ``` + +--- ## Embedded Figures @@ -121,11 +155,14 @@ You will need the following: You can read more details in the [documentation](doc/embedded.md) +--- + ## Implementation Details *Blast Radius* uses the [Graphviz][] package to layout graph diagrams, -[PyHCL](https://github.com/virtuald/pyhcl) to parse [Terraform][] configuration, -and [d3.js](https://d3js.org/) to implement interactive features and animations. +[hcl] to parse [Terraform][] configuration, and [d3.js](https://d3js.org/) to implement interactive features and animations. + +--- ## Further Reading diff --git a/bin/blast-radius b/bin/blast-radius index eca3dd9..2d4b639 100755 --- a/bin/blast-radius +++ b/bin/blast-radius @@ -9,6 +9,7 @@ import sys import argparse import os import itertools +import subprocess # 1st party libraries from blastradius.handlers.dot import DotGraph, Format, DotNode @@ -16,6 +17,14 @@ from blastradius.handlers.plan import Plan from blastradius.handlers.apply import Apply from blastradius.handlers.terraform import Terraform from blastradius.server.server import app +from blastradius.handlers.cost import Cost +from blastradius.handlers.policy import Policy +from blastradius.handlers.time import Time + +# from blastradius.server.server import simple_graph, run_tf_graph +from blastradius.server.server import simple_graph + + def main(): @@ -27,21 +36,17 @@ def main(): output_group.add_argument('--json', action='store_const', const=True, default=False, help='print a json representation of the Terraform graph') output_group.add_argument('--dot', action='store_const', const=True, default=False, help='print the graphviz/dot representation of the Terraform graph') output_group.add_argument('--svg', action='store_const', const=True, default=False, help='print the svg representation of the Terraform graph') + output_group.add_argument('--svg-ext', action='store_const', const=True, default=False, help='download the simple svg of modified svg representation of the Terraform graph') output_group.add_argument('--serve', action='store_const', const=True, default=False, help='spins up a webserver with an interactive Terraform graph') parser.add_argument('--graph', type=str, help='`terraform graph` output (defaults to stdin)', default=sys.stdin) - + # options to limit, re-focus, and re-center presentation of larger graphs. constraint_group = parser.add_mutually_exclusive_group() constraint_group.add_argument('--module-depth', type=int, help='hide module details', required=False) constraint_group.add_argument('--focus', type=str, help='', required=False) constraint_group.add_argument('--center', type=str, help='', required=False) - # TODO present changes, and animate `terraform apply' - #parser.add_argument('--plan', type=str, help='terraform plan output', default=None) - #parser.add_argument('--state', type=str, help='tfstate file', default=None) - #parser.add_argument('--apply', type=str, help='terraform apply log', default=None) - args = parser.parse_args() if args.serve: @@ -49,11 +54,14 @@ def main(): app.run(host='0.0.0.0',port=args.port) sys.exit(0) - elif args.json or args.dot or args.svg: + elif args.json or args.dot or args.svg or args.svg_ext: if args.graph is sys.stdin: - dot = DotGraph('', file_contents=sys.stdin.read()) + dot = DotGraph('','', file_contents=sys.stdin.read()) + elif args.svg_ext: + #for simple blasradius svg + dot = DotGraph('ext','',file_contents=simple_graph()) else: - dot = DotGraph(args.graph) + dot = DotGraph('','',file_contents=simple_graph()) # we might not want to show every node in the depedency graph # specifying --module-depth is an easy way to limit detail @@ -76,21 +84,25 @@ def main(): parser.print_help() sys.exit(1) dot.focus(f_node) - + if args.json: tf = Terraform(args.directory) for node in dot.nodes: node.definition = tf.get_def(node) - - if args.json: - print(dot.json()) + f = open("visualization.json", "a") + f.write(dot.json()) + f.close() elif args.dot: print(dot.dot()) elif args.svg: print(dot.svg()) + elif args.svg_ext: + f = open("visualization.svg", "a") + f.write(dot.svg()) + f.close() else: parser.print_help() if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/blastradius/handlers/apply.py b/blastradius/handlers/apply.py index 1390828..06ae9f8 100644 --- a/blastradius/handlers/apply.py +++ b/blastradius/handlers/apply.py @@ -1,55 +1,37 @@ -# standard libraries -import re +from __future__ import print_function import json - -# 1st party libraries -from blastradius.graph import Graph, Node, Edge -from blastradius.handlers.dot import DotNode -from blastradius.util import Re - -class Apply(Graph): - def __init__(self, filename): - self.filename = filename - self.contents = '' - self.nodes = [] # we can populate this, - self.edges = [] # but not this! - - ansi_escape = re.compile(r'\x1b[^m]*m') - with open(filename, 'r') as f: - self.contents = ansi_escape.sub('', f.read()) - - # example output: - # - # aws_vpc.default: Creation complete after 4s (ID: vpc-024f7a64) - # ... - # aws_key_pair.auth: Creating... - # fingerprint: "" => "" - # key_name: "" => "default-key" - # ... - # aws_instance.web: Still creating... (10s elapsed) - # aws_instance.web: Still creating... (20s elapsed) - # aws_instance.web (remote-exec): Connecting to remote host via SSH... - # aws_instance.web (remote-exec): Host: 1.2.3.4 - # aws_instance.web (remote-exec): User: ubuntu - # ... - - node_begin_re =r'(?P\S+)\:\s+Creating...' - node_compl_re = r'(?P\S+)\:\s+Creation\s+complete\s+after\s+(?P\S+)\s+' - node_still_re = r'(?P\S+)\:\s+Still\s+creating\.\.\.\s+\((?P\S+)\s+' - - for line in self.contents.splitlines(): - - r = Re() - if r.match(node_begin_re, line): - - - - - break - - - - - print(self.contents) - - +import sys +import graphviz +import jinja2 +import json +import subprocess +import os.path +from os import path + +class Apply(): + def __init__(self,filename=None): + self.apply_resource_info = [] + #create json for apply + #reading from state file + if filename == None: + if(path.exists("terraform.tfstate")): + with open("terraform.tfstate", 'r') as f: + data = json.load(f) + else: + data = "" + else: + with open(filename, 'r') as f: + data = json.load(f) + + if (data) : + for index, var in enumerate(data["resources"]): + temp_data = dict() + temp_data = var + self.apply_resource_info.append(temp_data) + + else: + self.apply_resource_info.append("not applied") + + def json(self): + my_json_string = json.dumps(self.apply_resource_info,indent=4, sort_keys=True) + return my_json_string \ No newline at end of file diff --git a/blastradius/handlers/cost.py b/blastradius/handlers/cost.py new file mode 100644 index 0000000..515e5a4 --- /dev/null +++ b/blastradius/handlers/cost.py @@ -0,0 +1,37 @@ +from __future__ import print_function + +from os import path +import json + + +class Cost(): + def __init__(self,filename=None): + self.resource_cost_info = [] + if filename == None: + if(path.exists("cost.json")): + with open("cost.json", 'r') as f: + data = json.load(f) + else: + data = "" + else: + with open(filename, 'r') as f: + data = json.load(f) + + if (data) : + temp_data = dict() + for (index, var) in data.items(): + temp_data[index] = var + if (index == "Lineitem"): + if var == None: + temp_data[index] = "not available" + + self.resource_cost_info.append(temp_data) + + else: + self.resource_cost_info.append("not available") + + + def json(self): + my_cost_json = json.dumps(self.resource_cost_info,indent=4, sort_keys=True) + return my_cost_json + \ No newline at end of file diff --git a/blastradius/handlers/dot.py b/blastradius/handlers/dot.py index 1126c4b..1b79b70 100644 --- a/blastradius/handlers/dot.py +++ b/blastradius/handlers/dot.py @@ -1,26 +1,44 @@ # standard libraries +from __future__ import print_function import json import re import subprocess from collections import OrderedDict from collections import deque +import sys +import graphviz + # 3rd party libraries import jinja2 # 1st party libraries from blastradius.graph import Graph, Node, Edge from blastradius.util import OrderedSet +from blastradius.handlers.plan import Plan +from blastradius.handlers.apply import Apply +from blastradius.handlers.cost import Cost +from blastradius.handlers.time import Time +from blastradius.handlers.policy import Policy + class DotGraph(Graph): - def __init__(self, filename, file_contents=None): + def __init__(self,flag,filename, file_contents=None): self.filename = filename self.nodes = [] self.edges = [] self.clusters = OrderedDict() self.clusters['root'] = True # Used like an ordered Set. - + self.plan = Plan() + self.apply = Apply() + self.flag = flag + self.cost = Cost() + self.time = Time() + self.policy = Policy() + self.totalcost = "" + self.totaltime = "" + if file_contents: self.contents = file_contents else: @@ -44,17 +62,117 @@ def __init__(self, filename, file_contents=None): e = DotEdge(d['src'], d['dst'], fmt=fmt) self.edges.append(e) elif 'node' in m.groupdict(): - self.nodes.append(DotNode(d['node'], fmt=fmt)) - break - + + sp = d['node'].split(" ") + + res = sp[1].replace("data.","") + + type = sp[1].split(".")[0] + if type == "data": + #process data source: + plan_data = "no plan available" + policy_data = "no policy available" + cost_data = "no cost available" + time_data = "no time estimation available" + if ("not applied" in self.apply.apply_resource_info): + apply_data = "not yet applied" + self.nodes.append(DotNode(d['node'], plan_data, apply_data,cost_data,policy_data,time_data,fmt=fmt )) + break + + else: + for i in self.apply.apply_resource_info: + if i['type']+"."+i['name'] == res: + apply_data = i + self.nodes.append(DotNode(d['node'], plan_data, apply_data,cost_data,policy_data,time_data,fmt=fmt )) + break + else: + if type == "provider" or type == "provisioner": + apply_data = "not yet applied" + plan_data = "no plan available" + policy_data = "no policy available" + cost_data = "no cost available" + time_data = "no time estimation available" + self.nodes.append(DotNode(d['node'], plan_data, apply_data,cost_data,policy_data,time_data,fmt=fmt )) + else: + apply_data = None + plan_data = None + policy_data = "no policy available" + cost_data = "no cost available" + time_data = "no time estimation available" + if ("not applied" in self.apply.apply_resource_info): + apply_data = "not yet applied" + else: + for i in self.apply.apply_resource_info: + if i['type']+"."+i['name'] == res: + apply_data = i + break + + for i in self.plan.resource_info: + data = i["address"].split("[") + if data[0] == res: + plan_data = i + break + + if ("not available" in self.policy.resource_policy_info): + policy_data = "no policy available" + + else: + for i in self.policy.resource_policy_info: + data = i["type"]+"."+i["name"] + if data == res: + policy_data = i + break + + if ("not available" in self.cost.resource_cost_info): + cost_data = "no cost available" + + else: + for i in range(len(self.cost.resource_cost_info)): + currency = self.cost.resource_cost_info[i]["currency"] + self.totalcost = str(self.cost.resource_cost_info[i]["totalcost"]) + " " +currency + if self.cost.resource_cost_info[i]["Lineitem"] == "not available": + cost_data = "no cost available" + else: + for _, val in enumerate(self.cost.resource_cost_info[i]["Lineitem"]): + data = val["terraformItemId"]+"."+val["id"] + if data == res: + val["lineitemtotal"] = str(val["lineitemtotal"]) + " "+ currency + cost_data = val + break + + if ("not available" in self.time.resource_time_info): + time_data = "no time estimation available" + + else: + for i in range(len(self.time.resource_time_info)): + self.totaltime = str(self.time.resource_time_info[i]["totalTimeEstimation"]) + for _, val in enumerate(self.time.resource_time_info[i]["resources"]): + data = val["name"] + if data == res.split(".")[0]: + val["TimeEstimation"] = str(val["TimeEstimation"]) + time_data = val + break + self.nodes.append(DotNode(d['node'], plan_data, apply_data,cost_data,policy_data,time_data,fmt=fmt )) + # terraform graph output doesn't always make explicit node declarations; # sometimes they're a side-effect of edge definitions. Capture them. for e in self.edges: if e.source not in [ n.label for n in self.nodes ]: - self.nodes.append(DotNode(e.source)) + apply_data = "not yet applied" + plan_data = "no plan available" + policy_data = "no policy available" + cost_data = "no cost available" + time_data = "no time estimation available" + self.nodes.append(DotNode(e.source, plan_data,apply_data,cost_data,policy_data,time_data)) + if e.target not in [ n.label for n in self.nodes ]: - self.nodes.append(DotNode(e.target)) - + apply_data = "not yet applied" + plan_data = "no plan available" + policy_data = "no policy available" + cost_data = "no cost available" + time_data = "no time estimation available" + self.nodes.append(DotNode(e.target, plan_data,apply_data,cost_data,policy_data,time_data)) + self.stack('var') self.stack('output') @@ -62,6 +180,7 @@ def __init__(self, filename, file_contents=None): for n in self.nodes: n.cluster = 'root' if not n.cluster else n.cluster + def get_node_by_name(self, label): '''return node by label (if exists) otherwise simple_name''' for n in self.nodes: @@ -80,12 +199,16 @@ def get_node_by_name(self, label): def dot(self): 'returns a dot/graphviz representation of the graph (a string)' - return self.dot_template.render({ 'nodes': self.nodes, 'edges': self.edges, 'clusters' : self.clusters, 'EdgeType' : EdgeType }) + + if self.flag == "ext": + return self.dot_template_ext.render({ 'nodes': self.nodes, 'edges': self.edges, 'clusters' : self.clusters, 'EdgeType' : EdgeType,'totalcost': self.totalcost,'totaltime': self.totaltime }) + else : + return self.dot_template.render({ 'nodes': self.nodes, 'edges': self.edges, 'clusters' : self.clusters, 'EdgeType' : EdgeType }) def json(self): edges = [ dict(e) for e in self.edges ] nodes = [ dict(n) for n in self.nodes ] - return json.dumps({ 'nodes' : nodes, 'edges' : edges }, indent=4, sort_keys=True) + return json.dumps({ 'nodes' : nodes, 'edges' : edges,'totalcost' : self.totalcost,'totaltime': self.totaltime }, indent=4, sort_keys=True) # # A handful of graph manipulations. These are hampered by the decision @@ -225,7 +348,6 @@ def find_edge(edges, e): # add placeholder nodes, remove nodes beyond specified module_depth. self.nodes = list(OrderedSet(placeholders) | (OrderedSet(self.nodes) - OrderedSet(too_deep))) - def center(self, node): ''' prunes graph to include only (1) the given node, (2) its @@ -303,20 +425,134 @@ def focus(self, node): self.edges = list(edges_to_save) self.nodes = [ n for n in self.nodes if n.label in nodes_to_save ] - - # # Formatting templates. # + + dot_template_str_ext = """ + digraph { + compound = "true" + graph [fontname="Arial Black",fontsize=12]; + node [fontname="Arial Black",fontsize=11]; + edge [fontname=Helvetica,fontsize=10]; + + {# just the root module #} + {% for cluster in clusters %} + subgraph "{{cluster}}" { + style=invis; + {% for node in nodes %} + {% if node.cluster == cluster and node.module == 'root' %} + {% if node.type %} + {% if node.type == 'var' or node.type == 'provider' or node.type == 'meta' or node.type == 'provider' or node.type == 'output'%} + "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< + + + +
{{node.type}}
{{node.resource_name}}
>]; + {% else %} + "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< + {% if "ibm_cos" in node.type %} + + {% elif "ibm_kp" in node.type %} + + {% elif "ibm_container" in node.type %} + + {% elif "ibm_is" in node.type %} + + {% else %} + + + {% endif %} + + + {% if node.policy == "no policy available" %} + + {% elif node.policy.decision == "pass" %} + + {% elif node.policy.decision == "failed" %} + + {% endif %} + {% if node.cost == "no cost available" %} + + {% else %} + + {% endif %} + {% if node.time == "no time estimation available" %} + + {% else %} + + {% endif %} + {% if node.apply == "not yet applied" %} + + {% elif not node.apply %} + + {% elif node.apply %} + {% if node.apply.instances[0] == null %} + + {% else %} + + {% endif %} + {% endif %} +
{{ "%-20s"|format(node.type) }}
{{ "%-20s"|format(node.type) }}
{{ "%-20s"|format(node.type) }}
{{ "%-20s"|format(node.type) }}
{{ "%-20s"|format(node.type) }}
{{ "%-20s"|format(node.resource_name) }}
{{ "%-30s"|format(">_terraform plan") }}
{{ "%-30s"|format(">_controls verify") }}
{{ "%-30s"|format(">_controls verify") }}
{{ "%-30s"|format(">_controls verify") }}
{{ "%-30s"|format(">_estimate cost") }}{{ "%-10s"|format("N/A") }}
{{ "%-30s"|format(">_estimate cost") }}{{ "%-10s"|format(node.cost.currlineitemtotal) }}
{{ "%-30s"|format(">_estimate time") }}
{{ "%-30s"|format(">_estimate time") }}{{ "%-10s"|format(node.time.TimeEstimation) }}
{{ "%-30s"|format(">_terraform apply") }}
{{ "%-30s"|format(">_terraform apply") }}
{{ "%-30s"|format(">_terraform apply") }}
{{ "%-30s"|format(">_terraform apply") }}
>]; + {% endif %} + {% else %} + {% if totalcost != "" or totaltime != "" %} + "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< + + {% if totalcost != "" %} + + {% endif %} + {% if totaltime != "" %} + + {% endif %} +
{{node.label}}
{{totalcost}}
{{totaltime}}
>]; + {% else %} + "{{node.label}}" [{{node.fmt}}] + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + } + {% endfor %} + + {# non-root modules #} + {% for node in nodes %} + {% if node.module != 'root' %} + + {% if node.collapsed %} + "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< + {% for module in node.modules %}{% endfor %} + + +
(M) {{module}}
(collapsed)
...
>]; + {% else %} + "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< + {% for module in node.modules %}{% endfor %} + + +
(M) {{module}}
{{node.type}}
{{node.resource_name}}
>]; + {% endif %} + {% endif %} + + {% endfor %} + + {% for edge in edges %} + {% if edge.edge_type == EdgeType.NORMAL %}"{{edge.source}}" -> "{{edge.target}}" {% if edge.fmt %} [{{edge.fmt}}] {% endif %}{% endif %} + {% if edge.edge_type == EdgeType.LAYOUT_SHOWN %}"{{edge.source}}" -> "{{edge.target}}" {% if edge.fmt %} [{{edge.fmt}}] {% endif %}{% endif %} + {% if edge.edge_type == EdgeType.LAYOUT_HIDDEN %}"{{edge.source}}" -> "{{edge.target}}" [style="invis"]{% endif %} + {% endfor %} +} +""" + dot_template_str = """ -digraph { + digraph { compound = "true" graph [fontname = "courier new",fontsize=8]; node [fontname = "courier new",fontsize=8]; edge [fontname = "courier new",fontsize=8]; - + {# just the root module #} {% for cluster in clusters %} subgraph "{{cluster}}" { @@ -327,7 +563,9 @@ def focus(self, node): "{{node.label}}" [ shape=none, margin=0, id={{node.svg_id}} label=< +
{{node.type}}
{{node.resource_name}}
>]; + {% else %} "{{node.label}}" [{{node.fmt}}] {% endif %} @@ -365,6 +603,7 @@ def focus(self, node): } """ dot_template = jinja2.Environment(loader=jinja2.BaseLoader()).from_string(dot_template_str) + dot_template_ext = jinja2.Environment(loader=jinja2.BaseLoader()).from_string(dot_template_str_ext) class Format: @@ -402,7 +641,7 @@ def __str__(self): class DotNode(Node): - def __init__(self, label, fmt=None): + def __init__(self, label, plan_data,apply_data,cost_data,policy_data,time_data,fmt=None): self.label = DotNode._label_fixup(label) self.fmt = fmt if fmt else Format('') # graphviz formatting. @@ -415,14 +654,17 @@ def __init__(self, label, fmt=None): self.module = DotNode._module(self.label) # for module groupings. 'root' or 'module.foo.module.bar' self.cluster = None # for stacked resources (usually var/output). self.collapsed = False - + self.plan = plan_data + self.apply = apply_data + self.cost = cost_data + self.policy = policy_data + self.time = time_data self.fmt.add(id=self.svg_id, shape='box') - - + self.modules = [ m for m in self.module.split('.') if m != 'module' ] def __iter__(self): - for key in {'label', 'simple_name', 'type', 'resource_name', 'group', 'svg_id', 'definition', 'cluster', 'module', 'modules'}: + for key in {'label', 'simple_name', 'type', 'resource_name', 'group', 'svg_id', 'definition', 'cluster', 'module', 'modules', 'plan', 'apply','cost','policy','time'}: yield (key, getattr(self, key)) # @@ -520,6 +762,4 @@ def __init__(self, source, target, fmt=None, edge_type=EdgeType.NORMAL): def __iter__(self): for key in {'source', 'target', 'svg_id', 'edge_type'}: - yield (key, getattr(self, key)) - - + yield (key, getattr(self, key)) \ No newline at end of file diff --git a/blastradius/handlers/plan.py b/blastradius/handlers/plan.py index 15c0651..1637e92 100644 --- a/blastradius/handlers/plan.py +++ b/blastradius/handlers/plan.py @@ -1,54 +1,24 @@ -# standard libraries -import re +from __future__ import print_function +import json +import sys +import graphviz +import jinja2 import json -# 1st party libraries -from blastradius.graph import Graph, Node, Edge -from blastradius.handlers.dot import DotNode - -class Plan(Graph): - def __init__(self, filename): - self.filename = filename - self.contents = '' - self.nodes = [] # we can populate this, - self.edges = [] # but not this! - - ansi_escape = re.compile(r'\x1b[^m]*m') - with open(filename, 'r') as f: - self.contents = ansi_escape.sub('', f.read()) - - node_re = re.compile(r'\s+(?P(\+|\-))\s+(?P\S+)') - attr_re = re.compile(r'\s+(?P\S+)\:\s+(?P.*)') - - action = None - name = None - definition = {} - for line in self.contents.splitlines(): - for p in [ node_re, attr_re ]: - m = p.match(line) - if m: - d = m.groupdict() - if 'action' in d: - if action: - self.nodes.append(PlanNode(action, name, definition)) - action = d['action'] - name = d['name'] - definition = {} - elif 'key' in d: - definition[d['key']] = d['value'] - break - - print(json.dumps([ dict(n) for n in self.nodes], indent=4)) - -class PlanNode(Node): - def __init__(self, action, name, definition): - self.action = action - self.simple_name = name - self.definition = definition - self.type = DotNode._resource_type(self.simple_name) - self.resource_name = DotNode._resource_name(self.simple_name) - self.svg_id = 'node_' + str(Node.svg_id_counter()) - - def __iter__(self): - for key in ['action', 'simple_name', 'definition', 'type', 'resource_name', 'svg_id']: - yield (key, getattr(self, key)) +class Plan(): + def __init__(self,filename=None): + self.resource_info = [] + #create json reading from tfplan.json file + with open("tfplan.json", 'r') as f: + data = json.load(f) + for index, var in enumerate(data["planned_values"]["root_module"]["resources"]): + temp_data = dict() + temp_data = var + for attribute, variable in enumerate(data["resource_changes"]): + if temp_data["address"] == variable["address"]: + temp_data["change"] = variable["change"] + self.resource_info.append(temp_data) + + def json(self): + my_json_string = json.dumps(self.resource_info,indent=4, sort_keys=True) + return my_json_string \ No newline at end of file diff --git a/blastradius/handlers/policy.py b/blastradius/handlers/policy.py new file mode 100644 index 0000000..8181f12 --- /dev/null +++ b/blastradius/handlers/policy.py @@ -0,0 +1,31 @@ +import json +import os.path +from os import path + +class Policy(): + def __init__(self,filename=None): + self.resource_policy_info = [] + if filename == None: + if(path.exists("policy.json")): + with open("policy.json", 'r') as f: + data = json.load(f) + else: + data = "" + else: + with open(filename, 'r') as f: + data = json.load(f) + + if (data) : + for index, var in enumerate(data["resources"]): + temp_data = dict() + temp_data = var + self.resource_policy_info.append(temp_data) + + else: + self.resource_policy_info.append("not available") + + + def json(self): + my_policy_json = json.dumps(self.resource_policy_info,indent=4, sort_keys=True) + return my_policy_json + \ No newline at end of file diff --git a/blastradius/handlers/terraform.py b/blastradius/handlers/terraform.py index 00b41d9..5073cab 100644 --- a/blastradius/handlers/terraform.py +++ b/blastradius/handlers/terraform.py @@ -5,7 +5,7 @@ import re # 3rd party libraries -import hcl # hashicorp configuration language (.tf) +import hcl2 as hcl # hashicorp configuration language (.tf) class Terraform: """Finds terraform/hcl files (*.tf) in CWD or a supplied directory, parses @@ -22,6 +22,7 @@ def __init__(self, directory=None, settings=None): for fname in iterator: with open(fname, 'r', encoding='utf-8') as f: self.config_str += f.read() + ' ' + config_io = io.StringIO(self.config_str) self.config = hcl.load(config_io) @@ -80,19 +81,42 @@ def get_def(self, node, module_depth=0): try: # non resource types - types = { 'var' : lambda x: self.config['variable'][x.resource_name], - 'provider' : lambda x: self.config['provider'][x.resource_name], - 'output' : lambda x: self.config['output'][x.resource_name], - 'data' : lambda x: self.config['data'][x.resource_name], - 'meta' : lambda x: '', - 'provisioner' : lambda x: '', - '' : lambda x: '' } - if node.type in types: - return types[node.type](node) + # types = { 'var' : lambda x: self.config['variable'][x.resource_name], + # 'provider' : lambda x: self.config['provider'][x.resource_name], + # 'output' : lambda x: self.config['output'][x.resource_name], + # 'data' : lambda x: self.config['data'][x.resource_name], + # 'meta' : lambda x: '', + # 'provisioner' : lambda x: '', + # '' : lambda x: '' } + # types = {'output','data','provider'} + +#for simple graphs we do not need these information in json + + # if node.type in types: + # for n in self.config[node.type]: + # if node.resource_name in n: + # return n[node.resource_name] + + # return '' + + # if node.type == 'var': + # for n in self.config['variable']: + # if node.resource_name in n: + # return n[node.resource_name] + + # return '' # resources are a little different _many_ possible types, # nested within the 'resource' field. - else: - return self.config['resource'][node.type][node.resource_name] - except: + # else: + + for n in self.config['resource']: + if node.type in n: + if node.resource_name in n[node.type]: + return n[node.type][node.resource_name] + return '' + + # return self.config['resource'][0][node.type][node.resource_name] + except: + return '' \ No newline at end of file diff --git a/blastradius/handlers/time.py b/blastradius/handlers/time.py new file mode 100644 index 0000000..9cf081c --- /dev/null +++ b/blastradius/handlers/time.py @@ -0,0 +1,34 @@ +from __future__ import print_function + +from os import path +import json + + +class Time(): + def __init__(self,filename=None): + self.resource_time_info = [] + if filename == None: + if(path.exists("time.json")): + with open("time.json", 'r') as f: + data = json.load(f) + else: + data = "" + else: + with open(filename, 'r') as f: + data = json.load(f) + + if (data) : + temp_data = dict() + for (index, var) in data.items(): + temp_data[index] = var + + self.resource_time_info.append(data) + + else: + self.resource_time_info.append("not available") + + + def json(self): + my_time_json = json.dumps(self.resource_time_info,indent=4, sort_keys=True) + return my_time_json + \ No newline at end of file diff --git a/blastradius/server/server.py b/blastradius/server/server.py index aae9278..1b09d30 100644 --- a/blastradius/server/server.py +++ b/blastradius/server/server.py @@ -3,11 +3,13 @@ import subprocess import itertools import json +import re # 3rd-party libraries from flask import Flask from flask import render_template from flask import request + import jinja2 # 1st-party libraries @@ -18,6 +20,9 @@ app = Flask(__name__) + + + @app.route('/') def index(): # we need terraform, graphviz, and an init-ed terraform project. @@ -33,7 +38,25 @@ def index(): @app.route('/graph.svg') def graph_svg(): Graph.reset_counters() - dot = DotGraph('', file_contents=run_tf_graph()) + dot = DotGraph('','', file_contents=run_tf_graph()) + + module_depth = request.args.get('module_depth', default=None, type=int) + refocus = request.args.get('refocus', default=None, type=str) + + if module_depth is not None and module_depth >= 0: + dot.set_module_depth(module_depth) + + if refocus is not None: + node = dot.get_node_by_name(refocus) + if node: + dot.center(node) + + return dot.svg() + +@app.route('/graphsimple.svg') +def graphsimple_svg(): + Graph.reset_counters() + dot = DotGraph('ext','',file_contents=simple_graph()) module_depth = request.args.get('module_depth', default=None, type=int) refocus = request.args.get('refocus', default=None, type=str) @@ -49,10 +72,30 @@ def graph_svg(): return dot.svg() +def simple_graph(): + file_contents=run_tf_graph() + new_file_content = '' + for line in file_contents.splitlines(): + if re.search("var",line) or re.search("provider",line) or re.search("meta.count-boundary",line) or re.search("output",line) : + if re.search("meta.count-boundary",line) and not (re.search("output",line) or re.search("var",line) or re.search('\[root\] root',line)): + new_line = line.replace("meta.count-boundary (EachMode fixup)","root") + new_file_content+=new_line +'\n' + if re.search("provider.template",line): + x = line.split('->') + if x[0].find("[root] provider.template (close)") != -1 : + new_line = line.replace("[root] provider.template (close)","[root] root") + new_file_content+=new_line +'\n' + else: + new_file_content+=line +'\n' + + return new_file_content + + @app.route('/graph.json') def graph_json(): Graph.reset_counters() - dot = DotGraph('', file_contents=run_tf_graph()) + # dot = DotGraph('','',file_contents=run_tf_graph()) we will create jsn with extended svg info + dot = DotGraph('','',file_contents=simple_graph()) module_depth = request.args.get('module_depth', default=None, type=int) refocus = request.args.get('refocus', default=None, type=str) if module_depth is not None and module_depth >= 0: @@ -69,6 +112,8 @@ def graph_json(): return dot.json() + + def run_tf_graph(): completed = subprocess.run(['terraform', 'graph'], stdout=subprocess.PIPE) if completed.returncode != 0: @@ -87,9 +132,4 @@ def get_terraform_version(): return completed.stdout.decode('utf-8').splitlines()[0].split(' ')[-1] def get_terraform_exe(): - return which('terraform') - - - - - + return which('terraform') \ No newline at end of file diff --git a/blastradius/server/static/css/style.css b/blastradius/server/static/css/style.css index 63d8f56..fdfb5ad 100644 --- a/blastradius/server/static/css/style.css +++ b/blastradius/server/static/css/style.css @@ -3,12 +3,14 @@ h1, h2, h3, h4, p { } p.explain { - font-family: monospace; + font-family: Arial; + font-weight:400; white-space: pre; } h3.explain { - font-family: monospace; + font-family: Arial; + font-weight:400; } path.link { @@ -24,7 +26,7 @@ circle { text { fill: #000; - font: 10px sans-serif; + font: 40px sans-serif; pointer-events: none; } @@ -48,19 +50,20 @@ div.graph svg { } .diagmenu .dropdown-item { - font-family: 'courier new'; + font-family: 'Arial'; /*font-size: 14px;*/ } .dropdown-menu div label { - font-family: 'courier new'; + font-family: 'Arial'; + font-weight: bold; } /* tooltip stuff */ .d3-tip { line-height: 1.4; - font-weight: normal; - font-family: 'courier new', 'monaco', fixed-width; + font-weight: bold; + font-family: 'Arial', 'sans-serif', fixed-width; font-size: 14px; padding: 6px; background: rgba(0, 0, 0, 0.8); @@ -72,9 +75,9 @@ div.graph svg { } .d3-tip p { - font-weight: normal; + font-weight: bold; line-height: 1.2; - font-family: 'courier new', 'monaco', fixed-width; + font-family: 'Arial', 'sans-serif', fixed-width; font-size: 11px; } @@ -94,7 +97,8 @@ span.title { span.sbox-listing { display: inline-block; font-size: 12px; - font-family: "Courier New"; + font-family: "Arial"; + font-weight: 900; line-height: 18px; color: black; margin: 1px; @@ -104,6 +108,7 @@ span.sbox-listing { span.dep { line-height: 15px; font-size: 12px; + font-weight: 900; color: white; display: inline-block; margin: 1px; @@ -132,6 +137,82 @@ span.dep { } g.node text { - font-family: 'consolas', 'monaco', 'fixed-width'; + font-family: 'Arial', 'sans-serif', 'fixed-width'; font-size: 8px; + font-weight: 900; +} + +.navbar-nav>li { + padding-left: 6px; +} + +.navbar-brand { + font-family: 'Arial'; + font-weight: 900; +} + +body { + font-family: "Arial", sans-serif; } +.sidenav { +height: 100%; +width: 0; +position: fixed; +z-index: 1; +top: 0; +right: 0; +background-color: #D3D3D3; + +transition: 0.5s; +padding-top: 60px; +color: #000; +overflow: auto; +} + +.sidenav a { +padding: 8px 8px 8px 32px; +text-decoration: none; +font-size: 25px; +color: #818181; +display: block; +transition: 0.3s; + +} + +.sidenav a:hover { +color: #f1f1f1; +} + +.square { +height: 10px; +width: 10px; + +} + +.sidenav .closebtn { + +position: absolute; +top: 60; +right: 20px; +font-size: 16px; +margin-right: 0px; +color: grey; +} + + +table, td { +/* /* position: absolute; */ +margin-top: 60; +margin-left: 20; +border: 1px solid black; +} + + +@media screen and (max-height: 450px) { +.sidenav {padding-top: 15px;} +.sidenav a {font-size: 18px;} +} + + + + diff --git a/blastradius/server/static/example/demo-1/demo-1.json b/blastradius/server/static/example/demo-1/demo-1.json index acba36f..607e81a 100644 --- a/blastradius/server/static/example/demo-1/demo-1.json +++ b/blastradius/server/static/example/demo-1/demo-1.json @@ -1,193 +1,2450 @@ { + "edges": [ + { + "edge_type": 1, + "source": "[root] data.template_cloudinit_config.cloud-init-apptier", + "svg_id": "edge_0", + "target": "[root] provider.template" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_floating_ip.floatingip1", + "svg_id": "edge_1", + "target": "[root] ibm_is_instance.instance1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_floating_ip.floatingip2", + "svg_id": "edge_2", + "target": "[root] ibm_is_instance.instance2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance1", + "svg_id": "edge_3", + "target": "[root] data.template_cloudinit_config.cloud-init-apptier" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance1", + "svg_id": "edge_4", + "target": "[root] ibm_is_ssh_key.ssh1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance1", + "svg_id": "edge_5", + "target": "[root] ibm_is_subnet.subnet1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance1", + "svg_id": "edge_6", + "target": "[root] var.image" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance1", + "svg_id": "edge_7", + "target": "[root] var.profile" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance2", + "svg_id": "edge_8", + "target": "[root] data.template_cloudinit_config.cloud-init-apptier" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance2", + "svg_id": "edge_9", + "target": "[root] ibm_is_ssh_key.ssh1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance2", + "svg_id": "edge_10", + "target": "[root] ibm_is_subnet.subnet2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance2", + "svg_id": "edge_11", + "target": "[root] var.image" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_instance.instance2", + "svg_id": "edge_12", + "target": "[root] var.profile" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb.lb1", + "svg_id": "edge_13", + "target": "[root] ibm_is_subnet.subnet1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb.lb1", + "svg_id": "edge_14", + "target": "[root] ibm_is_subnet.subnet2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_listener.lb1-listener", + "svg_id": "edge_15", + "target": "[root] ibm_is_lb_pool.lb1-pool" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_pool.lb1-pool", + "svg_id": "edge_16", + "target": "[root] ibm_is_lb.lb1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_pool_member.lb1-pool-member1", + "svg_id": "edge_17", + "target": "[root] ibm_is_instance.instance1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_pool_member.lb1-pool-member1", + "svg_id": "edge_18", + "target": "[root] ibm_is_lb_pool.lb1-pool" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_pool_member.lb1-pool-member2", + "svg_id": "edge_19", + "target": "[root] ibm_is_instance.instance2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_lb_pool_member.lb1-pool-member2", + "svg_id": "edge_20", + "target": "[root] ibm_is_lb_pool.lb1-pool" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_security_group_rule.sg1_tcp_rule_22", + "svg_id": "edge_21", + "target": "[root] ibm_is_floating_ip.floatingip1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_security_group_rule.sg1_tcp_rule_22", + "svg_id": "edge_22", + "target": "[root] ibm_is_floating_ip.floatingip2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_security_group_rule.sg1_tcp_rule_80", + "svg_id": "edge_23", + "target": "[root] ibm_is_floating_ip.floatingip1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_security_group_rule.sg1_tcp_rule_80", + "svg_id": "edge_24", + "target": "[root] ibm_is_floating_ip.floatingip2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_ssh_key.ssh1", + "svg_id": "edge_25", + "target": "[root] provider.ibm" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_ssh_key.ssh1", + "svg_id": "edge_26", + "target": "[root] var.ssh_public_key" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_subnet.subnet1", + "svg_id": "edge_27", + "target": "[root] ibm_is_vpc_address_prefix.vpc-ap1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_subnet.subnet2", + "svg_id": "edge_28", + "target": "[root] ibm_is_vpc_address_prefix.vpc-ap2" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc.vpc1", + "svg_id": "edge_29", + "target": "[root] provider.ibm" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc.vpc1", + "svg_id": "edge_30", + "target": "[root] var.vpc_name" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap1", + "svg_id": "edge_31", + "target": "[root] ibm_is_vpc.vpc1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap1", + "svg_id": "edge_32", + "target": "[root] var.zone1" + }, + { + "edge_type": 2, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap1", + "svg_id": "edge_33", + "target": "[root] var.zone1_cidr" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap2", + "svg_id": "edge_34", + "target": "[root] ibm_is_vpc.vpc1" + }, + { + "edge_type": 1, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap2", + "svg_id": "edge_35", + "target": "[root] var.zone2" + }, + { + "edge_type": 2, + "source": "[root] ibm_is_vpc_address_prefix.vpc-ap2", + "svg_id": "edge_36", + "target": "[root] var.zone2_cidr" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_37", + "target": "[root] ibm_is_lb_listener.lb1-listener" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_38", + "target": "[root] ibm_is_lb_pool_member.lb1-pool-member1" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_39", + "target": "[root] ibm_is_lb_pool_member.lb1-pool-member2" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_40", + "target": "[root] ibm_is_security_group_rule.sg1_tcp_rule_22" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_41", + "target": "[root] ibm_is_security_group_rule.sg1_tcp_rule_80" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_42", + "target": "[root] output.FloatingIP-1" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_43", + "target": "[root] output.FloatingIP-2" + }, + { + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_44", + "target": "[root] output.LB-Hostname" + }, + { + "edge_type": 1, + "source": "[root] output.FloatingIP-1", + "svg_id": "edge_45", + "target": "[root] ibm_is_floating_ip.floatingip1" + }, + { + "edge_type": 1, + "source": "[root] output.FloatingIP-2", + "svg_id": "edge_46", + "target": "[root] ibm_is_floating_ip.floatingip2" + }, + { + "edge_type": 1, + "source": "[root] output.LB-Hostname", + "svg_id": "edge_47", + "target": "[root] ibm_is_lb.lb1" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_48", + "target": "[root] ibm_is_lb_listener.lb1-listener" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_49", + "target": "[root] ibm_is_lb_pool_member.lb1-pool-member1" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_50", + "target": "[root] ibm_is_lb_pool_member.lb1-pool-member2" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_51", + "target": "[root] ibm_is_security_group_rule.sg1_tcp_rule_22" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_52", + "target": "[root] ibm_is_security_group_rule.sg1_tcp_rule_80" + }, + { + "edge_type": 1, + "source": "[root] provider.ibm", + "svg_id": "edge_53", + "target": "[root] var.ibmcloud_region" + }, + { + "edge_type": 1, + "source": "[root] provider.template (close)", + "svg_id": "edge_54", + "target": "[root] data.template_cloudinit_config.cloud-init-apptier" + }, + { + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_55", + "target": "[root] meta.count-boundary (EachMode fixup)" + }, + { + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_56", + "target": "[root] provider.ibm (close)" + }, + { + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_57", + "target": "[root] provider.template (close)" + }, + { + "edge_type": 3, + "source": "[root] var.zone1", + "svg_id": "edge_58", + "target": "[root] var.zone1_cidr" + }, + { + "edge_type": 3, + "source": "[root] var.zone2", + "svg_id": "edge_59", + "target": "[root] var.zone2_cidr" + } + ], "nodes": [ { - "simple_name": "aws_iam_role.default", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "base64_encode": false, + "gzip": false, + "id": "708834281", + "part": [ + { + "content": "#cloud-config\npackages:\n - nginx\n\n", + "content_type": "", + "filename": "", + "merge_type": "" + } + ], + "rendered": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n" + }, + "schema_version": 0 + } + ], + "mode": "data", + "name": "cloud-init-apptier", + "provider": "provider.template", + "type": "template_cloudinit_config" + }, + "cluster": "root", + "definition": "", "group": 20000, + "label": "[root] data.template_cloudinit_config.cloud-init-apptier", + "module": "root", + "modules": [ + "root" + ], + "plan": "data-source", + "resource_name": "cloud-init-apptier", + "simple_name": "data.template_cloudinit_config.cloud-init-apptier", "svg_id": "node_0", - "label": "[root] aws_iam_role.default", - "type": "aws_iam_role", - "resource_name": "default", - "def": { - "name": "terraform_lambda_alexa_example", - "assume_role_policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"lambda.amazonaws.com\"\n },\n \"Effect\": \"Allow\",\n \"Sid\": \"\"\n }\n ]\n}" - } + "type": "template_cloudinit_config" }, { - "simple_name": "aws_iam_role_policy.default", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "address": "52.116.132.120", + "id": "r006-9661aedd-3abf-4c59-8071-c3ae62a01df2", + "name": "fip4", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/floatingIPs", + "resource_crn": "crn:v1:bluemix:public:is:us-south-1:a/b9687c7011984685a20a8d25dfbea11b::floating-ip:r006-9661aedd-3abf-4c59-8071-c3ae62a01df2", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "fip4", + "resource_status": "available", + "status": "available", + "target": "0717-63e55a61-dfdc-47f5-ba6e-92f47c63500f", + "timeouts": null, + "zone": "us-south-1" + }, + "dependencies": [ + "ibm_is_instance.instance1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "floatingip1", + "provider": "provider.ibm", + "type": "ibm_is_floating_ip" + }, + "cluster": "root", + "definition": { + "name": "fip4", + "target": "${ibm_is_instance.instance1.primary_network_interface[0].id}" + }, "group": 20000, + "label": "[root] ibm_is_floating_ip.floatingip1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_floating_ip.floatingip1", + "change": { + "actions": [ + "create" + ], + "after": { + "name": "fip1", + "timeouts": null + }, + "after_unknown": { + "address": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "target": true, + "zone": true + }, + "before": null + }, + "mode": "managed", + "name": "floatingip1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_floating_ip", + "values": { + "name": "fip1", + "timeouts": null + } + }, + "resource_name": "floatingip1", + "simple_name": "ibm_is_floating_ip.floatingip1", "svg_id": "node_1", - "label": "[root] aws_iam_role_policy.default", - "type": "aws_iam_role_policy", - "resource_name": "default", - "def": { - "name": "terraform_lambda_alexa_example", - "role": "${aws_iam_role.default.id}", - "policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}" - } + "type": "ibm_is_floating_ip" }, { - "simple_name": "aws_lambda_function.default", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "address": "169.47.92.133", + "id": "r006-f002d39a-5bce-4fb7-9374-d2afced1ce91", + "name": "fip5", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/floatingIPs", + "resource_crn": "crn:v1:bluemix:public:is:us-south-2:a/b9687c7011984685a20a8d25dfbea11b::floating-ip:r006-f002d39a-5bce-4fb7-9374-d2afced1ce91", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "fip5", + "resource_status": "available", + "status": "available", + "target": "0727-064145ac-974e-413e-a024-5148fd5eb4c4", + "timeouts": null, + "zone": "us-south-2" + }, + "dependencies": [ + "ibm_is_instance.instance2" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "floatingip2", + "provider": "provider.ibm", + "type": "ibm_is_floating_ip" + }, + "cluster": "root", + "definition": { + "name": "fip5", + "target": "${ibm_is_instance.instance2.primary_network_interface[0].id}" + }, "group": 20000, + "label": "[root] ibm_is_floating_ip.floatingip2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_floating_ip.floatingip2", + "change": { + "actions": [ + "create" + ], + "after": { + "name": "fip2", + "timeouts": null + }, + "after_unknown": { + "address": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "target": true, + "zone": true + }, + "before": null + }, + "mode": "managed", + "name": "floatingip2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_floating_ip", + "values": { + "name": "fip2", + "timeouts": null + } + }, + "resource_name": "floatingip2", + "simple_name": "ibm_is_floating_ip.floatingip2", "svg_id": "node_2", - "label": "[root] aws_lambda_function.default", - "type": "aws_lambda_function", - "resource_name": "default", - "def": { - "filename": "lambda_function.zip", - "source_code_hash": "${base64sha256(file(\"lambda_function.zip\"))}", - "function_name": "terraform_lambda_alexa_example", - "role": "${aws_iam_role.default.arn}", - "handler": "lambda_function.lambda_handler", - "runtime": "python2.7" - } - }, - { - "simple_name": "aws_lambda_permission.default", - "definition": {}, + "type": "ibm_is_floating_ip" + }, + { + "apply": { + "instances": [ + { + "attributes": { + "boot_volume": [ + { + "encryption": "", + "iops": 3000, + "name": "volume-attachment", + "profile": "general-purpose", + "size": 100 + } + ], + "generation": null, + "gpu": [], + "id": "0717_c94d2de2-9ae0-43ba-854a-50ce878742da", + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "keys": [ + "r006-0ccc8520-d0a8-47ab-9994-6ac4358ec036" + ], + "memory": 4, + "name": "instance4", + "network_interfaces": [], + "primary_network_interface": [ + { + "id": "0717-63e55a61-dfdc-47f5-ba6e-92f47c63500f", + "name": "promotion-proton-semicolon-taking-unworldly-washout", + "port_speed": 0, + "primary_ipv4_address": "172.16.1.5", + "security_groups": [ + "r006-2073a530-8ca1-4735-9b2d-748e9c69078e" + ], + "subnet": "0717-0340cc00-b8e4-41ca-9f81-b903cbf61c50" + } + ], + "profile": "cx2-2x4", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/compute/vs", + "resource_crn": "crn:v1:bluemix:public:is:us-south-1:a/b9687c7011984685a20a8d25dfbea11b::instance:0717_c94d2de2-9ae0-43ba-854a-50ce878742da", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "instance4", + "resource_status": "running", + "status": "running", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "vcpu": [ + { + "architecture": "amd64", + "count": 2 + } + ], + "volume_attachments": [ + { + "id": "0717-8c414447-bdb1-40ec-9d2c-07c3505acc75", + "name": "volume-attachment", + "volume_crn": "crn:v1:bluemix:public:is:us-south-1:a/b9687c7011984685a20a8d25dfbea11b::volume:r006-4966cffa-6483-11ea-97f2-feff0b334b12", + "volume_id": "r006-4966cffa-6483-11ea-97f2-feff0b334b12", + "volume_name": "living-unrated-jawed-crummy-smuggling-mankind" + } + ], + "volumes": [], + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-1" + }, + "dependencies": [ + "ibm_is_ssh_key.ssh1", + "ibm_is_subnet.subnet1", + "ibm_is_vpc.vpc1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDB9fQ==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "instance1", + "provider": "provider.ibm", + "type": "ibm_is_instance" + }, + "cluster": "root", + "definition": { + "image": "${var.image}", + "keys": [ + "${ibm_is_ssh_key.ssh1.id}" + ], + "name": "instance4", + "primary_network_interface": { + "subnet": "${ibm_is_subnet.subnet1.id}" + }, + "profile": "${var.profile}", + "user_data": "${data.template_cloudinit_config.cloud-init-apptier.rendered}", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone1}" + }, "group": 20000, + "label": "[root] ibm_is_instance.instance1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_instance.instance1", + "change": { + "actions": [ + "create" + ], + "after": { + "generation": null, + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "name": "instance1", + "network_interfaces": [], + "primary_network_interface": [ + { + "port_speed": null + } + ], + "profile": "cx2-2x4", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "volumes": null, + "zone": "us-south-1" + }, + "after_unknown": { + "boot_volume": true, + "gpu": true, + "id": true, + "keys": true, + "memory": true, + "network_interfaces": [], + "primary_network_interface": [ + { + "id": true, + "name": true, + "primary_ipv4_address": true, + "security_groups": true, + "subnet": true + } + ], + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "vcpu": true, + "volume_attachments": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "instance1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_instance", + "values": { + "generation": null, + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "name": "instance1", + "network_interfaces": [], + "primary_network_interface": [ + { + "port_speed": null + } + ], + "profile": "cx2-2x4", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "volumes": null, + "zone": "us-south-1" + } + }, + "resource_name": "instance1", + "simple_name": "ibm_is_instance.instance1", "svg_id": "node_3", - "label": "[root] aws_lambda_permission.default", - "type": "aws_lambda_permission", - "resource_name": "default", - "def": { - "statement_id": "AllowExecutionFromAlexa", - "action": "lambda:InvokeFunction", - "function_name": "${aws_lambda_function.default.function_name}", - "principal": "alexa-appkit.amazon.com" - } + "type": "ibm_is_instance" }, { - "simple_name": "provider.aws", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "boot_volume": [ + { + "encryption": "", + "iops": 3000, + "name": "volume-attachment", + "profile": "general-purpose", + "size": 100 + } + ], + "generation": null, + "gpu": [], + "id": "0727_ce10c7f4-6795-4b79-ae26-49b1f8cbd024", + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "keys": [ + "r006-0ccc8520-d0a8-47ab-9994-6ac4358ec036" + ], + "memory": 4, + "name": "instance5", + "network_interfaces": [], + "primary_network_interface": [ + { + "id": "0727-064145ac-974e-413e-a024-5148fd5eb4c4", + "name": "penny-collector-bling-scurvy-ravishing-gradation", + "port_speed": 0, + "primary_ipv4_address": "172.16.2.5", + "security_groups": [ + "r006-2073a530-8ca1-4735-9b2d-748e9c69078e" + ], + "subnet": "0727-7c13f793-df48-4f9f-84dd-8295cc57d611" + } + ], + "profile": "cx2-2x4", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/compute/vs", + "resource_crn": "crn:v1:bluemix:public:is:us-south-2:a/b9687c7011984685a20a8d25dfbea11b::instance:0727_ce10c7f4-6795-4b79-ae26-49b1f8cbd024", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "instance5", + "resource_status": "running", + "status": "running", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "vcpu": [ + { + "architecture": "amd64", + "count": 2 + } + ], + "volume_attachments": [ + { + "id": "0727-3a8e8f62-ba60-4d30-8296-9f921228782f", + "name": "volume-attachment", + "volume_crn": "crn:v1:bluemix:public:is:us-south-2:a/b9687c7011984685a20a8d25dfbea11b::volume:r006-49596fbb-6483-11ea-983f-feff0b0a4b07", + "volume_id": "r006-49596fbb-6483-11ea-983f-feff0b0a4b07", + "volume_name": "humorist-gratify-unfounded-scale-renter-strangely" + } + ], + "volumes": [], + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-2" + }, + "dependencies": [ + "ibm_is_ssh_key.ssh1", + "ibm_is_subnet.subnet2", + "ibm_is_vpc.vpc1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDB9fQ==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "instance2", + "provider": "provider.ibm", + "type": "ibm_is_instance" + }, + "cluster": "root", + "definition": { + "image": "${var.image}", + "keys": [ + "${ibm_is_ssh_key.ssh1.id}" + ], + "name": "instance5", + "primary_network_interface": { + "subnet": "${ibm_is_subnet.subnet2.id}" + }, + "profile": "${var.profile}", + "user_data": "${data.template_cloudinit_config.cloud-init-apptier.rendered}", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone2}" + }, "group": 20000, + "label": "[root] ibm_is_instance.instance2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_instance.instance2", + "change": { + "actions": [ + "create" + ], + "after": { + "generation": null, + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "name": "instance2", + "network_interfaces": [], + "primary_network_interface": [ + { + "port_speed": null + } + ], + "profile": "cx2-2x4", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "volumes": null, + "zone": "us-south-2" + }, + "after_unknown": { + "boot_volume": true, + "gpu": true, + "id": true, + "keys": true, + "memory": true, + "network_interfaces": [], + "primary_network_interface": [ + { + "id": true, + "name": true, + "primary_ipv4_address": true, + "security_groups": true, + "subnet": true + } + ], + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "vcpu": true, + "volume_attachments": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "instance2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_instance", + "values": { + "generation": null, + "image": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "name": "instance2", + "network_interfaces": [], + "primary_network_interface": [ + { + "port_speed": null + } + ], + "profile": "cx2-2x4", + "timeouts": null, + "user_data": "Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version: 1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain\r\nMime-Version: 1.0\r\n\r\n#cloud-config\npackages:\n - nginx\n\n\r\n--MIMEBOUNDARY--\r\n", + "volumes": null, + "zone": "us-south-2" + } + }, + "resource_name": "instance2", + "simple_name": "ibm_is_instance.instance2", "svg_id": "node_4", - "label": "[root] provider.aws", - "type": "provider", - "resource_name": "aws", - "def": [] + "type": "ibm_is_instance" }, { - "simple_name": "meta.count-boundary (count boundary fixup)", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "hostname": "f8983743-us-south.lb.appdomain.cloud", + "id": "r006-f8983743-844a-4619-8789-3ffcbed92897", + "name": "vpc-fs2020-lab3-lb", + "operating_status": "online", + "private_ips": [ + "172.16.1.4", + "172.16.2.4" + ], + "public_ips": [ + "52.116.136.89", + "52.116.200.44" + ], + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/loadBalancers", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "vpc-fs2020-lab3-lb", + "status": "active", + "subnets": [ + "0717-0340cc00-b8e4-41ca-9f81-b903cbf61c50", + "0727-7c13f793-df48-4f9f-84dd-8295cc57d611" + ], + "timeouts": null, + "type": "public" + }, + "dependencies": [ + "ibm_is_subnet.subnet1", + "ibm_is_subnet.subnet2", + "ibm_is_vpc.vpc1", + "ibm_is_vpc_address_prefix.vpc-ap1", + "ibm_is_vpc_address_prefix.vpc-ap2" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDB9fQ==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "lb1", + "provider": "provider.ibm", + "type": "ibm_is_lb" + }, + "cluster": "root", + "definition": { + "name": "${var.vpc_name}-lb", + "subnets": [ + "${ibm_is_subnet.subnet1.id}", + "${ibm_is_subnet.subnet2.id}" + ] + }, "group": 20000, + "label": "[root] ibm_is_lb.lb1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_lb.lb1", + "change": { + "actions": [ + "create" + ], + "after": { + "name": "vpc-fs2020-lab-lb", + "timeouts": null, + "type": "public" + }, + "after_unknown": { + "hostname": true, + "id": true, + "operating_status": true, + "private_ips": true, + "public_ips": true, + "resource_controller_url": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "status": true, + "subnets": true + }, + "before": null + }, + "mode": "managed", + "name": "lb1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_lb", + "values": { + "name": "vpc-fs2020-lab-lb", + "timeouts": null, + "type": "public" + } + }, + "resource_name": "lb1", + "simple_name": "ibm_is_lb.lb1", "svg_id": "node_5", - "label": "[root] meta.count-boundary (count boundary fixup)", - "type": "meta", - "resource_name": "count-boundary", - "def": [] + "type": "ibm_is_lb" }, { - "simple_name": "output.aws_lambda_function_arn", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "certificate_instance": null, + "connection_limit": 0, + "default_pool": "r006-44aee37c-051e-4ca2-9d23-58f7c508c97a", + "id": "r006-f8983743-844a-4619-8789-3ffcbed92897/r006-3e1e986b-b861-4304-8fd0-aa3aef5db707", + "lb": "r006-f8983743-844a-4619-8789-3ffcbed92897", + "port": 80, + "protocol": "http", + "status": "active", + "timeouts": null + }, + "dependencies": [ + "ibm_is_lb.lb1", + "ibm_is_lb_pool.lb1-pool", + "ibm_is_subnet.subnet1", + "ibm_is_subnet.subnet2", + "ibm_is_vpc.vpc1", + "ibm_is_vpc_address_prefix.vpc-ap1", + "ibm_is_vpc_address_prefix.vpc-ap2" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInVwZGF0ZSI6MzYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "lb1-listener", + "provider": "provider.ibm", + "type": "ibm_is_lb_listener" + }, + "cluster": "root", + "definition": { + "default_pool": "${element(split(\"/\", ibm_is_lb_pool.lb1-pool.id), 1)}", + "lb": "${ibm_is_lb.lb1.id}", + "port": "80", + "protocol": "http" + }, "group": 20000, + "label": "[root] ibm_is_lb_listener.lb1-listener", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_lb_listener.lb1-listener", + "change": { + "actions": [ + "create" + ], + "after": { + "certificate_instance": null, + "connection_limit": null, + "port": 80, + "protocol": "http", + "timeouts": null + }, + "after_unknown": { + "default_pool": true, + "id": true, + "lb": true, + "status": true + }, + "before": null + }, + "mode": "managed", + "name": "lb1-listener", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_lb_listener", + "values": { + "certificate_instance": null, + "connection_limit": null, + "port": 80, + "protocol": "http", + "timeouts": null + } + }, + "resource_name": "lb1-listener", + "simple_name": "ibm_is_lb_listener.lb1-listener", "svg_id": "node_6", - "label": "[root] output.aws_lambda_function_arn", - "type": "output", - "resource_name": "aws_lambda_function_arn", - "def": [] + "type": "ibm_is_lb_listener" }, { - "simple_name": "provider.aws (close)", - "definition": {}, + "apply": { + "instances": [ + { + "attributes": { + "algorithm": "round_robin", + "health_delay": 5, + "health_monitor_port": 0, + "health_monitor_url": "/", + "health_retries": 2, + "health_timeout": 2, + "health_type": "http", + "id": "r006-f8983743-844a-4619-8789-3ffcbed92897/r006-44aee37c-051e-4ca2-9d23-58f7c508c97a", + "lb": "r006-f8983743-844a-4619-8789-3ffcbed92897", + "name": "vpc-fs2020-lab3-lb1-pool", + "protocol": "http", + "provisioning_status": "active", + "session_persistence_cookie_name": null, + "session_persistence_type": null, + "timeouts": null + }, + "dependencies": [ + "ibm_is_lb.lb1", + "ibm_is_subnet.subnet1", + "ibm_is_subnet.subnet2", + "ibm_is_vpc.vpc1", + "ibm_is_vpc_address_prefix.vpc-ap1", + "ibm_is_vpc_address_prefix.vpc-ap2" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInVwZGF0ZSI6MzYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "lb1-pool", + "provider": "provider.ibm", + "type": "ibm_is_lb_pool" + }, + "cluster": "root", + "definition": { + "algorithm": "round_robin", + "health_delay": "5", + "health_monitor_url": "/", + "health_retries": "2", + "health_timeout": "2", + "health_type": "http", + "lb": "${ibm_is_lb.lb1.id}", + "name": "${var.vpc_name}-lb1-pool", + "protocol": "http" + }, "group": 20000, + "label": "[root] ibm_is_lb_pool.lb1-pool", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_lb_pool.lb1-pool", + "change": { + "actions": [ + "create" + ], + "after": { + "algorithm": "round_robin", + "health_delay": 5, + "health_monitor_url": "/", + "health_retries": 2, + "health_timeout": 2, + "health_type": "http", + "name": "vpc-fs2020-lab-lb1-pool", + "protocol": "http", + "session_persistence_cookie_name": null, + "session_persistence_type": null, + "timeouts": null + }, + "after_unknown": { + "health_monitor_port": true, + "id": true, + "lb": true, + "provisioning_status": true + }, + "before": null + }, + "mode": "managed", + "name": "lb1-pool", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_lb_pool", + "values": { + "algorithm": "round_robin", + "health_delay": 5, + "health_monitor_url": "/", + "health_retries": 2, + "health_timeout": 2, + "health_type": "http", + "name": "vpc-fs2020-lab-lb1-pool", + "protocol": "http", + "session_persistence_cookie_name": null, + "session_persistence_type": null, + "timeouts": null + } + }, + "resource_name": "lb1-pool", + "simple_name": "ibm_is_lb_pool.lb1-pool", "svg_id": "node_7", - "label": "[root] provider.aws (close)", - "type": "provider", - "resource_name": "aws", - "def": [] + "type": "ibm_is_lb_pool" }, { - "simple_name": "var.aws_region", - "definition": {}, + "apply": { + "each": "list", + "instances": [ + { + "attributes": { + "health": "ok", + "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-f8983743-844a-4619-8789-3ffcbed92897/pools/r006-44aee37c-051e-4ca2-9d23-58f7c508c97a/members/r006-ecfe3a18-4a5f-425f-b4f5-9155a7d0599f", + "id": "r006-f8983743-844a-4619-8789-3ffcbed92897/r006-44aee37c-051e-4ca2-9d23-58f7c508c97a/r006-ecfe3a18-4a5f-425f-b4f5-9155a7d0599f", + "lb": "r006-f8983743-844a-4619-8789-3ffcbed92897", + "pool": "r006-44aee37c-051e-4ca2-9d23-58f7c508c97a", + "port": 80, + "provisioning_status": "active", + "target_address": "172.16.1.5", + "timeouts": null, + "weight": 50 + }, + "dependencies": [ + "ibm_is_instance.instance1", + "ibm_is_lb.lb1", + "ibm_is_lb_pool.lb1-pool" + ], + "index_key": 0, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "lb1-pool-member1", + "provider": "provider.ibm", + "type": "ibm_is_lb_pool_member" + }, + "cluster": "root", + "definition": { + "count": 1, + "lb": "${ibm_is_lb.lb1.id}", + "pool": "${ibm_is_lb_pool.lb1-pool.id}", + "port": "80", + "target_address": "${ibm_is_instance.instance1.primary_network_interface[0].primary_ipv4_address}" + }, "group": 20000, + "label": "[root] ibm_is_lb_pool_member.lb1-pool-member1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_lb_pool_member.lb1-pool-member1[0]", + "change": { + "actions": [ + "create" + ], + "after": { + "port": 80, + "timeouts": null + }, + "after_unknown": { + "health": true, + "href": true, + "id": true, + "lb": true, + "pool": true, + "provisioning_status": true, + "target_address": true, + "weight": true + }, + "before": null + }, + "index": 0, + "mode": "managed", + "name": "lb1-pool-member1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_lb_pool_member", + "values": { + "port": 80, + "timeouts": null + } + }, + "resource_name": "lb1-pool-member1", + "simple_name": "ibm_is_lb_pool_member.lb1-pool-member1", "svg_id": "node_8", - "label": "[root] var.aws_region", - "type": "var", - "resource_name": "aws_region", - "def": { - "description": "The AWS region to create things in.", - "default": "us-east-1" - } + "type": "ibm_is_lb_pool_member" }, { - "simple_name": "root", - "definition": {}, + "apply": { + "each": "list", + "instances": [ + { + "attributes": { + "health": "ok", + "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-f8983743-844a-4619-8789-3ffcbed92897/pools/r006-44aee37c-051e-4ca2-9d23-58f7c508c97a/members/r006-81ceccac-212d-491e-b386-d0ad57f53be7", + "id": "r006-f8983743-844a-4619-8789-3ffcbed92897/r006-44aee37c-051e-4ca2-9d23-58f7c508c97a/r006-81ceccac-212d-491e-b386-d0ad57f53be7", + "lb": "r006-f8983743-844a-4619-8789-3ffcbed92897", + "pool": "r006-44aee37c-051e-4ca2-9d23-58f7c508c97a", + "port": 80, + "provisioning_status": "active", + "target_address": "172.16.2.5", + "timeouts": null, + "weight": 50 + }, + "dependencies": [ + "ibm_is_instance.instance2", + "ibm_is_lb.lb1", + "ibm_is_lb_pool.lb1-pool" + ], + "index_key": 0, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "lb1-pool-member2", + "provider": "provider.ibm", + "type": "ibm_is_lb_pool_member" + }, + "cluster": "root", + "definition": { + "count": 1, + "lb": "${ibm_is_lb.lb1.id}", + "pool": "${ibm_is_lb_pool.lb1-pool.id}", + "port": "80", + "target_address": "${ibm_is_instance.instance2.primary_network_interface[0].primary_ipv4_address}" + }, "group": 20000, + "label": "[root] ibm_is_lb_pool_member.lb1-pool-member2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_lb_pool_member.lb1-pool-member2[0]", + "change": { + "actions": [ + "create" + ], + "after": { + "port": 80, + "timeouts": null + }, + "after_unknown": { + "health": true, + "href": true, + "id": true, + "lb": true, + "pool": true, + "provisioning_status": true, + "target_address": true, + "weight": true + }, + "before": null + }, + "index": 0, + "mode": "managed", + "name": "lb1-pool-member2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_lb_pool_member", + "values": { + "port": 80, + "timeouts": null + } + }, + "resource_name": "lb1-pool-member2", + "simple_name": "ibm_is_lb_pool_member.lb1-pool-member2", "svg_id": "node_9", - "label": "[root] root", - "type": "", - "resource_name": "", - "def": [] - } - ], - "edges": [ + "type": "ibm_is_lb_pool_member" + }, { - "target": "[root] provider.aws", - "svg_id": "edge_0", - "source": "[root] aws_iam_role.default" + "apply": { + "instances": [ + { + "attributes": { + "direction": "inbound", + "group": "r006-2073a530-8ca1-4735-9b2d-748e9c69078e", + "icmp": [], + "id": "r006-2073a530-8ca1-4735-9b2d-748e9c69078e.r006-5f19d9a5-90f5-4cd1-8ccb-464510a2ba90", + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "rule_id": "r006-5f19d9a5-90f5-4cd1-8ccb-464510a2ba90", + "tcp": [ + { + "port_max": 22, + "port_min": 22 + } + ], + "udp": [] + }, + "dependencies": [ + "ibm_is_floating_ip.floatingip1", + "ibm_is_floating_ip.floatingip2", + "ibm_is_instance.instance1", + "ibm_is_instance.instance2", + "ibm_is_vpc.vpc1" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "sg1_tcp_rule_22", + "provider": "provider.ibm", + "type": "ibm_is_security_group_rule" + }, + "cluster": "root", + "definition": { + "depends_on": [ + "${ibm_is_floating_ip.floatingip1}", + "${ibm_is_floating_ip.floatingip2}" + ], + "direction": "inbound", + "group": "${ibm_is_vpc.vpc1.default_security_group}", + "remote": "0.0.0.0/0", + "tcp": { + "port_max": "22", + "port_min": "22" + } + }, + "group": 20000, + "label": "[root] ibm_is_security_group_rule.sg1_tcp_rule_22", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_security_group_rule.sg1_tcp_rule_22", + "change": { + "actions": [ + "create" + ], + "after": { + "direction": "inbound", + "icmp": [], + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "tcp": [ + { + "port_max": 22, + "port_min": 22 + } + ], + "udp": [] + }, + "after_unknown": { + "group": true, + "icmp": [], + "id": true, + "rule_id": true, + "tcp": [ + {} + ], + "udp": [] + }, + "before": null + }, + "mode": "managed", + "name": "sg1_tcp_rule_22", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_security_group_rule", + "values": { + "direction": "inbound", + "icmp": [], + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "tcp": [ + { + "port_max": 22, + "port_min": 22 + } + ], + "udp": [] + } + }, + "resource_name": "sg1_tcp_rule_22", + "simple_name": "ibm_is_security_group_rule.sg1_tcp_rule_22", + "svg_id": "node_10", + "type": "ibm_is_security_group_rule" }, { - "target": "[root] aws_iam_role.default", - "svg_id": "edge_1", - "source": "[root] aws_iam_role_policy.default" + "apply": { + "instances": [ + { + "attributes": { + "direction": "inbound", + "group": "r006-2073a530-8ca1-4735-9b2d-748e9c69078e", + "icmp": [], + "id": "r006-2073a530-8ca1-4735-9b2d-748e9c69078e.r006-4d6c73cf-6ce5-4306-9e0c-6c79efd70c3e", + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "rule_id": "r006-4d6c73cf-6ce5-4306-9e0c-6c79efd70c3e", + "tcp": [ + { + "port_max": 80, + "port_min": 80 + } + ], + "udp": [] + }, + "dependencies": [ + "ibm_is_floating_ip.floatingip1", + "ibm_is_floating_ip.floatingip2", + "ibm_is_instance.instance1", + "ibm_is_instance.instance2", + "ibm_is_vpc.vpc1" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "sg1_tcp_rule_80", + "provider": "provider.ibm", + "type": "ibm_is_security_group_rule" + }, + "cluster": "root", + "definition": { + "depends_on": [ + "${ibm_is_floating_ip.floatingip1}", + "${ibm_is_floating_ip.floatingip2}" + ], + "direction": "inbound", + "group": "${ibm_is_vpc.vpc1.default_security_group}", + "remote": "0.0.0.0/0", + "tcp": { + "port_max": "80", + "port_min": "80" + } + }, + "group": 20000, + "label": "[root] ibm_is_security_group_rule.sg1_tcp_rule_80", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_security_group_rule.sg1_tcp_rule_80", + "change": { + "actions": [ + "create" + ], + "after": { + "direction": "inbound", + "icmp": [], + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "tcp": [ + { + "port_max": 80, + "port_min": 80 + } + ], + "udp": [] + }, + "after_unknown": { + "group": true, + "icmp": [], + "id": true, + "rule_id": true, + "tcp": [ + {} + ], + "udp": [] + }, + "before": null + }, + "mode": "managed", + "name": "sg1_tcp_rule_80", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_security_group_rule", + "values": { + "direction": "inbound", + "icmp": [], + "ip_version": "ipv4", + "remote": "0.0.0.0/0", + "tcp": [ + { + "port_max": 80, + "port_min": 80 + } + ], + "udp": [] + } + }, + "resource_name": "sg1_tcp_rule_80", + "simple_name": "ibm_is_security_group_rule.sg1_tcp_rule_80", + "svg_id": "node_11", + "type": "ibm_is_security_group_rule" }, { - "target": "[root] aws_iam_role.default", - "svg_id": "edge_2", - "source": "[root] aws_lambda_function.default" + "apply": { + "instances": [ + { + "attributes": { + "fingerprint": "SHA256:MF2gq98pgmaJ2JEGJu9KjQkNO0DkR/Dv2N73SenxhTA", + "id": "r006-0ccc8520-d0a8-47ab-9994-6ac4358ec036", + "length": 4096, + "name": "ssh10", + "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgDGui3AghFSuOm0BKr70Hljv5OFIg8GLFiCBUuKR+SVcB4E51Z1KGXxsaijX3+pfKJHKZvd1mr3XAUQNutguZT1PpA7gksiIZfZNonAM7QDoq/BMq7AsSkxL/+4Ea3HOwJMFm2jSFzwwNCogvv4xK4+KKeuw3AI6lCDSetzs5maqwzqVDKGMfzwDyNcJaH20Nr4Twoy85MdrddlJi3eLq2xWytw+EdJvUXUXrsnrdORiK9kKx8D1Wn5TjTw3W90CM0gk1skNnT9D1Rpo8Lq2IXBDw6SCoSU+YTpQZERRNSB35BMDrRqPNC3cDwnL0clp64KJDmjQYsBreD4H5VdRXcHOagh2uZ6MbUz5p5tvvZpVLldt6pTmbZ8jk6Vo1WMnp65NQrUZsRoh9JxzpXldaJgb8ieCoj9x78jMEMd3EgtkAowE8MALVOl7y/4WMvwMmMt+4uVw1TJjozI38qtLBxUWdzjOF2KoT/uXPP7bRvMBsHHoVlUMRWAV7KKwPJrk= nishubharti@Nishus-MacBook-Pro.local", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/compute/sshKeys", + "resource_crn": "crn:v1:bluemix:public:is:us-south:a/b9687c7011984685a20a8d25dfbea11b::key:r006-0ccc8520-d0a8-47ab-9994-6ac4358ec036", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "ssh10", + "type": "rsa" + }, + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "ssh1", + "provider": "provider.ibm", + "type": "ibm_is_ssh_key" + }, + "cluster": "root", + "definition": { + "name": "ssh10", + "public_key": "${var.ssh_public_key}" + }, + "group": 20000, + "label": "[root] ibm_is_ssh_key.ssh1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_ssh_key.ssh1", + "change": { + "actions": [ + "create" + ], + "after": { + "name": "ssh1", + "public_key": "" + }, + "after_unknown": { + "fingerprint": true, + "id": true, + "length": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "type": true + }, + "before": null + }, + "mode": "managed", + "name": "ssh1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_ssh_key", + "values": { + "name": "ssh1", + "public_key": "" + } + }, + "resource_name": "ssh1", + "simple_name": "ibm_is_ssh_key.ssh1", + "svg_id": "node_12", + "type": "ibm_is_ssh_key" }, { - "target": "[root] aws_lambda_function.default", - "svg_id": "edge_3", - "source": "[root] aws_lambda_permission.default" + "apply": { + "instances": [ + { + "attributes": { + "available_ipv4_address_count": null, + "id": "0717-0340cc00-b8e4-41ca-9f81-b903cbf61c50", + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.1.0/24", + "ipv6_cidr_block": "", + "name": "subnet1", + "network_acl": "r006-1c7e8df6-f7dc-4d71-bbdc-3f1e56216dfe", + "public_gateway": "", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/subnets", + "resource_crn": "crn:v1:bluemix:public:is:us-south-1:a/b9687c7011984685a20a8d25dfbea11b::subnet:0717-0340cc00-b8e4-41ca-9f81-b903cbf61c50", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "subnet1", + "resource_status": "available", + "status": "available", + "timeouts": null, + "total_ipv4_address_count": 256, + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-1" + }, + "dependencies": [ + "ibm_is_vpc.vpc1", + "ibm_is_vpc_address_prefix.vpc-ap1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "subnet1", + "provider": "provider.ibm", + "type": "ibm_is_subnet" + }, + "cluster": "root", + "definition": { + "depends_on": [ + "${ibm_is_vpc_address_prefix.vpc-ap1}" + ], + "ipv4_cidr_block": "${var.zone1_cidr}", + "name": "subnet1", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone1}" + }, + "group": 20000, + "label": "[root] ibm_is_subnet.subnet1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_subnet.subnet1", + "change": { + "actions": [ + "create" + ], + "after": { + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.1.0/24", + "name": "subnet1", + "public_gateway": null, + "timeouts": null, + "zone": "us-south-1" + }, + "after_unknown": { + "available_ipv4_address_count": true, + "id": true, + "ipv6_cidr_block": true, + "network_acl": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "total_ipv4_address_count": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "subnet1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_subnet", + "values": { + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.1.0/24", + "name": "subnet1", + "public_gateway": null, + "timeouts": null, + "zone": "us-south-1" + } + }, + "resource_name": "subnet1", + "simple_name": "ibm_is_subnet.subnet1", + "svg_id": "node_13", + "type": "ibm_is_subnet" }, { - "target": "[root] aws_iam_role_policy.default", - "svg_id": "edge_4", - "source": "[root] meta.count-boundary (count boundary fixup)" + "apply": { + "instances": [ + { + "attributes": { + "available_ipv4_address_count": null, + "id": "0727-7c13f793-df48-4f9f-84dd-8295cc57d611", + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.2.0/24", + "ipv6_cidr_block": "", + "name": "subnet2", + "network_acl": "r006-1c7e8df6-f7dc-4d71-bbdc-3f1e56216dfe", + "public_gateway": "", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/subnets", + "resource_crn": "crn:v1:bluemix:public:is:us-south-2:a/b9687c7011984685a20a8d25dfbea11b::subnet:0727-7c13f793-df48-4f9f-84dd-8295cc57d611", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "subnet2", + "resource_status": "available", + "status": "available", + "timeouts": null, + "total_ipv4_address_count": 256, + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-2" + }, + "dependencies": [ + "ibm_is_vpc.vpc1", + "ibm_is_vpc_address_prefix.vpc-ap2" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "subnet2", + "provider": "provider.ibm", + "type": "ibm_is_subnet" + }, + "cluster": "root", + "definition": { + "depends_on": [ + "${ibm_is_vpc_address_prefix.vpc-ap2}" + ], + "ipv4_cidr_block": "${var.zone2_cidr}", + "name": "subnet2", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone2}" + }, + "group": 20000, + "label": "[root] ibm_is_subnet.subnet2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_subnet.subnet2", + "change": { + "actions": [ + "create" + ], + "after": { + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.2.0/24", + "name": "subnet2", + "public_gateway": null, + "timeouts": null, + "zone": "us-south-2" + }, + "after_unknown": { + "available_ipv4_address_count": true, + "id": true, + "ipv6_cidr_block": true, + "network_acl": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "total_ipv4_address_count": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "subnet2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_subnet", + "values": { + "ip_version": "ipv4", + "ipv4_cidr_block": "172.16.2.0/24", + "name": "subnet2", + "public_gateway": null, + "timeouts": null, + "zone": "us-south-2" + } + }, + "resource_name": "subnet2", + "simple_name": "ibm_is_subnet.subnet2", + "svg_id": "node_14", + "type": "ibm_is_subnet" }, { - "target": "[root] aws_lambda_permission.default", - "svg_id": "edge_5", - "source": "[root] meta.count-boundary (count boundary fixup)" + "apply": { + "instances": [ + { + "attributes": { + "address_prefix_management": "auto", + "classic_access": false, + "default_network_acl": "r006-1c7e8df6-f7dc-4d71-bbdc-3f1e56216dfe", + "default_security_group": "r006-2073a530-8ca1-4735-9b2d-748e9c69078e", + "id": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "is_default": null, + "name": "vpc-fs2020-lab3", + "resource_controller_url": "https://cloud.ibm.com/vpc-ext/network/vpcs", + "resource_crn": "crn:v1:bluemix:public:is:us-south:a/b9687c7011984685a20a8d25dfbea11b::vpc:r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "resource_group": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "Default", + "resource_name": "vpc-fs2020-lab3", + "resource_status": "available", + "status": "available", + "tags": [], + "timeouts": null + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDB9fQ==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "vpc1", + "provider": "provider.ibm", + "type": "ibm_is_vpc" + }, + "cluster": "root", + "definition": { + "name": "${var.vpc_name}" + }, + "group": 20000, + "label": "[root] ibm_is_vpc.vpc1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_vpc.vpc1", + "change": { + "actions": [ + "create" + ], + "after": { + "address_prefix_management": "auto", + "classic_access": false, + "is_default": null, + "name": "vpc-fs2020-lab", + "tags": null, + "timeouts": null + }, + "after_unknown": { + "default_network_acl": true, + "default_security_group": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true + }, + "before": null + }, + "mode": "managed", + "name": "vpc1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_vpc", + "values": { + "address_prefix_management": "auto", + "classic_access": false, + "is_default": null, + "name": "vpc-fs2020-lab", + "tags": null, + "timeouts": null + } + }, + "resource_name": "vpc1", + "simple_name": "ibm_is_vpc.vpc1", + "svg_id": "node_15", + "type": "ibm_is_vpc" }, { - "target": "[root] output.aws_lambda_function_arn", - "svg_id": "edge_6", - "source": "[root] meta.count-boundary (count boundary fixup)" + "apply": { + "instances": [ + { + "attributes": { + "cidr": "172.16.1.0/24", + "has_subnets": true, + "id": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5/r006-31d36b32-3a4a-4e29-abba-39497da11303", + "name": "vpc-ap1", + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-1" + }, + "dependencies": [ + "ibm_is_vpc.vpc1" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "vpc-ap1", + "provider": "provider.ibm", + "type": "ibm_is_vpc_address_prefix" + }, + "cluster": "root", + "definition": { + "cidr": "${var.zone1_cidr}", + "name": "vpc-ap1", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone1}" + }, + "group": 20000, + "label": "[root] ibm_is_vpc_address_prefix.vpc-ap1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_vpc_address_prefix.vpc-ap1", + "change": { + "actions": [ + "create" + ], + "after": { + "cidr": "172.16.1.0/24", + "name": "vpc-ap1", + "zone": "us-south-1" + }, + "after_unknown": { + "has_subnets": true, + "id": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "vpc-ap1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_vpc_address_prefix", + "values": { + "cidr": "172.16.1.0/24", + "name": "vpc-ap1", + "zone": "us-south-1" + } + }, + "resource_name": "vpc-ap1", + "simple_name": "ibm_is_vpc_address_prefix.vpc-ap1", + "svg_id": "node_16", + "type": "ibm_is_vpc_address_prefix" }, { - "target": "[root] aws_lambda_function.default", - "svg_id": "edge_7", - "source": "[root] output.aws_lambda_function_arn" + "apply": { + "instances": [ + { + "attributes": { + "cidr": "172.16.2.0/24", + "has_subnets": true, + "id": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5/r006-e184f6cd-2534-4fa9-8116-d3d0209df709", + "name": "vpc-ap2", + "vpc": "r006-41cf5f67-57a8-4f3f-91d2-c35ecf2a7df5", + "zone": "us-south-2" + }, + "dependencies": [ + "ibm_is_vpc.vpc1" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "vpc-ap2", + "provider": "provider.ibm", + "type": "ibm_is_vpc_address_prefix" + }, + "cluster": "root", + "definition": { + "cidr": "${var.zone2_cidr}", + "name": "vpc-ap2", + "vpc": "${ibm_is_vpc.vpc1.id}", + "zone": "${var.zone2}" + }, + "group": 20000, + "label": "[root] ibm_is_vpc_address_prefix.vpc-ap2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_vpc_address_prefix.vpc-ap2", + "change": { + "actions": [ + "create" + ], + "after": { + "cidr": "172.16.2.0/24", + "name": "vpc-ap2", + "zone": "us-south-2" + }, + "after_unknown": { + "has_subnets": true, + "id": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "vpc-ap2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_vpc_address_prefix", + "values": { + "cidr": "172.16.2.0/24", + "name": "vpc-ap2", + "zone": "us-south-2" + } + }, + "resource_name": "vpc-ap2", + "simple_name": "ibm_is_vpc_address_prefix.vpc-ap2", + "svg_id": "node_17", + "type": "ibm_is_vpc_address_prefix" }, { - "target": "[root] aws_iam_role_policy.default", - "svg_id": "edge_8", - "source": "[root] provider.aws (close)" + "apply": null, + "cluster": "cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip1", + "definition": { + "value": "${ibm_is_floating_ip.floatingip1.address}" + }, + "group": 20000, + "label": "[root] output.FloatingIP-1", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "FloatingIP-1", + "simple_name": "output.FloatingIP-1", + "svg_id": "node_18", + "type": "output" }, { - "target": "[root] aws_lambda_permission.default", - "svg_id": "edge_9", - "source": "[root] provider.aws (close)" + "apply": null, + "cluster": "cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip2", + "definition": { + "value": "${ibm_is_floating_ip.floatingip2.address}" + }, + "group": 20000, + "label": "[root] output.FloatingIP-2", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "FloatingIP-2", + "simple_name": "output.FloatingIP-2", + "svg_id": "node_19", + "type": "output" }, { - "target": "[root] var.aws_region", - "svg_id": "edge_10", - "source": "[root] provider.aws" + "apply": null, + "cluster": "cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_lb.lb1", + "definition": { + "value": "http://${ibm_is_lb.lb1.hostname}" + }, + "group": 20000, + "label": "[root] output.LB-Hostname", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "LB-Hostname", + "simple_name": "output.LB-Hostname", + "svg_id": "node_20", + "type": "output" }, { - "target": "[root] meta.count-boundary (count boundary fixup)", - "svg_id": "edge_11", - "source": "[root] root" + "apply": {}, + "cluster": "root", + "definition": { + "generation": 2, + "region": "${var.ibmcloud_region}" + }, + "group": 20000, + "label": "[root] provider.ibm", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "ibm", + "simple_name": "provider.ibm", + "svg_id": "node_21", + "type": "provider" }, { - "target": "[root] provider.aws (close)", - "svg_id": "edge_12", - "source": "[root] root" + "apply": {}, + "cluster": "root", + "definition": "", + "group": 20000, + "label": "[root] provider.template", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "template", + "simple_name": "provider.template", + "svg_id": "node_22", + "type": "provider" + }, + { + "apply": null, + "cluster": "cluster[root] provider.ibm_var_", + "definition": { + "default": "us-south", + "description": "Preferred IBM Cloud region to use for your infrastructure" + }, + "group": 20000, + "label": "[root] var.ibmcloud_region", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "ibmcloud_region", + "simple_name": "var.ibmcloud_region", + "svg_id": "node_23", + "type": "var" + }, + { + "apply": null, + "cluster": "root", + "definition": { + "default": "r006-14140f94-fcc4-11e9-96e7-a72723715315", + "description": "OS Image ID to be used for virtual instances" + }, + "group": 20000, + "label": "[root] var.image", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "image", + "simple_name": "var.image", + "svg_id": "node_24", + "type": "var" + }, + { + "apply": null, + "cluster": "root", + "definition": { + "default": "cx2-2x4", + "description": "Instance profile to be used for virtual instances" + }, + "group": 20000, + "label": "[root] var.profile", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "profile", + "simple_name": "var.profile", + "svg_id": "node_25", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_ssh_key.ssh1_var_", + "definition": { + "default": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgDGui3AghFSuOm0BKr70Hljv5OFIg8GLFiCBUuKR+SVcB4E51Z1KGXxsaijX3+pfKJHKZvd1mr3XAUQNutguZT1PpA7gksiIZfZNonAM7QDoq/BMq7AsSkxL/+4Ea3HOwJMFm2jSFzwwNCogvv4xK4+KKeuw3AI6lCDSetzs5maqwzqVDKGMfzwDyNcJaH20Nr4Twoy85MdrddlJi3eLq2xWytw+EdJvUXUXrsnrdORiK9kKx8D1Wn5TjTw3W90CM0gk1skNnT9D1Rpo8Lq2IXBDw6SCoSU+YTpQZERRNSB35BMDrRqPNC3cDwnL0clp64KJDmjQYsBreD4H5VdRXcHOagh2uZ6MbUz5p5tvvZpVLldt6pTmbZ8jk6Vo1WMnp65NQrUZsRoh9JxzpXldaJgb8ieCoj9x78jMEMd3EgtkAowE8MALVOl7y/4WMvwMmMt+4uVw1TJjozI38qtLBxUWdzjOF2KoT/uXPP7bRvMBsHHoVlUMRWAV7KKwPJrk= nishubharti@Nishus-MacBook-Pro.local", + "description": "SSH Public Key contents to be used" + }, + "group": 20000, + "label": "[root] var.ssh_public_key", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "ssh_public_key", + "simple_name": "var.ssh_public_key", + "svg_id": "node_26", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_vpc.vpc1_var_", + "definition": { + "default": "vpc-fs2020-lab3", + "description": "Name of your VPC" + }, + "group": 20000, + "label": "[root] var.vpc_name", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "vpc_name", + "simple_name": "var.vpc_name", + "svg_id": "node_27", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_vpc_address_prefix.vpc-ap1_var_", + "definition": { + "default": "us-south-1", + "description": "Define the 1st zone of the region" + }, + "group": 20000, + "label": "[root] var.zone1", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "zone1", + "simple_name": "var.zone1", + "svg_id": "node_28", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_vpc_address_prefix.vpc-ap1_var_", + "definition": { + "default": "172.16.1.0/24", + "description": "CIDR block to be used for zone 1" + }, + "group": 20000, + "label": "[root] var.zone1_cidr", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "zone1_cidr", + "simple_name": "var.zone1_cidr", + "svg_id": "node_29", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_vpc_address_prefix.vpc-ap2_var_", + "definition": { + "default": "us-south-2", + "description": "Define the 2nd zone of the region" + }, + "group": 20000, + "label": "[root] var.zone2", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "zone2", + "simple_name": "var.zone2", + "svg_id": "node_30", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_is_vpc_address_prefix.vpc-ap2_var_", + "definition": { + "default": "172.16.2.0/24", + "description": "CIDR block to be used for zone 2" + }, + "group": 20000, + "label": "[root] var.zone2_cidr", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "resource_name": "zone2_cidr", + "simple_name": "var.zone2_cidr", + "svg_id": "node_31", + "type": "var" + }, + { + "apply": {}, + "cluster": "root", + "definition": "", + "group": 20000, + "label": "[root] meta.count-boundary (EachMode fixup)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "count-boundary", + "simple_name": "meta.count-boundary (EachMode fixup)", + "svg_id": "node_32", + "type": "meta" + }, + { + "apply": {}, + "cluster": "root", + "definition": { + "generation": 2, + "region": "${var.ibmcloud_region}" + }, + "group": 20000, + "label": "[root] provider.ibm (close)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "ibm", + "simple_name": "provider.ibm (close)", + "svg_id": "node_33", + "type": "provider" + }, + { + "apply": {}, + "cluster": "root", + "definition": "", + "group": 20000, + "label": "[root] provider.template (close)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "template", + "simple_name": "provider.template (close)", + "svg_id": "node_34", + "type": "provider" + }, + { + "apply": {}, + "cluster": "root", + "definition": "", + "group": 20000, + "label": "[root] root", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "", + "simple_name": "root", + "svg_id": "node_35", + "type": "" } ] } + diff --git a/blastradius/server/static/example/demo-1/demo-1.svg b/blastradius/server/static/example/demo-1/demo-1.svg index 30e4050..47af9a4 100644 --- a/blastradius/server/static/example/demo-1/demo-1.svg +++ b/blastradius/server/static/example/demo-1/demo-1.svg @@ -1,169 +1,669 @@ - - - + + %3 - - + + +cluster[root] provider.ibm_var_ + + +cluster[root] ibm_is_ssh_key.ssh1_var_ + + +cluster[root] ibm_is_vpc.vpc1_var_ + + +cluster[root] ibm_is_vpc_address_prefix.vpc-ap1_var_ + + +cluster[root] ibm_is_vpc_address_prefix.vpc-ap2_var_ + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip1 + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip2 + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_lb.lb1 + + -[root] aws_iam_role.default - -aws_iam_role - -default +[root] data.template_cloudinit_config.cloud-init-apptier + +template_cloudinit_config + +cloud-init-apptier - - -[root] provider.aws - -provider - -aws + + +[root] provider.template + +provider + +template - + -[root] aws_iam_role.default->[root] provider.aws - - +[root] data.template_cloudinit_config.cloud-init-apptier->[root] provider.template + + - + -[root] aws_iam_role_policy.default - -aws_iam_role_policy - -default +[root] ibm_is_floating_ip.floatingip1 + +ibm_is_floating_ip + +floatingip1 + + + +[root] ibm_is_instance.instance1 + +ibm_is_instance + +instance1 - + -[root] aws_iam_role_policy.default->[root] aws_iam_role.default - - +[root] ibm_is_floating_ip.floatingip1->[root] ibm_is_instance.instance1 + + - + -[root] aws_lambda_function.default - -aws_lambda_function - -default +[root] ibm_is_floating_ip.floatingip2 + +ibm_is_floating_ip + +floatingip2 - - -[root] aws_lambda_function.default->[root] aws_iam_role.default - - + + +[root] ibm_is_instance.instance2 + +ibm_is_instance + +instance2 - - -[root] aws_lambda_permission.default - -aws_lambda_permission - -default + + +[root] ibm_is_floating_ip.floatingip2->[root] ibm_is_instance.instance2 + + - + -[root] aws_lambda_permission.default->[root] aws_lambda_function.default - - - - - -[root] var.aws_region - -var - -aws_region +[root] ibm_is_instance.instance1->[root] data.template_cloudinit_config.cloud-init-apptier + + - - -[root] provider.aws->[root] var.aws_region - - + + +[root] ibm_is_ssh_key.ssh1 + +ibm_is_ssh_key + +ssh1 - - -[root] meta.count-boundary (count boundary fixup) - -meta - -count-boundary - - + -[root] meta.count-boundary (count boundary fixup)->[root] aws_iam_role_policy.default - - +[root] ibm_is_instance.instance1->[root] ibm_is_ssh_key.ssh1 + + + + + +[root] ibm_is_subnet.subnet1 + +ibm_is_subnet + +subnet1 - + -[root] meta.count-boundary (count boundary fixup)->[root] aws_lambda_permission.default - - +[root] ibm_is_instance.instance1->[root] ibm_is_subnet.subnet1 + + - - -[root] output.aws_lambda_function_arn - -output - -aws_lambda_function_arn + + +[root] var.image + +var + +image - + -[root] meta.count-boundary (count boundary fixup)->[root] output.aws_lambda_function_arn - - +[root] ibm_is_instance.instance1->[root] var.image + + - - -[root] output.aws_lambda_function_arn->[root] aws_lambda_function.default - - + + +[root] var.profile + +var + +profile - - -[root] provider.aws (close) - -provider - -aws + + +[root] ibm_is_instance.instance1->[root] var.profile + + - + -[root] provider.aws (close)->[root] aws_iam_role_policy.default - - +[root] ibm_is_instance.instance2->[root] data.template_cloudinit_config.cloud-init-apptier + + - + -[root] provider.aws (close)->[root] aws_lambda_permission.default - - +[root] ibm_is_instance.instance2->[root] ibm_is_ssh_key.ssh1 + + - - -[root] root - -[root] root + + +[root] ibm_is_subnet.subnet2 + +ibm_is_subnet + +subnet2 + + + +[root] ibm_is_instance.instance2->[root] ibm_is_subnet.subnet2 + + - + -[root] root->[root] meta.count-boundary (count boundary fixup) - - +[root] ibm_is_instance.instance2->[root] var.image + + - + -[root] root->[root] provider.aws (close) - - +[root] ibm_is_instance.instance2->[root] var.profile + + + + + +[root] ibm_is_lb.lb1 + +ibm_is_lb + +lb1 + + + +[root] ibm_is_lb.lb1->[root] ibm_is_subnet.subnet1 + + + + + +[root] ibm_is_lb.lb1->[root] ibm_is_subnet.subnet2 + + + + + +[root] ibm_is_lb_listener.lb1-listener + +ibm_is_lb_listener + +lb1-listener + + + +[root] ibm_is_lb_pool.lb1-pool + +ibm_is_lb_pool + +lb1-pool + + + +[root] ibm_is_lb_listener.lb1-listener->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_lb_pool.lb1-pool->[root] ibm_is_lb.lb1 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1 + +ibm_is_lb_pool_member + +lb1-pool-member1 + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1->[root] ibm_is_instance.instance1 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2 + +ibm_is_lb_pool_member + +lb1-pool-member2 + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2->[root] ibm_is_instance.instance2 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + +ibm_is_security_group_rule + +sg1_tcp_rule_22 + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + +ibm_is_security_group_rule + +sg1_tcp_rule_80 + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] provider.ibm + +provider + +ibm + + + +[root] ibm_is_ssh_key.ssh1->[root] provider.ibm + + + + + +[root] var.ssh_public_key + +var + +ssh_public_key + + + +[root] ibm_is_ssh_key.ssh1->[root] var.ssh_public_key + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1 + +ibm_is_vpc_address_prefix + +vpc-ap1 + + + +[root] ibm_is_subnet.subnet1->[root] ibm_is_vpc_address_prefix.vpc-ap1 + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2 + +ibm_is_vpc_address_prefix + +vpc-ap2 + + + +[root] ibm_is_subnet.subnet2->[root] ibm_is_vpc_address_prefix.vpc-ap2 + + + + + +[root] ibm_is_vpc.vpc1 + +ibm_is_vpc + +vpc1 + + + +[root] ibm_is_vpc.vpc1->[root] provider.ibm + + + + + +[root] var.vpc_name + +var + +vpc_name + + + +[root] ibm_is_vpc.vpc1->[root] var.vpc_name + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1->[root] ibm_is_vpc.vpc1 + + + + + +[root] var.zone1 + +var + +zone1 + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1->[root] var.zone1 + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2->[root] ibm_is_vpc.vpc1 + + + + + +[root] var.zone2 + +var + +zone2 + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2->[root] var.zone2 + + + + + +[root] var.ibmcloud_region + +var + +ibmcloud_region + + + +[root] provider.ibm->[root] var.ibmcloud_region + + + + + +[root] meta.count-boundary (EachMode fixup) + +meta + +count-boundary + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_listener.lb1-listener + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_pool_member.lb1-pool-member1 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_pool_member.lb1-pool-member2 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + + + + + +[root] output.FloatingIP-1 + +output + +FloatingIP-1 + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.FloatingIP-1 + + + + + +[root] output.FloatingIP-2 + +output + +FloatingIP-2 + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.FloatingIP-2 + + + + + +[root] output.LB-Hostname + +output + +LB-Hostname + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.LB-Hostname + + + + + +[root] provider.ibm (close) + +provider + +ibm + + + +[root] provider.ibm (close)->[root] ibm_is_lb_listener.lb1-listener + + + + + +[root] provider.ibm (close)->[root] ibm_is_lb_pool_member.lb1-pool-member1 + + + + + +[root] provider.ibm (close)->[root] ibm_is_lb_pool_member.lb1-pool-member2 + + + + + +[root] provider.ibm (close)->[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + + + + + +[root] provider.ibm (close)->[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + + + + + +[root] provider.template (close) + +provider + +template + + + +[root] provider.template (close)->[root] data.template_cloudinit_config.cloud-init-apptier + + + + + +[root] root + +[root] root + + + +[root] root->[root] meta.count-boundary (EachMode fixup) + + + + + +[root] root->[root] provider.ibm (close) + + + + + +[root] root->[root] provider.template (close) + + + + + +[root] var.zone1_cidr + +var + +zone1_cidr + + + +[root] var.zone1->[root] var.zone1_cidr + + + + +[root] var.zone2_cidr + +var + +zone2_cidr + + + +[root] var.zone2->[root] var.zone2_cidr + + + + +[root] output.FloatingIP-1->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] output.FloatingIP-2->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] output.LB-Hostname->[root] ibm_is_lb.lb1 + + diff --git a/blastradius/server/static/example/demo-1/demonew-1.svg b/blastradius/server/static/example/demo-1/demonew-1.svg new file mode 100644 index 0000000..b847b20 --- /dev/null +++ b/blastradius/server/static/example/demo-1/demonew-1.svg @@ -0,0 +1,757 @@ + + + + + + +%3 + + +cluster[root] provider.ibm_var_ + + +cluster[root] ibm_is_ssh_key.ssh1_var_ + + +cluster[root] ibm_is_vpc.vpc1_var_ + + +cluster[root] ibm_is_vpc_address_prefix.vpc-ap1_var_ + + +cluster[root] ibm_is_vpc_address_prefix.vpc-ap2_var_ + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip1 + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_floating_ip.floatingip2 + + +cluster[root] meta.count-boundary (EachMode fixup)_output_[root] ibm_is_lb.lb1 + + + +[root] data.template_cloudinit_config.cloud-init-apptier + +template_cloudinit_config + + + + +cloud-init-apptier + + + +[root] provider.template + +provider + + +template + + + +[root] data.template_cloudinit_config.cloud-init-apptier->[root] provider.template + + + + + +[root] ibm_is_floating_ip.floatingip1 + +ibm_is_floating_ip + + ++ + + +floatingip1 + + + +[root] ibm_is_instance.instance1 + +ibm_is_instance + + ++ + + +instance1 + + + +[root] ibm_is_floating_ip.floatingip1->[root] ibm_is_instance.instance1 + + + + + +[root] ibm_is_floating_ip.floatingip2 + +ibm_is_floating_ip + + ++ + + +floatingip2 + + + +[root] ibm_is_instance.instance2 + +ibm_is_instance + + ++ + + +instance2 + + + +[root] ibm_is_floating_ip.floatingip2->[root] ibm_is_instance.instance2 + + + + + +[root] ibm_is_instance.instance1->[root] data.template_cloudinit_config.cloud-init-apptier + + + + + +[root] ibm_is_ssh_key.ssh1 + +ibm_is_ssh_key + + ++ + + +ssh1 + + + +[root] ibm_is_instance.instance1->[root] ibm_is_ssh_key.ssh1 + + + + + +[root] ibm_is_subnet.subnet1 + +ibm_is_subnet + + ++ + + +subnet1 + + + +[root] ibm_is_instance.instance1->[root] ibm_is_subnet.subnet1 + + + + + +[root] var.image + +var + + +image + + + +[root] ibm_is_instance.instance1->[root] var.image + + + + + +[root] var.profile + +var + + +profile + + + +[root] ibm_is_instance.instance1->[root] var.profile + + + + + +[root] ibm_is_instance.instance2->[root] data.template_cloudinit_config.cloud-init-apptier + + + + + +[root] ibm_is_instance.instance2->[root] ibm_is_ssh_key.ssh1 + + + + + +[root] ibm_is_subnet.subnet2 + +ibm_is_subnet + + ++ + + +subnet2 + + + +[root] ibm_is_instance.instance2->[root] ibm_is_subnet.subnet2 + + + + + +[root] ibm_is_instance.instance2->[root] var.image + + + + + +[root] ibm_is_instance.instance2->[root] var.profile + + + + + +[root] ibm_is_lb.lb1 + +ibm_is_lb + + ++ + + +lb1 + + + +[root] ibm_is_lb.lb1->[root] ibm_is_subnet.subnet1 + + + + + +[root] ibm_is_lb.lb1->[root] ibm_is_subnet.subnet2 + + + + + +[root] ibm_is_lb_listener.lb1-listener + +ibm_is_lb_listener + + ++ + + +lb1-listener + + + +[root] ibm_is_lb_pool.lb1-pool + +ibm_is_lb_pool + + ++ + + +lb1-pool + + + +[root] ibm_is_lb_listener.lb1-listener->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_lb_pool.lb1-pool->[root] ibm_is_lb.lb1 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1 + +ibm_is_lb_pool_member + + ++ + + +lb1-pool-member1 + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1->[root] ibm_is_instance.instance1 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member1->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2 + +ibm_is_lb_pool_member + + ++ + + +lb1-pool-member2 + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2->[root] ibm_is_instance.instance2 + + + + + +[root] ibm_is_lb_pool_member.lb1-pool-member2->[root] ibm_is_lb_pool.lb1-pool + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + +ibm_is_security_group_rule + + ++ + + +sg1_tcp_rule_22 + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_22->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + +ibm_is_security_group_rule + + ++ + + +sg1_tcp_rule_80 + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] ibm_is_security_group_rule.sg1_tcp_rule_80->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] provider.ibm + +provider + + +ibm + + + +[root] ibm_is_ssh_key.ssh1->[root] provider.ibm + + + + + +[root] var.ssh_public_key + +var + + +ssh_public_key + + + +[root] ibm_is_ssh_key.ssh1->[root] var.ssh_public_key + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1 + +ibm_is_vpc_address_prefix + + ++ + + +vpc-ap1 + + + +[root] ibm_is_subnet.subnet1->[root] ibm_is_vpc_address_prefix.vpc-ap1 + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2 + +ibm_is_vpc_address_prefix + + ++ + + +vpc-ap2 + + + +[root] ibm_is_subnet.subnet2->[root] ibm_is_vpc_address_prefix.vpc-ap2 + + + + + +[root] ibm_is_vpc.vpc1 + +ibm_is_vpc + + ++ + + +vpc1 + + + +[root] ibm_is_vpc.vpc1->[root] provider.ibm + + + + + +[root] var.vpc_name + +var + + +vpc_name + + + +[root] ibm_is_vpc.vpc1->[root] var.vpc_name + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1->[root] ibm_is_vpc.vpc1 + + + + + +[root] var.zone1 + +var + + +zone1 + + + +[root] ibm_is_vpc_address_prefix.vpc-ap1->[root] var.zone1 + + + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2->[root] ibm_is_vpc.vpc1 + + + + + +[root] var.zone2 + +var + + +zone2 + + + +[root] ibm_is_vpc_address_prefix.vpc-ap2->[root] var.zone2 + + + + + +[root] var.ibmcloud_region + +var + + +ibmcloud_region + + + +[root] provider.ibm->[root] var.ibmcloud_region + + + + + +[root] meta.count-boundary (EachMode fixup) + +meta + + +count-boundary + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_listener.lb1-listener + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_pool_member.lb1-pool-member1 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_lb_pool_member.lb1-pool-member2 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + + + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + + + + + +[root] output.FloatingIP-1 + +output + + +FloatingIP-1 + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.FloatingIP-1 + + + + + +[root] output.FloatingIP-2 + +output + + +FloatingIP-2 + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.FloatingIP-2 + + + + + +[root] output.LB-Hostname + +output + + +LB-Hostname + + + +[root] meta.count-boundary (EachMode fixup)->[root] output.LB-Hostname + + + + + +[root] provider.ibm (close) + +provider + + +ibm + + + +[root] provider.ibm (close)->[root] ibm_is_lb_listener.lb1-listener + + + + + +[root] provider.ibm (close)->[root] ibm_is_lb_pool_member.lb1-pool-member1 + + + + + +[root] provider.ibm (close)->[root] ibm_is_lb_pool_member.lb1-pool-member2 + + + + + +[root] provider.ibm (close)->[root] ibm_is_security_group_rule.sg1_tcp_rule_22 + + + + + +[root] provider.ibm (close)->[root] ibm_is_security_group_rule.sg1_tcp_rule_80 + + + + + +[root] provider.template (close) + +provider + + +template + + + +[root] provider.template (close)->[root] data.template_cloudinit_config.cloud-init-apptier + + + + + +[root] root + +[root] root + + + +[root] root->[root] meta.count-boundary (EachMode fixup) + + + + + +[root] root->[root] provider.ibm (close) + + + + + +[root] root->[root] provider.template (close) + + + + + +[root] var.zone1_cidr + +var + + +zone1_cidr + + + +[root] var.zone1->[root] var.zone1_cidr + + + + +[root] var.zone2_cidr + +var + + +zone2_cidr + + + +[root] var.zone2->[root] var.zone2_cidr + + + + +[root] output.FloatingIP-1->[root] ibm_is_floating_ip.floatingip1 + + + + + +[root] output.FloatingIP-2->[root] ibm_is_floating_ip.floatingip2 + + + + + +[root] output.LB-Hostname->[root] ibm_is_lb.lb1 + + + + + diff --git a/blastradius/server/static/example/demo-2/demo-2.json b/blastradius/server/static/example/demo-2/demo-2.json index e7cdfc6..9bdf233 100644 --- a/blastradius/server/static/example/demo-2/demo-2.json +++ b/blastradius/server/static/example/demo-2/demo-2.json @@ -1,457 +1,2309 @@ { - "nodes": [ + "edges": [ { - "svg_id": "node_0", - "type": "digitalocean_domain", - "simple_name": "digitalocean_domain.mywebserver", - "resource_name": "mywebserver", - "definition": {}, - "group": 20000, - "label": "[root] digitalocean_domain.mywebserver", - "def": { - "name": "www.mywebserver.com", - "ip_address": "${digitalocean_droplet.mywebserver.ipv4_address}" - } + "edge_type": 1, + "source": "[root] ibm_cis.demo_web_domain", + "svg_id": "edge_0", + "target": "[root] ibm_resource_group.demo_group1" }, { - "svg_id": "node_1", - "type": "digitalocean_droplet", - "simple_name": "digitalocean_droplet.mywebserver", - "resource_name": "mywebserver", - "definition": {}, - "group": 20000, - "label": "[root] digitalocean_droplet.mywebserver", - "def": { - "ssh_keys": [ - 12345678 - ], - "image": "${var.ubuntu}", - "region": "${var.do_ams3}", - "size": "512mb", - "private_networking": true, - "backups": true, - "ipv6": true, - "name": "mywebserver-ams3", - "provisioner": { - "remote-exec": { - "inline": [ - "export PATH=$PATH:/usr/bin", - "sudo apt-get update", - "sudo apt-get -y install nginx" - ], - "connection": { - "type": "ssh", - "private_key": "${file(\"~/.ssh/id_rsa\")}", - "user": "root", - "timeout": "2m" - } - } - } - } + "edge_type": 1, + "source": "[root] ibm_cis_domain.demo_web_domain", + "svg_id": "edge_1", + "target": "[root] ibm_cis.demo_web_domain" }, { - "svg_id": "node_2", - "type": "digitalocean_record", - "simple_name": "digitalocean_record.mywebserver", - "resource_name": "mywebserver", - "definition": {}, - "group": 20000, - "label": "[root] digitalocean_record.mywebserver", - "def": { - "domain": "${digitalocean_domain.mywebserver.name}", - "type": "A", - "name": "mywebserver", - "value": "${digitalocean_droplet.mywebserver.ipv4_address}" - } + "edge_type": 1, + "source": "[root] ibm_cis_domain_settings.demo_web_domain", + "svg_id": "edge_2", + "target": "[root] ibm_cis_domain.demo_web_domain" }, { - "svg_id": "node_3", - "type": "provider", - "simple_name": "provider.digitalocean", - "resource_name": "digitalocean", - "definition": {}, - "group": 20000, - "label": "[root] provider.digitalocean", - "def": [] + "edge_type": 1, + "source": "[root] ibm_container_bind_service.bind_service", + "svg_id": "edge_3", + "target": "[root] ibm_container_vpc_cluster.cluster" }, { - "svg_id": "node_4", - "type": "var", - "simple_name": "var.do_ams3", - "resource_name": "do_ams3", - "definition": {}, - "group": 20000, - "label": "[root] var.do_ams3", - "def": { - "description": "Digital Ocean Amsterdam Data Center 3", - "default": "ams3" - } + "edge_type": 1, + "source": "[root] ibm_container_bind_service.bind_service", + "svg_id": "edge_4", + "target": "[root] ibm_resource_instance.cos_instance" }, { - "svg_id": "node_5", - "type": "var", - "simple_name": "var.ubuntu", - "resource_name": "ubuntu", - "definition": {}, - "group": 20000, - "label": "[root] var.ubuntu", - "def": { - "description": "Default LTS", - "default": "ubuntu-16-04-x64" - } + "edge_type": 1, + "source": "[root] ibm_container_vpc_cluster.cluster", + "svg_id": "edge_5", + "target": "[root] ibm_is_subnet.subnet1" }, { - "svg_id": "node_6", - "type": "meta", - "simple_name": "meta.count-boundary (count boundary fixup)", - "resource_name": "count-boundary", - "definition": {}, - "group": 20000, - "label": "[root] meta.count-boundary (count boundary fixup)", - "def": [] + "edge_type": 1, + "source": "[root] ibm_container_vpc_cluster.cluster", + "svg_id": "edge_6", + "target": "[root] ibm_resource_group.demo_group1" }, { - "svg_id": "node_7", - "type": "output", - "simple_name": "output.Name", - "resource_name": "Name", - "definition": {}, - "group": 20000, - "label": "[root] output.Name", - "def": [] + "edge_type": 1, + "source": "[root] ibm_cos_bucket.standard-ams03", + "svg_id": "edge_7", + "target": "[root] ibm_kp_key.cos_encrypt" }, { - "svg_id": "node_8", - "type": "output", - "simple_name": "output.Public ip", - "resource_name": "Public", - "definition": {}, - "group": 20000, - "label": "[root] output.Public ip", - "def": [] + "edge_type": 1, + "source": "[root] ibm_cos_bucket.standard-ams03", + "svg_id": "edge_8", + "target": "[root] ibm_resource_instance.cos_instance" }, { - "svg_id": "node_9", - "type": "var", - "simple_name": "var.centos", - "resource_name": "centos", - "definition": {}, - "group": 20000, - "label": "[root] var.centos", - "def": { - "description": "Default Centos", - "default": "centos-72-x64" - } + "edge_type": 1, + "source": "[root] ibm_iam_authorization_policy.policy", + "svg_id": "edge_9", + "target": "[root] provider.ibm" }, { - "svg_id": "node_10", - "type": "var", - "simple_name": "var.coreos", - "resource_name": "coreos", - "definition": {}, - "group": 20000, - "label": "[root] var.coreos", - "def": { - "description": "Defaut Coreos", - "default": "coreos-899.17.0" - } + "edge_type": 1, + "source": "[root] ibm_iam_service_id.serviceID", + "svg_id": "edge_10", + "target": "[root] provider.ibm" }, { - "svg_id": "node_11", - "type": "var", - "simple_name": "var.do_ams2", - "resource_name": "do_ams2", - "definition": {}, - "group": 20000, - "label": "[root] var.do_ams2", - "def": { - "description": "Digital Ocean Amsterdam Data Center 2", - "default": "ams2" - } + "edge_type": 1, + "source": "[root] ibm_iam_service_policy.policy", + "svg_id": "edge_11", + "target": "[root] ibm_iam_service_id.serviceID" }, { - "svg_id": "node_12", - "type": "var", - "simple_name": "var.do_blr1", - "resource_name": "do_blr1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_blr1", - "def": { - "description": "Digital Ocean Bangalore Data Center 1", - "default": "blr1" - } + "edge_type": 1, + "source": "[root] ibm_iam_user_policy.policy1", + "svg_id": "edge_12", + "target": "[root] provider.ibm" }, { - "svg_id": "node_13", - "type": "var", - "simple_name": "var.do_fra1", - "resource_name": "do_fra1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_fra1", - "def": { - "description": "Digital Ocean Frankfurt Data Center 1", - "default": "fra1" - } + "edge_type": 1, + "source": "[root] ibm_iam_user_policy.policy1", + "svg_id": "edge_13", + "target": "[root] var.user1" }, { - "svg_id": "node_14", - "type": "var", - "simple_name": "var.do_lon1", - "resource_name": "do_lon1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_lon1", - "def": { - "description": "Digital Ocean London Data Center 1", - "default": "lon1" - } + "edge_type": 1, + "source": "[root] ibm_iam_user_policy.policy2", + "svg_id": "edge_14", + "target": "[root] provider.ibm" }, { - "svg_id": "node_15", - "type": "var", - "simple_name": "var.do_nyc1", - "resource_name": "do_nyc1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_nyc1", - "def": { - "description": "Digital Ocean New York Data Center 1", - "default": "nyc1" - } + "edge_type": 1, + "source": "[root] ibm_iam_user_policy.policy2", + "svg_id": "edge_15", + "target": "[root] var.user2" }, { - "svg_id": "node_16", - "type": "var", - "simple_name": "var.do_nyc2", - "resource_name": "do_nyc2", - "definition": {}, - "group": 20000, - "label": "[root] var.do_nyc2", - "def": { - "description": "Digital Ocean New York Data Center 2", - "default": "nyc2" - } + "edge_type": 1, + "source": "[root] ibm_is_subnet.subnet1", + "svg_id": "edge_16", + "target": "[root] ibm_is_vpc.vpc1" }, { - "svg_id": "node_17", - "type": "var", - "simple_name": "var.do_nyc3", - "resource_name": "do_nyc3", - "definition": {}, - "group": 20000, - "label": "[root] var.do_nyc3", - "def": { - "description": "Digital Ocean New York Data Center 3", - "default": "nyc3" - } + "edge_type": 1, + "source": "[root] ibm_is_subnet.subnet2", + "svg_id": "edge_17", + "target": "[root] ibm_is_vpc.vpc1" }, { - "svg_id": "node_18", - "type": "var", - "simple_name": "var.do_sfo1", - "resource_name": "do_sfo1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_sfo1", - "def": { - "description": "Digital Ocean San Francisco Data Center 1", - "default": "sfo1" - } + "edge_type": 1, + "source": "[root] ibm_is_vpc.vpc1", + "svg_id": "edge_18", + "target": "[root] provider.ibm" }, { - "svg_id": "node_19", - "type": "var", - "simple_name": "var.do_sgp1", - "resource_name": "do_sgp1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_sgp1", - "def": { - "description": "Digital Ocean Singapore Data Center 1", - "default": "sgp1" - } + "edge_type": 1, + "source": "[root] ibm_kp_key.cos_encrypt", + "svg_id": "edge_19", + "target": "[root] ibm_resource_instance.kp_instance" }, { - "svg_id": "node_20", - "type": "var", - "simple_name": "var.do_tor1", - "resource_name": "do_tor1", - "definition": {}, - "group": 20000, - "label": "[root] var.do_tor1", - "def": { - "description": "Digital Ocean Toronto Datacenter 1", - "default": "tor1" - } + "edge_type": 1, + "source": "[root] ibm_resource_group.demo_group1", + "svg_id": "edge_20", + "target": "[root] provider.ibm" }, { - "svg_id": "node_21", - "type": "provider", - "simple_name": "provider.digitalocean (close)", - "resource_name": "digitalocean", - "definition": {}, - "group": 20000, - "label": "[root] provider.digitalocean (close)", - "def": [] + "edge_type": 1, + "source": "[root] ibm_resource_instance.cos_instance", + "svg_id": "edge_21", + "target": "[root] ibm_resource_group.demo_group1" }, { - "svg_id": "node_22", - "type": "provisioner", - "simple_name": "provisioner.remote-exec (close)", - "resource_name": "remote-exec", - "definition": {}, - "group": 20000, - "label": "[root] provisioner.remote-exec (close)", - "def": [] + "edge_type": 1, + "source": "[root] ibm_resource_instance.kp_instance", + "svg_id": "edge_22", + "target": "[root] provider.ibm" }, { - "svg_id": "node_23", - "type": "", - "simple_name": "root", - "resource_name": "", - "definition": {}, - "group": 20000, - "label": "[root] root", - "def": [] - } - ], - "edges": [ + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_23", + "target": "[root] ibm_cis_domain_settings.demo_web_domain" + }, { - "svg_id": "edge_0", - "source": "[root] digitalocean_domain.mywebserver", - "target": "[root] digitalocean_droplet.mywebserver" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_24", + "target": "[root] ibm_container_bind_service.bind_service" }, { - "svg_id": "edge_1", - "source": "[root] digitalocean_droplet.mywebserver", - "target": "[root] provider.digitalocean" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_25", + "target": "[root] ibm_cos_bucket.standard-ams03" }, { - "svg_id": "edge_2", - "source": "[root] digitalocean_droplet.mywebserver", - "target": "[root] var.do_ams3" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_26", + "target": "[root] ibm_iam_authorization_policy.policy" }, { - "svg_id": "edge_3", - "source": "[root] digitalocean_droplet.mywebserver", - "target": "[root] var.ubuntu" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_27", + "target": "[root] ibm_iam_service_policy.policy" }, { - "svg_id": "edge_4", - "source": "[root] digitalocean_record.mywebserver", - "target": "[root] digitalocean_domain.mywebserver" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_28", + "target": "[root] ibm_iam_user_policy.policy1" }, { - "svg_id": "edge_5", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] digitalocean_record.mywebserver" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_29", + "target": "[root] ibm_iam_user_policy.policy2" }, { - "svg_id": "edge_6", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] output.Name" + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_30", + "target": "[root] ibm_is_subnet.subnet2" }, { - "svg_id": "edge_7", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] output.Public ip" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_31", + "target": "[root] ibm_cis_domain_settings.demo_web_domain" }, { - "svg_id": "edge_8", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.centos" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_32", + "target": "[root] ibm_container_bind_service.bind_service" }, { - "svg_id": "edge_9", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.coreos" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_33", + "target": "[root] ibm_cos_bucket.standard-ams03" }, { - "svg_id": "edge_10", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_ams2" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_34", + "target": "[root] ibm_iam_authorization_policy.policy" }, { - "svg_id": "edge_11", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_blr1" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_35", + "target": "[root] ibm_iam_service_policy.policy" }, { - "svg_id": "edge_12", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_fra1" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_36", + "target": "[root] ibm_iam_user_policy.policy1" }, { - "svg_id": "edge_13", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_lon1" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_37", + "target": "[root] ibm_iam_user_policy.policy2" }, { - "svg_id": "edge_14", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_nyc1" + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_38", + "target": "[root] ibm_is_subnet.subnet2" }, { - "svg_id": "edge_15", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_nyc2" + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_39", + "target": "[root] meta.count-boundary (EachMode fixup)" }, { - "svg_id": "edge_16", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_nyc3" + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_40", + "target": "[root] provider.ibm (close)" + } + ], + "nodes": [ + { + "apply": { + "instances": [ + { + "attributes": { + "guid": "592261fe-bc09-4a3e-a91d-0ad3a83d3196", + "id": "crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "location": "global", + "name": "web_domain", + "parameters": null, + "plan": "standard", + "resource_controller_url": "https://cloud.ibm.com/internet-svcs/crn%3Av1%3Abluemix%3Apublic%3Ainternet-svcs%3Aglobal%3Aa%2F93cd8038cd994fe29c0646a1ed609032%3A592261fe-bc09-4a3e-a91d-0ad3a83d3196%3A%3A", + "resource_crn": "crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "resource_group_id": "52f9d499dfdc4db388f4e9094ac93313", + "resource_group_name": "", + "resource_name": "web_domain", + "resource_status": "active", + "service": "internet-svcs", + "status": "active", + "tags": null, + "timeouts": null + }, + "depends_on": [ + "ibm_resource_group.demo_group1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "demo_web_domain", + "provider": "provider.ibm", + "type": "ibm_cis" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "location": [ + "global" + ], + "name": [ + "web_domain" + ], + "plan": [ + "standard" + ], + "resource_group_id": [ + "${ibm_resource_group.demo_group1.id}" + ] + }, + "group": 20000, + "label": "[root] ibm_cis.demo_web_domain", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_cis.demo_web_domain", + "change": { + "actions": [ + "create" + ], + "after": { + "location": "global", + "name": "web_domain", + "parameters": null, + "plan": "standard", + "tags": null, + "timeouts": null + }, + "after_unknown": { + "guid": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_id": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "service": true, + "status": true + }, + "before": null + }, + "mode": "managed", + "name": "demo_web_domain", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_cis", + "values": { + "location": "global", + "name": "web_domain", + "parameters": null, + "plan": "standard", + "tags": null, + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "demo_web_domain", + "simple_name": "ibm_cis.demo_web_domain", + "svg_id": "node_0", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:43", + "TimeEstimation": "00:04:00", + "id": "5fcf5dd2b1d825100b8be13c", + "name": "ibm_cis", + "region": "us-south" + }, + "type": "ibm_cis" }, { - "svg_id": "edge_17", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_sfo1" + "apply": { + "instances": [ + { + "attributes": { + "cis_id": "crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "domain": "demo.ibm.com", + "id": "2e86accf0abe5b8fa09bfbeb1c66a48f:crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "name_servers": [ + "ns061.name.cloud.ibm.com", + "ns118.name.cloud.ibm.com" + ], + "original_name_servers": [], + "paused": false, + "status": "pending" + }, + "depends_on": [ + "ibm_cis.demo_web_domain" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "demo_web_domain", + "provider": "provider.ibm", + "type": "ibm_cis_domain" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "cis_id": [ + "${ibm_cis.demo_web_domain.id}" + ], + "domain": [ + "demo.ibm.com" + ] + }, + "group": 20000, + "label": "[root] ibm_cis_domain.demo_web_domain", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_cis_domain.demo_web_domain", + "change": { + "actions": [ + "create" + ], + "after": { + "domain": "demo.ibm.com" + }, + "after_unknown": { + "cis_id": true, + "id": true, + "name_servers": true, + "original_name_servers": true, + "paused": true, + "status": true + }, + "before": null + }, + "mode": "managed", + "name": "demo_web_domain", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_cis_domain", + "values": { + "domain": "demo.ibm.com" + } + }, + "policy": "no policy available", + "resource_name": "demo_web_domain", + "simple_name": "ibm_cis_domain.demo_web_domain", + "svg_id": "node_1", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:44", + "TimeEstimation": "00:04:01", + "id": "5fcf5dd2b1d825100b8be143", + "name": "ibm_cis_domain", + "region": "us-south" + }, + "type": "ibm_cis_domain" }, { - "svg_id": "edge_18", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_sgp1" + "apply": { + "instances": [ + { + "attributes": { + "always_use_https": "off", + "automatic_https_rewrites": "off", + "brotli": null, + "browser_check": "on", + "certificate_status": null, + "cis_id": "crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "cname_flattening": "flatten_at_root", + "domain_id": "2e86accf0abe5b8fa09bfbeb1c66a48f:crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "hotlink_protection": "off", + "http2": "on", + "id": "2e86accf0abe5b8fa09bfbeb1c66a48f:crn:v1:bluemix:public:internet-svcs:global:a/93cd8038cd994fe29c0646a1ed609032:592261fe-bc09-4a3e-a91d-0ad3a83d3196::", + "image_load_optimization": "off", + "image_size_optimization": "off", + "ip_geolocation": "on", + "ipv6": "on", + "min_tls_version": "1.2", + "opportunistic_encryption": "off", + "origin_error_page_pass_thru": null, + "prefetch_preload": null, + "pseudo_ipv4": null, + "response_buffering": null, + "script_load_optimization": null, + "server_side_exclude": null, + "ssl": "full", + "tls_client_auth": null, + "true_client_ip_header": null, + "waf": "on", + "websockets": null + }, + "depends_on": [ + "ibm_cis.demo_web_domain", + "ibm_cis_domain.demo_web_domain" + ], + "private": "bnVsbA==", + "schema_version": 0, + "status": "tainted" + } + ], + "mode": "managed", + "name": "demo_web_domain", + "provider": "provider.ibm", + "type": "ibm_cis_domain_settings" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "cis_id": [ + "${ibm_cis.demo_web_domain.id}" + ], + "domain_id": [ + "${ibm_cis_domain.demo_web_domain.id}" + ], + "min_tls_version": [ + "1.2" + ], + "ssl": [ + "full" + ], + "waf": [ + "on" + ] + }, + "group": 20000, + "label": "[root] ibm_cis_domain_settings.demo_web_domain", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_cis_domain_settings.demo_web_domain", + "change": { + "actions": [ + "create" + ], + "after": { + "min_tls_version": "1.2", + "ssl": "full", + "waf": "on" + }, + "after_unknown": { + "always_use_https": true, + "automatic_https_rewrites": true, + "brotli": true, + "browser_check": true, + "certificate_status": true, + "cis_id": true, + "cname_flattening": true, + "domain_id": true, + "hotlink_protection": true, + "http2": true, + "id": true, + "image_load_optimization": true, + "image_size_optimization": true, + "ip_geolocation": true, + "ipv6": true, + "opportunistic_encryption": true, + "origin_error_page_pass_thru": true, + "prefetch_preload": true, + "pseudo_ipv4": true, + "response_buffering": true, + "script_load_optimization": true, + "server_side_exclude": true, + "tls_client_auth": true, + "true_client_ip_header": true, + "websockets": true + }, + "before": null + }, + "mode": "managed", + "name": "demo_web_domain", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_cis_domain_settings", + "values": { + "min_tls_version": "1.2", + "ssl": "full", + "waf": "on" + } + }, + "policy": "no policy available", + "resource_name": "demo_web_domain", + "simple_name": "ibm_cis_domain_settings.demo_web_domain", + "svg_id": "node_2", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:45", + "TimeEstimation": "00:04:02", + "id": "5fcf5dd2b1d825100b8be14a", + "name": "ibm_cis_domain_settings", + "region": "us-south" + }, + "type": "ibm_cis_domain_settings" }, { - "svg_id": "edge_19", - "source": "[root] meta.count-boundary (count boundary fixup)", - "target": "[root] var.do_tor1" + "apply": { + "instances": [], + "mode": "managed", + "name": "bind_service", + "provider": "provider.ibm", + "type": "ibm_container_bind_service" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "cluster_name_id": [ + "${ibm_container_vpc_cluster.cluster.id}" + ], + "namespace_id": [ + "default" + ], + "role": [ + "Writer" + ], + "service_instance_id": [ + "${element(split(\":\",ibm_resource_instance.cos_instance.id),7)}" + ] + }, + "group": 20000, + "label": "[root] ibm_container_bind_service.bind_service", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_container_bind_service.bind_service", + "change": { + "actions": [ + "create" + ], + "after": { + "account_guid": null, + "key": null, + "namespace_id": "default", + "org_guid": null, + "region": null, + "resource_group_id": null, + "role": "Writer", + "service_instance_name_id": null, + "service_instance_space_guid": null, + "space_guid": null, + "tags": null + }, + "after_unknown": { + "cluster_name_id": true, + "id": true, + "secret_name": true, + "service_instance_id": true, + "service_instance_name": true + }, + "before": null + }, + "mode": "managed", + "name": "bind_service", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_container_bind_service", + "values": { + "account_guid": null, + "key": null, + "namespace_id": "default", + "org_guid": null, + "region": null, + "resource_group_id": null, + "role": "Writer", + "service_instance_name_id": null, + "service_instance_space_guid": null, + "space_guid": null, + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "bind_service", + "simple_name": "ibm_container_bind_service.bind_service", + "svg_id": "node_3", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:01", + "TimeEstimation": "00:05:00", + "id": "5fcf5dd2b1d825100b8be0fd", + "name": "ibm_container_bind_service", + "region": "us-south" + }, + "type": "ibm_container_bind_service" }, { - "svg_id": "edge_20", - "source": "[root] output.Name", - "target": "[root] digitalocean_droplet.mywebserver" + "apply": { + "instances": [], + "mode": "managed", + "name": "cluster", + "provider": "provider.ibm", + "type": "ibm_container_vpc_cluster" + }, + "cluster": "root", + "cost": { + "depends": null, + "estimateType": "", + "features": null, + "id": "cluster", + "lineitemtotal": "269.1 USD", + "planID": "", + "quantity": 1, + "shortDescription": "", + "terraformItemId": "ibm_container_vpc_cluster", + "title": "Cluster" + }, + "definition": { + "flavor": [ + "bc1-2x8" + ], + "name": [ + "mycluster" + ], + "resource_group_id": [ + "${ibm_resource_group.demo_group1.id}" + ], + "vpc_id": [ + "${ibm_is_vpc.vpc1.id}" + ], + "worker_count": [ + 3 + ], + "zones": [ + { + "name": [ + "us-south-1" + ], + "subnet_id": [ + "${ibm_is_subnet.subnet1.id}" + ] + } + ] + }, + "group": 20000, + "label": "[root] ibm_container_vpc_cluster.cluster", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_container_vpc_cluster.cluster", + "change": { + "actions": [ + "create" + ], + "after": { + "cos_instance_crn": null, + "disable_public_service_endpoint": false, + "entitlement": null, + "flavor": "bc1-2x8", + "name": "mycluster", + "timeouts": null, + "wait_till": "IngressReady", + "worker_count": 3, + "zones": [ + { + "name": "us-south-1" + } + ] + }, + "after_unknown": { + "albs": true, + "crn": true, + "id": true, + "ingress_hostname": true, + "ingress_secret": true, + "kube_version": true, + "master_status": true, + "master_url": true, + "pod_subnet": true, + "private_service_endpoint_url": true, + "public_service_endpoint_url": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_id": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "service_subnet": true, + "state": true, + "tags": true, + "vpc_id": true, + "zones": [ + { + "subnet_id": true + } + ] + }, + "before": null + }, + "mode": "managed", + "name": "cluster", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_container_vpc_cluster", + "values": { + "cos_instance_crn": null, + "disable_public_service_endpoint": false, + "entitlement": null, + "flavor": "bc1-2x8", + "name": "mycluster", + "timeouts": null, + "wait_till": "IngressReady", + "worker_count": 3, + "zones": [ + { + "name": "us-south-1" + } + ] + } + }, + "policy": "no policy available", + "resource_name": "cluster", + "simple_name": "ibm_container_vpc_cluster.cluster", + "svg_id": "node_4", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:05", + "TimeEstimation": "13:00:00", + "id": "5fcf5dd2b1d825100b8be104", + "name": "ibm_container_vpc_cluster", + "region": "us-south" + }, + "type": "ibm_container_vpc_cluster" }, { - "svg_id": "edge_21", - "source": "[root] output.Public ip", - "target": "[root] digitalocean_droplet.mywebserver" + "apply": null, + "cluster": "root", + "cost": "no cost available", + "definition": { + "bucket_name": [ + "terraform-demo-bucket-m98hji6hgk89067ga" + ], + "key_protect": [ + "${ibm_kp_key.cos_encrypt.id}" + ], + "region_location": [ + "us-south" + ], + "resource_instance_id": [ + "${ibm_resource_instance.cos_instance.id}" + ], + "storage_class": [ + "standard" + ] + }, + "group": 20000, + "label": "[root] ibm_cos_bucket.standard-ams03", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_cos_bucket.standard-ams03", + "change": { + "actions": [ + "create" + ], + "after": { + "activity_tracking": [], + "allowed_ip": null, + "bucket_name": "terraform-demo-bucket-m98hji6hgk89067ga", + "cross_region_location": null, + "metrics_monitoring": [], + "region_location": "us-south", + "single_site_location": null, + "storage_class": "standard", + "timeouts": null + }, + "after_unknown": { + "activity_tracking": [], + "crn": true, + "id": true, + "key_protect": true, + "metrics_monitoring": [], + "resource_instance_id": true, + "s3_endpoint_private": true, + "s3_endpoint_public": true + }, + "before": null + }, + "mode": "managed", + "name": "standard-ams03", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_cos_bucket", + "values": { + "activity_tracking": [], + "allowed_ip": null, + "bucket_name": "terraform-demo-bucket-m98hji6hgk89067ga", + "cross_region_location": null, + "metrics_monitoring": [], + "region_location": "us-south", + "single_site_location": null, + "storage_class": "standard", + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "standard-ams03", + "simple_name": "ibm_cos_bucket.standard-ams03", + "svg_id": "node_5", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:11", + "TimeEstimation": "00:00:12", + "id": "5fcf5dd2b1d825100b8be10b", + "name": "ibm_cos_bucket", + "region": "us-south" + }, + "type": "ibm_cos_bucket" }, { - "svg_id": "edge_22", - "source": "[root] provider.digitalocean (close)", - "target": "[root] digitalocean_record.mywebserver" + "apply": null, + "cluster": "root", + "cost": "no cost available", + "definition": { + "roles": [ + [ + "Reader" + ] + ], + "source_service_name": [ + "cloud-object-storage" + ], + "target_service_name": [ + "kms" + ] + }, + "group": 20000, + "label": "[root] ibm_iam_authorization_policy.policy", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_iam_authorization_policy.policy", + "change": { + "actions": [ + "create" + ], + "after": { + "roles": [ + "Reader" + ], + "source_resource_group_id": null, + "source_resource_instance_id": null, + "source_resource_type": null, + "source_service_name": "cloud-object-storage", + "target_resource_group_id": null, + "target_resource_instance_id": null, + "target_resource_type": null, + "target_service_name": "kms" + }, + "after_unknown": { + "id": true, + "roles": [ + false + ], + "source_service_account": true, + "version": true + }, + "before": null + }, + "mode": "managed", + "name": "policy", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_iam_authorization_policy", + "values": { + "roles": [ + "Reader" + ], + "source_resource_group_id": null, + "source_resource_instance_id": null, + "source_resource_type": null, + "source_service_name": "cloud-object-storage", + "target_resource_group_id": null, + "target_resource_instance_id": null, + "target_resource_type": null, + "target_service_name": "kms" + } + }, + "policy": "no policy available", + "resource_name": "policy", + "simple_name": "ibm_iam_authorization_policy.policy", + "svg_id": "node_6", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:36", + "TimeEstimation": "00:02:05", + "id": "5fcf5dd2b1d825100b8be120", + "name": "ibm_iam_authorization_policy", + "region": "us-south" + }, + "type": "ibm_iam_authorization_policy" }, { - "svg_id": "edge_23", - "source": "[root] provisioner.remote-exec (close)", - "target": "[root] digitalocean_droplet.mywebserver" + "apply": { + "instances": [ + { + "attributes": { + "crn": "crn:v1:bluemix:public:iam-identity::a/93cd8038cd994fe29c0646a1ed609032::serviceid:ServiceId-e2de2af5-d4b2-48b6-ab2f-1497c9a0ea93", + "description": "", + "id": "ServiceId-e2de2af5-d4b2-48b6-ab2f-1497c9a0ea93", + "name": "demo-cis-dervice", + "tags": null, + "version": "1-9fb5e62df9b334948fbb1ea9ed8d7e6a" + }, + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "serviceID", + "provider": "provider.ibm", + "type": "ibm_iam_service_id" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "name": [ + "demo-cis-dervice" + ] + }, + "group": 20000, + "label": "[root] ibm_iam_service_id.serviceID", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_iam_service_id.serviceID", + "change": { + "actions": [ + "create" + ], + "after": { + "description": null, + "name": "demo-cis-dervice", + "tags": null + }, + "after_unknown": { + "crn": true, + "id": true, + "version": true + }, + "before": null + }, + "mode": "managed", + "name": "serviceID", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_iam_service_id", + "values": { + "description": null, + "name": "demo-cis-dervice", + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "serviceID", + "simple_name": "ibm_iam_service_id.serviceID", + "svg_id": "node_7", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:40", + "TimeEstimation": "00:02:09", + "id": "5fcf5dd2b1d825100b8be12e", + "name": "ibm_iam_service_id", + "region": "us-south" + }, + "type": "ibm_iam_service_id" }, { - "svg_id": "edge_24", - "source": "[root] root", - "target": "[root] meta.count-boundary (count boundary fixup)" + "apply": { + "instances": [ + { + "attributes": { + "account_management": false, + "iam_service_id": "ServiceId-e2de2af5-d4b2-48b6-ab2f-1497c9a0ea93", + "id": "ServiceId-e2de2af5-d4b2-48b6-ab2f-1497c9a0ea93/6b5ff8e6-97f4-4181-9e87-ebb436e366e5", + "resources": [ + { + "attributes": null, + "region": "", + "resource": "", + "resource_group_id": "demo_group1", + "resource_instance_id": "", + "resource_type": "", + "service": "cloud-object-storage" + } + ], + "roles": [ + "Writer" + ], + "tags": null, + "version": "1-89feba3c86c28d43368189ad94650252" + }, + "depends_on": [ + "ibm_iam_service_id.serviceID" + ], + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "policy", + "provider": "provider.ibm", + "type": "ibm_iam_service_policy" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "iam_service_id": [ + "${ibm_iam_service_id.serviceID.id}" + ], + "resources": [ + { + "resource_group_id": [ + "demo_group1" + ], + "service": [ + "cloud-object-storage" + ] + } + ], + "roles": [ + [ + "Writer" + ] + ] + }, + "group": 20000, + "label": "[root] ibm_iam_service_policy.policy", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_iam_service_policy.policy", + "change": { + "actions": [ + "create" + ], + "after": { + "account_management": false, + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": "demo_group1", + "resource_instance_id": null, + "resource_type": null, + "service": "cloud-object-storage" + } + ], + "roles": [ + "Writer" + ], + "tags": null + }, + "after_unknown": { + "iam_service_id": true, + "id": true, + "resources": [ + {} + ], + "roles": [ + false + ], + "version": true + }, + "before": null + }, + "mode": "managed", + "name": "policy", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_iam_service_policy", + "values": { + "account_management": false, + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": "demo_group1", + "resource_instance_id": null, + "resource_type": null, + "service": "cloud-object-storage" + } + ], + "roles": [ + "Writer" + ], + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "policy", + "simple_name": "ibm_iam_service_policy.policy", + "svg_id": "node_8", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:41", + "TimeEstimation": "00:02:10", + "id": "5fcf5dd2b1d825100b8be135", + "name": "ibm_iam_service_policy", + "region": "us-south" + }, + "type": "ibm_iam_service_policy" }, { - "svg_id": "edge_25", - "source": "[root] root", - "target": "[root] provider.digitalocean (close)" + "apply": null, + "cluster": "root", + "cost": "no cost available", + "definition": { + "ibm_id": [ + "${var.user1}" + ], + "resources": [ + { + "service": [ + "kms" + ] + } + ], + "roles": [ + [ + "Viewer", + "Administrator" + ] + ] + }, + "group": 20000, + "label": "[root] ibm_iam_user_policy.policy1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_iam_user_policy.policy1", + "change": { + "actions": [ + "create" + ], + "after": { + "account_management": false, + "ibm_id": "test1@in.ibm.com", + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": null, + "resource_instance_id": null, + "resource_type": null, + "service": "kms" + } + ], + "roles": [ + "Viewer", + "Administrator" + ], + "tags": null + }, + "after_unknown": { + "id": true, + "resources": [ + {} + ], + "roles": [ + false, + false + ], + "version": true + }, + "before": null + }, + "mode": "managed", + "name": "policy1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_iam_user_policy", + "values": { + "account_management": false, + "ibm_id": "test1@in.ibm.com", + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": null, + "resource_instance_id": null, + "resource_type": null, + "service": "kms" + } + ], + "roles": [ + "Viewer", + "Administrator" + ], + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "policy1", + "simple_name": "ibm_iam_user_policy.policy1", + "svg_id": "node_9", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:38", + "TimeEstimation": "00:02:07", + "id": "5fcf5dd2b1d825100b8be127", + "name": "ibm_iam_user_policy", + "region": "us-south" + }, + "type": "ibm_iam_user_policy" }, { - "svg_id": "edge_26", - "source": "[root] root", - "target": "[root] provisioner.remote-exec (close)" + "apply": null, + "cluster": "root", + "cost": "no cost available", + "definition": { + "ibm_id": [ + "${var.user2}" + ], + "resources": [ + { + "service": [ + "kms" + ] + } + ], + "roles": [ + [ + "Viewer" + ] + ] + }, + "group": 20000, + "label": "[root] ibm_iam_user_policy.policy2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_iam_user_policy.policy2", + "change": { + "actions": [ + "create" + ], + "after": { + "account_management": false, + "ibm_id": "test2@in.ibm.com", + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": null, + "resource_instance_id": null, + "resource_type": null, + "service": "kms" + } + ], + "roles": [ + "Viewer" + ], + "tags": null + }, + "after_unknown": { + "id": true, + "resources": [ + {} + ], + "roles": [ + false + ], + "version": true + }, + "before": null + }, + "mode": "managed", + "name": "policy2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_iam_user_policy", + "values": { + "account_management": false, + "ibm_id": "test2@in.ibm.com", + "resources": [ + { + "attributes": null, + "region": null, + "resource": null, + "resource_group_id": null, + "resource_instance_id": null, + "resource_type": null, + "service": "kms" + } + ], + "roles": [ + "Viewer" + ], + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "policy2", + "simple_name": "ibm_iam_user_policy.policy2", + "svg_id": "node_10", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:38", + "TimeEstimation": "00:02:07", + "id": "5fcf5dd2b1d825100b8be127", + "name": "ibm_iam_user_policy", + "region": "us-south" + }, + "type": "ibm_iam_user_policy" + }, + { + "apply": { + "instances": [], + "mode": "managed", + "name": "subnet1", + "provider": "provider.ibm", + "type": "ibm_is_subnet" + }, + "cluster": "root", + "cost": { + "depends": null, + "estimateType": "", + "features": null, + "id": "subnet1", + "lineitemtotal": "0 USD", + "planID": "", + "quantity": 1, + "shortDescription": "", + "terraformItemId": "ibm_is_subnet", + "title": "Subnet" + }, + "definition": { + "name": [ + "mysubnet1" + ], + "total_ipv4_address_count": [ + 256 + ], + "vpc": [ + "${ibm_is_vpc.vpc1.id}" + ], + "zone": [ + "us_south-1" + ] + }, + "group": 20000, + "label": "[root] ibm_is_subnet.subnet1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_subnet.subnet1", + "change": { + "actions": [ + "create" + ], + "after": { + "ip_version": "ipv4", + "name": "mysubnet1", + "public_gateway": null, + "timeouts": null, + "total_ipv4_address_count": 256, + "zone": "us_south-1" + }, + "after_unknown": { + "available_ipv4_address_count": true, + "id": true, + "ipv4_cidr_block": true, + "ipv6_cidr_block": true, + "network_acl": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "subnet1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_subnet", + "values": { + "ip_version": "ipv4", + "name": "mysubnet1", + "public_gateway": null, + "timeouts": null, + "total_ipv4_address_count": 256, + "zone": "us_south-1" + } + }, + "policy": "no policy available", + "resource_name": "subnet1", + "simple_name": "ibm_is_subnet.subnet1", + "svg_id": "node_11", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:72", + "TimeEstimation": "00:00:12", + "id": "5fcf5dd2b1d825100b8be151", + "name": "ibm_is_subnet", + "region": "us-south" + }, + "type": "ibm_is_subnet" + }, + { + "apply": { + "instances": [], + "mode": "managed", + "name": "subnet2", + "provider": "provider.ibm", + "type": "ibm_is_subnet" + }, + "cluster": "root", + "cost": { + "depends": null, + "estimateType": "", + "features": null, + "id": "subnet2", + "lineitemtotal": "0 USD", + "planID": "", + "quantity": 1, + "shortDescription": "", + "terraformItemId": "ibm_is_subnet", + "title": "Subnet" + }, + "definition": { + "name": [ + "mysubnet2" + ], + "total_ipv4_address_count": [ + 256 + ], + "vpc": [ + "${ibm_is_vpc.vpc1.id}" + ], + "zone": [ + "us-south-2" + ] + }, + "group": 20000, + "label": "[root] ibm_is_subnet.subnet2", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_subnet.subnet2", + "change": { + "actions": [ + "create" + ], + "after": { + "ip_version": "ipv4", + "name": "mysubnet2", + "public_gateway": null, + "timeouts": null, + "total_ipv4_address_count": 256, + "zone": "us-south-2" + }, + "after_unknown": { + "available_ipv4_address_count": true, + "id": true, + "ipv4_cidr_block": true, + "ipv6_cidr_block": true, + "network_acl": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "vpc": true + }, + "before": null + }, + "mode": "managed", + "name": "subnet2", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_subnet", + "values": { + "ip_version": "ipv4", + "name": "mysubnet2", + "public_gateway": null, + "timeouts": null, + "total_ipv4_address_count": 256, + "zone": "us-south-2" + } + }, + "policy": "no policy available", + "resource_name": "subnet2", + "simple_name": "ibm_is_subnet.subnet2", + "svg_id": "node_12", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:72", + "TimeEstimation": "00:00:12", + "id": "5fcf5dd2b1d825100b8be151", + "name": "ibm_is_subnet", + "region": "us-south" + }, + "type": "ibm_is_subnet" + }, + { + "apply": null, + "cluster": "root", + "cost": { + "depends": null, + "estimateType": "", + "features": null, + "id": "vpc1", + "lineitemtotal": "0 USD", + "planID": "aeb480c6-11ae-4abc-929a-eaaefcdc5615", + "quantity": 1, + "shortDescription": "", + "terraformItemId": "ibm_is_vpc", + "title": "VPC" + }, + "definition": { + "name": [ + "myvpc" + ] + }, + "group": 20000, + "label": "[root] ibm_is_vpc.vpc1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_is_vpc.vpc1", + "change": { + "actions": [ + "create" + ], + "after": { + "address_prefix_management": "auto", + "classic_access": false, + "is_default": null, + "name": "myvpc", + "timeouts": null + }, + "after_unknown": { + "crn": true, + "cse_source_addresses": true, + "default_network_acl": true, + "default_security_group": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "subnets": true, + "tags": true + }, + "before": null + }, + "mode": "managed", + "name": "vpc1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_is_vpc", + "values": { + "address_prefix_management": "auto", + "classic_access": false, + "is_default": null, + "name": "myvpc", + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "vpc1", + "simple_name": "ibm_is_vpc.vpc1", + "svg_id": "node_13", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:77", + "TimeEstimation": "00:00:18", + "id": "5fcf5dd2b1d825100b8be158", + "name": "ibm_is_vpc", + "region": "us-south" + }, + "type": "ibm_is_vpc" + }, + { + "apply": { + "instances": [ + { + "attributes": { + "crn": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e:key:fbfdf3f3-ab23-4729-81a7-eba96d30c9fb", + "encrypted_nonce": null, + "force_delete": false, + "id": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e:key:fbfdf3f3-ab23-4729-81a7-eba96d30c9fb", + "iv_value": "", + "key_id": "fbfdf3f3-ab23-4729-81a7-eba96d30c9fb", + "key_name": "key-name", + "key_protect_id": "0948eeee-1252-41a8-80b6-b7797b14ad4e", + "payload": "", + "resource_controller_url": "https://cloud.ibm.com/services/kms/crn%3Av1%3Abluemix%3Apublic%3Akms%3Aus-south%3Aa%2F93cd8038cd994fe29c0646a1ed609032%3A0948eeee-1252-41a8-80b6-b7797b14ad4e%3A%3A", + "resource_crn": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e:key:fbfdf3f3-ab23-4729-81a7-eba96d30c9fb", + "resource_group_name": null, + "resource_name": "key-name", + "resource_status": null, + "standard_key": false, + "timeouts": null + }, + "depends_on": [ + "ibm_resource_instance.kp_instance" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjM2MDAwMDAwMDAwMDB9fQ==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "cos_encrypt", + "provider": "provider.ibm", + "type": "ibm_kp_key" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "key_name": [ + "key-name" + ], + "key_protect_id": [ + "${ibm_resource_instance.kp_instance.guid}" + ], + "standard_key": [ + false + ] + }, + "group": 20000, + "label": "[root] ibm_kp_key.cos_encrypt", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_kp_key.cos_encrypt", + "change": { + "actions": [ + "create" + ], + "after": { + "encrypted_nonce": null, + "force_delete": false, + "iv_value": null, + "key_name": "key-name", + "standard_key": false, + "timeouts": null + }, + "after_unknown": { + "crn": true, + "id": true, + "key_id": true, + "key_protect_id": true, + "payload": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true + }, + "before": null + }, + "mode": "managed", + "name": "cos_encrypt", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_kp_key", + "values": { + "encrypted_nonce": null, + "force_delete": false, + "iv_value": null, + "key_name": "key-name", + "standard_key": false, + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "cos_encrypt", + "simple_name": "ibm_kp_key.cos_encrypt", + "svg_id": "node_14", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:23", + "TimeEstimation": "00:00:02", + "id": "5fcf5dd2b1d825100b8be112", + "name": "ibm_kp_key", + "region": "us-south" + }, + "type": "ibm_kp_key" + }, + { + "apply": { + "instances": [ + { + "attributes": { + "default": false, + "id": "52f9d499dfdc4db388f4e9094ac93313", + "name": "prod", + "quota_id": null, + "state": "ACTIVE", + "tags": null + }, + "private": "bnVsbA==", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "demo_group1", + "provider": "provider.ibm", + "type": "ibm_resource_group" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "name": [ + "prod" + ] + }, + "group": 20000, + "label": "[root] ibm_resource_group.demo_group1", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_resource_group.demo_group1", + "change": { + "actions": [ + "create" + ], + "after": { + "name": "prod", + "quota_id": null, + "tags": null + }, + "after_unknown": { + "default": true, + "id": true, + "state": true + }, + "before": null + }, + "mode": "managed", + "name": "demo_group1", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_resource_group", + "values": { + "name": "prod", + "quota_id": null, + "tags": null + } + }, + "policy": "no policy available", + "resource_name": "demo_group1", + "simple_name": "ibm_resource_group.demo_group1", + "svg_id": "node_15", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "nan", + "StartTime": "2020-12-07T05:54:04.000+00:24", + "TimeEstimation": "00:00:04", + "id": "5fcf5dd2b1d825100b8be119", + "name": "ibm_resource_group", + "region": "us-south" + }, + "type": "ibm_resource_group" + }, + { + "apply": { + "instances": [ + { + "attributes": { + "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/93cd8038cd994fe29c0646a1ed609032:6ffe0e10-9909-4577-b51b-109fc24580f4::", + "guid": "6ffe0e10-9909-4577-b51b-109fc24580f4", + "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/93cd8038cd994fe29c0646a1ed609032:6ffe0e10-9909-4577-b51b-109fc24580f4::", + "location": "global", + "name": "demo_cos_instance", + "parameters": null, + "plan": "standard", + "resource_controller_url": "https://cloud.ibm.com/services/", + "resource_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/93cd8038cd994fe29c0646a1ed609032:6ffe0e10-9909-4577-b51b-109fc24580f4::", + "resource_group_id": "52f9d499dfdc4db388f4e9094ac93313", + "resource_group_name": "", + "resource_name": "demo_cos_instance", + "resource_status": "active", + "service": "cloud-object-storage", + "service_endpoints": null, + "status": "active", + "tags": [], + "timeouts": null + }, + "depends_on": [ + "ibm_resource_group.demo_group1" + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "cos_instance", + "provider": "provider.ibm", + "type": "ibm_resource_instance" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "location": [ + "global" + ], + "name": [ + "demo_cos_instance" + ], + "plan": [ + "standard" + ], + "resource_group_id": [ + "${ibm_resource_group.demo_group1.id}" + ], + "service": [ + "cloud-object-storage" + ] + }, + "group": 20000, + "label": "[root] ibm_resource_instance.cos_instance", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_resource_instance.cos_instance", + "change": { + "actions": [ + "create" + ], + "after": { + "location": "global", + "name": "demo_cos_instance", + "parameters": null, + "plan": "standard", + "service": "cloud-object-storage", + "service_endpoints": null, + "timeouts": null + }, + "after_unknown": { + "crn": true, + "guid": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_id": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "tags": true + }, + "before": null + }, + "mode": "managed", + "name": "cos_instance", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_resource_instance", + "values": { + "location": "global", + "name": "demo_cos_instance", + "parameters": null, + "plan": "standard", + "service": "cloud-object-storage", + "service_endpoints": null, + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "cos_instance", + "simple_name": "ibm_resource_instance.cos_instance", + "svg_id": "node_16", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "kms", + "StartTime": "2020-12-07T05:54:04.000+00:82", + "TimeEstimation": "00:01:00", + "id": "5fcf5dd2b1d825100b8be166", + "name": "ibm_resource_instance", + "region": "us-south" + }, + "type": "ibm_resource_instance" + }, + { + "apply": { + "instances": [ + { + "attributes": { + "crn": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e::", + "guid": "0948eeee-1252-41a8-80b6-b7797b14ad4e", + "id": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e::", + "location": "us-south", + "name": "demo_KMS_instance", + "parameters": null, + "plan": "tiered-pricing", + "resource_controller_url": "https://cloud.ibm.com/services/", + "resource_crn": "crn:v1:bluemix:public:kms:us-south:a/93cd8038cd994fe29c0646a1ed609032:0948eeee-1252-41a8-80b6-b7797b14ad4e::", + "resource_group_id": "66e101aa10194a809c39227c95aa8e94", + "resource_group_name": "", + "resource_name": "demo_KMS_instance", + "resource_status": "active", + "service": "kms", + "service_endpoints": null, + "status": "active", + "tags": [], + "timeouts": null + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "kp_instance", + "provider": "provider.ibm", + "type": "ibm_resource_instance" + }, + "cluster": "root", + "cost": "no cost available", + "definition": { + "location": [ + "us-south" + ], + "name": [ + "demo_KMS_instance" + ], + "plan": [ + "tiered-pricing" + ], + "service": [ + "kms" + ] + }, + "group": 20000, + "label": "[root] ibm_resource_instance.kp_instance", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_resource_instance.kp_instance", + "change": { + "actions": [ + "create" + ], + "after": { + "location": "us-south", + "name": "demo_KMS_instance", + "parameters": null, + "plan": "tiered-pricing", + "resource_group_id": null, + "service": "kms", + "service_endpoints": null, + "timeouts": null + }, + "after_unknown": { + "crn": true, + "guid": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true, + "tags": true + }, + "before": null + }, + "mode": "managed", + "name": "kp_instance", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_resource_instance", + "values": { + "location": "us-south", + "name": "demo_KMS_instance", + "parameters": null, + "plan": "tiered-pricing", + "resource_group_id": null, + "service": "kms", + "service_endpoints": null, + "timeouts": null + } + }, + "policy": "no policy available", + "resource_name": "kp_instance", + "simple_name": "ibm_resource_instance.kp_instance", + "svg_id": "node_17", + "time": { + "AccuracyPercentage": 50, + "Action": "create", + "Day": "Tue", + "ServiceType": "kms", + "StartTime": "2020-12-07T05:54:04.000+00:82", + "TimeEstimation": "00:01:00", + "id": "5fcf5dd2b1d825100b8be166", + "name": "ibm_resource_instance", + "region": "us-south" + }, + "type": "ibm_resource_instance" + }, + { + "apply": {}, + "cluster": "root", + "cost": "no cost data available", + "definition": { + "generation": [ + 1 + ] + }, + "group": 20000, + "label": "[root] provider.ibm", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "policy": "no policy data available", + "resource_name": "ibm", + "simple_name": "provider.ibm", + "svg_id": "node_18", + "time": "no time estimation available", + "type": "provider" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_iam_user_policy.policy1_var_", + "cost": "no cost available", + "definition": { + "default": [ + "test1@in.ibm.com" + ] + }, + "group": 20000, + "label": "[root] var.user1", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "policy": "no policy available", + "resource_name": "user1", + "simple_name": "var.user1", + "svg_id": "node_19", + "time": "no time estimation available", + "type": "var" + }, + { + "apply": null, + "cluster": "cluster[root] ibm_iam_user_policy.policy2_var_", + "cost": "no cost available", + "definition": { + "default": [ + "test2@in.ibm.com" + ] + }, + "group": 20000, + "label": "[root] var.user2", + "module": "root", + "modules": [ + "root" + ], + "plan": null, + "policy": "no policy available", + "resource_name": "user2", + "simple_name": "var.user2", + "svg_id": "node_20", + "time": "no time estimation available", + "type": "var" + }, + { + "apply": {}, + "cluster": "root", + "cost": {}, + "definition": "", + "group": 20000, + "label": "[root] meta.count-boundary (EachMode fixup)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "policy": {}, + "resource_name": "count-boundary", + "simple_name": "meta.count-boundary (EachMode fixup)", + "svg_id": "node_21", + "time": {}, + "type": "meta" + }, + { + "apply": {}, + "cluster": "root", + "cost": {}, + "definition": { + "generation": [ + 1 + ] + }, + "group": 20000, + "label": "[root] provider.ibm (close)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "policy": {}, + "resource_name": "ibm", + "simple_name": "provider.ibm (close)", + "svg_id": "node_22", + "time": {}, + "type": "provider" + }, + { + "apply": {}, + "cluster": "root", + "cost": {}, + "definition": "", + "group": 20000, + "label": "[root] root", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "policy": {}, + "resource_name": "", + "simple_name": "root", + "svg_id": "node_23", + "time": {}, + "type": "" } - ] -} + ], + "totalcost": "269.1 USD", + "totaltime": "13:05:30" +} \ No newline at end of file diff --git a/blastradius/server/static/example/demo-2/demo-2.svg b/blastradius/server/static/example/demo-2/demo-2.svg index 4b8fb8a..6f7e508 100644 --- a/blastradius/server/static/example/demo-2/demo-2.svg +++ b/blastradius/server/static/example/demo-2/demo-2.svg @@ -1,365 +1,946 @@ - - - - -%3 - - + + + + + -[root] digitalocean_domain.mywebserver - -digitalocean_domain - -mywebserver - - - -[root] digitalocean_droplet.mywebserver - -digitalocean_droplet - -mywebserver - - +[root] ibm_cis.demo_web_domain + + + +ibm_cis              + + + + +demo_web_domain      + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:04:00   + + + +>_terraform apply          + + + + + +[root] ibm_resource_group.demo_group1 + + + +ibm_resource_group   + + + + +demo_group1          + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:00:04   + + + +>_terraform apply          + + + + -[root] digitalocean_domain.mywebserver->[root] digitalocean_droplet.mywebserver - - +[root] ibm_cis.demo_web_domain->[root] ibm_resource_group.demo_group1 + + - - -[root] provider.digitalocean - -provider - -digitalocean - - + + +[root] ibm_cis_domain.demo_web_domain + + + +ibm_cis_domain       + + + + +demo_web_domain      + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:04:01   + + + +>_terraform apply          + + + + -[root] digitalocean_droplet.mywebserver->[root] provider.digitalocean - - +[root] ibm_cis_domain.demo_web_domain->[root] ibm_cis.demo_web_domain + + - - -[root] var.do_ams3 - -var - -do_ams3 - - + + +[root] ibm_cis_domain_settings.demo_web_domain + + + +ibm_cis_domain_settings + + + + +demo_web_domain      + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:04:02   + + + +>_terraform apply          + + + + -[root] digitalocean_droplet.mywebserver->[root] var.do_ams3 - - - - - -[root] var.ubuntu - -var - -ubuntu +[root] ibm_cis_domain_settings.demo_web_domain->[root] ibm_cis_domain.demo_web_domain + + - + + +[root] ibm_container_bind_service.bind_service + + + +ibm_container_bind_service + + + + +bind_service         + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:05:00   + + + +>_terraform apply          + + + + + +[root] ibm_container_vpc_cluster.cluster + + + +ibm_container_vpc_cluster + + + + +cluster              + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +269.1 USD + + + +>_estimate time            + +13:00:00   + + + +>_terraform apply          + + + + -[root] digitalocean_droplet.mywebserver->[root] var.ubuntu - - - - - -[root] digitalocean_record.mywebserver - -digitalocean_record - -mywebserver +[root] ibm_container_bind_service.bind_service->[root] ibm_container_vpc_cluster.cluster + + - + + +[root] ibm_resource_instance.cos_instance + + + +ibm_resource_instance + + + + +cos_instance         + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:01:00   + + + +>_terraform apply          + + + + -[root] digitalocean_record.mywebserver->[root] digitalocean_domain.mywebserver - - - - - -[root] meta.count-boundary (count boundary fixup) - -meta - -count-boundary +[root] ibm_container_bind_service.bind_service->[root] ibm_resource_instance.cos_instance + + - + + +[root] ibm_is_subnet.subnet1 + + + +ibm_is_subnet        + + + + +subnet1              + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +0 USD      + + + +>_estimate time            + +00:00:12   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] digitalocean_record.mywebserver - - - - - -[root] output.Name - -output - -Name +[root] ibm_container_vpc_cluster.cluster->[root] ibm_is_subnet.subnet1 + + - + -[root] meta.count-boundary (count boundary fixup)->[root] output.Name - - +[root] ibm_container_vpc_cluster.cluster->[root] ibm_resource_group.demo_group1 + + - - -[root] output.Public ip - -output - -Public - - + + +[root] ibm_cos_bucket.standard-ams03 + + + +ibm_cos_bucket       + + + + +standard-ams03       + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:00:12   + + + +>_terraform apply          + + + + + +[root] ibm_kp_key.cos_encrypt + + + +ibm_kp_key           + + + + +cos_encrypt          + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:00:02   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] output.Public ip - - +[root] ibm_cos_bucket.standard-ams03->[root] ibm_kp_key.cos_encrypt + + - - -[root] var.centos - -var - -centos - - + -[root] meta.count-boundary (count boundary fixup)->[root] var.centos - - - - - -[root] var.coreos - -var - -coreos +[root] ibm_cos_bucket.standard-ams03->[root] ibm_resource_instance.cos_instance + + - + + +[root] ibm_iam_authorization_policy.policy + + + +ibm_iam_authorization_policy + + + + +policy               + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:02:05   + + + +>_terraform apply          + + + + + +[root] ibm_iam_service_id.serviceID + + + +ibm_iam_service_id   + + + + +serviceID            + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:02:09   + + + +>_terraform apply          + + + + + +[root] ibm_iam_service_policy.policy + + + +ibm_iam_service_policy + + + + +policy               + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:02:10   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.coreos - - - - - -[root] var.do_ams2 - -var - -do_ams2 +[root] ibm_iam_service_policy.policy->[root] ibm_iam_service_id.serviceID + + - + + +[root] ibm_iam_user_policy.policy1 + + + +ibm_iam_user_policy + + + + +policy1              + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:02:07   + + + +>_terraform apply          + + + + + +[root] ibm_iam_user_policy.policy2 + + + +ibm_iam_user_policy + + + + +policy2              + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:02:07   + + + +>_terraform apply          + + + + + +[root] ibm_is_vpc.vpc1 + + + +ibm_is_vpc           + + + + +vpc1                 + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +0 USD      + + + +>_estimate time            + +00:00:18   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_ams2 - - +[root] ibm_is_subnet.subnet1->[root] ibm_is_vpc.vpc1 + + - + -[root] var.do_blr1 - -var - -do_blr1 - - +[root] ibm_is_subnet.subnet2 + + + +ibm_is_subnet        + + + + +subnet2              + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +0 USD      + + + +>_estimate time            + +00:00:12   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_blr1 - - - - - -[root] var.do_fra1 - -var - -do_fra1 +[root] ibm_is_subnet.subnet2->[root] ibm_is_vpc.vpc1 + + - + + +[root] ibm_resource_instance.kp_instance + + + +ibm_resource_instance + + + + +kp_instance          + + + + +>_terraform plan           + + + + + +>_controls verify           + + + + + +>_estimate cost            + +N/A        + + + +>_estimate time            + +00:01:00   + + + +>_terraform apply          + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_fra1 - - +[root] ibm_kp_key.cos_encrypt->[root] ibm_resource_instance.kp_instance + + - - -[root] var.do_lon1 - -var - -do_lon1 - - + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_lon1 - - - - - -[root] var.do_nyc1 - -var - -do_nyc1 +[root] ibm_resource_instance.cos_instance->[root] ibm_resource_group.demo_group1 + + - + + +[root] root + +[root] root + +269.1 USD + +13:05:30 + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_nyc1 - - +[root] root->[root] ibm_cis_domain_settings.demo_web_domain + + - - -[root] var.do_nyc2 - -var - -do_nyc2 - - + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_nyc2 - - - - - -[root] var.do_nyc3 - -var - -do_nyc3 +[root] root->[root] ibm_container_bind_service.bind_service + + - + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_nyc3 - - +[root] root->[root] ibm_cos_bucket.standard-ams03 + + - - -[root] var.do_sfo1 - -var - -do_sfo1 - - + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_sfo1 - - - - - -[root] var.do_sgp1 - -var - -do_sgp1 - - +[root] root->[root] ibm_iam_authorization_policy.policy + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_sgp1 - - - - - -[root] var.do_tor1 - -var - -do_tor1 - - +[root] root->[root] ibm_iam_service_policy.policy + + + + -[root] meta.count-boundary (count boundary fixup)->[root] var.do_tor1 - - +[root] root->[root] ibm_iam_user_policy.policy1 + + - + -[root] output.Name->[root] digitalocean_droplet.mywebserver - - +[root] root->[root] ibm_iam_user_policy.policy2 + + - + -[root] output.Public ip->[root] digitalocean_droplet.mywebserver - - - - - -[root] provider.digitalocean (close) - -provider - -digitalocean - - - -[root] provider.digitalocean (close)->[root] digitalocean_record.mywebserver - - - - - -[root] provisioner.remote-exec (close) - -provisioner - -remote-exec - - - -[root] provisioner.remote-exec (close)->[root] digitalocean_droplet.mywebserver - - - - - -[root] root - -[root] root - - - -[root] root->[root] meta.count-boundary (count boundary fixup) - - - - - -[root] root->[root] provider.digitalocean (close) - - - - - -[root] root->[root] provisioner.remote-exec (close) - - +[root] root->[root] ibm_is_subnet.subnet2 + + diff --git a/blastradius/server/static/example/demo-2/demonew-2.svg b/blastradius/server/static/example/demo-2/demonew-2.svg new file mode 100644 index 0000000..32cd77c --- /dev/null +++ b/blastradius/server/static/example/demo-2/demonew-2.svg @@ -0,0 +1,120 @@ + + + + + + +%3 + + +cluster[root] ibm_container_vpc_cluster.k8s_cluster_var_ + + + +[root] ibm_container_vpc_cluster.k8s_cluster + +ibm_container_vpc_cluster + + +-/+ + + +k8s_cluster + + + +[root] provider.ibm + +provider + + +ibm + + + +[root] ibm_container_vpc_cluster.k8s_cluster->[root] provider.ibm + + + + + +[root] var.subnets + +var + + +subnets + + + +[root] ibm_container_vpc_cluster.k8s_cluster->[root] var.subnets + + + + + +[root] meta.count-boundary (EachMode fixup) + +meta + + +count-boundary + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_container_vpc_cluster.k8s_cluster + + + + + +[root] provider.ibm (close) + +provider + + +ibm + + + +[root] provider.ibm (close)->[root] ibm_container_vpc_cluster.k8s_cluster + + + + + +[root] root + +[root] root + + + +[root] root->[root] meta.count-boundary (EachMode fixup) + + + + + +[root] root->[root] provider.ibm (close) + + + + + +[root] var.vpc + +var + + +vpc + + + +[root] var.subnets->[root] var.vpc + + + + diff --git a/blastradius/server/static/example/demo-3/demo-3.json b/blastradius/server/static/example/demo-3/demo-3.json index e8714b3..562a496 100644 --- a/blastradius/server/static/example/demo-3/demo-3.json +++ b/blastradius/server/static/example/demo-3/demo-3.json @@ -1,437 +1,267 @@ { - "nodes": [ + "edges": [ { - "simple_name": "aws_elb.web", - "definition": {}, - "svg_id": "node_0", - "group": 20000, - "label": "[root] aws_elb.web", - "resource_name": "web", - "type": "aws_elb", - "def": { - "name": "terraform-example-elb", - "subnets": [ - "${aws_subnet.default.id}" - ], - "security_groups": [ - "${aws_security_group.elb.id}" - ], - "instances": [ - "${aws_instance.web.id}" - ], - "listener": { - "instance_port": 80, - "instance_protocol": "http", - "lb_port": 80, - "lb_protocol": "http" - } - } + "edge_type": 1, + "source": "[root] ibm_kp_key.test", + "svg_id": "edge_0", + "target": "[root] ibm_resource_instance.kp_instance" }, { - "simple_name": "aws_instance.web", - "definition": {}, - "svg_id": "node_1", - "group": 20000, - "label": "[root] aws_instance.web", - "resource_name": "web", - "type": "aws_instance", - "def": { - "connection": { - "user": "ubuntu" - }, - "instance_type": "t2.micro", - "ami": "${lookup(var.aws_amis, var.aws_region)}", - "key_name": "${aws_key_pair.auth.id}", - "vpc_security_group_ids": [ - "${aws_security_group.default.id}" - ], - "subnet_id": "${aws_subnet.default.id}", - "provisioner": { - "remote-exec": { - "inline": [ - "sudo apt-get -y update", - "sudo apt-get -y install nginx", - "sudo service nginx start" - ] - } - } - } + "edge_type": 1, + "source": "[root] ibm_resource_instance.kp_instance", + "svg_id": "edge_1", + "target": "[root] provider.ibm" }, { - "simple_name": "aws_internet_gateway.default", - "definition": {}, - "svg_id": "node_2", - "group": 20000, - "label": "[root] aws_internet_gateway.default", - "resource_name": "default", - "type": "aws_internet_gateway", - "def": { - "vpc_id": "${aws_vpc.default.id}" - } + "edge_type": 1, + "source": "[root] meta.count-boundary (EachMode fixup)", + "svg_id": "edge_2", + "target": "[root] ibm_kp_key.test" }, { - "simple_name": "aws_key_pair.auth", - "definition": {}, - "svg_id": "node_3", - "group": 20000, - "label": "[root] aws_key_pair.auth", - "resource_name": "auth", - "type": "aws_key_pair", - "def": { - "key_name": "${var.key_name}", - "public_key": "${file(var.public_key_path)}" - } + "edge_type": 1, + "source": "[root] provider.ibm (close)", + "svg_id": "edge_3", + "target": "[root] ibm_kp_key.test" }, { - "simple_name": "aws_route.internet_access", - "definition": {}, - "svg_id": "node_4", - "group": 20000, - "label": "[root] aws_route.internet_access", - "resource_name": "internet_access", - "type": "aws_route", - "def": { - "route_table_id": "${aws_vpc.default.main_route_table_id}", - "destination_cidr_block": "0.0.0.0/0", - "gateway_id": "${aws_internet_gateway.default.id}" - } + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_4", + "target": "[root] meta.count-boundary (EachMode fixup)" }, { - "simple_name": "aws_security_group.default", - "definition": {}, - "svg_id": "node_5", - "group": 20000, - "label": "[root] aws_security_group.default", - "resource_name": "default", - "type": "aws_security_group", - "def": { - "name": "terraform_example", - "description": "Used in the terraform", - "vpc_id": "${aws_vpc.default.id}", - "ingress": [ - { - "from_port": 22, - "to_port": 22, - "protocol": "tcp", - "cidr_blocks": [ - "0.0.0.0/0" - ] - }, - { - "from_port": 80, - "to_port": 80, - "protocol": "tcp", - "cidr_blocks": [ - "10.0.0.0/16" - ] - } - ], - "egress": { - "from_port": 0, - "to_port": 0, - "protocol": "-1", - "cidr_blocks": [ - "0.0.0.0/0" - ] - } - } - }, + "edge_type": 1, + "source": "[root] root", + "svg_id": "edge_5", + "target": "[root] provider.ibm (close)" + } + ], + "nodes": [ { - "simple_name": "aws_security_group.elb", - "definition": {}, - "svg_id": "node_6", + "apply": null, + "cluster": "root", + "definition": { + "key_name": "ckey1", + "key_protect_id": "${ibm_resource_instance.kp_instance.guid}", + "standard_key": false + }, "group": 20000, - "label": "[root] aws_security_group.elb", - "resource_name": "elb", - "type": "aws_security_group", - "def": { - "name": "terraform_example_elb", - "description": "Used in the terraform", - "vpc_id": "${aws_vpc.default.id}", - "ingress": { - "from_port": 80, - "to_port": 80, - "protocol": "tcp", - "cidr_blocks": [ - "0.0.0.0/0" - ] + "label": "[root] ibm_kp_key.test", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_kp_key.test", + "change": { + "actions": [ + "create" + ], + "after": { + "encrypted_nonce": null, + "iv_value": null, + "key_name": "ckey1", + "standard_key": false, + "timeouts": null + }, + "after_unknown": { + "crn": true, + "id": true, + "key_id": true, + "key_protect_id": true, + "payload": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true + }, + "before": null }, - "egress": { - "from_port": 0, - "to_port": 0, - "protocol": "-1", - "cidr_blocks": [ - "0.0.0.0/0" - ] + "mode": "managed", + "name": "test", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_kp_key", + "values": { + "encrypted_nonce": null, + "iv_value": null, + "key_name": "ckey1", + "standard_key": false, + "timeouts": null } - } - }, - { - "simple_name": "aws_subnet.default", - "definition": {}, - "svg_id": "node_7", - "group": 20000, - "label": "[root] aws_subnet.default", - "resource_name": "default", - "type": "aws_subnet", - "def": { - "vpc_id": "${aws_vpc.default.id}", - "cidr_block": "10.0.1.0/24", - "map_public_ip_on_launch": true - } - }, - { - "simple_name": "aws_vpc.default", - "definition": {}, - "svg_id": "node_8", - "group": 20000, - "label": "[root] aws_vpc.default", - "resource_name": "default", - "type": "aws_vpc", - "def": { - "cidr_block": "10.0.0.0/16" - } - }, - { - "simple_name": "provider.aws", - "definition": {}, - "svg_id": "node_9", - "group": 20000, - "label": "[root] provider.aws", - "resource_name": "aws", - "type": "provider", - "def": [] + }, + "resource_name": "test", + "simple_name": "ibm_kp_key.test", + "svg_id": "node_0", + "type": "ibm_kp_key" }, { - "simple_name": "var.aws_amis", - "definition": {}, - "svg_id": "node_10", + "apply": { + "instances": [ + { + "attributes": { + "crn": "crn:v1:bluemix:public:kms:us-east:a/b9687c7011984685a20a8d25dfbea11b:98eebade-9330-4933-a67e-ff04c28a2fb0::", + "guid": "98eebade-9330-4933-a67e-ff04c28a2fb0", + "id": "crn:v1:bluemix:public:kms:us-east:a/b9687c7011984685a20a8d25dfbea11b:98eebade-9330-4933-a67e-ff04c28a2fb0::", + "location": "us-east", + "name": "tid", + "parameters": null, + "plan": "tiered-pricing", + "resource_controller_url": "https://cloud.ibm.com/services/", + "resource_crn": "crn:v1:bluemix:public:kms:us-east:a/b9687c7011984685a20a8d25dfbea11b:98eebade-9330-4933-a67e-ff04c28a2fb0::", + "resource_group_id": "ef0169d5f6ff45a8866ce5ff857aa7d1", + "resource_group_name": "", + "resource_name": "tid", + "resource_status": "active", + "service": "kms", + "service_endpoints": null, + "status": "active", + "tags": null, + "timeouts": null + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", + "schema_version": 0 + } + ], + "mode": "managed", + "name": "kp_instance", + "provider": "provider.ibm", + "type": "ibm_resource_instance" + }, + "cluster": "root", + "definition": { + "location": "us-east", + "name": "tid", + "plan": "tiered-pricing", + "service": "kms" + }, "group": 20000, - "label": "[root] var.aws_amis", - "resource_name": "aws_amis", - "type": "var", - "def": { - "default": { - "eu-west-1": "ami-674cbc1e", - "us-east-1": "ami-1d4e7a66", - "us-west-1": "ami-969ab1f6", - "us-west-2": "ami-8803e0f0" + "label": "[root] ibm_resource_instance.kp_instance", + "module": "root", + "modules": [ + "root" + ], + "plan": { + "address": "ibm_resource_instance.kp_instance", + "change": { + "actions": [ + "create" + ], + "after": { + "location": "us-east", + "name": "tid", + "parameters": null, + "plan": "tiered-pricing", + "resource_group_id": null, + "service": "kms", + "service_endpoints": null, + "tags": null, + "timeouts": null + }, + "after_unknown": { + "crn": true, + "guid": true, + "id": true, + "resource_controller_url": true, + "resource_crn": true, + "resource_group_name": true, + "resource_name": true, + "resource_status": true, + "status": true + }, + "before": null + }, + "mode": "managed", + "name": "kp_instance", + "provider_name": "ibm", + "schema_version": 0, + "type": "ibm_resource_instance", + "values": { + "location": "us-east", + "name": "tid", + "parameters": null, + "plan": "tiered-pricing", + "resource_group_id": null, + "service": "kms", + "service_endpoints": null, + "tags": null, + "timeouts": null } - } - }, - { - "simple_name": "var.key_name", - "definition": {}, - "svg_id": "node_11", - "group": 20000, - "label": "[root] var.key_name", - "resource_name": "key_name", - "type": "var", - "def": { - "description": "Desired name of AWS key pair" - } + }, + "resource_name": "kp_instance", + "simple_name": "ibm_resource_instance.kp_instance", + "svg_id": "node_1", + "type": "ibm_resource_instance" }, { - "simple_name": "var.public_key_path", - "definition": {}, - "svg_id": "node_12", + "apply": {}, + "cluster": "root", + "definition": { + "ibmcloud_api_key": "BEhDmmepkTNxWCToEuxiLugho-TIDAIRxAiSQOUcJof-" + }, "group": 20000, - "label": "[root] var.public_key_path", - "resource_name": "public_key_path", - "type": "var", - "def": { - "description": "Path to the SSH public key to be used for authentication.\nEnsure this keypair is added to your local SSH agent so provisioners can\nconnect.\n\nExample: ~/.ssh/terraform.pub" - } + "label": "[root] provider.ibm", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "ibm", + "simple_name": "provider.ibm", + "svg_id": "node_2", + "type": "provider" }, { - "simple_name": "meta.count-boundary (count boundary fixup)", - "definition": {}, - "svg_id": "node_13", + "apply": {}, + "cluster": "root", + "definition": "", "group": 20000, - "label": "[root] meta.count-boundary (count boundary fixup)", + "label": "[root] meta.count-boundary (EachMode fixup)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, "resource_name": "count-boundary", - "type": "meta", - "def": [] - }, - { - "simple_name": "output.address", - "definition": {}, - "svg_id": "node_14", - "group": 20000, - "label": "[root] output.address", - "resource_name": "address", - "type": "output", - "def": [] - }, - { - "simple_name": "provider.aws (close)", - "definition": {}, - "svg_id": "node_15", - "group": 20000, - "label": "[root] provider.aws (close)", - "resource_name": "aws", - "type": "provider", - "def": [] - }, - { - "simple_name": "var.aws_region", - "definition": {}, - "svg_id": "node_16", - "group": 20000, - "label": "[root] var.aws_region", - "resource_name": "aws_region", - "type": "var", - "def": { - "description": "AWS region to launch servers.", - "default": "us-west-2" - } + "simple_name": "meta.count-boundary (EachMode fixup)", + "svg_id": "node_3", + "type": "meta" }, { - "simple_name": "provisioner.remote-exec (close)", - "definition": {}, - "svg_id": "node_17", + "apply": {}, + "cluster": "root", + "definition": { + "ibmcloud_api_key": "BEhDmmepkTNxWCToEuxiLugho-TIDAIRxAiSQOUcJof-" + }, "group": 20000, - "label": "[root] provisioner.remote-exec (close)", - "resource_name": "remote-exec", - "type": "provisioner", - "def": [] + "label": "[root] provider.ibm (close)", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, + "resource_name": "ibm", + "simple_name": "provider.ibm (close)", + "svg_id": "node_4", + "type": "provider" }, { - "simple_name": "root", - "definition": {}, - "svg_id": "node_18", + "apply": {}, + "cluster": "root", + "definition": "", "group": 20000, "label": "[root] root", + "module": "root", + "modules": [ + "root" + ], + "plan": {}, "resource_name": "", - "type": "", - "def": [] - } - ], - "edges": [ - { - "target": "[root] aws_instance.web", - "source": "[root] aws_elb.web", - "svg_id": "edge_0" - }, - { - "target": "[root] aws_security_group.elb", - "source": "[root] aws_elb.web", - "svg_id": "edge_1" - }, - { - "target": "[root] aws_key_pair.auth", - "source": "[root] aws_instance.web", - "svg_id": "edge_2" - }, - { - "target": "[root] aws_security_group.default", - "source": "[root] aws_instance.web", - "svg_id": "edge_3" - }, - { - "target": "[root] aws_subnet.default", - "source": "[root] aws_instance.web", - "svg_id": "edge_4" - }, - { - "target": "[root] var.aws_amis", - "source": "[root] aws_instance.web", - "svg_id": "edge_5" - }, - { - "target": "[root] aws_vpc.default", - "source": "[root] aws_internet_gateway.default", - "svg_id": "edge_6" - }, - { - "target": "[root] provider.aws", - "source": "[root] aws_key_pair.auth", - "svg_id": "edge_7" - }, - { - "target": "[root] var.key_name", - "source": "[root] aws_key_pair.auth", - "svg_id": "edge_8" - }, - { - "target": "[root] var.public_key_path", - "source": "[root] aws_key_pair.auth", - "svg_id": "edge_9" - }, - { - "target": "[root] aws_internet_gateway.default", - "source": "[root] aws_route.internet_access", - "svg_id": "edge_10" - }, - { - "target": "[root] aws_vpc.default", - "source": "[root] aws_security_group.default", - "svg_id": "edge_11" - }, - { - "target": "[root] aws_vpc.default", - "source": "[root] aws_security_group.elb", - "svg_id": "edge_12" - }, - { - "target": "[root] aws_vpc.default", - "source": "[root] aws_subnet.default", - "svg_id": "edge_13" - }, - { - "target": "[root] provider.aws", - "source": "[root] aws_vpc.default", - "svg_id": "edge_14" - }, - { - "target": "[root] aws_route.internet_access", - "source": "[root] meta.count-boundary (count boundary fixup)", - "svg_id": "edge_15" - }, - { - "target": "[root] output.address", - "source": "[root] meta.count-boundary (count boundary fixup)", - "svg_id": "edge_16" - }, - { - "target": "[root] aws_elb.web", - "source": "[root] output.address", - "svg_id": "edge_17" - }, - { - "target": "[root] aws_elb.web", - "source": "[root] provider.aws (close)", - "svg_id": "edge_18" - }, - { - "target": "[root] aws_route.internet_access", - "source": "[root] provider.aws (close)", - "svg_id": "edge_19" - }, - { - "target": "[root] var.aws_region", - "source": "[root] provider.aws", - "svg_id": "edge_20" - }, - { - "target": "[root] aws_instance.web", - "source": "[root] provisioner.remote-exec (close)", - "svg_id": "edge_21" - }, - { - "target": "[root] meta.count-boundary (count boundary fixup)", - "source": "[root] root", - "svg_id": "edge_22" - }, - { - "target": "[root] provider.aws (close)", - "source": "[root] root", - "svg_id": "edge_23" - }, - { - "target": "[root] provisioner.remote-exec (close)", - "source": "[root] root", - "svg_id": "edge_24" + "simple_name": "root", + "svg_id": "node_5", + "type": "" } ] } diff --git a/blastradius/server/static/example/demo-3/demo-3.svg b/blastradius/server/static/example/demo-3/demo-3.svg index 7a68abe..1caca7a 100644 --- a/blastradius/server/static/example/demo-3/demo-3.svg +++ b/blastradius/server/static/example/demo-3/demo-3.svg @@ -1,313 +1,95 @@ - - - + + %3 - - + + -[root] aws_elb.web - -aws_elb - -web +[root] ibm_kp_key.test + +ibm_kp_key + +test - + -[root] aws_instance.web - -aws_instance - -web +[root] ibm_resource_instance.kp_instance + +ibm_resource_instance + +kp_instance - + -[root] aws_elb.web->[root] aws_instance.web - - +[root] ibm_kp_key.test->[root] ibm_resource_instance.kp_instance + + - - -[root] aws_security_group.elb - -aws_security_group - -elb + + +[root] provider.ibm + +provider + +ibm - + -[root] aws_elb.web->[root] aws_security_group.elb - - +[root] ibm_resource_instance.kp_instance->[root] provider.ibm + + - + -[root] aws_key_pair.auth - -aws_key_pair - -auth +[root] meta.count-boundary (EachMode fixup) + +meta + +count-boundary - + -[root] aws_instance.web->[root] aws_key_pair.auth - - - - - -[root] aws_security_group.default - -aws_security_group - -default - - - -[root] aws_instance.web->[root] aws_security_group.default - - - - - -[root] aws_subnet.default - -aws_subnet - -default - - - -[root] aws_instance.web->[root] aws_subnet.default - - - - - -[root] var.aws_amis - -var - -aws_amis - - - -[root] aws_instance.web->[root] var.aws_amis - - - - - -[root] aws_internet_gateway.default - -aws_internet_gateway - -default - - - -[root] aws_vpc.default - -aws_vpc - -default - - - -[root] aws_internet_gateway.default->[root] aws_vpc.default - - - - - -[root] provider.aws - -provider - -aws - - - -[root] aws_key_pair.auth->[root] provider.aws - - - - - -[root] var.key_name - -var - -key_name - - - -[root] aws_key_pair.auth->[root] var.key_name - - - - - -[root] var.public_key_path - -var - -public_key_path - - - -[root] aws_key_pair.auth->[root] var.public_key_path - - +[root] meta.count-boundary (EachMode fixup)->[root] ibm_kp_key.test + + - + -[root] aws_route.internet_access - -aws_route - -internet_access +[root] provider.ibm (close) + +provider + +ibm - - -[root] aws_route.internet_access->[root] aws_internet_gateway.default - - - - - -[root] aws_security_group.default->[root] aws_vpc.default - - - - - -[root] aws_security_group.elb->[root] aws_vpc.default - - - - - -[root] aws_subnet.default->[root] aws_vpc.default - - - - - -[root] aws_vpc.default->[root] provider.aws - - - - - -[root] var.aws_region - -var - -aws_region - - - -[root] provider.aws->[root] var.aws_region - - - - - -[root] meta.count-boundary (count boundary fixup) - -meta - -count-boundary - - - -[root] meta.count-boundary (count boundary fixup)->[root] aws_route.internet_access - - - - - -[root] output.address - -output - -address - - - -[root] meta.count-boundary (count boundary fixup)->[root] output.address - - - - - -[root] output.address->[root] aws_elb.web - - - - - -[root] provider.aws (close) - -provider - -aws - - - -[root] provider.aws (close)->[root] aws_elb.web - - - - - -[root] provider.aws (close)->[root] aws_route.internet_access - - - - - -[root] provisioner.remote-exec (close) - -provisioner - -remote-exec - - - -[root] provisioner.remote-exec (close)->[root] aws_instance.web - - + + +[root] provider.ibm (close)->[root] ibm_kp_key.test + + - + [root] root - -[root] root - - - -[root] root->[root] meta.count-boundary (count boundary fixup) - - + +[root] root - - -[root] root->[root] provider.aws (close) - - + + +[root] root->[root] meta.count-boundary (EachMode fixup) + + - - -[root] root->[root] provisioner.remote-exec (close) - - + + +[root] root->[root] provider.ibm (close) + + diff --git a/blastradius/server/static/example/demo-3/demonew-3.svg b/blastradius/server/static/example/demo-3/demonew-3.svg new file mode 100644 index 0000000..8e65231 --- /dev/null +++ b/blastradius/server/static/example/demo-3/demonew-3.svg @@ -0,0 +1,106 @@ + + + + + + +%3 + + + +[root] ibm_kp_key.test + +ibm_kp_key + + ++ + + +test + + + +[root] ibm_resource_instance.kp_instance + +ibm_resource_instance + + ++ + + +kp_instance + + + +[root] ibm_kp_key.test->[root] ibm_resource_instance.kp_instance + + + + + +[root] provider.ibm + +provider + + +ibm + + + +[root] ibm_resource_instance.kp_instance->[root] provider.ibm + + + + + +[root] meta.count-boundary (EachMode fixup) + +meta + + +count-boundary + + + +[root] meta.count-boundary (EachMode fixup)->[root] ibm_kp_key.test + + + + + +[root] provider.ibm (close) + +provider + + +ibm + + + +[root] provider.ibm (close)->[root] ibm_kp_key.test + + + + + +[root] root + +[root] root + + + +[root] root->[root] meta.count-boundary (EachMode fixup) + + + + + +[root] root->[root] provider.ibm (close) + + + + + diff --git a/blastradius/server/static/images/.DS_Store b/blastradius/server/static/images/.DS_Store new file mode 100644 index 0000000..ad1a1ab Binary files /dev/null and b/blastradius/server/static/images/.DS_Store differ diff --git a/blastradius/server/static/images/COS_Icon.png b/blastradius/server/static/images/COS_Icon.png new file mode 100644 index 0000000..9d79eb4 Binary files /dev/null and b/blastradius/server/static/images/COS_Icon.png differ diff --git a/blastradius/server/static/images/apply.png b/blastradius/server/static/images/apply.png new file mode 100644 index 0000000..0f47e43 Binary files /dev/null and b/blastradius/server/static/images/apply.png differ diff --git a/blastradius/server/static/images/controls.png b/blastradius/server/static/images/controls.png new file mode 100644 index 0000000..4204905 Binary files /dev/null and b/blastradius/server/static/images/controls.png differ diff --git a/blastradius/server/static/images/correct.png b/blastradius/server/static/images/correct.png new file mode 100644 index 0000000..03f51ab Binary files /dev/null and b/blastradius/server/static/images/correct.png differ diff --git a/blastradius/server/static/images/cost.png b/blastradius/server/static/images/cost.png new file mode 100644 index 0000000..b1bb83b Binary files /dev/null and b/blastradius/server/static/images/cost.png differ diff --git a/blastradius/server/static/images/diagram.png b/blastradius/server/static/images/diagram.png new file mode 100644 index 0000000..39736aa Binary files /dev/null and b/blastradius/server/static/images/diagram.png differ diff --git a/blastradius/server/static/images/error.png b/blastradius/server/static/images/error.png new file mode 100644 index 0000000..55d5cd0 Binary files /dev/null and b/blastradius/server/static/images/error.png differ diff --git a/blastradius/server/static/images/hourglass.png b/blastradius/server/static/images/hourglass.png new file mode 100644 index 0000000..55f9af5 Binary files /dev/null and b/blastradius/server/static/images/hourglass.png differ diff --git a/blastradius/server/static/images/instance.png b/blastradius/server/static/images/instance.png new file mode 100644 index 0000000..37108a1 Binary files /dev/null and b/blastradius/server/static/images/instance.png differ diff --git a/blastradius/server/static/images/kp.png b/blastradius/server/static/images/kp.png new file mode 100644 index 0000000..ca40303 Binary files /dev/null and b/blastradius/server/static/images/kp.png differ diff --git a/blastradius/server/static/images/kubernetes.png b/blastradius/server/static/images/kubernetes.png new file mode 100644 index 0000000..e227007 Binary files /dev/null and b/blastradius/server/static/images/kubernetes.png differ diff --git a/blastradius/server/static/images/plan.png b/blastradius/server/static/images/plan.png new file mode 100644 index 0000000..efaeff6 Binary files /dev/null and b/blastradius/server/static/images/plan.png differ diff --git a/blastradius/server/static/images/policy.png b/blastradius/server/static/images/policy.png new file mode 100644 index 0000000..3ed79e1 Binary files /dev/null and b/blastradius/server/static/images/policy.png differ diff --git a/blastradius/server/static/images/resource.png b/blastradius/server/static/images/resource.png new file mode 100644 index 0000000..30ffb3d Binary files /dev/null and b/blastradius/server/static/images/resource.png differ diff --git a/blastradius/server/static/images/time.png b/blastradius/server/static/images/time.png new file mode 100644 index 0000000..780193e Binary files /dev/null and b/blastradius/server/static/images/time.png differ diff --git a/blastradius/server/static/images/vpc.png b/blastradius/server/static/images/vpc.png new file mode 100644 index 0000000..790117f Binary files /dev/null and b/blastradius/server/static/images/vpc.png differ diff --git a/blastradius/server/static/js/blast-radius-ext.js b/blastradius/server/static/js/blast-radius-ext.js new file mode 100644 index 0000000..8ed5255 --- /dev/null +++ b/blastradius/server/static/js/blast-radius-ext.js @@ -0,0 +1,858 @@ +// +// terraform-graph.js +// +// enumerate the various kinds of edges that Blast Radius understands. +// only NORMAL and LAYOUT_SHOWN will show up in the , but all four +// will likely appear in the json representation. +var edge_types = { + NORMAL : 1, // what we talk about when we're talking about edges. + HIDDEN : 2, // these are normal edges, but aren't drawn. + LAYOUT_SHOWN : 3, // these edges are drawn, but aren't "real" edges + LAYOUT_HIDDEN : 4, // these edges are not drawn, aren't "real" edges, but inform layout. +} + +// Sometimes we have escaped newlines (\n) in json strings. we want
instead. +// FIXME: much better line wrapping is probably possible. +var replacer = function (key, value) { + if (typeof value == 'string') { + return value.replace(/\n/g, '
'); + } + return value; +} + +build_uri = function(url, params) { + url += '?' + for (var key in params) + url += key + '=' + params[key] + '&'; + return url.slice(0,-1); +} + +var to_list = function(obj) { + var lst = []; + for (var k in obj) + lst.push(obj[k]); + return lst; +} + +var Queue = function() { + this._oldestIndex = 1; + this._newestIndex = 1; + this._storage = {}; +} + +Queue.prototype.size = function() { + return this._newestIndex - this._oldestIndex; +}; + +Queue.prototype.enqueue = function(data) { + this._storage[this._newestIndex] = data; + this._newestIndex++; +}; + +Queue.prototype.dequeue = function() { + var oldestIndex = this._oldestIndex, + newestIndex = this._newestIndex, + deletedData; + + if (oldestIndex !== newestIndex) { + deletedData = this._storage[oldestIndex]; + delete this._storage[oldestIndex]; + this._oldestIndex++; + + return deletedData; + } +}; + +// Takes a unique selector, e.g. "#demo-1", and +// appends svg xml from svg_url, and takes graph +// info from json_url to highlight/annotate it. + +blastradiusnew = function (selector, svg_url, json_url,br_state) { + + // TODO: remove scale. + scale = null + + // mainly for d3-tips + class_selector = '.' + selector.slice(1,selector.length); + + + // we should have an object to keep track of state with, but if we + // don't, just fudge one. + if (! br_state) { + var br_state = {}; + } + + // if we haven't already got an entry in br_state to manage our + // state with, go ahead and create one. + if (! br_state[selector]) { + br_state[selector] = {}; + } + + var state = br_state[selector]; + var container = d3.select(selector); + + // color assignments (resource_type : rgb) are stateful. If we use a new palette + // every time the a subgraph is selected, the color assignments would differ and + // become confusing. + var color = (state['color'] ? state['color'] : d3.scaleOrdinal(d3['schemeCategory20'])); + state['color'] = color; + + // console.log(color); + + // 1st pull down the svg, and append it to the DOM as a child + // of our selector. If added as , we wouldn't + // be able to manipulate x.svg with d3.js, or other DOM fns. + d3.xml(svg_url, function (error, xml) { + + d3.select(selector).selectAll("svg").remove(); + + container.node() + .appendChild(document.importNode(xml.documentElement, true)); + + // remove s in svg; graphviz leaves these here and they + // trigger useless tooltips. + d3.select(selector).selectAll('title').remove(); + + // remove any d3-tips we've left lying around + d3.selectAll(class_selector + '-d3-tip').remove(); + + // make sure the svg uses 100% of the viewport, so that pan/zoom works + // as expected and there's no clipping. + d3.select(selector + ' svg').attr('width', '100%').attr('height', '100%'); + + // Obtain the graph description. Doing this within the + // d3.xml success callback, to guaruntee the svg/xml + // has loaded. + + d3.json(json_url, function (error, data) { + var edges = data.edges; + var svg_nodes = []; + var nodes = {}; + data.nodes.forEach(function (node) { + if (!(node.type in resource_groups)) + console.log(node.type) + if (node.label == '[root] root') { // FIXME: w/ tf 0.11.2, resource_name not set by server. + node.resource_name = 'root'; + } + node.group = (node.type in resource_groups) ? resource_groups[node.type] : -1; + nodes[node['label']] = node; + svg_nodes.push(node); + }); + + // convenient to access edges by their source. + var edges_by_source = {} + for (var i in edges) { + if(edges[i].source in edges_by_source) + edges_by_source[edges[i].source].push(edges[i]); + else + edges_by_source[edges[i].source] = [edges[i]]; + } + + // convenient access to edges by their target. + var edges_by_target = {} + for (var i in edges) { + if(edges[i].target in edges_by_target) + edges_by_target[edges[i].target].push(edges[i]); + else + edges_by_target[edges[i].target] = [edges[i]]; + } + + var svg = container.select('svg'); + if (scale != null) { + svg.attr('height', scale).attr('width', scale); + } + + + var render_plan = function(d) { + var plan_title = "plan info" + var ttip = ''; + ttip += title_html(d); + if (d.plan == "no plan available"){ + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + plan_title + '</span><br><br>'+(d.plan.length == 0 ? '' : "<p class='explain'>" + JSON.stringify(d.plan, replacer, 2) + "</p><br>"+ '<hr style="background-color:black"/>') ; + } else { + var yamlplan = json2yaml(d.plan) + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + plan_title + '</span><br><br>'+(d.plan.length == 0 ? '' : "<p class='explain'>" + yamlplan + "</p><br>"+ '<hr style="background-color:black"/>') ; + } + ttip += child_html(d); + return ttip; + } + + var render_cost = function(d) { + var cost_title = "cost info" + var ttip = ''; + ttip += title_html(d); + if (d.cost == "no cost available"){ + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + cost_title + '</span><br><br>'+(d.cost.length == 0 ? '' : "<p class='explain'>" + JSON.stringify(d.cost, replacer, 2) + "</p><br>"+ '<hr style="background-color:black"/>') ; + } + else{ + var yamlcost = json2yaml(d.cost) + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + cost_title + '</span><br><br>'+(d.cost.length == 0 ? '' : "<p class='explain'>" + yamlcost + "</p><br>"+ '<hr style="background-color:black"/>') ; + } + ttip += child_html(d); + return ttip; + } + + var render_policy = function(d) { + var policy_title = "controls info" + var ttip = ''; + ttip += title_html(d); + if (d.policy == "no policy available" ) + { + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + policy_title + '</span><br><br>'+(d.policy.length == 0 ? '' : "<p class='explain'>" + JSON.stringify(d.policy, replacer, 2) + "</p><br>"+ '<hr style="background-color:black"/>'); + } + else{ + var yamlpolicy = json2yaml(d.policy) + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + policy_title + '</span><br><br>'+(d.policy.length == 0 ? '' : "<p class='explain'>" + yamlpolicy + "</p><br>"+ '<hr style="background-color:black"/>'); + } + ttip += child_html(d); + return ttip; + } + + var render_time = function(d) { + var time_title = "time info" + var ttip = ''; + ttip += title_html(d); + if (d.time == "no time estimation available" ) + { + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + time_title + '</span><br><br>'+(d.time.length == 0 ? '' : "<p class='explain'>" + JSON.stringify(d.time, replacer, 2) + "</p><br>"+ '<hr style="background-color:black"/>') ; + + } else{ + var yamltime = json2yaml(d.time) + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + time_title + '</span><br><br>'+(d.time.length == 0 ? '' : "<p class='explain'>" + yamltime + "</p><br>"+ '<hr style="background-color:black"/>') ; + } + ttip += child_html(d); + return ttip; + } + + var render_apply = function(d) { + var apply_title = "apply info" + var ttip = ''; + ttip += title_html(d); + if (d.apply == "not yet applied" ) + { + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + apply_title + '</span><br><br>'+("<p class='explain'>" + JSON.stringify(d.apply, replacer, 2) + "</p><br>"+ '<hr style="background-color:black"/>'); + } + else { + if( d.apply == null || d.apply.instances[0] == null) + { + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + apply_title + '</span><br><br>'+("<p class='explain'>" + "resource apply failed" + "</p><br>"+ '<hr style="background-color:black"/>'); + } + else + { + var yamlapply = json2yaml(d.apply) + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + apply_title + '</span><br><br>'+(d.apply.length == 0 ? '' : "<p class='explain'>" + yamlapply + "</p><br>"+ '<hr style="background-color:black"/>'); + } + } + ttip += child_html(d); + return ttip; + } + + var render_tfstate = function(d) { + var title = "config info" + var yamlstate = json2yaml(d.definition) + var ttip = ''; + ttip += title_html(d); + ttip += '<hr style="background-color:black"/><br><span class="title" style="background:' + color("#ffbf00") + ';">' + title + '</span><br><br>' +(d.definition.length == 0 ? '' : "<p class='explain'>" + yamlstate + "</p><br>"+ '<hr style="background-color:black"/>'); + ttip += child_html(d); + return ttip; + } + + var title_html = function(d) { + var node = d; + var title = [ '<div class="header">'] + var head = "resource name" + title[title.length] = '<span class="title" style="background:' + color("#ffbf00") + ';">' + head + '</span><br><br>'; + if (node.modules.length <= 1 && node.modules[0] == 'root') { + title[title.length] = '<span class="title" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + title[title.length] = '<span class="title" style="background:' + color(node.group) + ';">' + node.resource_name + '</span>'; + + } + else { + for (var i in node.modules) { + title[title.length] = '<span class="title" style="background: ' + color('(M) ' + node.modules[i]) + ';">' + node.modules[i] + '</span>'; + } + title[title.length] = '<span class="title" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + title[title.length] = '<span class="title" style="background:' + color(node.group) + ';">' + node.resource_name + '</span>'; + } + title[title.length] = '</div>' + return title.join(''); + } + + // returns <div> element representing node's title and module namespace. + // intended for use in an interactive searchbox. + var searchbox_listing = function(d) { + var node = d; + var title = [ '<div class="sbox-listings">'] + if (node.modules.length <= 1 && node.modules[0] == 'root') { + if (node.type) + title[title.length] = '<span class="sbox-listing" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + title[title.length] = '<span class="sbox-listing" style="background:' + color(node.group) + ';">' + node.resource_name + '</span>'; + } + else { + for (var i in node.modules) { + title[title.length] = '<span class="sbox-listing" style="background: ' + color('(M) ' + node.modules[i]) + ';">' + node.modules[i] + '</span>'; + } + title[title.length] = '<span class="sbox-listing" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + title[title.length] = '<span class="sbox-listing" style="background:' + color(node.group) + ';">' + node.resource_name + '</span>'; + } + title[title.length] = '</div>' + return title.join(''); + } + + // returns <span> elements representing a node's direct children + var child_html = function(d) { + var children = []; + var edges = edges_by_source[d.label]; + var foot = "child nodes"; + children[children.length] = '<span class="title" style="background:' + color("#ffbf00") + ';">' + foot + '</span><br><br>'; + for (i in edges) { + edge = edges[i]; + if (edge.edge_type == edge_types.NORMAL || edge.edge_type == edge_types.HIDDEN) { + var node = nodes[edge.target]; + if (node.modules.length <= 1 && node.modules[0] == 'root') { + children[children.length] = '<span class="dep" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + children[children.length] = '<span class="dep" style="background:' + color(node.group) + ';">' + node.resource_name + '</span></br>'; + } + else { + for (var i in node.modules) { + children[children.length] = '<span class="dep" style="background: ' + color('(M) ' + node.modules[i]) + ';">' + node.modules[i] + '</span>'; + } + children[children.length] = '<span class="dep" style="background:' + color(node.group) + ';">' + node.type + '</span>'; + children[children.length] = '<span class="dep" style="background:' + color(node.group) + ';">' + node.resource_name + '</span></br>'; + } + + } + } + return children.join(''); + } + + var get_downstream_nodes = function (node) { + var children = {}; + children[node.label] = node; + var visit_queue = new Queue(); + visit_queue.enqueue(node); + while (visit_queue.size() > 0 ) { + var cur_node = visit_queue.dequeue(); + var edges = edges_by_source[cur_node.label]; + for (var i in edges) { + if (edges[i].target in children) + continue; + var n = nodes[edges[i].target]; + children[n.label] = n; + visit_queue.enqueue(n); + } + } + return to_list(children); + } + + var get_upstream_nodes = function (node) { + var parents = {}; + parents[node.label] = node; + var visit_queue = new Queue(); + visit_queue.enqueue(node); + while (visit_queue.size() > 0) { + var cur_node = visit_queue.dequeue(); + var edges = edges_by_target[cur_node.label]; + for (var i in edges) { + if (edges[i].source in parents) + continue; + var n = nodes[edges[i].source]; + parents[n.label] = n; + visit_queue.enqueue(n); + } + } + return to_list(parents); + } + + var get_downstream_edges = function(node) { + var ret_edges = new Set(); + var children = new Set(); + var visit_queue = new Queue(); + + visit_queue.enqueue(node); + while (visit_queue.size() > 0) { + var cur_node = visit_queue.dequeue(); + var edges = edges_by_source[cur_node.label]; + for (var i in edges) { + e = edges[i]; + if (e in ret_edges || e.edge_type == edge_types.HIDDEN || e.edge_type == edge_types.LAYOUT_HIDDEN) + continue; + var n = nodes[edges[i].target]; + ret_edges.add(e); + children.add(n); + visit_queue.enqueue(n); + } + } + return Array.from(ret_edges); + } + + var get_upstream_edges = function(node) { + var ret_edges = new Set(); + var parents = new Set(); + var visit_queue = new Queue(); + + visit_queue.enqueue(node); + while (visit_queue.size() > 0) { + var cur_node = visit_queue.dequeue(); + var edges = edges_by_target[cur_node.label]; + for (var i in edges) { + e = edges[i]; + if (e in ret_edges || e.edge_type == edge_types.HIDDEN || e.edge_type == edge_types.LAYOUT_HIDDEN) + continue; + var n = nodes[edges[i].source]; + ret_edges.add(e); + parents.add(n); + visit_queue.enqueue(n); + } + } + return Array.from(ret_edges); + } + + // + // mouse event handling + // + // * 1st click (and mouseover): highlight downstream connections, only + tooltip + // * 2nd click: highlight upstream and downstream connections + no tooltip + // * 3rd click: return to normal (no-selection/highlights) + // + + var click_count = 0; + var sticky_node = null; + + // FIXME: these x,y,z-s pad out parameters I haven't looked up, + // FIXME: but don't seem to be necessary for display + var node_mousedown = function(d, x, y, z, no_tip_p) { + console.log(d) + if ( sticky_node == d && click_count == 1) { + + highlight(d, true, true); + click_count += 1; + } + else if (sticky_node == d && click_count == 2) { + unhighlight(d); + + sticky_node = null; + click_count = 0; + } + else { + if (sticky_node) { + unhighlight(sticky_node); + + } + sticky_node = d; + click_count = 1; + highlight(d, true, false); + } + } + + var plan_click = function(d) { + openNav() + var renderInfo = render_plan(d); + $('div.test').html(renderInfo); + + } + + var tfstate_click = function(d) { + openNav() + var renderInfo = render_tfstate(d); + $('div.test').html(renderInfo); + + } + + var apply_click = function(d) { + openNav() + var renderInfo = render_apply(d); + $('div.test').html(renderInfo); + + } + + var cost_click = function(d) { + openNav() + var renderInfo = render_cost(d); + $('div.test').html(renderInfo); + } + + var time_click = function(d) { + openNav() + var renderInfo = render_time(d); + $('div.test').html(renderInfo); + } + + var policy_click = function(d) { + openNav() + + var renderInfo = render_policy(d); + $('div.test').html(renderInfo); + + } + + function openNav() { + document.getElementById("mySidenav").style.width = "350px"; + } + + var highlight = function (d, downstream, upstream) { + + var highlight_nodes = []; + var highlight_edges = []; + + if (downstream) { + highlight_nodes = highlight_nodes.concat(get_downstream_nodes(d)); + highlight_edges = highlight_edges.concat(get_downstream_edges(d)); + } + + if (upstream) { + highlight_nodes = highlight_nodes.concat(get_upstream_nodes(d)); + highlight_edges = highlight_edges.concat(get_upstream_edges(d)); + } + + svg.selectAll('g.node') + .data(highlight_nodes, function (d) { return (d && d.svg_id) || d3.select(this).attr("id"); }) + .attr('opacity', 1.0) + .exit() + .attr('opacity', 0.2); + + svg.selectAll('g.edge') + .data(highlight_edges, function(d) { return d && d.svg_id || d3.select(this).attr("id"); }) + .attr('opacity', 1.0) + .exit() + .attr('opacity', 0.0); + } + + var unhighlight = function (d) { + svg.selectAll('g.node') + .attr('opacity', 1.0); + svg.selectAll('g.edge') + .attr('opacity', 1.0) + + } + + // var root = nodes['[root] root']; + node = svg.selectAll('g.node') + .data(svg_nodes, function (d) { + return (d && d.svg_id) || d3.select(this).attr("id"); + }) + + node.select('polygon:nth-of-type(2)') + .on('click', node_mousedown) + .style('fill', (function (d) { + if (d){ + if (d.label == "[root] root") { + return "#fff"; + } + else { + return "#AEC7E8"; + } + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(3)') + .on('click',(function (d) { + if (d.label == "[root] root") { + return ""; + } + else { + return tfstate_click(d); + } + })) + .style('fill', (function (d) { + if (d) + return '#fff'; + else + return '#000'; + })); + + + node.select('polygon:nth-of-type(8)') + .on('click',plan_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + + + node.select('polygon:nth-of-type(9)') + .on('click',plan_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(11)') + .on('click',policy_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(12)') + .on('click',policy_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(14)') + .on('click',cost_click) + .style('fill', (function (d) { + if (d) { + return '#fff'; + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(15)') + .on('click',cost_click) + .style('fill', (function (d) { + if (d) { + return '#fff'; + } + else + return '#000'; + })); + + + node.select('polygon:nth-of-type(17)') + .on('click',time_click) + .style('fill', (function (d) { + if (d) { + return '#fff'; + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(18)') + .on('click',time_click) + .style('fill', (function (d) { + if (d) { + return '#fff'; + } + else + return '#000'; + })); + + + + + node.select('polygon:nth-of-type(20)') + .on('click',apply_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + node.select('polygon:nth-of-type(21)') + .on('click',apply_click) + .style('fill', (function (d) { + if (d){ + return '#fff'; + + } + else + return '#000'; + })); + + + svg.selectAll('polygon') + .each(function(d, i) { + if (d != undefined) + return undefined; + sibling = this.nextElementSibling; + if (sibling) { + if(sibling.innerHTML.match(/\(M\)/)) { + this.setAttribute('fill', color(sibling.innerHTML)); + } + } + }); + + // hack to make mouse events and coloration work on the root node again. + var root = nodes['[root] root']; + svg.selectAll('g.node#' + root.svg_id) + .data(svg_nodes, function (d) { + return (d && d.svg_id) || d3.select(this).attr("id"); + }) + .select('polygon') + .attr('fill', function (d) { return color(d.group); }) + .style('fill', (function (d) { + if (d) + return color(d.group); + else + return '#000'; + })); + + // stub, in case we want to do something with edges on init. + svg.selectAll('g.edge') + .data(edges, function(d) { return d && d.svg_id || d3.select(this).attr("id"); }); + + // blast-radius --serve mode stuff. check for a zoom-in button as a proxy + // for whether other facilities will be available. + var refocus_btn = document.querySelector(selector + '-refocus'); + if (d3.select(selector + '-zoom-in')) { + var zin_btn = document.querySelector(selector + '-zoom-in'); + var zout_btn = document.querySelector(selector + '-zoom-out'); + // var refocus_btn = document.querySelector(selector + '-refocus'); + var download_btn = document.querySelector(selector + '-download') + var svg_el = document.querySelector(selector + ' svg'); + var panzoom = svgPanZoom(svg_el).disableDblClickZoom(); + + + console.log(state); + if (state['no_scroll_zoom'] == true) { + console.log('bang'); + panzoom.disableMouseWheelZoom(); + } + + var handle_zin = function(ev){ + ev.preventDefault(); + panzoom.zoomIn(); + } + zin_btn.addEventListener('click', handle_zin); + + var handle_zout = function(ev){ + ev.preventDefault(); + panzoom.zoomOut(); + } + zout_btn.addEventListener('click', handle_zout); + + var handle_refocus = function() { + console.log("here inside sticy node") + console.log("value",sticky_node) + if (sticky_node) { + $(selector + ' svg').remove(); + clear_listeners(); + if (! state['params']) + state.params = {} + state.params.refocus = encodeURIComponent(sticky_node.label); + + svg_url = svg_url.split('?')[0]; + json_url = json_url.split('?')[0]; + + console.log("svg_url is",svg_url) + console.log("json_url is",json_url) + console.log("herer state params is******",state.params) + console.log("selector value is",selector) + console.log("build uri for svg params is",build_uri(svg_url, state.params)) + console.log("herer buld for json is ",build_uri(json_url, state.params)) + console.log("here sta eis*****",br_state) + + + blastradiusnew(selector, build_uri(svg_url, state.params), build_uri(json_url, state.params), br_state); + } + } + + + // this feature is disabled for embedded images on static sites... + if (refocus_btn) { + console.log('refocus_btn.addEventListener'); + refocus_btn.addEventListener('click', handle_refocus); + } + + var handle_download = function() { + // svg extraction and download as data url borrowed from + // http://bl.ocks.org/curran/7cf9967028259ea032e8 + var svg_el = document.querySelector(selector + ' svg') + var svg_as_xml = (new XMLSerializer).serializeToString(svg_el); + var svg_data_url = "data:image/svg+xml," + encodeURIComponent(svg_as_xml); + var dl = document.createElement("a"); + document.body.appendChild(dl); + dl.setAttribute("href", svg_data_url); + dl.setAttribute("download", "blast-radius-new.svg"); + dl.click(); + } + download_btn.addEventListener('click', handle_download); + + var clear_listeners = function() { + zin_btn.removeEventListener('click', handle_zin); + zout_btn.removeEventListener('click', handle_zout); + refocus_btn.removeEventListener('click', handle_refocus); + download_btn.removeEventListener('click', handle_download); + panzoom = null; + } + + var render_searchbox_node = function(d) { + return searchbox_listing(d); + } + + var select_node = function(d) { + if (d === undefined || d.length == 0) { + return true; + } + // FIXME: these falses pad out parameters I haven't looked up, + // FIXME: but don't seem to be necessary for display + if (sticky_node) { + unhighlight(sticky_node); + sticky_node = null; + } + click_count = 0; + console.log("node here is",nodes) + console.log("herer d is",d) + console.log("her node r d is",nodes[d]) + node_mousedown(nodes[d], false, false, false, true); + } + + if ( $(selector + '-search.selectized').length > 0 ) { + console.log("inside if") + $(selector + '-search').selectize()[0].selectize.clear(); + $(selector + '-search').selectize()[0].selectize.clearOptions(); + for (var i in svg_nodes) { + + $(selector + '-search').selectize()[0].selectize.addOption(svg_nodes[i]); + } + if( state && state.params && state.params.refocus && state.params.refocus.length > 0 ) { + var n = state.params.refocus; + } + console.log(svg_nodes); + // because of scoping, we need to change the onChange callback to the new version + // of select_node(), and delete the old callback associations. + $(selector + '-search').selectize()[0].selectize.settings.onChange = select_node; + // $(selector + '-search').selectize()[0].selectize.swapOnChange(); + } + else { + $(selector + '-search').selectize({ + valueField: 'label', + searchField: ['label'], + maxItems: 1, + create: false, + multiple: false, + maximumSelectionSize: 1, + onChange: select_node, + render: { + option: render_searchbox_node, + item : render_searchbox_node + }, + options: svg_nodes + }); + } + + // without this, selecting an item with <enter> will submit the form + // and force a page refresh. not the desired behavior. + $(selector + '-search-form').submit(function(){return false;}); + } // end if(interactive) + }); // end json success callback + }); // end svg scuccess callback + +} // end blastradius() \ No newline at end of file diff --git a/blastradius/server/static/js/blast-radius.js b/blastradius/server/static/js/blast-radius.js index 0f9a466..5f434d9 100644 --- a/blastradius/server/static/js/blast-radius.js +++ b/blastradius/server/static/js/blast-radius.js @@ -104,6 +104,8 @@ blastradius = function (selector, svg_url, json_url, br_state) { // be able to manipulate x.svg with d3.js, or other DOM fns. d3.xml(svg_url, function (error, xml) { + d3.select(selector).selectAll("svg").remove(); + container.node() .appendChild(document.importNode(xml.documentElement, true)); @@ -571,8 +573,6 @@ blastradius = function (selector, svg_url, json_url, br_state) { refocus_btn.removeEventListener('click', handle_refocus); download_btn.removeEventListener('click', handle_download); panzoom = null; - - // tip.hide(); } diff --git a/blastradius/server/static/js/json2yaml.js b/blastradius/server/static/js/json2yaml.js new file mode 100644 index 0000000..6c5e320 --- /dev/null +++ b/blastradius/server/static/js/json2yaml.js @@ -0,0 +1,101 @@ +(function (self) { + /* + * TODO, lots of concatenation (slow in js) + */ + var spacing = " "; + + function getType(obj) { + var type = typeof obj; + if (obj instanceof Array) { + return 'array'; + } else if (type == 'string') { + return 'string'; + } else if (type == 'boolean') { + return 'boolean'; + } else if (type == 'number') { + return 'number'; + } else if (type == 'undefined' || obj === null) { + return 'null'; + } else { + return 'hash'; + } + } + + function convert(obj, ret) { + var type = getType(obj); + + switch(type) { + case 'array': + convertArray(obj, ret); + break; + case 'hash': + convertHash(obj, ret); + break; + case 'string': + convertString(obj, ret); + break; + case 'null': + ret.push('null'); + break; + case 'number': + ret.push(obj.toString()); + break; + case 'boolean': + ret.push(obj ? 'true' : 'false'); + break; + } + } + + function convertArray(obj, ret) { + for (var i=0; i<obj.length; i++) { + var ele = obj[i]; + var recurse = []; + convert(ele, recurse); + + for (var j=0; j<recurse.length; j++) { + ret.push((j == 0 ? "- " : spacing) + recurse[j]); + } + } + } + + function convertHash(obj, ret) { + for (var k in obj) { + var recurse = []; + if (obj.hasOwnProperty(k)) { + var ele = obj[k]; + convert(ele, recurse); + var type = getType(ele); + if (type == 'string' || type == 'null' || type == 'number' || type == 'boolean') { + ret.push(normalizeString(k) + ': ' + recurse[0]); + } else { + ret.push(normalizeString(k) + ': '); + for (var i=0; i<recurse.length; i++) { + ret.push(spacing + recurse[i]); + } + } + } + } + } + + function normalizeString(str) { + if (str.match(/^[\w]+$/)) { + return str; + } else { + return JSON.stringify(str); + } + } + + function convertString(obj, ret) { + ret.push(normalizeString(obj)); + } + + self.json2yaml = function(obj) { + if (typeof obj == 'string') { + obj = JSON.parse(obj); + } + + var ret = []; + convert(obj, ret); + return ret.join("\n"); + }; +})(this); diff --git a/blastradius/server/templates/index.html b/blastradius/server/templates/index.html index f39e933..427a314 100644 --- a/blastradius/server/templates/index.html +++ b/blastradius/server/templates/index.html @@ -1,153 +1,184 @@ <html> - <head> - <title>Blast Radius (Terraform Graph Tools) - - - - - - - - - - - - - - - - - - - - - - -