Skip to content

Commit 9c730e6

Browse files
Merge pull request #27 from overmindtech/k8s-additions
Added k8s mappings and dynamic scope
2 parents ae21006 + f0cafb5 commit 9c730e6

File tree

12 files changed

+4216
-96
lines changed

12 files changed

+4216
-96
lines changed

.github/actions/go_init/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ runs:
1212
with:
1313
repository: overmindtech/aws-source
1414
path: ./aws-source
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
repository: overmindtech/k8s-source
19+
path: ./k8s-source
1520

1621
- name: Move sources in place
1722
shell: bash
18-
run: mv -v aws-source ..
23+
run: |
24+
mv -v aws-source ..
25+
mv -v k8s-source ..
1926
2027
- name: Go Generate
2128
shell: bash

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,26 @@ terraform show -json ./tfplan > ./tfplan.json
4444
ovm-cli submit-plan --title "example change" --plan-json ./tfplan.json
4545
```
4646

47+
## Terraform ➡ Overmind Mapping
48+
49+
In order to calculate the blast radius from a Terraform plan, we use mappings provided by the sources to map a Terraform resource change to an Overmind item. In many cases this is simple, however in some instances, the plan doesn't have enough information for us to determine which resource the change is referring to. A good example is a Terraform environment that manages 2x Kubernetes deployments in 2x clusters which both have the same name.
50+
51+
By default we'll add both deployments to the blast radius since we can't tell them apart. However to improve the results, you can add the `overmind_mappings` output to your plan:
52+
53+
```hcl
54+
output "overmind_mappings" {
55+
value = {
56+
# The key here should be the name of the provider. Resources that use this
57+
# provider will be mapped to a cluster with the below name. If you had
58+
# another provider with an alias such as "prod" the name would be
59+
# "kubernetes.prod"
60+
kubernetes = {
61+
cluster_name = var.terraform_env_name
62+
}
63+
}
64+
}
65+
```
66+
67+
Valid mapping values are:
68+
69+
* `cluster_name`: The name of the cluster that was provided to the kubernetes source using the `source.clusterName` option

0 commit comments

Comments
 (0)