class GeoLocation
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Route53.GeoLocation |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsroute53#GeoLocation |
![]() | software.amazon.awscdk.services.route53.GeoLocation |
![]() | aws_cdk.aws_route53.GeoLocation |
![]() | aws-cdk-lib » aws_route53 » GeoLocation |
Routing based on geographical location.
Example
declare const myZone: route53.HostedZone;
// continent
new route53.ARecord(this, 'ARecordGeoLocationContinent', {
zone: myZone,
target: route53.RecordTarget.fromIpAddresses('1.2.3.0', '5.6.7.0'),
geoLocation: route53.GeoLocation.continent(route53.Continent.EUROPE),
});
// country
new route53.ARecord(this, 'ARecordGeoLocationCountry', {
zone: myZone,
target: route53.RecordTarget.fromIpAddresses('1.2.3.1', '5.6.7.1'),
geoLocation: route53.GeoLocation.country('DE'), // Germany
});
// subdivision
new route53.ARecord(this, 'ARecordGeoLocationSubDividion', {
zone: myZone,
target: route53.RecordTarget.fromIpAddresses('1.2.3.2', '5.6.7.2'),
geoLocation: route53.GeoLocation.subdivision('WA'), // Washington
});
// default (wildcard record if no specific record is found)
new route53.ARecord(this, 'ARecordGeoLocationDefault', {
zone: myZone,
target: route53.RecordTarget.fromIpAddresses('1.2.3.3', '5.6.7.3'),
geoLocation: route53.GeoLocation.default(),
});
Properties
Name | Type | Description |
---|---|---|
continent | Continent | |
country | string | |
subdivision | string |
continentCode?
Type:
Continent
(optional)
countryCode?
Type:
string
(optional)
subdivisionCode?
Type:
string
(optional)
Methods
Name | Description |
---|---|
static continent(continentCode) | Geolocation resource record based on continent code. |
static country(countryCode) | Geolocation resource record based on country code. |
static default() | Default (wildcard) routing record if no specific geolocation record is found. |
static subdivision(subdivisionCode, countryCode?) | Geolocation resource record based on subdivision code (e.g. state of the United States). |
static continent(continentCode)
public static continent(continentCode: Continent): GeoLocation
Parameters
- continentCode
Continent
— Continent.
Returns
Geolocation resource record based on continent code.
static country(countryCode)
public static country(countryCode: string): GeoLocation
Parameters
- countryCode
string
— Two-letter, uppercase country code for the country.
Returns
Geolocation resource record based on country code.
See also: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
static default()
public static default(): GeoLocation
Returns
Default (wildcard) routing record if no specific geolocation record is found.
static subdivision(subdivisionCode, countryCode?)
public static subdivision(subdivisionCode: string, countryCode?: string): GeoLocation
Parameters
- subdivisionCode
string
— Code of the subdivision (e.g. state of the United States). - countryCode
string
— Country code (ISO 3166-1-alpha-2) of this record, by default US (United States).
Returns
Geolocation resource record based on subdivision code (e.g. state of the United States).