aws.apigateway.UsagePlan
Explore with Pulumi AI
Provides an API Gateway Usage Plan.
Create UsagePlan Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UsagePlan(name: string, args?: UsagePlanArgs, opts?: CustomResourceOptions);@overload
def UsagePlan(resource_name: str,
              args: Optional[UsagePlanArgs] = None,
              opts: Optional[ResourceOptions] = None)
@overload
def UsagePlan(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              api_stages: Optional[Sequence[UsagePlanApiStageArgs]] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              product_code: Optional[str] = None,
              quota_settings: Optional[UsagePlanQuotaSettingsArgs] = None,
              tags: Optional[Mapping[str, str]] = None,
              throttle_settings: Optional[UsagePlanThrottleSettingsArgs] = None)func NewUsagePlan(ctx *Context, name string, args *UsagePlanArgs, opts ...ResourceOption) (*UsagePlan, error)public UsagePlan(string name, UsagePlanArgs? args = null, CustomResourceOptions? opts = null)
public UsagePlan(String name, UsagePlanArgs args)
public UsagePlan(String name, UsagePlanArgs args, CustomResourceOptions options)
type: aws:apigateway:UsagePlan
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UsagePlanArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UsagePlanArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UsagePlanArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UsagePlanArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UsagePlanArgs
- 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 usagePlanResource = new Aws.ApiGateway.UsagePlan("usagePlanResource", new()
{
    ApiStages = new[]
    {
        new Aws.ApiGateway.Inputs.UsagePlanApiStageArgs
        {
            ApiId = "string",
            Stage = "string",
            Throttles = new[]
            {
                new Aws.ApiGateway.Inputs.UsagePlanApiStageThrottleArgs
                {
                    Path = "string",
                    BurstLimit = 0,
                    RateLimit = 0,
                },
            },
        },
    },
    Description = "string",
    Name = "string",
    ProductCode = "string",
    QuotaSettings = new Aws.ApiGateway.Inputs.UsagePlanQuotaSettingsArgs
    {
        Limit = 0,
        Period = "string",
        Offset = 0,
    },
    Tags = 
    {
        { "string", "string" },
    },
    ThrottleSettings = new Aws.ApiGateway.Inputs.UsagePlanThrottleSettingsArgs
    {
        BurstLimit = 0,
        RateLimit = 0,
    },
});
example, err := apigateway.NewUsagePlan(ctx, "usagePlanResource", &apigateway.UsagePlanArgs{
	ApiStages: apigateway.UsagePlanApiStageArray{
		&apigateway.UsagePlanApiStageArgs{
			ApiId: pulumi.String("string"),
			Stage: pulumi.String("string"),
			Throttles: apigateway.UsagePlanApiStageThrottleArray{
				&apigateway.UsagePlanApiStageThrottleArgs{
					Path:       pulumi.String("string"),
					BurstLimit: pulumi.Int(0),
					RateLimit:  pulumi.Float64(0),
				},
			},
		},
	},
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	ProductCode: pulumi.String("string"),
	QuotaSettings: &apigateway.UsagePlanQuotaSettingsArgs{
		Limit:  pulumi.Int(0),
		Period: pulumi.String("string"),
		Offset: pulumi.Int(0),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ThrottleSettings: &apigateway.UsagePlanThrottleSettingsArgs{
		BurstLimit: pulumi.Int(0),
		RateLimit:  pulumi.Float64(0),
	},
})
var usagePlanResource = new UsagePlan("usagePlanResource", UsagePlanArgs.builder()
    .apiStages(UsagePlanApiStageArgs.builder()
        .apiId("string")
        .stage("string")
        .throttles(UsagePlanApiStageThrottleArgs.builder()
            .path("string")
            .burstLimit(0)
            .rateLimit(0)
            .build())
        .build())
    .description("string")
    .name("string")
    .productCode("string")
    .quotaSettings(UsagePlanQuotaSettingsArgs.builder()
        .limit(0)
        .period("string")
        .offset(0)
        .build())
    .tags(Map.of("string", "string"))
    .throttleSettings(UsagePlanThrottleSettingsArgs.builder()
        .burstLimit(0)
        .rateLimit(0)
        .build())
    .build());
usage_plan_resource = aws.apigateway.UsagePlan("usagePlanResource",
    api_stages=[{
        "api_id": "string",
        "stage": "string",
        "throttles": [{
            "path": "string",
            "burst_limit": 0,
            "rate_limit": 0,
        }],
    }],
    description="string",
    name="string",
    product_code="string",
    quota_settings={
        "limit": 0,
        "period": "string",
        "offset": 0,
    },
    tags={
        "string": "string",
    },
    throttle_settings={
        "burst_limit": 0,
        "rate_limit": 0,
    })
const usagePlanResource = new aws.apigateway.UsagePlan("usagePlanResource", {
    apiStages: [{
        apiId: "string",
        stage: "string",
        throttles: [{
            path: "string",
            burstLimit: 0,
            rateLimit: 0,
        }],
    }],
    description: "string",
    name: "string",
    productCode: "string",
    quotaSettings: {
        limit: 0,
        period: "string",
        offset: 0,
    },
    tags: {
        string: "string",
    },
    throttleSettings: {
        burstLimit: 0,
        rateLimit: 0,
    },
});
type: aws:apigateway:UsagePlan
properties:
    apiStages:
        - apiId: string
          stage: string
          throttles:
            - burstLimit: 0
              path: string
              rateLimit: 0
    description: string
    name: string
    productCode: string
    quotaSettings:
        limit: 0
        offset: 0
        period: string
    tags:
        string: string
    throttleSettings:
        burstLimit: 0
        rateLimit: 0
UsagePlan 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 UsagePlan resource accepts the following input properties:
- ApiStages List<UsagePlan Api Stage> 
- Associated API stages of the usage plan.
- Description string
- Description of a usage plan.
- Name string
- Name of the usage plan.
- ProductCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- QuotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- Dictionary<string, string>
- ThrottleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- ApiStages []UsagePlan Api Stage Args 
- Associated API stages of the usage plan.
- Description string
- Description of a usage plan.
- Name string
- Name of the usage plan.
- ProductCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- QuotaSettings UsagePlan Quota Settings Args 
- Quota of the usage plan.
- map[string]string
- ThrottleSettings UsagePlan Throttle Settings Args 
- Throttling limits of the usage plan.
- apiStages List<UsagePlan Api Stage> 
- Associated API stages of the usage plan.
- description String
- Description of a usage plan.
- name String
- Name of the usage plan.
- productCode String
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- Map<String,String>
- throttleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- apiStages UsagePlan Api Stage[] 
- Associated API stages of the usage plan.
- description string
- Description of a usage plan.
- name string
- Name of the usage plan.
- productCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- {[key: string]: string}
- throttleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- api_stages Sequence[UsagePlan Api Stage Args] 
- Associated API stages of the usage plan.
- description str
- Description of a usage plan.
- name str
- Name of the usage plan.
- product_code str
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quota_settings UsagePlan Quota Settings Args 
- Quota of the usage plan.
- Mapping[str, str]
- throttle_settings UsagePlan Throttle Settings Args 
- Throttling limits of the usage plan.
- apiStages List<Property Map>
- Associated API stages of the usage plan.
- description String
- Description of a usage plan.
- name String
- Name of the usage plan.
- productCode String
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings Property Map
- Quota of the usage plan.
- Map<String>
- throttleSettings Property Map
- Throttling limits of the usage plan.
Outputs
All input properties are implicitly available as output properties. Additionally, the UsagePlan resource produces the following output properties:
Look up Existing UsagePlan Resource
Get an existing UsagePlan 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?: UsagePlanState, opts?: CustomResourceOptions): UsagePlan@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_stages: Optional[Sequence[UsagePlanApiStageArgs]] = None,
        arn: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        product_code: Optional[str] = None,
        quota_settings: Optional[UsagePlanQuotaSettingsArgs] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        throttle_settings: Optional[UsagePlanThrottleSettingsArgs] = None) -> UsagePlanfunc GetUsagePlan(ctx *Context, name string, id IDInput, state *UsagePlanState, opts ...ResourceOption) (*UsagePlan, error)public static UsagePlan Get(string name, Input<string> id, UsagePlanState? state, CustomResourceOptions? opts = null)public static UsagePlan get(String name, Output<String> id, UsagePlanState state, CustomResourceOptions options)resources:  _:    type: aws:apigateway:UsagePlan    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- ApiStages List<UsagePlan Api Stage> 
