You can use extensibility actions along with subscriptions to automate and simplify tagging VMs.
As a cloud administrator, you can create deployments that are automatically tagged with specified inputs and outputs by using extensibility actions and extensibility subscriptions. When a new deployment is created against the project containing the tag VM subscription, the deployment event triggers the Tag VM script to run and the tags are automatically applied. This saves time and promotes efficiency while allowing for easier deployment management.
- Access to cloud administrator credentials.
- Amazon Web Services role for Lambda functions.
- Navigate to
and create an action with the following parameters.
Parameter Description Action Name Extensibility action name, preferably with TagVM as a prefix or suffix. Project Project to test the extensibility action against. Action Template Tag VM Runtime Python Script Source Write Script
- Enter Handler as the Main function.
- Add tagging inputs for testing the extensibility action.
resourceNames = ["DB_VM"]and
target = world.
- To save your action, click Save.
- To test your action, click Test.
- To exit the action editor, click Close.
- Navigate to .
- Click New Subscription.
- Enter the following subscription details.
Detail Setting Event Topic Select an event topic related to the tagging phase of the VM. For example, Compute Allocation.Note: Tags must be part of the event parameters of the selected event topic. Blocking Set the timeout for the subscription to 1 minute. Action/Workflow Select an extensibility action runnable type, and select your custom extensibility action.
- To save your custom extensibility action subscription, click Save.
- Navigate to , and create a cloud template from a blank canvas.
- Add two virtual machines to the cloud template:
- To deploy the VMs, click Deploy.
- During deployment, verify that the event is initiated and the extensibility action is run.
- To verify that the tags were applied correctly, navigate to .