Skip to content

Commit

Permalink
updated readme and added logic to throw error when tag is added to rd…
Browse files Browse the repository at this point in the history
…s cluster
  • Loading branch information
chenbishop committed Jun 21, 2022
1 parent 7d296b3 commit 0f424ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@ Tag an AWS resource with the following tags


**Supported AWS Resources**
The project should work against all ec2, ecs and rds services, below are list of tested services:
- EC2
- Instance
- ECS
- Cluster (Issue with duplicate resource)
- Service
- Task
- Instance (To Be Tested)
-
- RDS
- Cluster
- Instance

## Remove the Corresponding Twingate Resource
Remove the AWS tag 'tg_resource_id' From the AWS Instance.

| AWS Resource | Supported |
|------------------------|--------------|
| EC2 Instance | Yes |
| ECS Cluster | Yes |
| ECS Service | Yes |
| ECS Task | Yes |
| ECS Container Instance | Yes |
| ECS Instance | No |
| RDS Cluster | No |
| RDS Instance | Yes |
4 changes: 4 additions & 0 deletions twingate/eventProcessor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const apiKey = ssmParameter.Parameters.find(x => x.Name === 'TwingateApiKey').V
export async function eventProcessor(event) {
let [remoteNetworkName, resourceNameOrId, resourceAddress, resourceId] = ["", "", "", ""]

if (event.detail.service=="rds" && event.detail.resource-type=="cluster"){
throw new Error(`RDS cluster is not supported`)
}

// process tg_resource tag
if ("tg_resource" in event.detail.tags){
let resourceInfo = event.detail.tags.tg_resource.replace(/\s*\+\+\s*/g, "++").split("++")
Expand Down

0 comments on commit 0f424ca

Please # to comment.