- Associated API stages of the usage plan.
- Arn string
- ARN
- Description string
- Description of a usage plan.
- Name string
- Name of the usage plan.
- ProductCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- QuotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- Dictionary<string, string>
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- ThrottleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- ApiStages []UsagePlan Api Stage Args 
- Associated API stages of the usage plan.
- Arn string
- ARN
- Description string
- Description of a usage plan.
- Name string
- Name of the usage plan.
- ProductCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- QuotaSettings UsagePlan Quota Settings Args 
- Quota of the usage plan.
- map[string]string
- map[string]string
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- ThrottleSettings UsagePlan Throttle Settings Args 
- Throttling limits of the usage plan.
- apiStages List<UsagePlan Api Stage> 
- Associated API stages of the usage plan.
- arn String
- ARN
- description String
- Description of a usage plan.
- name String
- Name of the usage plan.
- productCode String
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- Map<String,String>
- Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- throttleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- apiStages UsagePlan Api Stage[] 
- Associated API stages of the usage plan.
- arn string
- ARN
- description string
- Description of a usage plan.
- name string
- Name of the usage plan.
- productCode string
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings UsagePlan Quota Settings 
- Quota of the usage plan.
- {[key: string]: string}
- {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- throttleSettings UsagePlan Throttle Settings 
- Throttling limits of the usage plan.
- api_stages Sequence[UsagePlan Api Stage Args] 
- Associated API stages of the usage plan.
- arn str
- ARN
- description str
- Description of a usage plan.
- name str
- Name of the usage plan.
- product_code str
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quota_settings UsagePlan Quota Settings Args 
- Quota of the usage plan.
- Mapping[str, str]
- Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- throttle_settings UsagePlan Throttle Settings Args 
- Throttling limits of the usage plan.
- apiStages List<Property Map>
- Associated API stages of the usage plan.
- arn String
- ARN
- description String
- Description of a usage plan.
- name String
- Name of the usage plan.
- productCode String
- AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
- quotaSettings Property Map
- Quota of the usage plan.
- Map<String>
- Map<String>
- Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- throttleSettings Property Map
- Throttling limits of the usage plan.
Supporting Types
UsagePlanApiStage, UsagePlanApiStageArgs        
- ApiId string
- API Id of the associated API stage in a usage plan.
- Stage string
- API stage name of the associated API stage in a usage plan.
- Throttles
List<UsagePlan Api Stage Throttle> 
- The throttling limits of the usage plan.
- ApiId string
- API Id of the associated API stage in a usage plan.
- Stage string
- API stage name of the associated API stage in a usage plan.
- Throttles
[]UsagePlan Api Stage Throttle 
- The throttling limits of the usage plan.
- apiId String
- API Id of the associated API stage in a usage plan.
- stage String
- API stage name of the associated API stage in a usage plan.
- throttles
List<UsagePlan Api Stage Throttle> 
- The throttling limits of the usage plan.
- apiId string
- API Id of the associated API stage in a usage plan.
- stage string
- API stage name of the associated API stage in a usage plan.
- throttles
UsagePlan Api Stage Throttle[] 
- The throttling limits of the usage plan.
- api_id str
- API Id of the associated API stage in a usage plan.
- stage str
- API stage name of the associated API stage in a usage plan.
- throttles
Sequence[UsagePlan Api Stage Throttle] 
- The throttling limits of the usage plan.
- apiId String
- API Id of the associated API stage in a usage plan.
- stage String
- API stage name of the associated API stage in a usage plan.
- throttles List<Property Map>
- The throttling limits of the usage plan.
UsagePlanApiStageThrottle, UsagePlanApiStageThrottleArgs          
- Path string
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- BurstLimit int
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- RateLimit double
- The API request steady-state rate limit.
- Path string
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- BurstLimit int
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- RateLimit float64
- The API request steady-state rate limit.
- path String
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- burstLimit Integer
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- rateLimit Double
- The API request steady-state rate limit.
- path string
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- burstLimit number
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- rateLimit number
- The API request steady-state rate limit.
- path str
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- burst_limit int
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- rate_limit float
- The API request steady-state rate limit.
- path String
- Method to apply the throttle settings for. Specfiy the path and method, for example /test/GET.
- burstLimit Number
- The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
- rateLimit Number
- The API request steady-state rate limit.
UsagePlanQuotaSettings, UsagePlanQuotaSettingsArgs        
UsagePlanThrottleSettings, UsagePlanThrottleSettingsArgs        
- BurstLimit int
- RateLimit double
- BurstLimit int
- RateLimit float64
- burstLimit Integer
- rateLimit Double
- burstLimit number
- rateLimit number
- burst_limit int
- rate_limit float
- burstLimit Number
- rateLimit Number
Import
Using pulumi import, import AWS API Gateway Usage Plan using the id. For example:
$ pulumi import aws:apigateway/usagePlan:UsagePlan myusageplan <usage_plan_id>
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 awsTerraform Provider.