aws_sdk_ram/client/
associate_resource_share.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`AssociateResourceShare`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`resource_share_arn(impl Into<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::resource_share_arn) / [`set_resource_share_arn(Option<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::set_resource_share_arn):<br>required: **true**<br><p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the resource share that you want to add principals or resources to.</p><br>
    ///   - [`resource_arns(impl Into<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::resource_arns) / [`set_resource_arns(Option<Vec::<String>>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::set_resource_arns):<br>required: **false**<br><p>Specifies a list of <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> of the resources that you want to share. This can be <code>null</code> if you want to add only principals.</p><br>
    ///   - [`principals(impl Into<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::principals) / [`set_principals(Option<Vec::<String>>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::set_principals):<br>required: **false**<br><p>Specifies a list of principals to whom you want to the resource share. This can be <code>null</code> if you want to add only resources.</p> <p>What the principals can do with the resources in the share is determined by the RAM permissions that you associate with the resource share. See <code>AssociateResourceSharePermission</code>.</p> <p>You can include the following values:</p> <ul>  <li>   <p>An Amazon Web Services account ID, for example: <code>123456789012</code></p></li>  <li>   <p>An <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an organization in Organizations, for example: <code>organizations::123456789012:organization/o-exampleorgid</code></p></li>  <li>   <p>An ARN of an organizational unit (OU) in Organizations, for example: <code>organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123</code></p></li>  <li>   <p>An ARN of an IAM role, for example: <code>iam::123456789012:role/rolename</code></p></li>  <li>   <p>An ARN of an IAM user, for example: <code>iam::123456789012user/username</code></p></li> </ul><note>  <p>Not all resource types can be shared with IAM roles and users. For more information, see <a href="https://docs.aws.amazon.com/ram/latest/userguide/permissions.html#permissions-rbp-supported-resource-types">Sharing with IAM roles and users</a> in the <i>Resource Access Manager User Guide</i>.</p> </note><br>
    ///   - [`client_token(impl Into<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::set_client_token):<br>required: **false**<br><p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p><br>
    ///   - [`sources(impl Into<String>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::sources) / [`set_sources(Option<Vec::<String>>)`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::set_sources):<br>required: **false**<br><p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p><br>
    /// - On success, responds with [`AssociateResourceShareOutput`](crate::operation::associate_resource_share::AssociateResourceShareOutput) with field(s):
    ///   - [`resource_share_associations(Option<Vec::<ResourceShareAssociation>>)`](crate::operation::associate_resource_share::AssociateResourceShareOutput::resource_share_associations): <p>An array of objects that contain information about the associations.</p>
    ///   - [`client_token(Option<String>)`](crate::operation::associate_resource_share::AssociateResourceShareOutput::client_token): <p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>
    /// - On failure, responds with [`SdkError<AssociateResourceShareError>`](crate::operation::associate_resource_share::AssociateResourceShareError)
    pub fn associate_resource_share(&self) -> crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder {
        crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::new(self.handle.clone())
    }
}