Interface IApiKeyProps
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
ApiKey Properties.
public interface IApiKeyProps : IApiKeyOptions, IResourceOptions
- Inherited Members
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
using Amazon.CDK;
Authorizer authorizer;
Integration integration;
Model model;
RequestValidator requestValidator;
RestApi restApi;
var apiKeyProps = new ApiKeyProps {
ApiKeyName = "apiKeyName",
CustomerId = "customerId",
DefaultCorsPreflightOptions = new CorsOptions {
AllowOrigins = new [] { "allowOrigins" },
// the properties below are optional
AllowCredentials = false,
AllowHeaders = new [] { "allowHeaders" },
AllowMethods = new [] { "allowMethods" },
DisableCache = false,
ExposeHeaders = new [] { "exposeHeaders" },
MaxAge = Duration.Minutes(30),
StatusCode = 123
},
DefaultIntegration = integration,
DefaultMethodOptions = new MethodOptions {
ApiKeyRequired = false,
AuthorizationScopes = new [] { "authorizationScopes" },
AuthorizationType = AuthorizationType.NONE,
Authorizer = authorizer,
MethodResponses = new [] { new MethodResponse {
StatusCode = "statusCode",
// the properties below are optional
ResponseModels = new Dictionary<string, IModel> {
{ "responseModelsKey", model }
},
ResponseParameters = new Dictionary<string, boolean> {
{ "responseParametersKey", false }
}
} },
OperationName = "operationName",
RequestModels = new Dictionary<string, IModel> {
{ "requestModelsKey", model }
},
RequestParameters = new Dictionary<string, boolean> {
{ "requestParametersKey", false }
},
RequestValidator = requestValidator,
RequestValidatorOptions = new RequestValidatorOptions {
RequestValidatorName = "requestValidatorName",
ValidateRequestBody = false,
ValidateRequestParameters = false
}
},
Description = "description",
Enabled = false,
GenerateDistinctId = false,
Resources = new [] { restApi },
Value = "value"
};
Remarks
ExampleMetadata: fixture=_generated
Properties
CustomerId
An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
string? CustomerId { get; }
Property Value
Remarks
Default: none
Enabled
Indicates whether the API key can be used by clients.
bool? Enabled { get; }
Property Value
- bool?
Remarks
Default: true
GenerateDistinctId
Specifies whether the key identifier is distinct from the created API key value.
bool? GenerateDistinctId { get; }
Property Value
- bool?
Remarks
Default: false
Resources
A list of resources this api key is associated with.
IRestApi[]? Resources { get; }
Property Value
- IRestApi[]
Remarks
Default: none