Skip to content

put_resource_set async

put_resource_set(
    resource_set: ResourceSet,
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
    tag_list: Optional[TagList] = None,
) -> PutResourceSetResponse

Creates the resource set.

An Firewall Manager resource set defines the resources to import into an Firewall Manager policy from another Amazon Web Services service.

Parameters:

  • resource_set (ResourceSet) –

    Details about the resource set to be created or updated.>

  • tag_list (Optional[TagList], default: None ) –

    Retrieves the tags associated with the specified resource set. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing. For example, you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each Amazon Web Services resource, up to 50 tags for a resource.

Raises:

  • InternalErrorException –

    The operation failed because of a system problem, even though the request was valid. Retry your request.

  • InvalidInputException –

    The parameters of the request were invalid.

  • InvalidOperationException –

    The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an AssociateAdminAccount request for an account ID that was already set as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Organizations before you can access it.

  • LimitExceededException –

    The operation exceeds a resource limit, for example, the maximum number of policy objects that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits in the WAF Developer Guide.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fms/_services/async_fms.py
async def put_resource_set(
    self,
    resource_set: "capo_fms.types.resource_set.ResourceSet",
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
    tag_list: Optional["capo_fms.types.tag_list.TagList"] = None,
) -> "capo_fms.types.put_resource_set_response.PutResourceSetResponse":
    """<p>Creates the resource set.</p> <p>An Firewall Manager resource set defines the resources to import into an Firewall Manager policy from another Amazon Web Services service.</p>

    Args:
        resource_set: <p>Details about the resource set to be created or updated.></p>
        tag_list: <p>Retrieves the tags associated with the specified resource set. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing. For example, you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each Amazon Web Services resource, up to 50 tags for a resource.</p>

    Raises:
        capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_fms.errors.invalid_input_exception.InvalidInputException: <p>The parameters of the request were invalid.</p>
        capo_fms.errors.invalid_operation_exception.InvalidOperationException: <p>The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an <code>AssociateAdminAccount</code> request for an account ID that was already set as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Organizations before you can access it.</p>
        capo_fms.errors.limit_exceeded_exception.LimitExceededException: <p>The operation exceeds a resource limit, for example, the maximum number of <code>policy</code> objects that you can create for an Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html">Firewall Manager Limits</a> in the <i>WAF Developer Guide</i>.</p>
        capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fms.types.put_resource_set_request.PutResourceSetRequest]",
    ) -> AsyncOperationResponse[
        "capo_fms.types.put_resource_set_response.PutResourceSetResponse"
    ]:
        import capo_fms._operations.awsfms_20180101.put_resource_set

        (
            output,
            http_response,
        ) = await capo_fms._operations.awsfms_20180101.put_resource_set.async_put_resource_set(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutResourceSet")
    )
    input_: capo_fms.types.put_resource_set_request.PutResourceSetRequest = {
        "resource_set": resource_set
    }
    if tag_list is not None:
        input_["tag_list"] = tag_list

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output