create_resource_share
¶
create_resource_share(
name: String,
*,
config_overrides: Optional[RAMClientConfig] = None,
resource_arns: Optional[ResourceArnList] = None,
principals: Optional[PrincipalArnOrIdList] = None,
tags: Optional[TagList] = None,
allow_external_principals: Optional[Boolean] = None,
client_token: Optional[String] = None,
permission_arns: Optional[PermissionArnList] = None,
sources: Optional[SourceArnOrAccountList] = None,
resource_share_configuration: Optional[ResourceShareConfiguration] = None,
) -> CreateResourceShareResponse
Creates a resource share. You can provide a list of the Amazon Resource Names (ARNs) for the resources that you want to share, a list of principals you want to share the resources with, the permissions to grant those principals, and optionally source constraints to enhance security for service principal sharing.
Sharing a resource makes it available for use by principals outside of the Amazon Web Services account that created the resource. Sharing doesn't change any permissions or quotas that apply to the resource in the account that created it.
Parameters:
-
name(String) –Specifies the name of the resource share.
-
resource_arns(Optional[ResourceArnList], default:None) –Specifies a list of one or more ARNs of the resources to associate with the resource share.
-
principals(Optional[PrincipalArnOrIdList], default:None) –Specifies a list of one or more principals to associate with the resource share.
You can include the following values:
-
An Amazon Web Services account ID, for example:
123456789012 -
An Amazon Resource Name (ARN) of an organization in Organizations, for example:
organizations::123456789012:organization/o-exampleorgid -
An ARN of an organizational unit (OU) in Organizations, for example:
organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123 -
An ARN of an IAM role, for example:
iam::123456789012:role/rolename -
An ARN of an IAM user, for example:
iam::123456789012user/username -
A service principal name, for example:
service-id.amazonaws.com
Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide.
-
-
tags(Optional[TagList], default:None) –Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources associated with the resource share.
-
allow_external_principals(Optional[Boolean], default:None) –Specifies whether principals outside your organization in Organizations can be associated with a resource share. A value of
truelets you share with individual Amazon Web Services accounts that are not in your organization. A value offalseonly has meaning if your account is a member of an Amazon Web Services Organization. The default value istrue. -
client_token(Optional[String], default:None) –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 UUID type of value..
If you don't provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
ClientToken, but with different parameters, the retry fails with anIdempotentParameterMismatcherror. -
permission_arns(Optional[PermissionArnList], default:None) –Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
-
sources(Optional[SourceArnOrAccountList], default:None) –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.
-
resource_share_configuration(Optional[ResourceShareConfiguration], default:None) –Specifies the configuration of this resource share.
Raises:
-
IdempotentParameterMismatchException–The operation failed because the client token input parameter matched one that was used with a previous call to the operation, but at least one of the other input parameters is different from the previous call.
-
InvalidClientTokenException–The operation failed because the specified client token isn't valid.
-
InvalidParameterException–The operation failed because a parameter you specified isn't valid.
-
InvalidStateTransitionException–The operation failed because the requested operation isn't valid for the resource share in its current state.
-
MalformedArnException–The operation failed because the specified Amazon Resource Name (ARN) has a format that isn't valid.
-
OperationNotPermittedException–The operation failed because the requested operation isn't permitted.
-
ResourceShareLimitExceededException–The operation failed because it would exceed the limit for resource shares for your account. You can associate up to 100 resources per call. To view the limits for your Amazon Web Services account, see the RAM page in the Service Quotas console.
-
ServerInternalException–The operation failed because the service could not respond to the request due to an internal problem. Try again later.
-
ServiceUnavailableException–The operation failed because the service isn't available. Try again later.
-
TagLimitExceededException–The operation failed because it would exceed the limit for tags for your Amazon Web Services account.
-
TagPolicyViolationException–The operation failed because the specified tag key is a reserved word and can't be used.
-
ThrottlingException–The operation failed because it exceeded the rate at which you are allowed to perform this operation. Please try again later.
-
UnknownResourceException–The operation failed because a specified resource couldn't be found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ram/_services/ram.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | |