pub fn validate_service(service: &str) -> Result<(), ArnError>
Expand description

Verify that a service name meets the naming requirements.

AWS does not publish a formal specification for service names. In this validator, we specify:

  • The service must be composed of at least one or more Unicode non-uppercase alphabetic characeters, numeric
  • characters, or -.
  • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.

“Non-uppercase” is the same as “lowercase” for most Western scripts, but other scripts do not have a concept of uppercase and lowercase.

If service meets the requirements, Ok is returned. Otherwise, a ArnError::InvalidService error is returned.