Skip to content

promote_resource_share_created_from_policy

promote_resource_share_created_from_policy(
    resource_share_arn: String, *, config_overrides: Optional[RAMClientConfig] = None
) -> PromoteResourceShareCreatedFromPolicyResponse

When you attach a resource-based policy to a resource, RAM automatically creates a resource share of featureSet=CREATED_FROM_POLICY with a managed permission that has the same IAM permissions as the original resource-based policy. However, this type of managed permission is visible to only the resource share owner, and the associated resource share can't be modified by using RAM.

This operation promotes the resource share to a STANDARD resource share that is fully manageable in RAM. When you promote a resource share, you can then manage the resource share in RAM and it becomes visible to all of the principals you shared it with.

Before you perform this operation, you should first run PromotePermissionCreatedFromPolicyto ensure that you have an appropriate customer managed permission that can be associated with this resource share after its is promoted. If this operation can't find a managed permission that exactly matches the existing CREATED_FROM_POLICY permission, then this operation fails.

Parameters:

Raises:

Source code in docs_src/capo_ram/_services/ram.py
def promote_resource_share_created_from_policy(
    self,
    resource_share_arn: "capo_ram.types.string.String",
    *,
    config_overrides: Optional[RAMClientConfig] = None,
) -> "capo_ram.types.promote_resource_share_created_from_policy_response.PromoteResourceShareCreatedFromPolicyResponse":
    """<p>When you attach a resource-based policy to a resource, RAM automatically creates a resource share of <code>featureSet</code>=<code>CREATED_FROM_POLICY</code> with a managed permission that has the same IAM permissions as the original resource-based policy. However, this type of managed permission is visible to only the resource share owner, and the associated resource share can't be modified by using RAM.</p> <p>This operation promotes the resource share to a <code>STANDARD</code> resource share that is fully manageable in RAM. When you promote a resource share, you can then manage the resource share in RAM and it becomes visible to all of the principals you shared it with.</p> <important> <p>Before you perform this operation, you should first run <a>PromotePermissionCreatedFromPolicy</a>to ensure that you have an appropriate customer managed permission that can be associated with this resource share after its is promoted. If this operation can't find a managed permission that exactly matches the existing <code>CREATED_FROM_POLICY</code> permission, then this operation fails.</p> </important>

    Args:
        resource_share_arn: <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 to promote.</p>

    Raises:
        capo_ram.errors.invalid_parameter_exception.InvalidParameterException: <p>The operation failed because a parameter you specified isn't valid.</p>
        capo_ram.errors.invalid_state_transition_exception.InvalidStateTransitionException: <p>The operation failed because the requested operation isn't valid for the resource share in its current state.</p>
        capo_ram.errors.malformed_arn_exception.MalformedArnException: <p>The operation failed because the specified <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> has a format that isn't valid.</p>
        capo_ram.errors.missing_required_parameter_exception.MissingRequiredParameterException: <p>The operation failed because a required input parameter is missing.</p>
        capo_ram.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The operation failed because the requested operation isn't permitted.</p>
        capo_ram.errors.resource_share_limit_exceeded_exception.ResourceShareLimitExceededException: <p>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 <a href="https://console.aws.amazon.com/servicequotas/home/services/ram/quotas">RAM page in the Service Quotas console</a>.</p>
        capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
        capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
        capo_ram.errors.unknown_resource_exception.UnknownResourceException: <p>The operation failed because a specified resource couldn't be found.</p>
        capo_ram.errors.unmatched_policy_permission_exception.UnmatchedPolicyPermissionException: <p>There isn't an existing managed permission defined in RAM that has the same IAM permissions as the resource-based policy attached to the resource. You should first run <a>PromotePermissionCreatedFromPolicy</a> to create that managed permission.</p>
        capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ram.types.promote_resource_share_created_from_policy_request.PromoteResourceShareCreatedFromPolicyRequest]",
    ) -> OperationResponse[
        "capo_ram.types.promote_resource_share_created_from_policy_response.PromoteResourceShareCreatedFromPolicyResponse"
    ]:
        import capo_ram._operations.amazon_resource_sharing.promote_resource_share_created_from_policy

        output, http_response = (
            capo_ram._operations.amazon_resource_sharing.promote_resource_share_created_from_policy.promote_resource_share_created_from_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PromoteResourceShareCreatedFromPolicy")
    )
    input_: capo_ram.types.promote_resource_share_created_from_policy_request.PromoteResourceShareCreatedFromPolicyRequest = {
        "resource_share_arn": resource_share_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output