Skip to content

create_directory_config

create_directory_config(
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    directory_name: Optional[DirectoryName] = None,
    organizational_unit_distinguished_names: Optional[
        OrganizationalUnitDistinguishedNamesList
    ] = None,
    service_account_credentials: Optional[ServiceAccountCredentials] = None,
    certificate_based_auth_properties: Optional[CertificateBasedAuthProperties] = None,
) -> CreateDirectoryConfigResult

Creates a Directory Config object in WorkSpaces Applications. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.

Parameters:

  • directory_name (Optional[DirectoryName], default: None ) –

    The fully qualified name of the directory (for example, corp.example.com).

  • organizational_unit_distinguished_names (Optional[OrganizationalUnitDistinguishedNamesList], default: None ) –

    The distinguished names of the organizational units for computer accounts.

  • service_account_credentials (Optional[ServiceAccountCredentials], default: None ) –

    The credentials for the service account used by the fleet or image builder to connect to the directory.

  • certificate_based_auth_properties (Optional[CertificateBasedAuthProperties], default: None ) –

    The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is Enabled . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. Enabled_no_directory_login_fallback enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.

Raises:

Source code in docs_src/capo_appstream/_services/app_stream.py
def create_directory_config(
    self,
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    directory_name: Optional[
        "capo_appstream.types.directory_name.DirectoryName"
    ] = None,
    organizational_unit_distinguished_names: Optional[
        "capo_appstream.types.organizational_unit_distinguished_names_list.OrganizationalUnitDistinguishedNamesList"
    ] = None,
    service_account_credentials: Optional[
        "capo_appstream.types.service_account_credentials.ServiceAccountCredentials"
    ] = None,
    certificate_based_auth_properties: Optional[
        "capo_appstream.types.certificate_based_auth_properties.CertificateBasedAuthProperties"
    ] = None,
) -> "capo_appstream.types.create_directory_config_result.CreateDirectoryConfigResult":
    """<p>Creates a Directory Config object in WorkSpaces Applications. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.</p>

    Args:
        directory_name: <p>The fully qualified name of the directory (for example, corp.example.com).</p>
        organizational_unit_distinguished_names: <p>The distinguished names of the organizational units for computer accounts.</p>
        service_account_credentials: <p>The credentials for the service account used by the fleet or image builder to connect to the directory.</p>
        certificate_based_auth_properties: <p>The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is <b>Enabled</b> . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. <b>Enabled_no_directory_login_fallback</b> enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.</p>

    Raises:
        capo_appstream.errors.invalid_account_status_exception.InvalidAccountStatusException: <p>The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support. </p>
        capo_appstream.errors.invalid_role_exception.InvalidRoleException: <p>The specified role is invalid.</p>
        capo_appstream.errors.limit_exceeded_exception.LimitExceededException: <p>The requested limit exceeds the permitted limit for an account.</p>
        capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
        capo_appstream.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The specified resource already exists.</p>
        capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appstream.types.create_directory_config_request.CreateDirectoryConfigRequest]",
    ) -> OperationResponse[
        "capo_appstream.types.create_directory_config_result.CreateDirectoryConfigResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.create_directory_config

        output, http_response = (
            capo_appstream._operations.photon_admin_proxy_service.create_directory_config.create_directory_config(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appstream.types.create_directory_config_request.CreateDirectoryConfigRequest",
    ) -> dict[str, Any]:
        import capo_appstream.types.create_directory_config_request

        return (
            capo_appstream.types.create_directory_config_request.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_appstream.types.create_directory_config_result.CreateDirectoryConfigResult",
    ) -> dict[str, Any]:
        import capo_appstream.types.create_directory_config_result

        return capo_appstream.types.create_directory_config_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateDirectoryConfig",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_appstream.types.create_directory_config_request.CreateDirectoryConfigRequest = {}
    if directory_name is not None:
        input_["directory_name"] = directory_name
    if organizational_unit_distinguished_names is not None:
        input_["organizational_unit_distinguished_names"] = (
            organizational_unit_distinguished_names
        )
    if service_account_credentials is not None:
        input_["service_account_credentials"] = service_account_credentials
    if certificate_based_auth_properties is not None:
        input_["certificate_based_auth_properties"] = (
            certificate_based_auth_properties
        )

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