Skip to content

Commit

Permalink
feat(resource-groups): add per-group-type templates (#1414)
Browse files Browse the repository at this point in the history
* feat(resource-groups): add per-group-type templates

GROW-2489

* I don't always commit; but when I do it's empty

* feat(resource-groups): add per-group-type templates

Cmon Git Lint!

GROW-2489

* feat(resource-groups): add per-group-type templates

Anonymize GCP template

GROW-2489

* feat(resource-groups): add per-group-type templates

Handle errors in createResourceGroup (test)

GROW-2489

* feat(resource-groups): add per-group-type templates

Addressing PR review feedback

GROW-2489
  • Loading branch information
hazedav authored Oct 17, 2023
1 parent 1cea71b commit 2ccd309
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 69 deletions.
40 changes: 40 additions & 0 deletions api/_templates/resource_groups/aws.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"filters": {
"filter0": {
"field": "Account",
"operation": "EQUALS",
"values": [
"123456789012"
]
},
"filter1": {
"field": "Resource Tag",
"operation": "INCLUDES",
"key": "Hostname",
"values": [
"*"
]
},
"filter2": {
"field": "Region",
"operation": "STARTS_WITH",
"values": [
"ap-south"
]
}
},
"expression": {
"operator": "AND",
"children": [
{
"filterName": "filter0"
},
{
"filterName": "filter1"
},
{
"filterName": "filter2"
}
]
}
}
70 changes: 70 additions & 0 deletions api/_templates/resource_groups/azure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"filters": {
"filter0": {
"field": "Subscription ID",
"operation": "EQUALS",
"values": [
"0fe75302-1906-45ec-bde1-79b76899dd74"
]
},
"filter1": {
"field": "Subscription Name",
"operation": "STARTS_WITH",
"values": [
"prod"
]
},
"filter2": {
"field": "Tenant ID",
"operation": "EQUALS",
"values": [
"b329d4bf-4587-4ccf-e132-84e7025fa22d"
]
},
"filter3": {
"field": "Tenant Name",
"operation": "INCLUDES",
"values": [
"*"
]
},
"filter4": {
"field": "Resource Tag",
"operation": "EQUALS",
"key": "Env",
"values": [
"dev"
]
},
"filter5": {
"field": "Region",
"operation": "EQUALS",
"values": [
"westus2"
]
}
},
"expression": {
"operator": "AND",
"children": [
{
"filterName": "filter0"
},
{
"filterName": "filter1"
},
{
"filterName": "filter2"
},
{
"filterName": "filter3"
},
{
"filterName": "filter4"
},
{
"filterName": "filter5"
}
]
}
}
50 changes: 50 additions & 0 deletions api/_templates/resource_groups/container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"filters": {
"filter0": {
"field": "Image Tag",
"operation": "EQUALS",
"values": [
"1.17.1"
]
},
"filter1": {
"field": "Container Label",
"operation": "INCLUDES",
"key": "app",
"values": [
"*"
]
},
"filter2": {
"field": "Image Repo",
"operation": "EQUALS",
"values": [
"parrotsec/core"
]
},
"filter3": {
"field": "Image Registry",
"operation": "EQUALS",
"values": [
"k8s.gcr.io"
]
}
},
"expression": {
"operator": "AND",
"children": [
{
"filterName": "filter0"
},
{
"filterName": "filter1"
},
{
"filterName": "filter2"
},
{
"filterName": "filter3"
}
]
}
}
70 changes: 70 additions & 0 deletions api/_templates/resource_groups/gcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"filters": {
"filter0": {
"field": "Project ID",
"operation": "EQUALS",
"values": [
"abc-demo-project-123"
]
},
"filter1": {
"field": "Organization ID",
"operation": "EQUALS",
"values": [
"123456789012"
]
},
"filter2": {
"field": "Organization Name",
"operation": "STARTS_WITH",
"values": [
"somecompany"
]
},
"filter3": {
"field": "Folder",
"operation": "EQUALS",
"values": [
"1234567890123"
]
},
"filter4": {
"field": "Resource Label",
"operation": "EQUALS",
"key": "Env",
"values": [
"dev"
]
},
"filter5": {
"field": "Region",
"operation": "EQUALS",
"values": [
"australia-southeast2"
]
}
},
"expression": {
"operator": "AND",
"children": [
{
"filterName": "filter0"
},
{
"filterName": "filter1"
},
{
"filterName": "filter2"
},
{
"filterName": "filter3"
},
{
"filterName": "filter4"
},
{
"filterName": "filter5"
}
]
}
}
20 changes: 20 additions & 0 deletions api/_templates/resource_groups/machine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"filters": {
"filter0": {
"field": "Machine Tag",
"operation": "EQUALS",
"key": "cluster",
"values": [
"dev"
]
}
},
"expression": {
"operator": "OR",
"children": [
{
"filterName": "filter0"
}
]
}
}
50 changes: 50 additions & 0 deletions api/_templates/resource_groups/oci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"filters": {
"filter0": {
"field": "Compartment ID",
"operation": "EQUALS",
"values": [
"ocid1.tenancy.oc1..abaaaabaqp6mzxi6z3xouvhawvsekntanafelw5vmwdjw5vqmgvlegcs2s6q"
]
},
"filter1": {
"field": "Compartment Name",
"operation": "INCLUDES",
"values": [
"prod"
]
},
"filter2": {
"field": "Region",
"operation": "STARTS_WITH",
"values": [
"us-"
]
},
"filter3": {
"field": "Resource Tag",
"operation": "EQUALS",
"key": "\"definedTags\".\"Oracle-Tags\".\"CreatedBy\"",
"values": [
"default/my.email@somecompany.net"
]
}
},
"expression": {
"operator": "AND",
"children": [
{
"filterName": "filter0"
},
{
"filterName": "filter1"
},
{
"filterName": "filter2"
},
{
"filterName": "filter3"
}
]
}
}
Loading

0 comments on commit 2ccd309

Please sign in to comment.