Skip to main content

aws_sdk_ram/client/
associate_resource_share.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`AssociateResourceShare`](crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`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>
7    ///   - [`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>
8    ///   - [`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>  <li>   <p>A service principal name, for example: <code>service-id.amazonaws.com</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>
9    ///   - [`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>
10    ///   - [`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 source constraints (accounts, ARNs, organization IDs, or organization paths) that limit when service principals can access resources in this resource share. When a service principal attempts to access a shared resource, validation is performed to ensure the request originates from one of the specified sources. This helps prevent confused deputy attacks by applying constraints on where service principals can access resources from.</p><br>
11    /// - On success, responds with [`AssociateResourceShareOutput`](crate::operation::associate_resource_share::AssociateResourceShareOutput) with field(s):
12    ///   - [`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>
13    ///   - [`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>
14    /// - On failure, responds with [`SdkError<AssociateResourceShareError>`](crate::operation::associate_resource_share::AssociateResourceShareError)
15    pub fn associate_resource_share(&self) -> crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder {
16        crate::operation::associate_resource_share::builders::AssociateResourceShareFluentBuilder::new(self.handle.clone())
17    }
18}