Usage Plan Key Args
data class UsagePlanKeyArgs(val keyId: Output<String>? = null, val keyType: Output<String>? = null, val usagePlanId: Output<String>? = null) : ConvertibleToJava<UsagePlanKeyArgs>
Provides an API Gateway Usage Plan Key.
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.UsagePlan;
import com.pulumi.aws.apigateway.UsagePlanArgs;
import com.pulumi.aws.apigateway.inputs.UsagePlanApiStageArgs;
import com.pulumi.aws.apigateway.ApiKey;
import com.pulumi.aws.apigateway.UsagePlanKey;
import com.pulumi.aws.apigateway.UsagePlanKeyArgs;
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 test = new RestApi("test");
var myusageplan = new UsagePlan("myusageplan", UsagePlanArgs.builder()
.apiStages(UsagePlanApiStageArgs.builder()
.apiId(test.id())
.stage(aws_api_gateway_stage.foo().stage_name())
.build())
.build());
var mykey = new ApiKey("mykey");
var main = new UsagePlanKey("main", UsagePlanKeyArgs.builder()
.keyId(mykey.id())
.keyType("API_KEY")
.usagePlanId(myusageplan.id())
.build());
}
}
Content copied to clipboard
Import
AWS API Gateway Usage Plan Key can be imported using the USAGE-PLAN-ID/USAGE-PLAN-KEY-ID
, e.g.,
$ pulumi import aws:apigateway/usagePlanKey:UsagePlanKey key 12345abcde/zzz
Content copied to clipboard