Skip to content

update_security_config async

update_security_config(
    id: SecurityConfigId,
    config_version: PolicyVersion,
    *,
    config_overrides: Optional[AsyncOpenSearchServerlessClientConfig] = None,
    description: Optional[ConfigDescription] = None,
    saml_options: Optional[SamlConfigOptions] = None,
    iam_identity_center_options_updates: Optional[
        UpdateIamIdentityCenterConfigOptions
    ] = None,
    iam_federation_options: Optional[IamFederationConfigOptions] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateSecurityConfigResponse

Updates a security configuration for OpenSearch Serverless. For more information, see SAML authentication for Amazon OpenSearch Serverless.

Parameters:

  • id (SecurityConfigId) –

    The security configuration identifier. For SAML the ID will be saml/<accountId>/<idpProviderName>. For example, saml/123456789123/OKTADev.

  • config_version (PolicyVersion) –

    The version of the security configuration to be updated. You can find the most recent version of a security configuration using the GetSecurityPolicy command.

  • description (Optional[ConfigDescription], default: None ) –

    A description of the security configuration.

  • saml_options (Optional[SamlConfigOptions], default: None ) –

    SAML options in in the form of a key-value map.

  • iam_identity_center_options_updates (Optional[UpdateIamIdentityCenterConfigOptions], default: None ) –

    Describes IAM Identity Center options in the form of a key-value map.

  • iam_federation_options (Optional[IamFederationConfigOptions], default: None ) –

    Describes IAM federation options in the form of a key-value map for updating an existing security configuration. Use this field to modify IAM federation settings for the security configuration.

  • client_token (Optional[ClientToken], default: None ) –

    Unique, case-sensitive identifier to ensure idempotency of the request.

Raises:

  • ConflictException –

    When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.

  • InternalServerException –

    Thrown when an error internal to the service occurs while processing a request.

  • ResourceNotFoundException –

    Thrown when accessing or deleting a resource that does not exist.

  • ValidationException –

    Thrown when the HTTP request contains invalid input or is missing required input.

  • UnknownServiceError –

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

Source code in docs_src/capo_opensearchserverless/_services/async_open_search_serverless.py
async def update_security_config(
    self,
    id: "capo_opensearchserverless.types.security_config_id.SecurityConfigId",
    config_version: "capo_opensearchserverless.types.policy_version.PolicyVersion",
    *,
    config_overrides: Optional[AsyncOpenSearchServerlessClientConfig] = None,
    description: Optional[
        "capo_opensearchserverless.types.config_description.ConfigDescription"
    ] = None,
    saml_options: Optional[
        "capo_opensearchserverless.types.saml_config_options.SamlConfigOptions"
    ] = None,
    iam_identity_center_options_updates: Optional[
        "capo_opensearchserverless.types.update_iam_identity_center_config_options.UpdateIamIdentityCenterConfigOptions"
    ] = None,
    iam_federation_options: Optional[
        "capo_opensearchserverless.types.iam_federation_config_options.IamFederationConfigOptions"
    ] = None,
    client_token: Optional[
        "capo_opensearchserverless.types.client_token.ClientToken"
    ] = None,
) -> "capo_opensearchserverless.types.update_security_config_response.UpdateSecurityConfigResponse":
    """<p>Updates a security configuration for OpenSearch Serverless. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html">SAML authentication for Amazon OpenSearch Serverless</a>.</p>

    Args:
        id: <p>The security configuration identifier. For SAML the ID will be <code>saml/&lt;accountId&gt;/&lt;idpProviderName&gt;</code>. For example, <code>saml/123456789123/OKTADev</code>.</p>
        config_version: <p>The version of the security configuration to be updated. You can find the most recent version of a security configuration using the <code>GetSecurityPolicy</code> command.</p>
        description: <p>A description of the security configuration.</p>
        saml_options: <p>SAML options in in the form of a key-value map.</p>
        iam_identity_center_options_updates: <p>Describes IAM Identity Center options in the form of a key-value map.</p>
        iam_federation_options: <p>Describes IAM federation options in the form of a key-value map for updating an existing security configuration. Use this field to modify IAM federation settings for the security configuration.</p>
        client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>

    Raises:
        capo_opensearchserverless.errors.conflict_exception.ConflictException: <p>When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.</p>
        capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
        capo_opensearchserverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when accessing or deleting a resource that does not exist.</p>
        capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
        capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_opensearchserverless.types.update_security_config_request.UpdateSecurityConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_opensearchserverless.types.update_security_config_response.UpdateSecurityConfigResponse"
    ]:
        import capo_opensearchserverless._operations.open_search_serverless.update_security_config

        (
            output,
            http_response,
        ) = await capo_opensearchserverless._operations.open_search_serverless.update_security_config.async_update_security_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSecurityConfig")
    )
    input_: capo_opensearchserverless.types.update_security_config_request.UpdateSecurityConfigRequest = {
        "id": id,
        "config_version": config_version,
    }
    if description is not None:
        input_["description"] = description
    if saml_options is not None:
        input_["saml_options"] = saml_options
    if iam_identity_center_options_updates is not None:
        input_["iam_identity_center_options_updates"] = (
            iam_identity_center_options_updates
        )
    if iam_federation_options is not None:
        input_["iam_federation_options"] = iam_federation_options
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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