:doc:`IoTSiteWise <../../iotsitewise>` / Client / create_portal

*************
create_portal
*************



.. py:method:: IoTSiteWise.Client.create_portal(**kwargs)

  

  Creates a portal, which can contain projects and dashboards. IoT SiteWise Monitor uses IAM Identity Center or IAM to authenticate portal users and manage user permissions.

   

  .. note::

    

    Before you can sign in to a new portal, you must add at least one identity to that portal. For more information, see `Adding or removing portal administrators <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/administer-portals.html#portal-change-admins>`__ in the *IoT SiteWise User Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iotsitewise-2019-12-02/CreatePortal>`_  


  **Request Syntax**
  ::

    response = client.create_portal(
        portalName='string',
        portalDescription='string',
        portalContactEmail='string',
        clientToken='string',
        portalLogoImageFile={
            'data': b'bytes',
            'type': 'PNG'
        },
        roleArn='string',
        tags={
            'string': 'string'
        },
        portalAuthMode='IAM'|'SSO',
        notificationSenderEmail='string',
        alarms={
            'alarmRoleArn': 'string',
            'notificationLambdaArn': 'string'
        },
        portalType='SITEWISE_PORTAL_V1'|'SITEWISE_PORTAL_V2',
        portalTypeConfiguration={
            'string': {
                'portalTools': [
                    'string',
                ]
            }
        }
    )
    
  :type portalName: string
  :param portalName: **[REQUIRED]** 

    A friendly name for the portal.

    

  
  :type portalDescription: string
  :param portalDescription: 

    A description for the portal.

    

  
  :type portalContactEmail: string
  :param portalContactEmail: **[REQUIRED]** 

    The Amazon Web Services administrator's contact email address.

    

  
  :type clientToken: string
  :param clientToken: 

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

  
  :type portalLogoImageFile: dict
  :param portalLogoImageFile: 

    A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.

    

  
    - **data** *(bytes) --* **[REQUIRED]** 

      The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.

      

    
    - **type** *(string) --* **[REQUIRED]** 

      The file type of the image.

      

    
  
  :type roleArn: string
  :param roleArn: **[REQUIRED]** 

    The `ARN <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of a service role that allows the portal's users to access your IoT SiteWise resources on your behalf. For more information, see `Using service roles for IoT SiteWise Monitor <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html>`__ in the *IoT SiteWise User Guide*.

    

  
  :type tags: dict
  :param tags: 

    A list of key-value pairs that contain metadata for the portal. For more information, see `Tagging your IoT SiteWise resources <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html>`__ in the *IoT SiteWise User Guide*.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type portalAuthMode: string
  :param portalAuthMode: 

    The service to use to authenticate users to the portal. Choose from the following options:

     

    
    * ``SSO`` – The portal uses IAM Identity Center to authenticate users and manage user permissions. Before you can create a portal that uses IAM Identity Center, you must enable IAM Identity Center. For more information, see `Enabling IAM Identity Center <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso>`__ in the *IoT SiteWise User Guide*. This option is only available in Amazon Web Services Regions other than the China Regions.
     
    * ``IAM`` – The portal uses Identity and Access Management to authenticate users and manage user permissions.
    

     

    You can't change this value after you create a portal.

     

    Default: ``SSO``

    

  
  :type notificationSenderEmail: string
  :param notificationSenderEmail: 

    The email address that sends alarm notifications.

     

    .. warning::

       

      If you use the `IoT Events managed Lambda function <https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html>`__ to manage your emails, you must `verify the sender email address in Amazon SES <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html>`__.

      

    

  
  :type alarms: dict
  :param alarms: 

    Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see `Monitoring with alarms <https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html>`__ in the *IoT SiteWise Application Guide*.

    

  
    - **alarmRoleArn** *(string) --* **[REQUIRED]** 

      The `ARN <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of the IAM role that allows the alarm to perform actions and access Amazon Web Services resources and services, such as IoT Events.

      

    
    - **notificationLambdaArn** *(string) --* 

      The `ARN <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of the Lambda function that manages alarm notifications. For more information, see `Managing alarm notifications <https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html>`__ in the *IoT Events Developer Guide*.

      

    
  
  :type portalType: string
  :param portalType: 

    Define the type of portal. The value for IoT SiteWise Monitor (Classic) is ``SITEWISE_PORTAL_V1``. The value for IoT SiteWise Monitor (AI-aware) is ``SITEWISE_PORTAL_V2``.

    

  
  :type portalTypeConfiguration: dict
  :param portalTypeConfiguration: 

    The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is ``SITEWISE_PORTAL_V1``. The value for IoT SiteWise Monitor (AI-aware) is ``SITEWISE_PORTAL_V2``.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        The configuration entry associated with the specific portal type. The ``portalTypeConfiguration`` is a map of the ``portalTypeKey`` to the ``PortalTypeEntry``.

        

      
        - **portalTools** *(list) --* 

          The array of tools associated with the specified portal type. The possible values are ``ASSISTANT`` and ``DASHBOARD``.

          

        
          - *(string) --* 

          
      
      


  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'portalId': 'string',
          'portalArn': 'string',
          'portalStartUrl': 'string',
          'portalStatus': {
              'state': 'CREATING'|'PENDING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED',
              'error': {
                  'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED',
                  'message': 'string'
              }
          },
          'ssoApplicationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **portalId** *(string) --* 

        The ID of the created portal.

        
      

      - **portalArn** *(string) --* 

        The `ARN <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of the portal, which has the following format.

         

        ``arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}``

        
      

      - **portalStartUrl** *(string) --* 

        The URL for the IoT SiteWise Monitor portal. You can use this URL to access portals that use IAM Identity Center for authentication. For portals that use IAM for authentication, you must use the IoT SiteWise console to get a URL that you can use to access the portal.

        
      

      - **portalStatus** *(dict) --* 

        The status of the portal, which contains a state ( ``CREATING`` after successfully calling this operation) and any error message.

        
        

        - **state** *(string) --* 

          The current state of the portal.

          
        

        - **error** *(dict) --* 

          Contains associated error information, if any.

          
          

          - **code** *(string) --* 

            The error code.

            
          

          - **message** *(string) --* 

            The error message.

            
      
    
      

      - **ssoApplicationId** *(string) --* 

        The associated IAM Identity Center application ID, if the portal uses IAM Identity Center.

        
  
  **Exceptions**
  
  *   :py:class:`IoTSiteWise.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.LimitExceededException`

  