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-idFrom 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: IdentifierThe 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: ResourceIdentifierThe 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§
Source§impl ResourceName
impl ResourceName
Sourcepub fn new(service: Identifier, resource: ResourceIdentifier) -> Self
pub fn new(service: Identifier, resource: ResourceIdentifier) -> Self
Construct a minimal ResourceName value with simply a service and resource.
Sourcepub fn aws(service: Identifier, resource: ResourceIdentifier) -> Self
pub fn aws(service: Identifier, resource: ResourceIdentifier) -> Self
Construct a minimal ResourceName value with simply a service and resource in the aws partition.
Sourcepub fn has_variables(&self) -> bool
pub fn has_variables(&self) -> bool
Return true if the identifier contains variables of the form
${name}, else false.
Trait Implementations§
Source§impl Clone for ResourceName
impl Clone for ResourceName
Source§fn clone(&self) -> ResourceName
fn clone(&self) -> ResourceName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more