# SingleUserHostedRotationOptions

Single user hosted rotation options.

Used as argument in: [HostedRotation.mariaDbSingleUser](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.HostedRotation.html#mariadbsingleuser), HostedRotation.mongoDbSingleUser, HostedRotation.mysqlSingleUser, HostedRotation.oracleSingleUser, HostedRotation.postgreSqlSingleUser, HostedRotation.redshiftSingleUser, HostedRotation.sqlServerSingleUser

- Source: [`aws-secretsmanager/lib/rotation-schedule.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-secretsmanager/lib/rotation-schedule.ts#L180)
- Type last changed: v2.72.0 · 29 Mar 2023

## Example

TypeScript:

```ts
declare const myVpc: ec2.IVpc;
declare const dbConnections: ec2.Connections;
declare const secret: secretsmanager.Secret;

const myHostedRotation = secretsmanager.HostedRotation.mysqlSingleUser({ vpc: myVpc });
secret.addRotationSchedule('RotationSchedule', { hostedRotation: myHostedRotation });
dbConnections.allowDefaultPortFrom(myHostedRotation);
```

Python:

```python
# my_vpc: ec2.IVpc
# db_connections: ec2.Connections
# secret: secretsmanager.Secret

my_hosted_rotation = secretsmanager.HostedRotation.mysql_single_user(vpc=my_vpc)
secret.add_rotation_schedule("RotationSchedule", hosted_rotation=my_hosted_rotation)
db_connections.allow_default_port_from(my_hosted_rotation)
```

Java:

```java
IVpc myVpc;
Connections dbConnections;
Secret secret;

HostedRotation myHostedRotation = HostedRotation.mysqlSingleUser(SingleUserHostedRotationOptions.builder().vpc(myVpc).build());
secret.addRotationSchedule("RotationSchedule", RotationScheduleOptions.builder().hostedRotation(myHostedRotation).build());
dbConnections.allowDefaultPortFrom(myHostedRotation);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
IVpc myVpc;
Connections dbConnections;
Secret secret;

var myHostedRotation = HostedRotation.MysqlSingleUser(new SingleUserHostedRotationOptions { Vpc = myVpc });
secret.AddRotationSchedule("RotationSchedule", new RotationScheduleOptions { HostedRotation = myHostedRotation });
dbConnections.AllowDefaultPortFrom(myHostedRotation);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myVpc IVpc
var dbConnections Connections
var secret Secret

myHostedRotation := secretsmanager.HostedRotation_MysqlSingleUser(&SingleUserHostedRotationOptions{
	Vpc: myVpc,
})
secret.addRotationSchedule(jsii.String("RotationSchedule"), &RotationScheduleOptions{
	HostedRotation: myHostedRotation,
})
dbConnections.AllowDefaultPortFrom(myHostedRotation)
```

## Properties

- `excludeCharacters`: string — A string of the characters that you don't want in the password.

  **Default:** the same exclude characters as the ones used for the secret or " %+~`#$&*()|[]{}:;<>?!'/@\"\\"

- `functionName`: string — A name for the Lambda created to rotate the secret.

  **Default:** a CloudFormation generated name

- `securityGroups`: [ISecurityGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] — A list of security groups for the Lambda created to rotate the secret.

  **Default:** a new security group is created

- `vpc`: [IVpc](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) — The VPC where the Lambda rotation function will run.

  **Default:** the Lambda is not deployed in a VPC

- `vpcSubnets`: [SubnetSelection](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) — The type of subnets in the VPC where the Lambda rotation function will run.

  **Default:** the Vpc default strategy if not specified.
