Repository: klothoplatform/klotho (go)

Issue:
adding routes to api can fail

engine error
```
Error: failed to run engine: failed to evaluate group 4: failed to evaluate aws:api_integration:rest_api_2:rest_api_2_integration_0#Method: could not apply operational rule for aws:api_integration:rest_api_2:rest_api_2_integration_0#Method: error checking if aws:api_method:rest_api_2:rest_api_2_integration_0_method matches selector 0: error transforming property value in resource selector: could not parse value {{ fieldValue "Resource" .Self }} for property Resource on resource aws:api_method:rest_api_2:rest_api_2_integration_0_method: template: config:1:3: executing "config" at <fieldValue "Resource" .Self>: error calling fieldValue: field 'Resource' not found on resource 'aws:api_integration:rest_api_2:rest_api_2_integration_0'
```

reproducer below

since we cant post yaml files reproducer below


```
constraints:
- node: aws:api_method:rest_api_2:rest_api_2_integration_0_method
  operator: add
  scope: application
- node: aws:api_integration:rest_api_2:rest_api_2_integration_0
  operator: add
  scope: application
- operator: equals
  property: HttpMethod
  scope: resource
  target: aws:api_method:rest_api_2:rest_api_2_integration_0_method
  value: GET
- operator: must_exist
  scope: edge
  target:
    source: aws:rest_api:rest_api_2
    target: aws:api_integration:rest_api_2:rest_api_2_integration_0
- operator: must_exist
  scope: edge
  target:
    source: aws:api_method:rest_api_2:rest_api_2_integration_0_method
    target: aws:api_integration:rest_api_2:rest_api_2_integration_0
- operator: equals
  property: Method
  scope: resource
  target: aws:api_integration:rest_api_2:rest_api_2_integration_0
  value: aws:api_method:rest_api_2:rest_api_2_integration_0_method
- operator: equals
  property: Route
  scope: resource
  target: aws:api_integration:rest_api_2:rest_api_2_integration_0
  value: /

resources:
    aws:api_stage:rest_api_2:api_stage-0:
        Deployment: aws:api_deployment:rest_api_2:api_deployment-0
        RestApi: aws:rest_api:rest_api_2
        StageName: stage
    aws:security_group:vpc-0:ecs_service_1-security_group:
        EgressRules:
            - CidrBlocks:
                - 0.0.0.0/0
              Description: Allows all outbound IPv4 traffic
              FromPort: 0
              Protocol: "-1"
              ToPort: 0
        IngressRules:
            - Description: Allow ingress traffic from within the same security group
              FromPort: 0
              Protocol: "-1"
              Self: true
              ToPort: 0
        Vpc: aws:vpc:vpc-0
    aws:api_deployment:rest_api_2:api_deployment-0:
        RestApi: aws:rest_api:rest_api_2
        Triggers:
            rest_api_2_integration_0: rest_api_2_integration_0
            rest_api_2_integration_0_method: rest_api_2_integration_0_method
    aws:ecs_service:ecs_service_1:
        AssignPublicIp: false
        Cluster: aws:ecs_cluster:ecs_cluster-0
        DesiredCount: 1
        ForceNewDeployment: true
        LaunchType: FARGATE
        SecurityGroups:
            - aws:security_group:vpc-0:ecs_service_1-security_group
        Subnets:
            - aws:subnet:vpc-0:subnet-0
            - aws:subnet:vpc-0:subnet-1
        TaskDefinition: aws:ecs_task_definition:ecs_service_1
    aws:rest_api:rest_api_2:
        BinaryMediaTypes:
            - application/octet-stream
            - image/*
        Stages:
            - aws:api_stage:rest_api_2:api_stage-0
    aws:ecs_cluster:ecs_cluster-0:
    aws:ecs_task_definition:ecs_service_1:
        Cpu: "256"
        ExecutionRole: aws:iam_role:ecs_service_1-execution-role
        Image: aws:ecr_image:ecs_service_1-image
        LogGroup: aws:log_group:ecs_service_1-log-group
        Memory: "512"
        NetworkMode: awsvpc
        PortMappings:
            - ContainerPort: 80
              HostPort: 80
              Protocol: TCP
        Region: aws:region:region-0
        RequiresCompatibilities:
            - FARGATE
        TaskRole: aws:iam_role:ecs_service_1-execution-role
    aws:subnet:vpc-0:subnet-0:
        AvailabilityZone: aws:availability_zone:region-0:availability_zone-0
        CidrBlock: 10.0.128.0/18
        MapPublicIpOnLaunch: false
        RouteTable: aws:route_table:vpc-0:subnet-0-route_table
        Type: private
        Vpc: aws:vpc:vpc-0
    aws:subnet:vpc-0:subnet-1:
        AvailabilityZone: aws:availability_zone:region-0:availability_zone-1
        CidrBlock: 10.0.192.0/18
        MapPublicIpOnLaunch: false
        RouteTable: aws:route_table:vpc-0:subnet-1-route_table
        Type: private
        Vpc: aws:vpc:vpc-0
    aws:ecr_image:ecs_service_1-image:
        Context: .
        Dockerfile: ecs_service_1-image.Dockerfile
        Repo: aws:ecr_repo:ecr_repo-0
    aws:iam_role:ecs_service_1-execution-role:
        AssumeRolePolicyDoc:
            Statement:
                - Action:
                    - sts:AssumeRole
                  Effect: Allow
                  Principal:
                    Service:
                        - ecs-tasks.amazonaws.com
            Version: "2012-10-17"
        ManagedPolicies:
            - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
    aws:log_group:ecs_service_1-log-group:
        LogGroupName: /aws/ecs/ecs_service_1
        RetentionInDays: 5
    aws:route_table_association:subnet-0-subnet-0-route_table:
        RouteTable: aws:route_table:vpc-0:subnet-0-route_table
        Subnet: aws:subnet:vpc-0:subnet-0
    aws:route_table_association:subnet-1-subnet-1-route_table:
        RouteTable: aws:route_table:vpc-0:subnet-1-route_table
        Subnet: aws:subnet:vpc-0:subnet-1
    aws:ecr_repo:ecr_repo-0:
        ForceDelete: true
    aws:route_table:vpc-0:subnet-0-route_table:
        Routes:
            - CidrBlock: 0.0.0.0/0
              NatGateway: aws:nat_gateway:subnet-2:subnet-0-route_table-nat_gateway
        Vpc: aws:vpc:vpc-0
    aws:route_table:vpc-0:subnet-1-route_table:
        Routes:
            - CidrBlock: 0.0.0.0/0
              NatGateway: aws:nat_gateway:subnet-3:subnet-1-route_table-nat_gateway
        Vpc: aws:vpc:vpc-0
    aws:nat_gateway:subnet-2:subnet-0-route_table-nat_gateway:
        ElasticIp: aws:elastic_ip:subnet-0-route_table-nat_gateway-elastic_ip
        Subnet: aws:subnet:vpc-0:subnet-2
    aws:nat_gateway:subnet-3:subnet-1-route_table-nat_gateway:
        ElasticIp: aws:elastic_ip:subnet-1-route_table-nat_gateway-elastic_ip
        Subnet: aws:subnet:vpc-0:subnet-3
    aws:elastic_ip:subnet-0-route_table-nat_gateway-elastic_ip:
    aws:subnet:vpc-0:subnet-2:
        AvailabilityZone: aws:availability_zone:region-0:availability_zone-0
        CidrBlock: 10.0.0.0/18
        MapPublicIpOnLaunch: false
        RouteTable: aws:route_table:vpc-0:subnet-2-route_table
        Type: public
        Vpc: aws:vpc:vpc-0
    aws:elastic_ip:subnet-1-route_table-nat_gateway-elastic_ip:
    aws:subnet:vpc-0:subnet-3:
        AvailabilityZone: aws:availability_zone:region-0:availability_zone-1
        CidrBlock: 10.0.64.0/18
        MapPublicIpOnLaunch: false
        RouteTable: aws:route_table:vpc-0:subnet-3-route_table
        Type: public
        Vpc: aws:vpc:vpc-0
    aws:availability_zone:region-0:availability_zone-0:
        Index: 0
        Region: aws:region:region-0
    aws:route_table_association:subnet-2-subnet-2-route_table:
        RouteTable: aws:route_table:vpc-0:subnet-2-route_table
        Subnet: aws:subnet:vpc-0:subnet-2
    aws:availability_zone:region-0:availability_zone-1:
        Index: 1
        Region: aws:region:region-0
    aws:route_table_association:subnet-3-subnet-3-route_table:
        RouteTable: aws:route_table:vpc-0:subnet-3-route_table
        Subnet: aws:subnet:vpc-0:subnet-3
    aws:route_table:vpc-0:subnet-2-route_table:
        Routes:
            - CidrBlock: 0.0.0.0/0
              Gateway: aws:internet_gateway:vpc-0:internet_gateway-0
        Vpc: aws:vpc:vpc-0
    aws:region:region-0:
    aws:route_table:vpc-0:subnet-3-route_table:
        Routes:
            - CidrBlock: 0.0.0.0/0
              Gateway: aws:internet_gateway:vpc-0:internet_gateway-0
        Vpc: aws:vpc:vpc-0
    aws:internet_gateway:vpc-0:internet_gateway-0:
        Vpc: aws:vpc:vpc-0
    aws:vpc:vpc-0:
        CidrBlock: 10.0.0.0/16
        EnableDnsHostnames: true
        EnableDnsSupport: true
edges:
    aws:api_stage:rest_api_2:api_stage-0 -> aws:api_deployment:rest_api_2:api_deployment-0:
    aws:api_stage:rest_api_2:api_stage-0 -> aws:rest_api:rest_api_2:
    aws:security_group:vpc-0:ecs_service_1-security_group -> aws:ecs_service:ecs_service_1:
    aws:security_group:vpc-0:ecs_service_1-security_group -> aws:vpc:vpc-0:
    aws:api_deployment:rest_api_2:api_deployment-0 -> aws:rest_api:rest_api_2:
    aws:ecs_service:ecs_service_1 -> aws:ecs_cluster:ecs_cluster-0:
    aws:ecs_service:ecs_service_1 -> aws:ecs_task_definition:ecs_service_1:
    aws:ecs_service:ecs_service_1 -> aws:subnet:vpc-0:subnet-0:
    aws:ecs_service:ecs_service_1 -> aws:subnet:vpc-0:subnet-1:
    aws:ecs_task_definition:ecs_service_1 -> aws:ecr_image:ecs_service_1-image:
    aws:ecs_task_definition:ecs_service_1 -> aws:iam_role:ecs_service_1-execution-role:
    aws:ecs_task_definition:ecs_service_1 -> aws:log_group:ecs_service_1-log-group:
    aws:ecs_task_definition:ecs_service_1 -> aws:region:region-0:
    aws:subnet:vpc-0:subnet-0 -> aws:availability_zone:region-0:availability_zone-0:
    aws:subnet:vpc-0:subnet-0 -> aws:route_table_association:subnet-0-subnet-0-route_table:
    aws:subnet:vpc-0:subnet-0 -> aws:vpc:vpc-0:
    aws:subnet:vpc-0:subnet-1 -> aws:availability_zone:region-0:availability_zone-1:
    aws:subnet:vpc-0:subnet-1 -> aws:route_table_association:subnet-1-subnet-1-route_table:
    aws:subnet:vpc-0:subnet-1 -> aws:vpc:vpc-0:
    aws:ecr_image:ecs_service_1-image -> aws:ecr_repo:ecr_repo-0:
    aws:route_table_association:subnet-0-subnet-0-route_table -> aws:route_table:vpc-0:subnet-0-route_table:
    aws:route_table_association:subnet-1-subnet-1-route_table -> aws:route_table:vpc-0:subnet-1-route_table:
    aws:route_table:vpc-0:subnet-0-route_table -> aws:nat_gateway:subnet-2:subnet-0-route_table-nat_gateway:
    aws:route_table:vpc-0:subnet-0-route_table -> aws:vpc:vpc-0:
    aws:route_table:vpc-0:subnet-1-route_table -> aws:nat_gateway:subnet-3:subnet-1-route_table-nat_gateway:
    aws:route_table:vpc-0:subnet-1-route_table -> aws:vpc:vpc-0:
    aws:nat_gateway:subnet-2:subnet-0-route_table-nat_gateway -> aws:elastic_ip:subnet-0-route_table-nat_gateway-elastic_ip:
    aws:nat_gateway:subnet-2:subnet-0-route_table-nat_gateway -> aws:subnet:vpc-0:subnet-2:
    aws:nat_gateway:subnet-3:subnet-1-route_table-nat_gateway -> aws:elastic_ip:subnet-1-route_table-nat_gateway-elastic_ip:
    aws:nat_gateway:subnet-3:subnet-1-route_table-nat_gateway -> aws:subnet:vpc-0:subnet-3:
    aws:subnet:vpc-0:subnet-2 -> aws:availability_zone:region-0:availability_zone-0:
    aws:subnet:vpc-0:subnet-2 -> aws:route_table_association:subnet-2-subnet-2-route_table:
    aws:subnet:vpc-0:subnet-2 -> aws:vpc:vpc-0:
    aws:subnet:vpc-0:subnet-3 -> aws:availability_zone:region-0:availability_zone-1:
    aws:subnet:vpc-0:subnet-3 -> aws:route_table_association:subnet-3-subnet-3-route_table:
    aws:subnet:vpc-0:subnet-3 -> aws:vpc:vpc-0:
    aws:availability_zone:region-0:availability_zone-0 -> aws:region:region-0:
    aws:route_table_association:subnet-2-subnet-2-route_table -> aws:route_table:vpc-0:subnet-2-route_table:
    aws:availability_zone:region-0:availability_zone-1 -> aws:region:region-0:
    aws:route_table_association:subnet-3-subnet-3-route_table -> aws:route_table:vpc-0:subnet-3-route_table:
    aws:route_table:vpc-0:subnet-2-route_table -> aws:internet_gateway:vpc-0:internet_gateway-0:
    aws:route_table:vpc-0:subnet-2-route_table -> aws:vpc:vpc-0:
    aws:route_table:vpc-0:subnet-3-route_table -> aws:internet_gateway:vpc-0:internet_gateway-0:
    aws:route_table:vpc-0:subnet-3-route_table -> aws:vpc:vpc-0:
    aws:internet_gateway:vpc-0:internet_gateway-0 -> aws:vpc:vpc-0:

```

