Cannot select CI type when creating "Infrastructure" discovery pattern.

Aidan
Tera Guru

I'm trying to build a discovery pattern for use by cloud events but cannot select the correct CI type when the "Pattern Type" is "Infrastructure".

I have built the pattern for discovery the particular resource (Pattern Type == Cloud Resources), and this works fine but I need to create the event equivalent.  All other event fired patterns have the Pattern type of "Infrastructure", but when I select that type the CI type field is filtered and my custom CI class is not available.

Does anyone know what the criteria is for getting my CI class in this list?

7 REPLIES 7

Hi @SiD2 
I have a use case in AWS cloud discovery where I've to discovery a AWS::ECR::Repository resource. now OOTB  there is no pattern for this. So, i created custom infrastructure type pattern to get the ECRs and it working fine in Debug session. But, that pattern is not getting triggered during actual run. 
Now to trigger this pattern I added AWS Datacenter Discovery pattern in trigger rule. Now my ECR pattern is triggering but due lack of correct inputs it is not working. As I made my custom ECR pattern similar to 'Amazon AWS - ECS pattern', so I want to know how the ECS pattern is getting triggered with correct inputs i.e., 'cloud account ID' and 'datacenter' (and these are same input which I provide during debug session)?. I checked pre/post processing table but there is not pre pattern execution script for ECS(OOTB pattern). I found a 'Cloud Account discovery' script include where some functions are using prePatternExecution API. But I don't know from where that script include is being called.

Could you help me to know how I can make my custom ECR pattern to work similar to ECS pattern?

SiD2
ServiceNow Employee
ServiceNow Employee

Hi @Raj Abhishek 

 

It's tough to explain such stuff here but will give it a try.

 

Firstly refer to any pattern of type 4 (Cloud Resource) instead of Infrastructure type Cloud Pattern.

Any new patterns on cloud should be of this type and only can scale with large/huge discovery.

 

So for your custom pattern if all that is needed for you is only DC info, you can trigger after LDC pattern. But if you need any other resource info for discovering this repository then try making that as a parent pattern.

 

Also, determine if you need any CI relationships for this new CI and which CI class are you targeting for this new custom one.

 

There will be many more such questions in the process of writing a custom cloud pattern, so better alternative could be adding this res type in the cloud inventory white list and it gets auto discovered as a generic cloud resource if that works for you meanwhile.

 

Please mark Helpful / Accept Solution so that it helps others with similar questions.

Thankyou for your response.

I tried adding the AWS::ECR:: Repository to 'resource inclusion list'.  But It didn't work out. 

I want to run my pattern for each sub account which are part of schedule cloud discovery exactly how Amazon AWS - ECS pattern runs.

It's hard to type everything here. But I will try out though, ECR can be present in any of the data center under an accounts. So basically my pattern should take one input of Sub account name and another input containing all the ldcs in that sub account so that it can check to ECR in all the data centers. 

Could you please help me understanding how the input parameters (not orchestration  input)are being set during actual run ?

 

As you suggested I will also try with cloud resources pattern type. 

Thankyou.