Adding Capability Tags & Constrain Tags on Event Subscription Dynamically vRealize Automation 8 | vRA8 - automation

we are in process of shifting to vRA 8.5 from vRA 7.6. We are trying to add dynamic tags to cloud template based on user input and some workflow in backend which decides the placement of machine and network to use.
Currently we are able to place and provide network of our choice by directly using tags in Cloud Template however we want that to happen dynamically on Events such as Compute Reservation & Compute Allocation. Is there any way to this please? I have pasted the code below which we need to change on above Event Subscriptions
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
networkType: existing
constraints:
- tag: site:0005
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints:
- tag: infoblox-demo
- tag: SG:5021

Related

Have the same lambda configurations for multiple events in cloudFormation

I'm writing a CloudFormation code to create and configure an S3 bucket.
As part of the configuration, I'm adding a lambda triggering in 2 events. It's the same lambda.
How can I write this code? Should I duplicate the section or can I map the two events to the same behavior?
Here is the code
MyBucket:
Condition: CreateNewBucket
Type: AWS::S3::Bucket
## ...Bucket Config comes here... ##
## The interesting part ##
NotificationConfiguration:
LambdaConfigurations:
- Event: 's3:ObjectCreated:Put'
Function: My Lambda name
Filter:
S3Key:
Rules:
- Name: prefix
Value: 'someValue'
Is there an option to write:
LambdaConfigurations:
- Events: ['s3:ObjectCreated:Put', 's3:ObjectCreated:Post']
Or maybe
LambdaConfigurations:
- Event: 's3:ObjectCreated:Put',
- Event 's3:ObjectCreated:Post',
...
Or Do I need to copy-past the block twice?
I can't find an example for this behavior.
Sorry if this is a trivial question, I'm new to CloudFormation.
Thanks!
It depends on exactly what you want to trigger the lambda function. If you want the event to fire on all object create events (s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:copy, and s3:ObjectCreated:CompleteMultipartUpload), you can simply use 's3:ObjectCreated:*' as the value for Event.
If you want Put and Post specifically, you'll need to supply two event configurations, one for Put and another for Post. The CloudFormation parser will accept multiple Event elements in a LambdaConfiguration but only the last one to appear is applied to the event notification.
This is an interesting divergence in console/API functionality vs CloudFormation/CDK functionality. The PutBucketNotificationConfiguration API operation accepts LambdaFunctionConfiguration arguments that support multiple individual events. PutBucketNotificationConfiguration replaces PutBucketNotification, which accepted CloudFunctionConfiguration, which has a deprecated Event element. So I wonder if CloudFormation still refers to the older API operation.

Vault Telemetry to CloudWatch

I'm trying to get Vault telemetry streamed through Cloudwatch Agent's StatsD interface into CW metrics, however, the gauge metric values are coming through with prefixes based on the instance ID and tags that are making the metrics impossible to target for IaC managed Cloudwatch alarms.
For instance, the vault.core.unsealed telemetry event is coming through as vault_CLOUDWATCH_AGENT_HOSTNAME_core_unsealed_INSTANCE_NAME instead of the vault_core_unsealed that I was expecting.
Managing the alarms for these metrics using Terraform is impossible because they will have dynamic names and based on whichever instance is determined as the current leader in the cluster which we have no control over.
In the Vault configuration HCL file, I have:
telemetry {
statsd_address = "127.0.0.1:8125"
disable_hostname = true
enable_hostname_label = true
}
along with several other combinations of hostname configuration values and they all seem to produce the same output. Is there a solution to this that I'm missing or just a flaw in deciding to use Cloudwatch with StatsD to capture telemetry?
Seemed to have gotten the gauge value names to a usable point with a few non-obvious configuration changes.
In the Vault telemetry stanza, only add the disable_hostname = true property with the StatsD address. Adding the labels in addition will simply move the hostname to a different position in the metric name.
The Cloudwatch agent configuration has an option to omit hostnames which can be toggles by appending of setting a new configuration:
{
"agent": {
"omit_hostname": true
}
}
This will prevent the CloudWatch agent from adding its own labels and suffixes to the gauge metric names and clean up some of the naming that is produced
(Optional) Adjust the appended dimensions in the CloudWatch agent configuration. By default, the agent will append the instance ID, image ID, autoscaling group name, and instance type. This may be something you want to keep, however, if you want to do something like IaC created metric alarms, you may need to remove some dimensions to make the metric names targetable (able to be found via direct match). The following can be added to the custom config that will replace the default CloudWatch agent configuration if you want to adjust which dimensions are automatically appended to the incoming telemetry.
{
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}"
}
}
}
As long as you know the name of the autoscaling group that the instances are targeted under, the gauge metric names coming in from the Vault telemetry will be named ambiguously enough to target them for IaC purposes.