Pull request:
fix bug with routes
closes #814 
method should be unique to the integration, we cant make it check the resource field because that wont exist for / route.

Naming needs to ensure there are no conflicts so we will make sure all resource names are different when we are responsible for naming

### Standard checks

- **Unit tests**: Any special considerations?
- **Docs**: Do we need to update any docs, internal or public?
- **Backwards compatibility**: Will this break existing apps? If so, what would be the extra work required to keep them working?


Patch:
diff --git a/pkg/engine2/operational_rule/operational_action.go b/pkg/engine2/operational_rule/operational_action.go
index 8d6636d2..0083648f 100644
--- a/pkg/engine2/operational_rule/operational_action.go
+++ b/pkg/engine2/operational_rule/operational_action.go
@@ -6,6 +6,7 @@ import (
 	"sort"
 
 	"github.com/dominikbraun/graph"
+	"github.com/google/uuid"
 	"github.com/klothoplatform/klotho/pkg/collectionutil"
 	construct "github.com/klothoplatform/klotho/pkg/construct2"
 	"github.com/klothoplatform/klotho/pkg/engine2/solution_context"
@@ -408,13 +409,21 @@ func (action *operationalResourceAction) generateResourceName(resourceToSet *con
 	if err != nil {
 		return err
 	}
-	matcher := construct.ResourceId{Provider: resourceToSet.Provider, Type: resourceToSet.Type, Namespace: resourceToSet.Namespace}
+	currNames := make(set.Set[string])
+	// we cannot consider things only in the namespace because when creating a resource for an operational action
+	// it likely has not been namespaced yet and we dont know where it will be namespaced to
+	matcher := construct.ResourceId{Provider: resourceToSet.Provider, Type: resourceToSet.Type}
 	for _, id := range ids {
 		if matcher.Matches(id) {
+			currNames.Add(id.Name)
 			numResources++
 		}
 	}
+	// check if the current name based on the digit conflicts with an existing name and if so create a random uuid suffix
 	resourceToSet.Name = fmt.Sprintf("%s-%d", resourceToSet.Type, numResources)
-
+	if currNames.Contains(resourceToSet.Name) {
+		suffix := uuid.NewString()[:8]
+		resourceToSet.Name = fmt.Sprintf("%s-%s", resourceToSet.Type, suffix)
+	}
 	return nil
 }
diff --git a/pkg/templates/aws/resources/api_integration.yaml b/pkg/templates/aws/resources/api_integration.yaml
index 24bc6348..9d3bdf96 100644
--- a/pkg/templates/aws/resources/api_integration.yaml
+++ b/pkg/templates/aws/resources/api_integration.yaml
@@ -31,9 +31,9 @@ properties:
         direction: upstream
         resources:
           - selector: aws:api_method
-            properties:
+            properties: 
               RestApi: '{{ fieldValue "RestApi" .Self }}'
-              Resource: '{{ fieldValue "Resource" .Self }}'
+        unique: true # Each Integration must have its own method
   RequestParameters:
     type: map(string,string)
     operational_rule:


Test patch:
diff --git a/pkg/engine2/testdata/2_routes.expect.yaml b/pkg/engine2/testdata/2_routes.expect.yaml
index 89a2ef1c..b5608563 100755
--- a/pkg/engine2/testdata/2_routes.expect.yaml
+++ b/pkg/engine2/testdata/2_routes.expect.yaml
@@ -6,10 +6,10 @@ resources:
     aws:api_deployment:rest_api_1:api_deployment-0:
         RestApi: aws:rest_api:rest_api_1
         Triggers:
-            api_method-0: api_method-0
-            api_method-1: api_method-1
             integ0: integ0
+            integ0-api_method: integ0-api_method
             integ1: integ1
+            integ1-api_method: integ1-api_method
     aws:rest_api:rest_api_1:
         BinaryMediaTypes:
             - application/octet-stream
@@ -34,13 +34,13 @@ resources:
         ParentResource: aws:api_resource:rest_api_1:lambda1
         PathPart: api
         RestApi: aws:rest_api:rest_api_1
-    aws:api_method:rest_api_1:api_method-0:
+    aws:api_method:rest_api_1:integ0-api_method:
         Authorization: NONE
         HttpMethod: ANY
         RequestParameters: {}
         Resource: aws:api_resource:rest_api_1:api_resource-0
         RestApi: aws:rest_api:rest_api_1
-    aws:api_method:rest_api_1:api_method-1:
+    aws:api_method:rest_api_1:integ1-api_method:
         Authorization: NONE
         HttpMethod: ANY
         RequestParameters: {}
@@ -48,7 +48,7 @@ resources:
         RestApi: aws:rest_api:rest_api_1
     aws:api_integration:rest_api_1:integ0:
         IntegrationHttpMethod: POST
-        Method: aws:api_method:rest_api_1:api_method-0
+        Method: aws:api_method:rest_api_1:integ0-api_method
         RequestParameters: {}
         Resource: aws:api_resource:rest_api_1:api_resource-0
         RestApi: aws:rest_api:rest_api_1
@@ -58,7 +58,7 @@ resources:
         Uri: aws:lambda_function:lambda_function_0#LambdaIntegrationUri
     aws:api_integration:rest_api_1:integ1:
         IntegrationHttpMethod: POST
-        Method: aws:api_method:rest_api_1:api_method-1
+        Method: aws:api_method:rest_api_1:integ1-api_method
         RequestParameters: {}
         Resource: aws:api_resource:rest_api_1:api_resource-1
         RestApi: aws:rest_api:rest_api_1
@@ -134,13 +134,13 @@ edges:
     aws:api_stage:rest_api_1:api_stage-0 -> aws:rest_api:rest_api_1:
     aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_integration:rest_api_1:integ0:
     aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_integration:rest_api_1:integ1:
-    aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_method:rest_api_1:api_method-0:
-    aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_method:rest_api_1:api_method-1:
+    aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_method:rest_api_1:integ0-api_method:
+    aws:api_deployment:rest_api_1:api_deployment-0 -> aws:api_method:rest_api_1:integ1-api_method:
     aws:api_deployment:rest_api_1:api_deployment-0 -> aws:rest_api:rest_api_1:
     aws:rest_api:rest_api_1 -> aws:api_integration:rest_api_1:integ0:
     aws:rest_api:rest_api_1 -> aws:api_integration:rest_api_1:integ1:
-    aws:rest_api:rest_api_1 -> aws:api_method:rest_api_1:api_method-0:
-    aws:rest_api:rest_api_1 -> aws:api_method:rest_api_1:api_method-1:
+    aws:rest_api:rest_api_1 -> aws:api_method:rest_api_1:integ0-api_method:
+    aws:rest_api:rest_api_1 -> aws:api_method:rest_api_1:integ1-api_method:
     aws:rest_api:rest_api_1 -> aws:api_resource:rest_api_1:api_resource-0:
     aws:rest_api:rest_api_1 -> aws:api_resource:rest_api_1:api_resource-1:
     aws:rest_api:rest_api_1 -> aws:api_resource:rest_api_1:lambda0:
@@ -148,11 +148,11 @@ edges:
     aws:api_resource:rest_api_1:lambda0 -> aws:api_resource:rest_api_1:api_resource-0:
     aws:api_resource:rest_api_1:lambda1 -> aws:api_resource:rest_api_1:api_resource-1:
     aws:api_resource:rest_api_1:api_resource-0 -> aws:api_integration:rest_api_1:integ0:
-    aws:api_resource:rest_api_1:api_resource-0 -> aws:api_method:rest_api_1:api_method-0:
+    aws:api_resource:rest_api_1:api_resource-0 -> aws:api_method:rest_api_1:integ0-api_method:
     aws:api_resource:rest_api_1:api_resource-1 -> aws:api_integration:rest_api_1:integ1:
-    aws:api_resource:rest_api_1:api_resource-1 -> aws:api_method:rest_api_1:api_method-1:
-    aws:api_method:rest_api_1:api_method-0 -> aws:api_integration:rest_api_1:integ0:
-    aws:api_method:rest_api_1:api_method-1 -> aws:api_integration:rest_api_1:integ1:
+    aws:api_resource:rest_api_1:api_resource-1 -> aws:api_method:rest_api_1:integ1-api_method:
+    aws:api_method:rest_api_1:integ0-api_method -> aws:api_integration:rest_api_1:integ0:
+    aws:api_method:rest_api_1:integ1-api_method -> aws:api_integration:rest_api_1:integ1:
     aws:api_integration:rest_api_1:integ0 -> aws:lambda_permission:integ0-lambda_function_0:
     aws:api_integration:rest_api_1:integ1 -> aws:lambda_permission:integ1-lambda_function_1:
     aws:lambda_permission:integ0-lambda_function_0 -> aws:lambda_function:lambda_function_0:
diff --git a/pkg/engine2/testdata/2_routes.iac-viz.yaml b/pkg/engine2/testdata/2_routes.iac-viz.yaml
index a134775b..a1922a06 100755
--- a/pkg/engine2/testdata/2_routes.iac-viz.yaml
+++ b/pkg/engine2/testdata/2_routes.iac-viz.yaml
@@ -42,28 +42,28 @@ resources:
   lambda_function/lambda_function_1 -> ecr_image/lambda_function_1-image:
   lambda_function/lambda_function_1 -> iam_role/lambda_function_1-executionrole:
 
-  aws:api_method:rest_api_1/api_method-0:
-  aws:api_method:rest_api_1/api_method-0 -> aws:api_resource:rest_api_1/api_resource-0:
-  aws:api_method:rest_api_1/api_method-0 -> rest_api/rest_api_1:
+  aws:api_method:rest_api_1/integ0-api_method:
+  aws:api_method:rest_api_1/integ0-api_method -> aws:api_resource:rest_api_1/api_resource-0:
+  aws:api_method:rest_api_1/integ0-api_method -> rest_api/rest_api_1:
 
   lambda_permission/integ0-lambda_function_0:
   lambda_permission/integ0-lambda_function_0 -> lambda_function/lambda_function_0:
 
-  aws:api_method:rest_api_1/api_method-1:
-  aws:api_method:rest_api_1/api_method-1 -> aws:api_resource:rest_api_1/api_resource-1:
-  aws:api_method:rest_api_1/api_method-1 -> rest_api/rest_api_1:
+  aws:api_method:rest_api_1/integ1-api_method:
+  aws:api_method:rest_api_1/integ1-api_method -> aws:api_resource:rest_api_1/api_resource-1:
+  aws:api_method:rest_api_1/integ1-api_method -> rest_api/rest_api_1:
 
   lambda_permission/integ1-lambda_function_1:
   lambda_permission/integ1-lambda_function_1 -> lambda_function/lambda_function_1:
 
   aws:api_integration:rest_api_1/integ0:
-  aws:api_integration:rest_api_1/integ0 -> aws:api_method:rest_api_1/api_method-0:
+  aws:api_integration:rest_api_1/integ0 -> aws:api_method:rest_api_1/integ0-api_method:
   aws:api_integration:rest_api_1/integ0 -> aws:api_resource:rest_api_1/api_resource-0:
   aws:api_integration:rest_api_1/integ0 -> lambda_permission/integ0-lambda_function_0:
   aws:api_integration:rest_api_1/integ0 -> rest_api/rest_api_1:
 
   aws:api_integration:rest_api_1/integ1:
-  aws:api_integration:rest_api_1/integ1 -> aws:api_method:rest_api_1/api_method-1:
+  aws:api_integration:rest_api_1/integ1 -> aws:api_method:rest_api_1/integ1-api_method:
   aws:api_integration:rest_api_1/integ1 -> aws:api_resource:rest_api_1/api_resource-1:
   aws:api_integration:rest_api_1/integ1 -> lambda_permission/integ1-lambda_function_1:
   aws:api_integration:rest_api_1/integ1 -> rest_api/rest_api_1:
@@ -71,8 +71,8 @@ resources:
   aws:api_deployment:rest_api_1/api_deployment-0:
   aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_integration:rest_api_1/integ0:
   aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_integration:rest_api_1/integ1:
-  aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_method:rest_api_1/api_method-0:
-  aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_method:rest_api_1/api_method-1:
+  aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_method:rest_api_1/integ0-api_method:
+  aws:api_deployment:rest_api_1/api_deployment-0 -> aws:api_method:rest_api_1/integ1-api_method:
   aws:api_deployment:rest_api_1/api_deployment-0 -> rest_api/rest_api_1:
 
   aws:api_stage:rest_api_1/api_stage-0: