diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
index 2c520a3..cfcf5ac 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
@@ -144,6 +144,7 @@
         AllottedResourceCustomization arCustomization = new AllottedResourceCustomization();
         arCustomization.setModelCustomizationUUID("f62bb612-c5d4-4406-865c-0abec30631ba");
         arCustomization.setModelInstanceName("rege1802pnf 0");
+        arCustomization.setResourceInput("{}");
         arCustomizationSet.add(arCustomization);
 
         arCustomization.setAllottedResource(expectedService);
@@ -164,7 +165,7 @@
 
     @Test
     @Transactional
-    public void test_VFW_Distrobution() throws Exception {
+    public void test_VFW_Distribution() throws Exception {
 
         wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
                 .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
@@ -290,6 +291,30 @@
         assertEquals("Generic NeutronNet", networkResource.get().getModelName());
     }
 
+    @Test
+    public void test_CCVPN_Distribution() throws Exception {
+        wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
+                .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
+
+        wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+                .willReturn(aResponse().withHeader("Content-Type", "application/json")
+                        .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value())));
+
+        String resourceLocation = "src/test/resources/resource-examples/ccvpn/";
+        ObjectMapper mapper = new ObjectMapper();
+        NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-ccvpn-notification.json"),
+                NotificationDataImpl.class);
+        headers.add("resource-location", resourceLocation);
+        HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers);
+        ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"),
+                HttpMethod.POST, entity, String.class);
+        assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+
+        Optional<Service> service = serviceRepo.findById("5c4d4793-67fb-4155-b7d8-60ec011138c9");
+        assertTrue(service.isPresent());
+        assertEquals("SDWAN", service.get().getModelName());
+    }
+
     protected String createURLWithPort(String uri) {
         return "http://localhost:" + port + uri;
     }
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index 7534ea6..ffad137 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -25,16 +25,19 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 import org.hibernate.exception.LockAcquisitionException;
 import org.junit.Before;
@@ -54,26 +57,38 @@
 import org.onap.sdc.toscaparser.api.NodeTemplate;
 import org.onap.sdc.toscaparser.api.RequirementAssignment;
 import org.onap.sdc.toscaparser.api.RequirementAssignments;
+import org.onap.sdc.toscaparser.api.SubstitutionMappings;
 import org.onap.sdc.toscaparser.api.elements.Metadata;
 import org.onap.sdc.toscaparser.api.elements.StatefulEntityType;
+import org.onap.sdc.toscaparser.api.parameters.Input;
 import org.onap.sdc.utils.DistributionStatusEnum;
 import org.onap.so.asdc.BaseTest;
+import org.onap.so.asdc.client.ResourceInstance;
 import org.onap.so.asdc.client.exceptions.ArtifactInstallerException;
 import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl;
 import org.onap.so.asdc.client.test.emulators.JsonStatusData;
 import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
+import org.onap.so.asdc.installer.IVfModuleData;
 import org.onap.so.asdc.installer.ResourceStructure;
 import org.onap.so.asdc.installer.ToscaResourceStructure;
+import org.onap.so.asdc.installer.VfModuleStructure;
+import org.onap.so.asdc.installer.VfResourceStructure;
+import org.onap.so.asdc.installer.bpmn.WorkflowResource;
 import org.onap.so.db.catalog.beans.ConfigurationResource;
 import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
 import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
 import org.onap.so.db.catalog.beans.ToscaCsar;
+import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
 import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
 import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
 import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
 import org.onap.so.db.catalog.data.repository.ServiceRepository;
 import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
+import org.onap.so.db.catalog.data.repository.VFModuleRepository;
+import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
+import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
 import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
 import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -111,6 +126,8 @@
     @Mock
     private ToscaResourceStructure toscaResourceStructure;
     @Mock
+    private VfResourceStructure vfResourceStruct;
+    @Mock
     private ServiceProxyResourceCustomization spResourceCustomization;
     @Mock
     private ISdcCsarHelper csarHelper;
@@ -258,6 +275,206 @@
     }
 
     @Test
