Skip to content

Commit

Permalink
feat(aws): Add owner/lifetime info in VM's metadata
Browse files Browse the repository at this point in the history
Owner and lifetime info will be added into VM's metadata
for AWS provider. This info will give info who
owns the VM and what is the lifetime of the VM which will
be used for notifying owners and cleaning up the resources
based on lifetime of the VMs.
If owner info not fetched, user notified with custom error
message for follow up action to take up.

Signed-off-by: ksiddiqu <[email protected]>
  • Loading branch information
kaleemsiddiqu committed Nov 10, 2022
1 parent 9572717 commit 45b81f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mrack/providers/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ async def create_server(self, req):
for key, value in self.instance_tags.items():
taglist.append({"Key": key, "Value": value})

if specs.get("metadata"):
for key, value in specs.get("metadata").items():
taglist.append({"Key": key, "Value": value})

logger.debug(f"{log_msg_start} Tagging instance with: {object2json(taglist)}")

request = {
Expand Down
1 change: 1 addition & 0 deletions src/mrack/transformers/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,5 @@ def create_host_requirement(self, host):
"subnet_ids": self._find_subnet_ids(host),
}

req = self.update_metadata_for_owner_lifetime(req)
return req

0 comments on commit 45b81f6

Please sign in to comment.