1. Packages
  2. AWS
  3. API Docs
  4. apigateway
  5. MethodSettings
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.apigateway.MethodSettings

Explore with Pulumi AI

Manages API Gateway Stage Method Settings. For example, CloudWatch logging and metrics.

NOTE: We recommend using this resource in conjunction with the aws.apigateway.Stage resource instead of a stage managed by the aws.apigateway.Deployment resource optional stage_name argument. Stages managed by the aws.apigateway.Deployment resource are recreated on redeployment and this resource will require a second apply to recreate the method settings.

Example Usage

End-to-end

Off

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const pathSpecific = new aws.apigateway.MethodSettings("path_specific", {
    restApi: example.id,
    stageName: exampleAwsApiGatewayStage.stageName,
    methodPath: "path1/GET",
    settings: {
        loggingLevel: "OFF",
    },
});
Copy
import pulumi
import pulumi_aws as aws

path_specific = aws.apigateway.MethodSettings("path_specific",
    rest_api=example["id"],
    stage_name=example_aws_api_gateway_stage["stageName"],
    method_path="path1/GET",
    settings={
        "logging_level": "OFF",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewMethodSettings(ctx, "path_specific", &apigateway.MethodSettingsArgs{
			RestApi:    pulumi.Any(example.Id),
			StageName:  pulumi.Any(exampleAwsApiGatewayStage.StageName),
			MethodPath: pulumi.String("path1/GET"),
			Settings: &apigateway.MethodSettingsSettingsArgs{
				LoggingLevel: pulumi.String("OFF"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var pathSpecific = new Aws.ApiGateway.MethodSettings("path_specific", new()
    {
        RestApi = example.Id,
        StageName = exampleAwsApiGatewayStage.StageName,
        MethodPath = "path1/GET",
        Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
        {
            LoggingLevel = "OFF",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.MethodSettings;
import com.pulumi.aws.apigateway.MethodSettingsArgs;
import com.pulumi.aws.apigateway.inputs.MethodSettingsSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var pathSpecific = new MethodSettings("pathSpecific", MethodSettingsArgs.builder()
            .restApi(example.id())
            .stageName(exampleAwsApiGatewayStage.stageName())
            .methodPath("path1/GET")
            .settings(MethodSettingsSettingsArgs.builder()
                .loggingLevel("OFF")
                .build())
            .build());

    }
}
Copy
resources:
  pathSpecific:
    type: aws:apigateway:MethodSettings
    name: path_specific
    properties:
      restApi: ${example.id}
      stageName: ${exampleAwsApiGatewayStage.stageName}
      methodPath: path1/GET
      settings:
        loggingLevel: OFF
Copy

Errors Only

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const pathSpecific = new aws.apigateway.MethodSettings("path_specific", {
    restApi: example.id,
    stageName: exampleAwsApiGatewayStage.stageName,
    methodPath: "path1/GET",
    settings: {
        loggingLevel: "ERROR",
        metricsEnabled: true,
        dataTraceEnabled: false,
    },
});
Copy
import pulumi
import pulumi_aws as aws

path_specific = aws.apigateway.MethodSettings("path_specific",
    rest_api=example["id"],
    stage_name=example_aws_api_gateway_stage["stageName"],
    method_path="path1/GET",
    settings={
        "logging_level": "ERROR",
        "metrics_enabled": True,
        "data_trace_enabled": False,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewMethodSettings(ctx, "path_specific", &apigateway.MethodSettingsArgs{
			RestApi:    pulumi.Any(example.Id),
			StageName:  pulumi.Any(exampleAwsApiGatewayStage.StageName),
			MethodPath: pulumi.String("path1/GET"),
			Settings: &apigateway.MethodSettingsSettingsArgs{
				LoggingLevel:     pulumi.String("ERROR"),
				MetricsEnabled:   pulumi.Bool(true),
				DataTraceEnabled: pulumi.Bool(false),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var pathSpecific = new Aws.ApiGateway.MethodSettings("path_specific", new()
    {
        RestApi = example.Id,
        StageName = exampleAwsApiGatewayStage.StageName,
        MethodPath = "path1/GET",
        Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
        {
            LoggingLevel = "ERROR",
            MetricsEnabled = true,
            DataTraceEnabled = false,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.MethodSettings;
import com.pulumi.aws.apigateway.MethodSettingsArgs;
import com.pulumi.aws.apigateway.inputs.MethodSettingsSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var pathSpecific = new MethodSettings("pathSpecific", MethodSettingsArgs.builder()
            .restApi(example.id())
            .stageName(exampleAwsApiGatewayStage.stageName())
            .methodPath("path1/GET")
            .settings(MethodSettingsSettingsArgs.builder()
                .loggingLevel("ERROR")
                .metricsEnabled(true)
                .dataTraceEnabled(false)
                .build())
            .build());

    }
}
Copy
resources:
  pathSpecific:
    type: aws:apigateway:MethodSettings
    name: path_specific
    properties:
      restApi: ${example.id}
      stageName: ${exampleAwsApiGatewayStage.stageName}
      methodPath: path1/GET
      settings:
        loggingLevel: ERROR
        metricsEnabled: true
        dataTraceEnabled: false
Copy

Errors and Info Logs

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const pathSpecific = new aws.apigateway.MethodSettings("path_specific", {
    restApi: example.id,
    stageName: exampleAwsApiGatewayStage.stageName,
    methodPath: "path1/GET",
    settings: {
        loggingLevel: "INFO",
        metricsEnabled: true,
        dataTraceEnabled: false,
    },
});
Copy
import pulumi
import pulumi_aws as aws

path_specific = aws.apigateway.MethodSettings("path_specific",
    rest_api=example["id"],
    stage_name=example_aws_api_gateway_stage["stageName"],
    method_path="path1/GET",
    settings={
        "logging_level": "INFO",
        "metrics_enabled": True,
        "data_trace_enabled": False,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewMethodSettings(ctx, "path_specific", &apigateway.MethodSettingsArgs{
			RestApi:    pulumi.Any(example.Id),
			StageName:  pulumi.Any(exampleAwsApiGatewayStage.StageName),
			MethodPath: pulumi.String("path1/GET"),
			Settings: &apigateway.MethodSettingsSettingsArgs{
				LoggingLevel:     pulumi.String("INFO"),
				MetricsEnabled:   pulumi.Bool(true),
				DataTraceEnabled: pulumi.Bool(false),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var pathSpecific = new Aws.ApiGateway.MethodSettings("path_specific", new()
    {
        RestApi = example.Id,
        StageName = exampleAwsApiGatewayStage.StageName,
        MethodPath = "path1/GET",
        Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
        {
            LoggingLevel = "INFO",
            MetricsEnabled = true,
            DataTraceEnabled = false,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.MethodSettings;
import com.pulumi.aws.apigateway.MethodSettingsArgs;
import com.pulumi.aws.apigateway.inputs.MethodSettingsSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var pathSpecific = new MethodSettings("pathSpecific", MethodSettingsArgs.builder()
            .restApi(example.id())
            .stageName(exampleAwsApiGatewayStage.stageName())
            .methodPath("path1/GET")
            .settings(MethodSettingsSettingsArgs.builder()
                .loggingLevel("INFO")
                .metricsEnabled(true)
                .dataTraceEnabled(false)
                .build())
            .build());

    }
}
Copy
resources:
  pathSpecific:
    type: aws:apigateway:MethodSettings
    name: path_specific
    properties:
      restApi: ${example.id}
      stageName: ${exampleAwsApiGatewayStage.stageName}
      methodPath: path1/GET
      settings:
        loggingLevel: INFO
        metricsEnabled: true
        dataTraceEnabled: false
Copy

Full Request and Response Logs

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const pathSpecific = new aws.apigateway.MethodSettings("path_specific", {
    restApi: example.id,
    stageName: exampleAwsApiGatewayStage.stageName,
    methodPath: "path1/GET",
    settings: {
        loggingLevel: "INFO",
        metricsEnabled: true,
        dataTraceEnabled: true,
    },
});
Copy
import pulumi
import pulumi_aws as aws

path_specific = aws.apigateway.MethodSettings("path_specific",
    rest_api=example["id"],
    stage_name=example_aws_api_gateway_stage["stageName"],
    method_path="path1/GET",
    settings={
        "logging_level": "INFO",
        "metrics_enabled": True,
        "data_trace_enabled": True,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewMethodSettings(ctx, "path_specific", &apigateway.MethodSettingsArgs{
			RestApi:    pulumi.Any(example.Id),
			StageName:  pulumi.Any(exampleAwsApiGatewayStage.StageName),
			MethodPath: pulumi.String("path1/GET"),
			Settings: &apigateway.MethodSettingsSettingsArgs{
				LoggingLevel:     pulumi.String("INFO"),
				MetricsEnabled:   pulumi.Bool(true),
				DataTraceEnabled: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var pathSpecific = new Aws.ApiGateway.MethodSettings("path_specific", new()
    {
        RestApi = example.Id,
        StageName = exampleAwsApiGatewayStage.StageName,
        MethodPath = "path1/GET",
        Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
        {
            LoggingLevel = "INFO",
            MetricsEnabled = true,
            DataTraceEnabled = true,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.MethodSettings;
import com.pulumi.aws.apigateway.MethodSettingsArgs;
import com.pulumi.aws.apigateway.inputs.MethodSettingsSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var pathSpecific = new MethodSettings("pathSpecific", MethodSettingsArgs.builder()
            .restApi(example.id())
            .stageName(exampleAwsApiGatewayStage.stageName())
            .methodPath("path1/GET")
            .settings(MethodSettingsSettingsArgs.builder()
                .loggingLevel("INFO")
                .metricsEnabled(true)
                .dataTraceEnabled(true)
                .build())
            .build());

    }
}
Copy
resources:
  pathSpecific:
    type: aws:apigateway:MethodSettings
    name: path_specific
    properties:
      restApi: ${example.id}
      stageName: ${exampleAwsApiGatewayStage.stageName}
      methodPath: path1/GET
      settings:
        loggingLevel: INFO
        metricsEnabled: true
        dataTraceEnabled: true
Copy

Create MethodSettings Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MethodSettings(name: string, args: MethodSettingsArgs, opts?: CustomResourceOptions);
@overload
def MethodSettings(resource_name: str,
                   args: MethodSettingsArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def MethodSettings(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   method_path: Optional[str] = None,
                   rest_api: Optional[str] = None,
                   settings: Optional[MethodSettingsSettingsArgs] = None,
                   stage_name: Optional[str] = None)
func NewMethodSettings(ctx *Context, name string, args MethodSettingsArgs, opts ...ResourceOption) (*MethodSettings, error)
public MethodSettings(string name, MethodSettingsArgs args, CustomResourceOptions? opts = null)
public MethodSettings(String name, MethodSettingsArgs args)
public MethodSettings(String name, MethodSettingsArgs args, CustomResourceOptions options)
type: aws:apigateway:MethodSettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. MethodSettingsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. MethodSettingsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. MethodSettingsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. MethodSettingsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. MethodSettingsArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var methodSettingsResource = new Aws.ApiGateway.MethodSettings("methodSettingsResource", new()
{
    MethodPath = "string",
    RestApi = "string",
    Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
    {
        CacheDataEncrypted = false,
        CacheTtlInSeconds = 0,
        CachingEnabled = false,
        DataTraceEnabled = false,
        LoggingLevel = "string",
        MetricsEnabled = false,
        RequireAuthorizationForCacheControl = false,
        ThrottlingBurstLimit = 0,
        ThrottlingRateLimit = 0,
        UnauthorizedCacheControlHeaderStrategy = "string",
    },
    StageName = "string",
});
Copy
example, err := apigateway.NewMethodSettings(ctx, "methodSettingsResource", &apigateway.MethodSettingsArgs{
	MethodPath: pulumi.String("string"),
	RestApi:    pulumi.Any("string"),
	Settings: &apigateway.MethodSettingsSettingsArgs{
		CacheDataEncrypted:                     pulumi.Bool(false),
		CacheTtlInSeconds:                      pulumi.Int(0),
		CachingEnabled:                         pulumi.Bool(false),
		DataTraceEnabled:                       pulumi.Bool(false),
		LoggingLevel:                           pulumi.String("string"),
		MetricsEnabled:                         pulumi.Bool(false),
		RequireAuthorizationForCacheControl:    pulumi.Bool(false),
		ThrottlingBurstLimit:                   pulumi.Int(0),
		ThrottlingRateLimit:                    pulumi.Float64(0),
		UnauthorizedCacheControlHeaderStrategy: pulumi.String("string"),
	},
	StageName: pulumi.String("string"),
})
Copy
var methodSettingsResource = new MethodSettings("methodSettingsResource", MethodSettingsArgs.builder()
    .methodPath("string")
    .restApi("string")
    .settings(MethodSettingsSettingsArgs.builder()
        .cacheDataEncrypted(false)
        .cacheTtlInSeconds(0)
        .cachingEnabled(false)
        .dataTraceEnabled(false)
        .loggingLevel("string")
        .metricsEnabled(false)
        .requireAuthorizationForCacheControl(false)
        .throttlingBurstLimit(0)
        .throttlingRateLimit(0)
        .unauthorizedCacheControlHeaderStrategy("string")
        .build())
    .stageName("string")
    .build());
Copy
method_settings_resource = aws.apigateway.MethodSettings("methodSettingsResource",
    method_path="string",
    rest_api="string",
    settings={
        "cache_data_encrypted": False,
        "cache_ttl_in_seconds": 0,
        "caching_enabled": False,
        "data_trace_enabled": False,
        "logging_level": "string",
        "metrics_enabled": False,
        "require_authorization_for_cache_control": False,
        "throttling_burst_limit": 0,
        "throttling_rate_limit": 0,
        "unauthorized_cache_control_header_strategy": "string",
    },
    stage_name="string")
Copy
const methodSettingsResource = new aws.apigateway.MethodSettings("methodSettingsResource", {
    methodPath: "string",
    restApi: "string",
    settings: {
        cacheDataEncrypted: false,
        cacheTtlInSeconds: 0,
        cachingEnabled: false,
        dataTraceEnabled: false,
        loggingLevel: "string",
        metricsEnabled: false,
        requireAuthorizationForCacheControl: false,
        throttlingBurstLimit: 0,
        throttlingRateLimit: 0,
        unauthorizedCacheControlHeaderStrategy: "string",
    },
    stageName: "string",
});
Copy
type: aws:apigateway:MethodSettings
properties:
    methodPath: string
    restApi: string
    settings:
        cacheDataEncrypted: false
        cacheTtlInSeconds: 0
        cachingEnabled: false
        dataTraceEnabled: false
        loggingLevel: string
        metricsEnabled: false
        requireAuthorizationForCacheControl: false
        throttlingBurstLimit: 0
        throttlingRateLimit: 0
        unauthorizedCacheControlHeaderStrategy: string
    stageName: string
Copy

MethodSettings Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MethodSettings resource accepts the following input properties:

MethodPath
This property is required.
Changes to this property will trigger replacement.
string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
RestApi
This property is required.
Changes to this property will trigger replacement.
string | string
ID of the REST API
Settings This property is required. MethodSettingsSettings
Settings block, see below.
StageName
This property is required.
Changes to this property will trigger replacement.
string
Name of the stage
MethodPath
This property is required.
Changes to this property will trigger replacement.
string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
RestApi
This property is required.
Changes to this property will trigger replacement.
string | string
ID of the REST API
Settings This property is required. MethodSettingsSettingsArgs
Settings block, see below.
StageName
This property is required.
Changes to this property will trigger replacement.
string
Name of the stage
methodPath
This property is required.
Changes to this property will trigger replacement.
String
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi
This property is required.
Changes to this property will trigger replacement.
String | String
ID of the REST API
settings This property is required. MethodSettingsSettings
Settings block, see below.
stageName
This property is required.
Changes to this property will trigger replacement.
String
Name of the stage
methodPath
This property is required.
Changes to this property will trigger replacement.
string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi
This property is required.
Changes to this property will trigger replacement.
string | RestApi
ID of the REST API
settings This property is required. MethodSettingsSettings
Settings block, see below.
stageName
This property is required.
Changes to this property will trigger replacement.
string
Name of the stage
method_path
This property is required.
Changes to this property will trigger replacement.
str
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
rest_api
This property is required.
Changes to this property will trigger replacement.
str | str
ID of the REST API
settings This property is required. MethodSettingsSettingsArgs
Settings block, see below.
stage_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the stage
methodPath
This property is required.
Changes to this property will trigger replacement.
String
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi
This property is required.
Changes to this property will trigger replacement.
String |
ID of the REST API
settings This property is required. Property Map
Settings block, see below.
stageName
This property is required.
Changes to this property will trigger replacement.
String
Name of the stage

Outputs

All input properties are implicitly available as output properties. Additionally, the MethodSettings resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing MethodSettings Resource

Get an existing MethodSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MethodSettingsState, opts?: CustomResourceOptions): MethodSettings
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        method_path: Optional[str] = None,
        rest_api: Optional[str] = None,
        settings: Optional[MethodSettingsSettingsArgs] = None,
        stage_name: Optional[str] = None) -> MethodSettings
func GetMethodSettings(ctx *Context, name string, id IDInput, state *MethodSettingsState, opts ...ResourceOption) (*MethodSettings, error)
public static MethodSettings Get(string name, Input<string> id, MethodSettingsState? state, CustomResourceOptions? opts = null)
public static MethodSettings get(String name, Output<String> id, MethodSettingsState state, CustomResourceOptions options)
resources:  _:    type: aws:apigateway:MethodSettings    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
MethodPath Changes to this property will trigger replacement. string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
RestApi Changes to this property will trigger replacement. string | string
ID of the REST API
Settings MethodSettingsSettings
Settings block, see below.
StageName Changes to this property will trigger replacement. string
Name of the stage
MethodPath Changes to this property will trigger replacement. string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
RestApi Changes to this property will trigger replacement. string | string
ID of the REST API
Settings MethodSettingsSettingsArgs
Settings block, see below.
StageName Changes to this property will trigger replacement. string
Name of the stage
methodPath Changes to this property will trigger replacement. String
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi Changes to this property will trigger replacement. String | String
ID of the REST API
settings MethodSettingsSettings
Settings block, see below.
stageName Changes to this property will trigger replacement. String
Name of the stage
methodPath Changes to this property will trigger replacement. string
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi Changes to this property will trigger replacement. string | RestApi
ID of the REST API
settings MethodSettingsSettings
Settings block, see below.
stageName Changes to this property will trigger replacement. string
Name of the stage
method_path Changes to this property will trigger replacement. str
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
rest_api Changes to this property will trigger replacement. str | str
ID of the REST API
settings MethodSettingsSettingsArgs
Settings block, see below.
stage_name Changes to this property will trigger replacement. str
Name of the stage
methodPath Changes to this property will trigger replacement. String
Method path defined as {resource_path}/{http_method} for an individual method override, or */* for overriding all methods in the stage. Ensure to trim any leading forward slashes in the path (e.g., trimprefix(aws_api_gateway_resource.example.path, "/")).
restApi Changes to this property will trigger replacement. String |
ID of the REST API
settings Property Map
Settings block, see below.
stageName Changes to this property will trigger replacement. String
Name of the stage

Supporting Types

MethodSettingsSettings
, MethodSettingsSettingsArgs

CacheDataEncrypted bool
Whether the cached responses are encrypted.
CacheTtlInSeconds int
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
CachingEnabled bool
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
DataTraceEnabled bool
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
LoggingLevel string
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
MetricsEnabled bool
Whether Amazon CloudWatch metrics are enabled for this method.
RequireAuthorizationForCacheControl bool
Whether authorization is required for a cache invalidation request.
ThrottlingBurstLimit int
Throttling burst limit. Default: -1 (throttling disabled).
ThrottlingRateLimit double
Throttling rate limit. Default: -1 (throttling disabled).
UnauthorizedCacheControlHeaderStrategy string
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.
CacheDataEncrypted bool
Whether the cached responses are encrypted.
CacheTtlInSeconds int
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
CachingEnabled bool
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
DataTraceEnabled bool
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
LoggingLevel string
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
MetricsEnabled bool
Whether Amazon CloudWatch metrics are enabled for this method.
RequireAuthorizationForCacheControl bool
Whether authorization is required for a cache invalidation request.
ThrottlingBurstLimit int
Throttling burst limit. Default: -1 (throttling disabled).
ThrottlingRateLimit float64
Throttling rate limit. Default: -1 (throttling disabled).
UnauthorizedCacheControlHeaderStrategy string
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.
cacheDataEncrypted Boolean
Whether the cached responses are encrypted.
cacheTtlInSeconds Integer
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
cachingEnabled Boolean
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
dataTraceEnabled Boolean
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
loggingLevel String
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
metricsEnabled Boolean
Whether Amazon CloudWatch metrics are enabled for this method.
requireAuthorizationForCacheControl Boolean
Whether authorization is required for a cache invalidation request.
throttlingBurstLimit Integer
Throttling burst limit. Default: -1 (throttling disabled).
throttlingRateLimit Double
Throttling rate limit. Default: -1 (throttling disabled).
unauthorizedCacheControlHeaderStrategy String
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.
cacheDataEncrypted boolean
Whether the cached responses are encrypted.
cacheTtlInSeconds number
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
cachingEnabled boolean
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
dataTraceEnabled boolean
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
loggingLevel string
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
metricsEnabled boolean
Whether Amazon CloudWatch metrics are enabled for this method.
requireAuthorizationForCacheControl boolean
Whether authorization is required for a cache invalidation request.
throttlingBurstLimit number
Throttling burst limit. Default: -1 (throttling disabled).
throttlingRateLimit number
Throttling rate limit. Default: -1 (throttling disabled).
unauthorizedCacheControlHeaderStrategy string
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.
cache_data_encrypted bool
Whether the cached responses are encrypted.
cache_ttl_in_seconds int
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
caching_enabled bool
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
data_trace_enabled bool
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
logging_level str
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
metrics_enabled bool
Whether Amazon CloudWatch metrics are enabled for this method.
require_authorization_for_cache_control bool
Whether authorization is required for a cache invalidation request.
throttling_burst_limit int
Throttling burst limit. Default: -1 (throttling disabled).
throttling_rate_limit float
Throttling rate limit. Default: -1 (throttling disabled).
unauthorized_cache_control_header_strategy str
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.
cacheDataEncrypted Boolean
Whether the cached responses are encrypted.
cacheTtlInSeconds Number
Time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.
cachingEnabled Boolean
Whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.
dataTraceEnabled Boolean
Whether data trace logging is enabled for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
loggingLevel String
Logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. The available levels are OFF, ERROR, and INFO.
metricsEnabled Boolean
Whether Amazon CloudWatch metrics are enabled for this method.
requireAuthorizationForCacheControl Boolean
Whether authorization is required for a cache invalidation request.
throttlingBurstLimit Number
Throttling burst limit. Default: -1 (throttling disabled).
throttlingRateLimit Number
Throttling rate limit. Default: -1 (throttling disabled).
unauthorizedCacheControlHeaderStrategy String
How to handle unauthorized requests for cache invalidation. The available values are FAIL_WITH_403, SUCCEED_WITH_RESPONSE_HEADER, SUCCEED_WITHOUT_RESPONSE_HEADER.

Import

Using pulumi import, import aws_api_gateway_method_settings using REST-API-ID/STAGE-NAME/METHOD-PATH. For example:

$ pulumi import aws:apigateway/methodSettings:MethodSettings example 12345abcde/example/test/GET
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.