# CfnDomainProps

Properties for defining a `CfnDomain`.

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

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_amplify as amplify } from 'aws-cdk-lib';
const cfnDomainProps: amplify.CfnDomainProps = {
  appId: 'appId',
  domainName: 'domainName',
  subDomainSettings: [{
    branchName: 'branchName',
    prefix: 'prefix',
  }],

  // the properties below are optional
  autoSubDomainCreationPatterns: ['autoSubDomainCreationPatterns'],
  autoSubDomainIamRole: 'autoSubDomainIamRole',
  certificateSettings: {
    certificateType: 'certificateType',
    customCertificateArn: 'customCertificateArn',
  },
  enableAutoSubDomain: false,
};
```

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_amplify as amplify

cfn_domain_props = amplify.CfnDomainProps(
    app_id="appId",
    domain_name="domainName",
    sub_domain_settings=[amplify.CfnDomain.SubDomainSettingProperty(
        branch_name="branchName",
        prefix="prefix"
    )],

    # the properties below are optional
    auto_sub_domain_creation_patterns=["autoSubDomainCreationPatterns"],
    auto_sub_domain_iam_role="autoSubDomainIamRole",
    certificate_settings=amplify.CfnDomain.CertificateSettingsProperty(
        certificate_type="certificateType",
        custom_certificate_arn="customCertificateArn"
    ),
    enable_auto_sub_domain=False
)
```

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

CfnDomainProps cfnDomainProps = CfnDomainProps.builder()
        .appId("appId")
        .domainName("domainName")
        .subDomainSettings(List.of(SubDomainSettingProperty.builder()
                .branchName("branchName")
                .prefix("prefix")
                .build()))

        // the properties below are optional
        .autoSubDomainCreationPatterns(List.of("autoSubDomainCreationPatterns"))
        .autoSubDomainIamRole("autoSubDomainIamRole")
        .certificateSettings(CertificateSettingsProperty.builder()
                .certificateType("certificateType")
                .customCertificateArn("customCertificateArn")
                .build())
        .enableAutoSubDomain(false)
        .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.Amplify;

var cfnDomainProps = new CfnDomainProps {
    AppId = "appId",
    DomainName = "domainName",
    SubDomainSettings = new [] { new SubDomainSettingProperty {
        BranchName = "branchName",
        Prefix = "prefix"
    } },

    // the properties below are optional
    AutoSubDomainCreationPatterns = new [] { "autoSubDomainCreationPatterns" },
    AutoSubDomainIamRole = "autoSubDomainIamRole",
    CertificateSettings = new CertificateSettingsProperty {
        CertificateType = "certificateType",
        CustomCertificateArn = "customCertificateArn"
    },
    EnableAutoSubDomain = false
};
```

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"

cfnDomainProps := &CfnDomainProps{
	AppId: jsii.String("appId"),
	DomainName: jsii.String("domainName"),
	SubDomainSettings: []interface{}{
		&SubDomainSettingProperty{
			BranchName: jsii.String("branchName"),
			Prefix: jsii.String("prefix"),
		},
	},

	// the properties below are optional
	AutoSubDomainCreationPatterns: []*string{
		jsii.String("autoSubDomainCreationPatterns"),
	},
	AutoSubDomainIamRole: jsii.String("autoSubDomainIamRole"),
	CertificateSettings: &CertificateSettingsProperty{
		CertificateType: jsii.String("certificateType"),
		CustomCertificateArn: jsii.String("customCertificateArn"),
	},
	EnableAutoSubDomain: jsii.Boolean(false),
}
```

## Properties

- `appId`: string (required) — The unique ID for an Amplify app.

- `autoSubDomainCreationPatterns`: string[] — Sets the branch patterns for automatic subdomain creation.

- `autoSubDomainIamRole`: string | [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The required AWS Identity and Access Management (IAMlong) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.

- `certificateSettings`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDomain.CertificateSettingsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_amplify.CfnDomain.CertificateSettingsProperty.html) — The type of SSL/TLS certificate to use for your custom domain.

  If you don't specify a certificate type, Amplify uses the default certificate that it provisions and manages for you.

- `domainName`: string (required) — The domain name for the domain association.

- `enableAutoSubDomain`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Enables the automated creation of subdomains for branches.

- `subDomainSettings`: [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) | [CfnDomain.SubDomainSettingProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_amplify.CfnDomain.SubDomainSettingProperty.html)[] (required) — The setting for the subdomain.
