# MultiUserHostedRotationOptions

Multi user hosted rotation options.

Extends: [SingleUserHostedRotationOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.SingleUserHostedRotationOptions.html)
Used as argument in: [HostedRotation.mariaDbMultiUser](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.HostedRotation.html#mariadbmultiuser), HostedRotation.mongoDbMultiUser, HostedRotation.mysqlMultiUser, HostedRotation.oracleMultiUser, HostedRotation.postgreSqlMultiUser, HostedRotation.redshiftMultiUser, HostedRotation.sqlServerMultiUser

- 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#L221)

## 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_secretsmanager as secretsmanager } from 'aws-cdk-lib';

declare const secret: secretsmanager.Secret;
declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const multiUserHostedRotationOptions: secretsmanager.MultiUserHostedRotationOptions = {
  masterSecret: secret,

  // the properties below are optional
  excludeCharacters: 'excludeCharacters',
  functionName: 'functionName',
  securityGroups: [securityGroup],
  vpc: vpc,
  vpcSubnets: {
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  },
};
```

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_secretsmanager as secretsmanager

# secret: secretsmanager.Secret
# security_group: ec2.SecurityGroup
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc: ec2.Vpc

multi_user_hosted_rotation_options = secretsmanager.MultiUserHostedRotationOptions(
    master_secret=secret,

    # the properties below are optional
    exclude_characters="excludeCharacters",
    function_name="functionName",
    security_groups=[security_group],
    vpc=vpc,
    vpc_subnets=ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
    )
)
```

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.secretsmanager.*;

Secret secret;
SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

MultiUserHostedRotationOptions multiUserHostedRotationOptions = MultiUserHostedRotationOptions.builder()
        .masterSecret(secret)

        // the properties below are optional
        .excludeCharacters("excludeCharacters")
        .functionName("functionName")
        .securityGroups(List.of(securityGroup))
        .vpc(vpc)
        .vpcSubnets(SubnetSelection.builder()
                .availabilityZones(List.of("availabilityZones"))
                .onePerAz(false)
                .subnetFilters(List.of(subnetFilter))
                .subnetGroupName("subnetGroupName")
                .subnets(List.of(subnet))
                .subnetType(SubnetType.PRIVATE_ISOLATED)
                .build())
        .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.SecretsManager;

Secret secret;
SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

var multiUserHostedRotationOptions = new MultiUserHostedRotationOptions {
    MasterSecret = secret,

    // the properties below are optional
    ExcludeCharacters = "excludeCharacters",
    FunctionName = "functionName",
    SecurityGroups = new [] { securityGroup },
    Vpc = vpc,
    VpcSubnets = new SubnetSelection {
        AvailabilityZones = new [] { "availabilityZones" },
        OnePerAz = false,
        SubnetFilters = new [] { subnetFilter },
        SubnetGroupName = "subnetGroupName",
        Subnets = new [] { subnet },
        SubnetType = SubnetType.PRIVATE_ISOLATED
    }
};
```

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 secret Secret
var securityGroup SecurityGroup
var subnet Subnet
var subnetFilter SubnetFilter
var vpc Vpc

multiUserHostedRotationOptions := &MultiUserHostedRotationOptions{
	MasterSecret: secret,

	// the properties below are optional
	ExcludeCharacters: jsii.String("excludeCharacters"),
	FunctionName: jsii.String("functionName"),
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},
	Vpc: vpc,
	VpcSubnets: &SubnetSelection{
		AvailabilityZones: []*string{
			jsii.String("availabilityZones"),
		},
		OnePerAz: jsii.Boolean(false),
		SubnetFilters: []SubnetFilter{
			subnetFilter,
		},
		SubnetGroupName: jsii.String("subnetGroupName"),
		Subnets: []ISubnet{
			subnet,
		},
		SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
	},
}
```

## 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

- `masterSecret`: [ISecret](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) (required) — The master secret for a multi user rotation scheme.

- `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.