+    public void installTheResourceWithGroupAndVFModulesTest() throws Exception {
+        ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller();
+        ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(true, toscaInstaller);
+
+        toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct);
+        assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully());
+    }
+
+    @Test
+    public void installTheResourceGroupWithoutVFModulesTest() throws Exception {
+        ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller();
+        ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(false, toscaInstaller);
+
+        toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct);
+        assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully());
+    }
+
+    private ToscaResourceStructure prepareToscaResourceStructure(boolean prepareVFModuleStructures,
+            ToscaResourceInstaller toscaInstaller) throws ArtifactInstallerException {
+
+        Metadata metadata = mock(Metadata.class);
+        IResourceInstance resourceInstance = mock(ResourceInstance.class);
+        NodeTemplate nodeTemplate = mock(NodeTemplate.class);
+        ISdcCsarHelper csarHelper = mock(SdcCsarHelperImpl.class);
+
+        IArtifactInfo inputCsar = mock(IArtifactInfo.class);
+        String artifactUuid = "0122c05e-e13a-4c63-b5d2-475ccf23aa74";
+        String checkSum = "MGUzNjJjMzk3OTBkYzExYzQ0MDg2ZDc2M2E3ZjZiZmY=";
+
+        doReturn(checkSum).when(inputCsar).getArtifactChecksum();
+        doReturn(artifactUuid).when(inputCsar).getArtifactUUID();
+        doReturn("1.0").when(inputCsar).getArtifactVersion();
+        doReturn("TestCsarWithGroupAndVFModule").when(inputCsar).getArtifactName();
+        doReturn("Test Csar data with Group and VF module inputs").when(inputCsar).getArtifactDescription();
+        doReturn("http://localhost/dummy/url/test.csar").when(inputCsar).getArtifactURL();
+
+        ToscaResourceStructure toscaResourceStructObj = new ToscaResourceStructure();
+        toscaResourceStructObj.setToscaArtifact(inputCsar);
+
+        ToscaCsarRepository toscaCsarRepo = spy(ToscaCsarRepository.class);
+
+
+        ToscaCsar toscaCsar = mock(ToscaCsar.class);
+        Optional<ToscaCsar> returnValue = Optional.of(toscaCsar);
+        doReturn(artifactUuid).when(toscaCsar).getArtifactUUID();
+        doReturn(checkSum).when(toscaCsar).getArtifactChecksum();
+        doReturn(returnValue).when(toscaCsarRepo).findById(artifactUuid);
+
+        ReflectionTestUtils.setField(toscaInstaller, "toscaCsarRepo", toscaCsarRepo);
+
+        NotificationDataImpl notificationData = new NotificationDataImpl();
+        notificationData.setDistributionID("testStatusSuccessfulTosca");
+        notificationData.setServiceVersion("1234567");
+        notificationData.setServiceUUID("serviceUUID1");
+        notificationData.setWorkloadContext("workloadContext1");
+
+
+
+        String serviceType = "test-type1";
+        String serviceRole = "test-role1";
+        String category = "Network L3+";
+        String description = "Customer Orderable service description";
+        String name = "Customer_Orderable_Service";
+        String uuid = "72db5868-4575-4804-b546-0b0d3c3b5ac6";
+        String invariantUUID = "6f30bbe3-4590-4185-a7e0-4f9610926c6f";
+        String namingPolicy = "naming Policy1";
+        String ecompGeneratedNaming = "true";
+        String environmentContext = "General_Revenue-Bearing1";
+        String resourceCustomizationUUID = "0177ba22-5547-4e4e-bcf8-178f7f71de3a";
+
+        doReturn(serviceType).when(metadata).getValue("serviceType");
+        doReturn(serviceRole).when(metadata).getValue("serviceRole");
+
+        doReturn(category).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+        doReturn(description).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION);
+        doReturn("1.0").when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_VERSION);
+        doReturn(name).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+
+        doReturn(uuid).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
+
+        doReturn(environmentContext).when(metadata).getValue(metadata.getValue("environmentContext"));
+        doReturn(invariantUUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID);
+        doReturn(namingPolicy).when(metadata).getValue("namingPolicy");
+        doReturn(ecompGeneratedNaming).when(metadata).getValue("ecompGeneratedNaming");
+        doReturn(resourceCustomizationUUID).when(metadata).getValue("vfModuleModelCustomizationUUID");
+
+        ServiceRepository serviceRepo = spy(ServiceRepository.class);
+
+        VnfResourceRepository vnfRepo = spy(VnfResourceRepository.class);
+        doReturn(null).when(vnfRepo).findResourceByModelUUID(uuid);
+
+        VFModuleRepository vfModuleRepo = spy(VFModuleRepository.class);
+        InstanceGroupRepository instanceGroupRepo = spy(InstanceGroupRepository.class);
+
+        WorkflowResource workflowResource = spy(WorkflowResource.class);
+
+        ReflectionTestUtils.setField(toscaInstaller, "serviceRepo", serviceRepo);
+        ReflectionTestUtils.setField(toscaInstaller, "vnfRepo", vnfRepo);
+        ReflectionTestUtils.setField(toscaInstaller, "vfModuleRepo", vfModuleRepo);
+        ReflectionTestUtils.setField(toscaInstaller, "instanceGroupRepo", instanceGroupRepo);
+        ReflectionTestUtils.setField(toscaInstaller, "workflowResource", workflowResource);
+
+        // doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper();
+        toscaResourceStructObj.setSdcCsarHelper(csarHelper);
+        doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
+                SdcPropertyNames.PROPERTY_NAME_NFFUNCTION);
+        doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
+                SdcPropertyNames.PROPERTY_NAME_NFROLE);
+        doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
+                SdcPropertyNames.PROPERTY_NAME_NFTYPE);
+        doReturn(resourceCustomizationUUID).when(csarHelper).getMetadataPropertyValue(metadata,
+                SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
+        doReturn(uuid).when(csarHelper).getMetadataPropertyValue(metadata,
+                SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID);
+
+
+        // vnfc instance group list
+        List<Group> vnfcInstanceGroupList = new ArrayList<>();
+        Group vnfcG1 = mock(Group.class);
+        Map<String, Object> metaProperties = new HashMap<>();
+        metaProperties.put(SdcPropertyNames.PROPERTY_NAME_UUID, "vnfc_group1_uuid");
+        metaProperties.put(SdcPropertyNames.PROPERTY_NAME_NAME, "vnfc_group1_uuid");
+        metaProperties.put(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID, "vnfc_group1_invariantid");
+        metaProperties.put(SdcPropertyNames.PROPERTY_NAME_VERSION, "1.0");
+        Metadata vnfcmetadata = new Metadata(metaProperties);
+
+        doReturn(vnfcmetadata).when(vnfcG1).getMetadata();
+        ArrayList<NodeTemplate> memberList = new ArrayList();
+        doReturn(memberList).when(vnfcG1).getMemberNodes();
+        vnfcInstanceGroupList.add(vnfcG1);
+        SubstitutionMappings submappings = mock(SubstitutionMappings.class);
+        doReturn(new ArrayList<Input>()).when(submappings).getInputs();
+        doReturn(submappings).when(nodeTemplate).getSubMappingToscaTemplate();
+
+        doReturn(vnfcInstanceGroupList).when(csarHelper).getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate,
+                "org.openecomp.groups.VfcInstanceGroup");
+
+
+        doReturn(notificationData).when(vfResourceStruct).getNotification();
+        doReturn(resourceInstance).when(vfResourceStruct).getResourceInstance();
+
+        if (prepareVFModuleStructures) {
+
+            // VfModule list
+            List<Group> vfModuleGroups = new ArrayList<>();
+            Group g1 = mock(Group.class);
+            doReturn(metadata).when(g1).getMetadata();
+            vfModuleGroups.add(g1);
+
+            doReturn(vfModuleGroups).when(csarHelper).getVfModulesByVf(resourceCustomizationUUID);
+            doReturn("1").when(csarHelper).getGroupPropertyLeafValue(g1, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT);
+
+            doReturn(metadata).when(nodeTemplate).getMetaData();
+            List<NodeTemplate> nodeList = new ArrayList<>();
+            nodeList.add(nodeTemplate);
+            doReturn(nodeList).when(csarHelper).getServiceVfList();
+
+            IVfModuleData moduleMetadata = mock(IVfModuleData.class);
+            doReturn(name).when(moduleMetadata).getVfModuleModelName();
+            doReturn(invariantUUID).when(moduleMetadata).getVfModuleModelInvariantUUID();
+            doReturn(Collections.<String>emptyList()).when(moduleMetadata).getArtifacts();
+            doReturn(resourceCustomizationUUID).when(moduleMetadata).getVfModuleModelCustomizationUUID();
+            doReturn(uuid).when(moduleMetadata).getVfModuleModelUUID();
+            doReturn("1.0").when(moduleMetadata).getVfModuleModelVersion();
+
+            VfModuleStructure moduleStructure = new VfModuleStructure(vfResourceStruct, moduleMetadata);
+
+            List<VfModuleStructure> moduleStructures = new ArrayList<>();
+            moduleStructures.add(moduleStructure);
+            doReturn(moduleStructures).when(vfResourceStruct).getVfModuleStructure();
+        }
+
+        toscaResourceStructObj.setServiceMetadata(metadata);
+        doReturn("resourceInstanceName1").when(resourceInstance).getResourceInstanceName();
+        doReturn(resourceCustomizationUUID).when(resourceInstance).getResourceCustomizationUUID();
+        doReturn("resourceName1").when(resourceInstance).getResourceName();
+
+        Service service = toscaInstaller.createService(toscaResourceStructObj, vfResourceStruct);
+
+        assertNotNull(service);
+        service.setModelVersion("1.0");
+
+        doReturn(service).when(serviceRepo).save(service);
+
+        WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository =
+                spy(WatchdogComponentDistributionStatusRepository.class);
+        ReflectionTestUtils.setField(toscaInstaller, "watchdogCDStatusRepository", watchdogCDStatusRepository);
+        doReturn(null).when(watchdogCDStatusRepository).save(any(WatchdogComponentDistributionStatus.class));
+
+        VnfcInstanceGroupCustomizationRepository vnfcInstanceGroupCustomizationRepo =
+                spy(VnfcInstanceGroupCustomizationRepository.class);
+        ReflectionTestUtils.setField(toscaInstaller, "vnfcInstanceGroupCustomizationRepo",
+                vnfcInstanceGroupCustomizationRepo);
+        doReturn(null).when(vnfcInstanceGroupCustomizationRepo).save(any(VnfcInstanceGroupCustomization.class));
+        return toscaResourceStructObj;
+    }
+
+
+
+    @Test
     public void installTheResourceExceptionTest() throws Exception {
         expectedException.expect(ArtifactInstallerException.class);
 
diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json
new file mode 100644
index 0000000..bc7d7d7
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json
@@ -0,0 +1,57 @@
+{
+  "distributionID": "cbc7ab24-7d96-4cb5-949c-f23ada265513",
+  "serviceName": "SDWAN",
+  "serviceVersion": "2.0",
+  "serviceUUID": "5c4d4793-67fb-4155-b7d8-60ec011138c9",
+  "serviceDescription": "SDWAN Service",
+  "serviceInvariantUUID": "e830c260-ee21-4830-980c-c802cd9bbb1c",
+  "resources": [
+    {
+      "resourceInstanceName": "siteVF 0",
+      "resourceName": "siteVF",
+      "resourceVersion": "1.0",
+      "resoucreType": "VF",
+      "resourceUUID": "2c10d85c-e492-4813-a2d6-d1fab757fe49",
+      "resourceInvariantUUID": "ed9b1fe5-1e94-4974-a48f-389571837fd6",
+      "resourceCustomizationUUID": "33de5105-edf3-48cb-bda0-37b2aa2f681f",
+      "category": "Configuration",
+      "subcategory": "Configuration",
+      "artifacts": []
+    },
+    {
+      "resourceInstanceName": "vpn 0",
+      "resourceName": "vpn",
+      "resourceVersion": "2.0",
+      "resoucreType": "VF",
+      "resourceUUID": "235861f1-ea93-4443-94fa-82f29903f54f",
+      "resourceInvariantUUID": "c4eff5e7-c4fe-4caf-989b-11efc8e42a73",
+      "resourceCustomizationUUID": "faa89d44-329b-4fcb-a5dc-6e6f84946537",
+      "category": "Configuration",
+      "subcategory": "Configuration",
+      "artifacts": []
+    }
+  ],
+  "serviceArtifacts": [
+    {
+      "artifactName": "service-Sdwan-template.yml",
+      "artifactType": "TOSCA_TEMPLATE",
+      "artifactURL": "/sdc/v1/catalog/services/Sdwan/2.0/artifacts/service-Sdwan-template.yml",
+      "artifactChecksum": "Zjg4MmJmNzI1MTliYzBiZjA2ZmJjN2EwNzZhZTcxYTQ=",
+      "artifactDescription": "TOSCA representation of the asset",
+      "artifactTimeout": 0,
+      "artifactUUID": "5e7beb91-61f9-4613-8cc5-1d288a624abb",
+      "artifactVersion": "2"
+    },
+    {
+      "artifactName": "service-Sdwan-csar.csar",
+      "artifactType": "TOSCA_CSAR",
+      "artifactURL": "/service-Sdwan-csar.csar",
+      "artifactChecksum": "ODA1ZGViMzI0NzIxMmRmNTIzYzE0ZTg5NmExYWFjZTE=",
+      "artifactDescription": "TOSCA definition package of the asset",
+      "artifactTimeout": 0,
+      "artifactUUID": "771ec21a-1d14-4891-a56f-d4e47e2c8c91",
+      "artifactVersion": "2"
+    }
+  ],
+  "workloadContext": "Production"
+}
\ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar
new file mode 100644
index 0000000..7a50842
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar
Binary files differ
