Show / Hide Table of Contents

Class ApiKeyProps

ApiKey Properties.

Inheritance
System.Object
ApiKeyProps
Implements
IApiKeyProps
IApiKeyOptions
IResourceOptions
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApiKeyProps : Object, IApiKeyProps, IApiKeyOptions, IResourceOptions
Syntax (vb)
Public Class ApiKeyProps
    Inherits Object
    Implements IApiKeyProps, IApiKeyOptions, IResourceOptions
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.APIGateway;

Authorizer authorizer;
Integration integration;
Model model;
RequestValidator requestValidator;
RestApi restApi;
Stage stage;

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 },
    Stages = new [] { stage },
    Value = "value"
};

Synopsis

Constructors

ApiKeyProps()

Properties

ApiKeyName

A name for the API key.

CustomerId

An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

DefaultCorsPreflightOptions

Adds a CORS preflight OPTIONS method to this resource and all child resources.

DefaultIntegration

An integration to use as a default for all methods created within this API unless an integration is specified.

DefaultMethodOptions

Method options to use as a default for all methods created within this API unless custom options are specified.

Description

A description of the purpose of the API key.

Enabled

Indicates whether the API key can be used by clients.

GenerateDistinctId

Specifies whether the key identifier is distinct from the created API key value.

Resources

(deprecated) A list of resources this api key is associated with.

Stages

A list of Stages this api key is associated with.

Value

The value of the API key.

Constructors

ApiKeyProps()

public ApiKeyProps()

Properties

ApiKeyName

A name for the API key.

public string ApiKeyName { get; set; }
Property Value

System.String

Remarks

If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.

Default: automically generated name

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-name

CustomerId

An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

public string CustomerId { get; set; }
Property Value

System.String

Remarks

Default: none

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-customerid

DefaultCorsPreflightOptions

Adds a CORS preflight OPTIONS method to this resource and all child resources.

public ICorsOptions DefaultCorsPreflightOptions { get; set; }
Property Value

ICorsOptions

Remarks

You can add CORS at the resource-level using addCorsPreflight.

Default: - CORS is disabled

DefaultIntegration

An integration to use as a default for all methods created within this API unless an integration is specified.

public Integration DefaultIntegration { get; set; }
Property Value

Integration

Remarks

Default: - Inherited from parent.

DefaultMethodOptions

Method options to use as a default for all methods created within this API unless custom options are specified.

public IMethodOptions DefaultMethodOptions { get; set; }
Property Value

IMethodOptions

Remarks

Default: - Inherited from parent.

Description

A description of the purpose of the API key.

public string Description { get; set; }
Property Value

System.String

Remarks

Default: none

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-description

Enabled

Indicates whether the API key can be used by clients.

public Nullable<bool> Enabled { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: true

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-enabled

GenerateDistinctId

Specifies whether the key identifier is distinct from the created API key value.

public Nullable<bool> GenerateDistinctId { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-generatedistinctid

Resources

(deprecated) A list of resources this api key is associated with.

public IRestApi[] Resources { get; set; }
Property Value

IRestApi[]

Remarks

Default: none

Stability: Deprecated

Stages

A list of Stages this api key is associated with.

public IStage[] Stages { get; set; }
Property Value

IStage[]

Remarks

Default: - the api key is not associated with any stages

Value

The value of the API key.

public string Value { get; set; }
Property Value

System.String

Remarks

Must be at least 20 characters long.

Default: none

Link: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-value

Implements

IApiKeyProps
IApiKeyOptions
IResourceOptions
Back to top Generated by DocFX