# CfnApiKeyProps

Properties for defining a `CfnApiKey`.

Used as props by: [CfnApiKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.CfnApiKey.html)

- Source: Generated at build time
- Type last changed: v2.88.0 · 20 Jul 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
const cfnApiKeyProps: apigateway.CfnApiKeyProps = {
  customerId: 'customerId',
  description: 'description',
  enabled: false,
  generateDistinctId: false,
  name: 'name',
  stageKeys: [{
    restApiId: 'restApiId',
    stageName: 'stageName',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  value: 'value',
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigateway as apigateway

cfn_api_key_props = apigateway.CfnApiKeyProps(
    customer_id="customerId",
    description="description",
    enabled=False,
    generate_distinct_id=False,
    name="name",
    stage_keys=[apigateway.CfnApiKey.StageKeyProperty(
        rest_api_id="restApiId",
        stage_name="stageName"
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    value="value"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;

CfnApiKeyProps cfnApiKeyProps = CfnApiKeyProps.builder()
        .customerId("customerId")
        .description("description")
        .enabled(false)
        .generateDistinctId(false)
        .name("name")
        .stageKeys(List.of(StageKeyProperty.builder()
                .restApiId("restApiId")
                .stageName("stageName")
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .value("value")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;

var cfnApiKeyProps = new CfnApiKeyProps {
    CustomerId = "customerId",
    Description = "description",
    Enabled = false,
    GenerateDistinctId = false,
    Name = "name",
    StageKeys = new [] { new StageKeyProperty {
        RestApiId = "restApiId",
        StageName = "stageName"
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Value = "value"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiKeyProps := &CfnApiKeyProps{
	CustomerId: jsii.String("customerId"),
	Description: jsii.String("description"),
	Enabled: jsii.Boolean(false),
	GenerateDistinctId: jsii.Boolean(false),
	Name: jsii.String("name"),
	StageKeys: []interface{}{
		&StageKeyProperty{
			RestApiId: jsii.String("restApiId"),
			StageName: jsii.String("stageName"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Value: jsii.String("value"),
}
```

## Properties

- `customerId`: string — An AWS Marketplace customer identifier, when integrating with the AWS SaaS Marketplace.

- `description`: string — The description of the ApiKey.

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — Specifies whether the ApiKey can be used by callers.

- `generateDistinctId`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specifies whether ( `true` ) or not ( `false` ) the key identifier is distinct from the created API key value.

  This parameter is deprecated and should not be used.

- `name`: string — A name for the API key.

  If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the API key name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .

  > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

- `stageKeys`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApiKey.StageKeyProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.CfnApiKey.StageKeyProperty.html)[] — DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The key-value map of strings.

  The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with `aws:` . The tag value can be up to 256 characters.

- `value`: string — Specifies a value of the API key.