Camunda : Set Assignee to all UserTasks of the process instance

I have a requirement where I need to set assignee's to all the "user-tasks" in a process instance as soon as the instance is created, which is based on the candidate group set to the user-task.
i tries getting the user-tasks using this :
Collection<UserTask> userTasks = execution.getBpmnModelInstance().getModelElementsByType(UserTask.class);
which is correct in someway but i am not able to set the assignee's , Also, looks like this would apply to the process itself and not the process instance.
secondly , I tried getting it from the taskQuery which gives me only the next task and not all the user-tasks inside a process.
Please help !!
It does not work that way. A process flow can be simplified to "a token moves through the bpmn diagram" ... only the current position of the token is relevant. So naturally, the tasklist only gives you the current task. Not what could happen after ... which you cannot know, because if you had a gateway that continues differently based on the task outcome? So drop playing with the BPMN meta model. Focus on the runtime.
You have two choices to dynamically assign user tasks:
1.) in the modeler, instead of hard-assigning the task to "a-user", use an expression like ${taskAssignment.assignTask(task)} where "taskAssignment" is a bean that provides a String method that returns the user.
2.) add a taskListener on "create" to the task and set the assignee in the listener.
for option 2 you can use the camunda spring boot events (or the (outdated) camunda-bpm-reactor extension) to register one central component rather than adding a listener to every task.

Blocking invoice creating in background (using programs YV60SBAT - SDBILLDL)

While creating an invoice through YV60SBAT-SDBILLDL via job - we have to do some checks.
If some of these custom checks don't pass, we should restrict the system not to create an invoice for that particular document and should continue for the rest of the documents. Also, that error message should be displayed in batch job log..
Here is an example:
Delivery documents: say 1,2,3
1-Invoice should generate
2-Invoice should not get generate because some check doesn't pass
3-Invoice should generate...
I've tried with Enhancement spot ES_SAPLV60A Point fakturaposi_auftragspositio_02 and set us_rc = 4 and RETURN (include LV60AA29), as found on some forum .. but the system doesn't access this code.

Sylius Generating CRUD routing with GRID, custom Repository & Actions

I'm using Sylius 1.0.0-dev
I created a custom "typed" Resource named manufactured_item.
I need to create a custom backend Grid, displaying my Resource depending of it's type, thus I want to specify a custom repository method.
I also need to create custom actions in main & item sections.
My configuration is the following:
app_production_manufactured_items:
resource: |
alias: app.manufactured_item
section: production
templates: ProductionBundle:Crud
only: ['index']
grid: app_production_manufactured_items
permission: true
vars:
all:
subheader: sylius.ui.manage_your_orders
templates:
form: ProductionBundle:ManufacturedItem:_form.html.twig
index:
icon: cube
type: sylius.resource
I tryed to add something like this, but it does'nt work
# defaults:
# _sylius:
# repository:
# method: myCustomRepositoryMethod
I've read the in the resource the grid (freshly updated) and various thread in SO & Sylius repo, can't find a clue.
Any idea ?