# OptionConfiguration

Configuration properties for an option.

Used as argument in: [IOptionGroup.addConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IOptionGroup.html#addconfiguration)

- Source: [`aws-rds/lib/option-group.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-rds/lib/option-group.ts#L39)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';

declare const securityGroup: ec2.SecurityGroup;
declare const vpc: ec2.Vpc;
const optionConfiguration: rds.OptionConfiguration = {
  name: 'name',

  // the properties below are optional
  port: 123,
  securityGroups: [securityGroup],
  settings: {
    settingsKey: 'settings',
  },
  version: 'version',
  vpc: vpc,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_rds as rds

# security_group: ec2.SecurityGroup
# vpc: ec2.Vpc

option_configuration = rds.OptionConfiguration(
    name="name",

    # the properties below are optional
    port=123,
    security_groups=[security_group],
    settings={
        "settings_key": "settings"
    },
    version="version",
    vpc=vpc
)
```

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.ec2.*;
import software.amazon.awscdk.services.rds.*;

SecurityGroup securityGroup;
Vpc vpc;

OptionConfiguration optionConfiguration = OptionConfiguration.builder()
        .name("name")

        // the properties below are optional
        .port(123)
        .securityGroups(List.of(securityGroup))
        .settings(Map.of(
                "settingsKey", "settings"))
        .version("version")
        .vpc(vpc)
        .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.EC2;
using Amazon.CDK.AWS.RDS;

SecurityGroup securityGroup;
Vpc vpc;

var optionConfiguration = new OptionConfiguration {
    Name = "name",

    // the properties below are optional
    Port = 123,
    SecurityGroups = new [] { securityGroup },
    Settings = new Dictionary<string, string> {
        { "settingsKey", "settings" }
    },
    Version = "version",
    Vpc = vpc
};
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var securityGroup SecurityGroup
var vpc Vpc

optionConfiguration := &OptionConfiguration{
	Name: jsii.String("name"),

	// the properties below are optional
	Port: jsii.Number(123),
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},
	Settings: map[string]*string{
		"settingsKey": jsii.String("settings"),
	},
	Version: jsii.String("version"),
	Vpc: vpc,
}
```

## Properties

- `name`: string (required) — The name of the option.

- `port`: number — The port number that this option uses.

  **Default:** no port

  If `port` is specified then `vpc`
  must also be specified.

- `securityGroups`: [ISecurityGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] — Optional list of security groups to use for this option, if `vpc` is specified.

  **Default:** a default group will be created if `port` or `vpc` are specified.

  If no groups are provided, a default one will be created.

- `settings`: { [key: string]: string } — The settings for the option.

  **Default:** no settings

- `version`: string — The version for the option.

  **Default:** no version

- `vpc`: [IVpc](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) — The VPC where a security group should be created for this option.

  **Default:** no VPC

  If `vpc`
  is specified then `port` must also be specified.
