Class AwsRegion
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
An AWS region, such as eu-central-2, and the DynamoDB and DynamoDB Streams endpoints that serve it.
public sealed record AwsRegion : IEquatable<AwsRegion>
- Inheritance
-
AwsRegion
- Implements
- Inherited Members
Remarks
The region name ends up in the endpoint host name and in the SigV4 credential scope. It is therefore validated up front: only lowercase ASCII letters, digits and inner hyphens are accepted. This rejects typos early and makes it impossible to inject other hosts through the region name.
Regions in the aws-cn partition (names starting with cn-) resolve to the
amazonaws.com.cn domain. All other regions resolve to amazonaws.com.
Properties
DynamoDbEndpoint
Gets the public HTTPS endpoint of DynamoDB in this region, for example
https://dynamodb.us-east-1.amazonaws.com/.
public Uri DynamoDbEndpoint { get; }
Property Value
DynamoDbStreamsEndpoint
Gets the public HTTPS endpoint of DynamoDB Streams in this region, for example
https://streams.dynamodb.us-east-1.amazonaws.com/. It is a different host from DynamoDbEndpoint.
public Uri DynamoDbStreamsEndpoint { get; }
Property Value
Name
Gets the region name, for example us-east-1.
public string Name { get; }
Property Value
Methods
Equals(AwsRegion?)
public bool Equals(AwsRegion? other)
Parameters
otherAwsRegion
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
FromName(string)
Creates a region from its name.
public static AwsRegion FromName(string name)
Parameters
namestringThe region name, for example
eu-central-2. It must be lowercase.
Returns
- AwsRegion
The region.
Exceptions
- ArgumentNullException
nameis null.- ArgumentException
nameis empty, contains characters other than lowercase ASCII letters, digits and hyphens, or starts or ends with a hyphen.
GetHashCode()
public override int GetHashCode()
Returns
ToString()
Returns the region name.
public override string ToString()
Returns
Operators
operator ==(AwsRegion?, AwsRegion?)
public static bool operator ==(AwsRegion? left, AwsRegion? right)
Parameters
Returns
operator !=(AwsRegion?, AwsRegion?)
public static bool operator !=(AwsRegion? left, AwsRegion? right)