AWSRegions

@interface AWSRegions : NSObject

Common utility methods related to AWS regions.

  • Returns all regions.

    Declaration

    Objective-C

    + (nonnull NSArray<NSNumber *> *)allRegions;

    Swift

    class func allRegions() -> [NSNumber]
  • Returns the short name of the region. This is the value typically used internally by amazon (e.g. in authentication steps). E.g. us-west-2

    Note

    When serializing region information, it’s recommended you convert from enum to shortName string. As Amazon adds more regions throughout the world, the enum values WILL change. However, the shortName values will remain consistent, and so are more reliable for persistent storage.

    Declaration

    Objective-C

    + (nonnull NSString *)shortNameForRegion:(AWSRegion)region;

    Swift

    class func shortName(for region: AWSRegion) -> String
  • Returns a string for the region which is suitable for display to the user. E.g. USA (Oregon)

    Declaration

    Objective-C

    + (nonnull NSString *)displayNameForRegion:(AWSRegion)region;

    Swift

    class func displayName(for region: AWSRegion) -> String
  • Returns the URL host for the given region. The host will be IPv4 specific.

    E.g. us-west-2.amazonaws.com

    Declaration

    Objective-C

    + (nullable NSString *)IPv4HostForRegion:(AWSRegion)region;

    Swift

    class func iPv4Host(for region: AWSRegion) -> String?
  • Returns the URL host for the given region & service). The host will be IPv4 specific.

    E.g. us-west-2.amazonaws.com

    Declaration

    Objective-C

    + (nullable NSString *)IPv4HostForRegion:(AWSRegion)region
                                     service:(AWSService)service;

    Swift

    class func iPv4Host(for region: AWSRegion, service: AWSService) -> String?
  • Returns the URL host for the given region. The host will support both IPv4 & IPv6.

    Note

    DualStack may not be supported by all aws services.

    E.g. dualstack.us-west-2.amazonaws.com

    Declaration

    Objective-C

    + (nullable NSString *)dualStackHostForRegion:(AWSRegion)region;

    Swift

    class func dualStackHost(for region: AWSRegion) -> String?
  • Returns the URL host for the given region & service. The host will support both IPv4 & IPv6.

    Note

    DualStack may not be supported by all aws services.

    E.g. s3.dualstack.us-west-2.amazonaws.com

    Declaration

    Objective-C

    + (nullable NSString *)dualStackHostForRegion:(AWSRegion)region
                                          service:(AWSService)service;

    Swift

    class func dualStackHost(for region: AWSRegion, service: AWSService) -> String?
  • Returns the region enum value for the given region’s shortName.

    This method works with either the shortName or displayName.

    Declaration

    Objective-C

    + (AWSRegion)regionForName:(nonnull NSString *)name;

    Swift

    class func region(forName name: String) -> AWSRegion