UsagePlan

class UsagePlan : KotlinCustomResource

Provides an API Gateway Usage Plan.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.RestApi;
import com.pulumi.aws.apigateway.RestApiArgs;
import com.pulumi.aws.apigateway.Deployment;
import com.pulumi.aws.apigateway.DeploymentArgs;
import com.pulumi.aws.apigateway.Stage;
import com.pulumi.aws.apigateway.StageArgs;
import com.pulumi.aws.apigateway.UsagePlan;
import com.pulumi.aws.apigateway.UsagePlanArgs;
import com.pulumi.aws.apigateway.inputs.UsagePlanApiStageArgs;
import com.pulumi.aws.apigateway.inputs.UsagePlanQuotaSettingsArgs;
import com.pulumi.aws.apigateway.inputs.UsagePlanThrottleSettingsArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 exampleRestApi = new RestApi("exampleRestApi", RestApiArgs.builder()
.body(serializeJson(
jsonObject(
jsonProperty("openapi", "3.0.1"),
jsonProperty("info", jsonObject(
jsonProperty("title", "example"),
jsonProperty("version", "1.0")
)),
jsonProperty("paths", jsonObject(
jsonProperty("/path1", jsonObject(
jsonProperty("get", jsonObject(
jsonProperty("x-amazon-apigateway-integration", jsonObject(
jsonProperty("httpMethod", "GET"),
jsonProperty("payloadFormatVersion", "1.0"),
jsonProperty("type", "HTTP_PROXY"),
jsonProperty("uri", "https://ip-ranges.amazonaws.com/ip-ranges.json")
))
))
))
))
)))
.build());
var exampleDeployment = new Deployment("exampleDeployment", DeploymentArgs.builder()
.restApi(exampleRestApi.id())
.triggers(Map.of("redeployment", exampleRestApi.body().applyValue(body -> serializeJson(
body)).applyValue(toJSON -> computeSHA1(toJSON))))
.build());
var development = new Stage("development", StageArgs.builder()
.deployment(exampleDeployment.id())
.restApi(exampleRestApi.id())
.stageName("development")
.build());
var production = new Stage("production", StageArgs.builder()
.deployment(exampleDeployment.id())
.restApi(exampleRestApi.id())
.stageName("production")
.build());
var exampleUsagePlan = new UsagePlan("exampleUsagePlan", UsagePlanArgs.builder()
.description("my description")
.productCode("MYCODE")
.apiStages(
UsagePlanApiStageArgs.builder()
.apiId(exampleRestApi.id())
.stage(development.stageName())
.build(),
UsagePlanApiStageArgs.builder()
.apiId(exampleRestApi.id())
.stage(production.stageName())
.build())
.quotaSettings(UsagePlanQuotaSettingsArgs.builder()
.limit(20)
.offset(2)
.period("WEEK")
.build())
.throttleSettings(UsagePlanThrottleSettingsArgs.builder()
.burstLimit(5)
.rateLimit(10)
.build())
.build());
}
}

Import

AWS API Gateway Usage Plan can be imported using the id, e.g.,

$ pulumi import aws:apigateway/usagePlan:UsagePlan myusageplan <usage_plan_id>

Properties

Link copied to clipboard

Associated API stages of the usage plan.

Link copied to clipboard
val arn: Output<String>

ARN

Link copied to clipboard
val description: Output<String>?

Description of a usage plan.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Name of the usage plan.

Link copied to clipboard
val productCode: Output<String>?

AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The quota settings of the usage plan.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

The throttling limits of the usage plan.

Link copied to clipboard
val urn: Output<String>