title: AWS Cloud formation always failed when I try to add new route to gateway
body: <p>I tried 7 times now but still failed.  I'm adding a new route endpoint to my API gateway.  I've made the required changes on the cloud formation file and upload it to AWS.</p>
  <p>Every try, I got the following error, I don't know how to fix it.</p>
  <pre><code>'comp/*/*' is not a valid method path. Method paths can be defined as
  {resource_path}/{http_method} for an individual method override,
  or */* for overriding all methods in the stage. 
  (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; 
  Request ID: 0878sd34-4555-987s-3332-8dfg7d8f9;
   Proxy: null)
  </code></pre>
  <p>Here's a part of the cloud formation file.</p>
  <pre class="lang-yaml prettyprint-override"><code>      DevEnvStage:
          Type: &quot;AWS::ApiGateway::Stage&quot;
          Properties:
            RestApiId: !Ref RestApi
            StageName: 'dev'
            Description: Stage for development environment
            DeploymentId: !Ref FakeStageDeployment
            CacheClusterEnabled: false
            MethodSettings:
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/red/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/yellow/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/blue/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/comp/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/dribl/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
            Variables:
              &quot;&quot;: &quot;&quot;
      
        QaEnvStage:
          Type: &quot;AWS::ApiGateway::Stage&quot;
          Properties:
            RestApiId: !Ref RestApi
            StageName: 'qa'
            Description: Stage for development environment
            DeploymentId: !Ref FakeStageDeployment
            CacheClusterEnabled: false
            MethodSettings:
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/black/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/red/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/yellow/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/blue/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/comp/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
            Variables:
              &quot;&quot;: &quot;&quot;
      
        StageEnvStage:
          Type: &quot;AWS::ApiGateway::Stage&quot;
          Properties:
            RestApiId: !Ref RestApi
            StageName: 'stg'
            Description: Stage for development environment
            DeploymentId: !Ref FakeStageDeployment
            CacheClusterEnabled: false
            MethodSettings:
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/black/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/red/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/yellow/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/blue/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/comp/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
            Variables:
              &quot;&quot;: &quot;&quot;
      
        ProdEnvStage:
          Type: &quot;AWS::ApiGateway::Stage&quot;
          Properties:
            RestApiId: !Ref RestApi
            StageName: 'prod'
            Description: Stage for development environment
            DeploymentId: !Ref FakeStageDeployment
            CacheClusterEnabled: false
            MethodSettings:
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/yellow/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/red/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/red/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/blue/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/comp/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
              - HttpMethod: &quot;*&quot;
                ResourcePath: &quot;/*&quot;
                CachingEnabled: true
                CacheDataEncrypted: false
                CacheTtlInSeconds: 180
            Variables:
              &quot;Hostname&quot;: &quot;&quot;
      
        DevEnvGatewayCustomDomain:
          Type: &quot;AWS::ApiGateway::DomainName&quot;
          Properties:
            DomainName: &quot;&quot;
            CertificateArn: &quot;&quot;
            EndpointConfiguration:
              Types:
                - EDGE
      
        DevEnvGatewayBasePathMapping:
          Type: &quot;AWS::ApiGateway::BasePathMapping&quot;
          Properties:
            RestApiId: !Ref RestApi
            DomainName: !Ref DevEnvGatewayCustomDomain
            Stage: !Ref DevEnvStage
      
        QaEnvGatewayCustomDomain:
          Type: &quot;AWS::ApiGateway::DomainName&quot;
          Properties:
            DomainName: &quot;&quot;
            CertificateArn: &quot;&quot;
            EndpointConfiguration:
              Types:
                - EDGE
      
        QaEnvGatewayBasePathMapping:
          Type: &quot;AWS::ApiGateway::BasePathMapping&quot;
          Properties:
            RestApiId: !Ref RestApi
            DomainName: !Ref QaEnvGatewayCustomDomain
            Stage: !Ref QaEnvStage
      
        StageEnvGatewayCustomDomain:
          Type: &quot;AWS::ApiGateway::DomainName&quot;
          Properties:
            DomainName: &quot;&quot;
            CertificateArn: &quot;&quot;
            EndpointConfiguration:
              Types:
                - EDGE
      
        StageEnvGatewayBasePathMapping:
          Type: &quot;AWS::ApiGateway::BasePathMapping&quot;
          Properties:
            RestApiId: !Ref RestApi
            DomainName: !Ref StageEnvGatewayCustomDomain
            Stage: !Ref StageEnvStage
      
        ProdEnvGatewayCustomDomain:
          Type: &quot;AWS::ApiGateway::DomainName&quot;
          Properties:
            DomainName: &quot;&quot;
            CertificateArn: &quot;&quot;
            EndpointConfiguration:
              Types:
                - EDGE
      
        ProdEnvGatewayBasePathMapping:
          Type: &quot;AWS::ApiGateway::BasePathMapping&quot;
          Properties:
            RestApiId: !Ref RestApi
            DomainName: !Ref ProdEnvGatewayCustomDomain
            Stage: !Ref ProdEnvStage
  </code></pre>
  <p>As you can see in the method settings section.  The HttpMehod for comp is &quot;<code>/comp/*</code>&quot;  not &quot;<code>/comp/*/*</code>&quot;</p>