Skip to content

create_security_profile

create_security_profile(
    security_profile_name: CreateSecurityProfileName,
    instance_id: InstanceId,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[SecurityProfileDescription] = None,
    permissions: Optional[PermissionsList] = None,
    tags: Optional[TagMap] = None,
    allowed_access_control_tags: Optional[AllowedAccessControlTags] = None,
    tag_restricted_resources: Optional[TagRestrictedResourceList] = None,
    applications: Optional[Applications] = None,
    hierarchy_restricted_resources: Optional[HierarchyRestrictedResourceList] = None,
    allowed_access_control_hierarchy_group_id: Optional[HierarchyGroupId] = None,
    allowed_flow_modules: Optional[AllowedFlowModules] = None,
    allowed_ai_agents: Optional[AllowedAIAgents] = None,
    granular_access_control_configuration: Optional[
        GranularAccessControlConfiguration
    ] = None,
) -> CreateSecurityProfileResponse

Creates a security profile.

For information about security profiles, see Security Profiles in the Connect Customer Administrator Guide. For a mapping of the API name and user interface name of the security profile permissions, see List of security profile permissions.

Parameters:

  • security_profile_name (CreateSecurityProfileName) –

    The name of the security profile.

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

    The description of the security profile.

  • permissions (Optional[PermissionsList], default: None ) –

    Permissions assigned to the security profile. For a list of valid permissions, see List of security profile permissions.

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • tags (Optional[TagMap], default: None ) –

    The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

  • allowed_access_control_tags (Optional[AllowedAccessControlTags], default: None ) –

    The list of tags that a security profile uses to restrict access to resources in Connect Customer.

  • tag_restricted_resources (Optional[TagRestrictedResourceList], default: None ) –

    The list of resources that a security profile applies tag restrictions to in Connect Customer. For a list of Connect Customer resources that you can tag, see Add tags to resources in Connect Customer in the Connect Customer Administrator Guide.

  • applications (Optional[Applications], default: None ) –

    A list of third-party applications or MCP Servers that the security profile will give access to.

  • hierarchy_restricted_resources (Optional[HierarchyRestrictedResourceList], default: None ) –

    The list of resources that a security profile applies hierarchy restrictions to in Connect Customer. Following are acceptable ResourceNames: User.

  • allowed_access_control_hierarchy_group_id (Optional[HierarchyGroupId], default: None ) –

    The identifier of the hierarchy group that a security profile uses to restrict access to resources in Connect Customer.

  • allowed_flow_modules (Optional[AllowedFlowModules], default: None ) –

    A list of Flow Modules an AI Agent can invoke as a tool.

  • allowed_ai_agents (Optional[AllowedAIAgents], default: None ) –

    A list of AI agents that the security profile will give access to.

  • granular_access_control_configuration (Optional[GranularAccessControlConfiguration], default: None ) –

    The granular access control configuration for the security profile, including data table permissions.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def create_security_profile(
    self,
    security_profile_name: "capo_connect.types.create_security_profile_name.CreateSecurityProfileName",
    instance_id: "capo_connect.types.instance_id.InstanceId",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.security_profile_description.SecurityProfileDescription"
    ] = None,
    permissions: Optional[
        "capo_connect.types.permissions_list.PermissionsList"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
    allowed_access_control_tags: Optional[
        "capo_connect.types.allowed_access_control_tags.AllowedAccessControlTags"
    ] = None,
    tag_restricted_resources: Optional[
        "capo_connect.types.tag_restricted_resource_list.TagRestrictedResourceList"
    ] = None,
    applications: Optional["capo_connect.types.applications.Applications"] = None,
    hierarchy_restricted_resources: Optional[
        "capo_connect.types.hierarchy_restricted_resource_list.HierarchyRestrictedResourceList"
    ] = None,
    allowed_access_control_hierarchy_group_id: Optional[
        "capo_connect.types.hierarchy_group_id.HierarchyGroupId"
    ] = None,
    allowed_flow_modules: Optional[
        "capo_connect.types.allowed_flow_modules.AllowedFlowModules"
    ] = None,
    allowed_ai_agents: Optional[
        "capo_connect.types.allowed_ai_agents.AllowedAIAgents"
    ] = None,
    granular_access_control_configuration: Optional[
        "capo_connect.types.granular_access_control_configuration.GranularAccessControlConfiguration"
    ] = None,
) -> "capo_connect.types.create_security_profile_response.CreateSecurityProfileResponse":
    """<p>Creates a security profile.</p> <p>For information about security profiles, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/connect-security-profiles.html">Security Profiles</a> in the <i>Connect Customer Administrator Guide</i>. For a mapping of the API name and user interface name of the security profile permissions, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-profile-list.html">List of security profile permissions</a>. </p>

    Args:
        security_profile_name: <p>The name of the security profile.</p>
        description: <p>The description of the security profile.</p>
        permissions: <p>Permissions assigned to the security profile. For a list of valid permissions, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-profile-list.html">List of security profile permissions</a>. </p>
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        tags: <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
        allowed_access_control_tags: <p>The list of tags that a security profile uses to restrict access to resources in Connect Customer.</p>
        tag_restricted_resources: <p>The list of resources that a security profile applies tag restrictions to in Connect Customer. For a list of Connect Customer resources that you can tag, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/tagging.html">Add tags to resources in Connect Customer</a> in the <i>Connect Customer Administrator Guide</i>. </p>
        applications: <p>A list of third-party applications or MCP Servers that the security profile will give access to.</p>
        hierarchy_restricted_resources: <p>The list of resources that a security profile applies hierarchy restrictions to in Connect Customer. Following are acceptable ResourceNames: <code>User</code>.</p>
        allowed_access_control_hierarchy_group_id: <p>The identifier of the hierarchy group that a security profile uses to restrict access to resources in Connect Customer.</p>
        allowed_flow_modules: <p> A list of Flow Modules an AI Agent can invoke as a tool. </p>
        allowed_ai_agents: <p>A list of AI agents that the security profile will give access to.</p>
        granular_access_control_configuration: <p>The granular access control configuration for the security profile, including data table permissions.</p>

    Raises:
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.create_security_profile_request.CreateSecurityProfileRequest]",
    ) -> OperationResponse[
        "capo_connect.types.create_security_profile_response.CreateSecurityProfileResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_security_profile

        output, http_response = (
            capo_connect._operations.amazon_connect_service.create_security_profile.create_security_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSecurityProfile")
    )
    input_: capo_connect.types.create_security_profile_request.CreateSecurityProfileRequest = {
        "security_profile_name": security_profile_name,
        "instance_id": instance_id,
    }
    if description is not None:
        input_["description"] = description
    if permissions is not None:
        input_["permissions"] = permissions
    if tags is not None:
        input_["tags"] = tags
    if allowed_access_control_tags is not None:
        input_["allowed_access_control_tags"] = allowed_access_control_tags
    if tag_restricted_resources is not None:
        input_["tag_restricted_resources"] = tag_restricted_resources
    if applications is not None:
        input_["applications"] = applications
    if hierarchy_restricted_resources is not None:
        input_["hierarchy_restricted_resources"] = hierarchy_restricted_resources
    if allowed_access_control_hierarchy_group_id is not None:
        input_["allowed_access_control_hierarchy_group_id"] = (
            allowed_access_control_hierarchy_group_id
        )
    if allowed_flow_modules is not None:
        input_["allowed_flow_modules"] = allowed_flow_modules
    if allowed_ai_agents is not None:
        input_["allowed_ai_agents"] = allowed_ai_agents
    if granular_access_control_configuration is not None:
        input_["granular_access_control_configuration"] = (
            granular_access_control_configuration
        )

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