Intelligent attribute value substitution in infrastructure as code (IAC) generation
An embodiment performs, by an attribute value substitution engine, key-value extraction on infrastructure as code. The embodiment assigns, by the attribute value substitution engine, an attribute in a plurality of attributes to a value in the extracted key-value. The embodiment computes, by the attribute value substitution engine, a plurality of similarities between the plurality of attributes and a cloud resource. The embodiment groups, based on the plurality of similarities, the plurality of attributes into a group of attributes. The embodiment substitutes, by the attribute value substitution engine, the attribute with another attribute, the attribute and the another attribute belonging to the group of attributes.
1 . A computer-implemented method comprising:
performing, by an attribute value substitution engine comprising a machine learning model, wherein the machine learning model is configured to perform relationship prediction and sequence prediction from infrastructure as code, key-value extraction on the infrastructure as code;
assigning, by the attribute value substitution engine, an attribute in a plurality of attributes to a value in the extracted key-value;
computing, by the attribute value substitution engine, a plurality of similarities between the plurality of attributes and a cloud resource;
grouping, based on the plurality of similarities, the plurality of attributes into a group of attributes;
substituting, by the attribute value substitution engine, the attribute with another attribute, the attribute and the another attribute belonging to the group of attributes; and
causing, by the attribute value substitution engine, deployment of one or more cloud resources using the another attribute.
2 . The method of claim 1 , further comprising:
determining, by the attribute value substitution engine based on a diagram associated with the infrastructure as code, a relationship between the cloud resource and another cloud resource in the diagram, the relationship comprising at least one of a parent-child relationship, a source-target relationship, and an overlap relationship.
3 . The method of claim 1 , further comprising:
determining, by the attribute value substitution engine, a parent-child relationship between the cloud resource and another cloud resource; and
substituting the attribute with the another attribute based on the parent-child relationship.
4 . The method of claim 3 , wherein the substituting the attribute with the another attribute based on the parent-child relationship further comprises substituting a first attribute associated with a child cloud resource with a second attribute associated with a parent cloud resource.
5 . The method of claim 1 , further comprising:
determining, by the attribute value substitution engine, a source-target relationship between the cloud resource and another cloud resource; and
substituting the attribute with the another attribute based on the source-target relationship.
6 . The method of claim 5 , wherein the substituting the attribute with the another attribute based on the source-target relationship further comprises substituting a first attribute associated with a source cloud resource with a second attribute associated with a target cloud resource.
7 . The method of claim 1 , further comprising:
training the machine learning model using a plurality of cloud resources; and
training the machine learning model using a plurality of infrastructure as code scripts.
8 . A computer program product comprising one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by a processor to cause the processor to perform operations comprising:
performing, by an attribute value substitution engine comprising a machine learning model, wherein the machine learning model is configured to perform relationship prediction and sequence prediction from infrastructure as code, key-value extraction on the infrastructure as code;
assigning, by the attribute value substitution engine, an attribute in a plurality of attributes to a value in the extracted key-value;
computing, by the attribute value substitution engine, a plurality of similarities between the plurality of attributes and a cloud resource;
grouping, based on the plurality of similarities, the plurality of attributes into a group of attributes;
substituting, by the attribute value substitution engine, the attribute with another attribute, the attribute and the another attribute belonging to the group of attributes; and
causing, by the attribute value substitution engine, deployment of one or more cloud resources using the another attribute.
9 . The computer program product of claim 8 , further comprising:
determining, by the attribute value substitution engine based on a diagram associated with the infrastructure as code, a relationship between the cloud resource and another cloud resource in the diagram, the relationship comprising at least one of a parent-child relationship, a source-target relationship, and an overlap relationship.
10 . The computer program product of claim 8 , further comprising:
determining, by the attribute value substitution engine, a parent-child relationship between the cloud resource and another cloud resource; and
substituting a first attribute associated with a child cloud resource with a second attribute associated with a parent cloud resource.
11 . The computer program product of claim 8 , further comprising:
determining, by the attribute value substitution engine, a source-target relationship between the cloud resource and another cloud resource; and
substituting a first attribute associated with a source cloud resource with a second attribute associated with a target cloud resource.
12 . The computer program product of claim 1 , further comprising:
training the machine learning model using a plurality of cloud resources; and
training the machine learning model using a plurality of infrastructure as code scripts.
13 . A computer system comprising a processor and one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by the processor to cause the processor to perform operations comprising:
performing, by an attribute value substitution engine comprising a machine learning model, wherein the machine learning model is configured to perform relationship prediction and sequence prediction from infrastructure as code, key-value extraction on the infrastructure as code;
assigning, by the attribute value substitution engine, an attribute in a plurality of attributes to a value in the extracted key-value;
computing, by the attribute value substitution engine, a plurality of similarities between the plurality of attributes and a cloud resource;
grouping, based on the plurality of similarities, the plurality of attributes into a group of attributes;
substituting, by the attribute value substitution engine, the attribute with another attribute, the attribute and the another attribute belonging to the group of attributes; and
causing, by the attribute value substitution engine, deployment of one or more cloud resources using the another attribute.
14 . The computer system of claim 13 , further comprising:
determining, by the attribute value substitution engine based on a diagram associated with the infrastructure as code, a relationship between the cloud resource and another cloud resource in the diagram, the relationship comprising at least one of a parent-child relationship, a source-target relationship, and an overlap relationship.
15 . The computer system of claim 13 , further comprising:
determining, by the attribute value substitution engine, a parent-child relationship between the cloud resource and another cloud resource; and
substituting a first attribute associated with a child cloud resource with a second attribute associated with a parent cloud resource.
16 . The computer system of claim 13 , further comprising:
determining, by the attribute value substitution engine, a source-target relationship between the cloud resource and another cloud resource; and
substituting a first attribute associated with a source cloud resource with a second attribute associated with a target cloud resource.