Class DomainName_
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DomainName_ : Resource, IDomainName, IResource, IConstruct, IDependable
Syntax (vb)
Public Class DomainName_ Inherits Resource Implements IDomainName, IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
RestApi api;
var domainName = DomainName.FromDomainNameAttributes(this, "DomainName", new DomainNameAttributes {
DomainName = "domainName",
DomainNameAliasHostedZoneId = "domainNameAliasHostedZoneId",
DomainNameAliasTarget = "domainNameAliasTarget"
});
new BasePathMapping(this, "BasePathMapping", new BasePathMappingProps {
DomainName = domainName,
RestApi = api
});
Synopsis
Constructors
DomainName_(Construct, string, IDomainNameProps) |
Properties
DomainName | The domain name (e.g. |
DomainNameAliasDomainName | The Route53 alias target to use in order to connect a record set to this domain through an alias. |
DomainNameAliasHostedZoneId | The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias. |
PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Methods
AddApiMapping(IStage, IApiMappingOptions?) | Maps this domain to an API endpoint. |
AddBasePathMapping(IRestApi, IBasePathMappingOptions?) | Maps this domain to an API endpoint. |
FromDomainNameAttributes(Construct, string, IDomainNameAttributes) | Imports an existing domain name. |
Constructors
DomainName_(Construct, string, IDomainNameProps)
public DomainName_(Construct scope, string id, IDomainNameProps props)
Parameters
- scope Construct
- id string
- props IDomainNameProps
Remarks
ExampleMetadata: infused
Examples
RestApi api;
var domainName = DomainName.FromDomainNameAttributes(this, "DomainName", new DomainNameAttributes {
DomainName = "domainName",
DomainNameAliasHostedZoneId = "domainNameAliasHostedZoneId",
DomainNameAliasTarget = "domainNameAliasTarget"
});
new BasePathMapping(this, "BasePathMapping", new BasePathMappingProps {
DomainName = domainName,
RestApi = api
});
Properties
DomainName
The domain name (e.g. example.com
).
public virtual string DomainName { get; }
Property Value
Remarks
ExampleMetadata: infused
DomainNameAliasDomainName
The Route53 alias target to use in order to connect a record set to this domain through an alias.
public virtual string DomainNameAliasDomainName { get; }
Property Value
Remarks
ExampleMetadata: infused
DomainNameAliasHostedZoneId
The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.
public virtual string DomainNameAliasHostedZoneId { get; }
Property Value
Remarks
ExampleMetadata: infused
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused
Methods
AddApiMapping(IStage, IApiMappingOptions?)
Maps this domain to an API endpoint.
public virtual void AddApiMapping(IStage targetStage, IApiMappingOptions? options = null)
Parameters
- targetStage IStage
the target API stage.
- options IApiMappingOptions
Options for mapping to a stage.
Remarks
This uses the ApiMapping from ApiGatewayV2 which supports multi-level paths, but also only supports:
AddBasePathMapping(IRestApi, IBasePathMappingOptions?)
Maps this domain to an API endpoint.
public virtual BasePathMapping AddBasePathMapping(IRestApi targetApi, IBasePathMappingOptions? options = null)
Parameters
- targetApi IRestApi
That target API endpoint, requests will be mapped to the deployment stage.
- options IBasePathMappingOptions
Options for mapping to base path with or without a stage.
Returns
Remarks
This uses the BasePathMapping from ApiGateway v1 which does not support multi-level paths.
If you need to create a mapping for a multi-level path use addApiMapping
instead.
FromDomainNameAttributes(Construct, string, IDomainNameAttributes)
Imports an existing domain name.
public static IDomainName FromDomainNameAttributes(Construct scope, string id, IDomainNameAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IDomainNameAttributes
Returns
Remarks
ExampleMetadata: infused