pub struct ResourceName {
    pub partition: Option<Identifier>,
    pub service: Identifier,
    pub region: Option<Identifier>,
    pub account_id: Option<AccountIdentifier>,
    pub resource: ResourceIdentifier,
}
Expand description

Amazon Resource Names (ResourceNames) uniquely identify AWS resources. We require an ResourceName when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.

The following are the general formats for ResourceNames; the specific components and values used depend on the AWS service.

arn:partition:service:region:account-id:resource-id
arn:partition:service:region:account-id:resource-type/resource-id
arn:partition:service:region:account-id:resource-type:resource-id

From ResourceName Format

Fields

partition: Option<Identifier>

The partition that the resource is in. For standard AWS Regions, the partition is aws. If you have resources in other partitions, the partition is aws-partitionname. For example, the partition for resources in the China partition is aws-cn. The module known::partition provides common values as constants (if the known feature is enabled).

service: Identifier

The service namespace that identifies the AWS. The module known::service provides

region: Option<Identifier>

The Region that the resource resides in. The ResourceNames for some resources do not require a Region, so this component might be omitted. The module known::region provides common values as constants (if the known feature is enabled).

account_id: Option<AccountIdentifier>

The ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. The ResourceNames for some resources don’t require an account number, so this component may be omitted.

resource: ResourceIdentifier

The content of this part of the ResourceName varies by service. A resource identifier can be the name or ID of the resource (for example, user/Bob or instance/i-1234567890abcdef0) or a resource path. For example, some resource identifiers include a parent resource (sub-resource-type/parent-resource/sub-resource) or a qualifier such as a version (resource-type:resource-name:qualifier).

Implementations

Construct a minimal ResourceName value with simply a service and resource.

Construct a minimal ResourceName value with simply a service and resource in the aws partition.

Return true if the identifier contains variables of the form ${name}, else false.

Replace any variables in the string with values from the context, returning a new value if the replacements result in a legal identifier string. The

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Format:

  • arn:partition:service:region:account-id: | resource part |

The associated error which can be returned from parsing.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.