# DomainNameProps

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

- Source: [`aws-apigateway/lib/domain-name.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigateway/lib/domain-name.ts#L168)

## Example

TypeScript:

```ts
declare const acmCertificateForExampleCom: any;

new apigateway.DomainName(this, 'custom-domain', {
  domainName: 'example.com',
  certificate: acmCertificateForExampleCom,
  endpointType: apigateway.EndpointType.EDGE, // default is REGIONAL
  securityPolicy: apigateway.SecurityPolicy.TLS_1_2
});
```

Python:

```python
# acm_certificate_for_example_com: Any

apigateway.DomainName(self, "custom-domain",
    domain_name="example.com",
    certificate=acm_certificate_for_example_com,
    endpoint_type=apigateway.EndpointType.EDGE,  # default is REGIONAL
    security_policy=apigateway.SecurityPolicy.TLS_1_2
)
```

Java:

```java
Object acmCertificateForExampleCom;

DomainName.Builder.create(this, "custom-domain")
        .domainName("example.com")
        .certificate(acmCertificateForExampleCom)
        .endpointType(EndpointType.EDGE) // default is REGIONAL
        .securityPolicy(SecurityPolicy.TLS_1_2)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var acmCertificateForExampleCom;

new DomainName(this, "custom-domain", new DomainNameProps {
    DomainName = "example.com",
    Certificate = acmCertificateForExampleCom,
    EndpointType = EndpointType.EDGE,  // default is REGIONAL
    SecurityPolicy = SecurityPolicy.TLS_1_2
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var acmCertificateForExampleCom interface{}

apigateway.NewDomainName(this, jsii.String("custom-domain"), &DomainNameProps{
	DomainName: jsii.String("example.com"),
	Certificate: acmCertificateForExampleCom,
	EndpointType: apigateway.EndpointType_EDGE,
	 // default is REGIONAL
	SecurityPolicy: apigateway.SecurityPolicy_TLS_1_2,
})
```

## Properties

- `basePath`: string — The base path name that callers of the API must provide in the URL after the domain name (e.g. `example.com/base-path`). If you specify this property, it can't be an empty string.

  **Default:** map requests from the domain root (e.g. `example.com`).

- `certificate`: [ICertificateRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_certificatemanager.ICertificateRef.html) (required) — The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name.

  For "EDGE" domain names, the certificate
  needs to be in the US East (N. Virginia) region.

- `domainName`: string (required) — The custom domain name for your API.

  Uppercase letters are not supported.

- `endpointAccessMode`: [EndpointAccessMode](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointAccessMode.html) — The endpoint access mode for this domain name.

  **Default:** No endpoint access mode is configured. Required for enhanced security policies.

  When using enhanced security policies (those starting with `SecurityPolicy_`),
  you must specify this property. STRICT is recommended for production workloads,
  but BASIC may be needed during migration or for certain application architectures.

- `endpointType`: [EndpointType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointType.html) = REGIONAL — The type of endpoint for this DomainName.

- `mapping`: [IRestApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) — If specified, all requests to this domain will be mapped to the production deployment of this API.

  **Default:** you will have to call `addBasePathMapping` to map this domain to API endpoints.

  If you wish to map this domain to multiple APIs
  with different base paths, use `addBasePathMapping` or `addApiMapping`.

- `mtls`: [MTLSConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MTLSConfig.html) — The mutual TLS authentication configuration for a custom domain name.

  **Default:** mTLS is not configured.

- `securityPolicy`: [SecurityPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.SecurityPolicy.html) = SecurityPolicy.TLS_1_2 — The Transport Layer Security (TLS) version + cipher suite for this domain name.
